netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Christian Eggers <ceggers@arri.de>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Krzysztof Halasa <khalasa@piap.pl>,
	Vishal Kulkarni <vishal@chelsio.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: ptp: get rid of IPV4_HLEN() and OFF_IHL macros
Date: Fri, 16 Oct 2020 05:52:59 -0700	[thread overview]
Message-ID: <20201016125259.GA19213@hoboy> (raw)
In-Reply-To: <2135183.8zsl8bQRyA@n95hx1g2>

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

      reply	other threads:[~2020-10-16 12:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 11:58 [PATCH net-next] net: ptp: get rid of IPV4_HLEN() and OFF_IHL macros Christian Eggers
2020-10-15  3:36 ` Richard Cochran
2020-10-15 16:56   ` Florian Fainelli
2020-10-16  7:04     ` Christian Eggers
2020-10-16 12:52       ` Richard Cochran [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201016125259.GA19213@hoboy \
    --to=richardcochran@gmail.com \
    --cc=ceggers@arri.de \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=khalasa@piap.pl \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vishal@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).