Netdev List
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf.kernel@gmail.com>
To: Eric Dumazet <edumazet@kernel.org>
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>,
	 "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org,  edumazet@google.com
Subject: Re: [PATCH net-next] net: inline eth_type_trans() fast path
Date: Fri, 2 Oct 2026 08:26:42 -0700	[thread overview]
Message-ID: <ar_NFo4DXUw3i_H4@devvm7509.cco0.facebook.com> (raw)
In-Reply-To: <CAL4Wiipep_WhfWBGov3vbOCLNKd0oQzFkX413AMU6V5DNN5Pmw@mail.gmail.com>

On 10/01, Eric Dumazet wrote:
> On Thu, Oct 1, 2026 at 5:58 PM Alexander Lobakin
> <aleksander.lobakin@intel.com> wrote:
> >
> > From: Edumazet@kernel.org <edumazet@kernel.org>
> > Date: Wed, 30 Sep 2026 19:29:57 +0200
> >
> > > eth_type_trans() is called once per received packet by most
> > > Ethernet drivers, and by core helpers (napi_gro_frags(),
> > > xdp_build_skb_from_*(), veth, tun, tunnels, loopback...).
> > >
> > > With CONFIG_MITIGATION_RETHUNK / SRSO, the call and return
> > > are not free anymore.
> > >
> > > Add eth_type_trans_inline(), handling the common case inline:
> > > unicast frame sent to dev->dev_addr, with a real ethertype,
> > > on a device which is not a DSA conduit. All other frames
> > > (multicast, broadcast, otherhost, 802.2, runts, DSA)
> > > are handled by the out-of-line eth_type_trans().
> > >
> > > eth_type_trans() is now a macro calling eth_type_trans_inline(),
> > > so that all existing callers get the fast path. The out-of-line
> > > version remains exported, and can be called with
> > > (eth_type_trans)(skb, dev). bpf_prog_test_run_skb() uses this
> >
> > Shouldn't it get renamed to e.g. eth_type_trans_slow() to avoid this
> > confusion?
> 
> This was my initial idea, but this would make the patch a bit more
> invasive and touch bpf selftests, something like:
> 
> Let me know if I should send a V2 and CC bpf maintainers, thanks!

I prefer this _slow version as well, less magic.

  reply	other threads:[~2026-10-02 15:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 17:29 [PATCH net-next] net: inline eth_type_trans() fast path Eric Dumazet
2026-10-01 15:57 ` Alexander Lobakin
2026-10-01 17:10   ` Eric Dumazet
2026-10-02 15:26     ` Stanislav Fomichev [this message]
2026-10-02 16:54     ` Alexander Lobakin
2026-10-02 18:52 ` Eric Dumazet

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=ar_NFo4DXUw3i_H4@devvm7509.cco0.facebook.com \
    --to=sdf.kernel@gmail.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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