Subject: Re: [PATCH v3 1/9] ptp: Add generic ptp v2 header parsing function

From: Kurt Kanzenbach <[email-masked]>
Date: Thu, 06 Aug 2020 09:56:05 +0200

On Wed Aug 05 2020, Grygorii Strashko wrote:
> On 05/08/2020 16:57, Kurt Kanzenbach wrote:
>> So, only patch 6 is to drop or 5 as well? Anyhow, I'll wait for your
>> test results. Thanks!
>
> Patch 5 not affected as all RX packet have timestamp and it's coming different way.
> TX not affected as skb come to .xmit() properly initialized.

OK.

>
> As I've just replied for patch 6 - skb_reset_mac_header() helps.

OK. I'll add it. Thanks for testing and fixing it.

>
> Rhetorical question - is below check really required?
> Bad packets (short, crc) expected to be discarded by HW
>
> 	/* Ensure that the entire header is present in this packet. */
> 	if (ptr + sizeof(struct ptp_header) > skb->data + skb->len)
> 		return NULL;

Even if it's a rhetorical question - Can we rely on the fact that too
short packets (or bad) are discarded? All driver instances I've changed
in this series do the length check somehow.

>
>
> And I'd like to ask you to update ptp_parse_header() documentation
> with description of expected SKB state for this function to work.

Yes, I've wanted to do that anyway.

Thanks,
Kurt