[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201016125259.GA19213@hoboy>
Date: Fri, 16 Oct 2020 05:52:59 -0700
From: Richard Cochran <richardcochran@...il.com>
To: Christian Eggers <ceggers@...i.de>
Cc: Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Krzysztof Halasa <khalasa@...p.pl>,
Vishal Kulkarni <vishal@...lsio.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [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
Powered by blists - more mailing lists