lkml.org 
[lkml]   [2020]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] net: ptp: get rid of IPV4_HLEN() and OFF_IHL macros
On Fri, Oct 16, 2020 at 09:04:38AM +0200, Christian Eggers wrote:
> IPV4_HLEN() is only used for PTP. Is there any way to use "normal"
> infrastructure as in the rest of the network stack?

You answered your own question...

> It looks like PTP code
> typically has to look into multiple network layers (mac, network, transport)
> at places these layers may not be processed yet (at least in RX direction).

here!

(The pointers in the skb are moved around as the skb flows through the stack.)

The original, per-driver, un-refactored callers of that macro (at
least the ones written by me) used the macro carefully. Also, I think
the recent re-factoring that Kurt implemented preserves the correct
usage of the macro. Any new users must, of course, use it carefully
while parsing the bytes of a frame.

I agree that the macro is perhaps not the best possible solution, but
it is not the worst either.

Thanks,
Richard

\
 
 \ /
  Last update: 2020-10-16 14:53    [W:0.072 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site