All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Jose Abreu <Jose.Abreu@synopsys.com>,
	Ong Boon Leong <boon.leong.ong@intel.com>,
	Simon Horman <horms@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	bpf@vger.kernel.org
Subject: Re: [PATCH net-next v12 1/4] net: xdp: add __xdp_build_skb_from_buff() helper
Date: Sun, 22 Nov 2026 20:21:49 +0100	[thread overview]
Message-ID: <c25a973e6efd6f626bb65d4f2500559b@tipi-net.de> (raw)
In-Reply-To: <20261121-stmmac-rx-mb-v12-1-3ae2f3bce174@oss.qualcomm.com>

On 21.11.2026 18:28, Lorenzo Bianconi wrote:
> xdp_build_skb_from_buff() always calls eth_type_trans() on the skb it
> builds, which pulls the Ethernet header and advances skb->data. Drivers
> that still need to process the L2 header before protocol parsing
> therefore cannot use the helper.
> 
> stmmac is such a driver: its software VLAN path (stmmac_rx_vlan()) 
> reads
> the VLAN tag at skb->data and shifts the MAC addresses over it, so it 
> has
> to run before eth_type_trans().
> 
> Split the implementation into __xdp_build_skb_from_buff(), which builds
> the skb (including the recycle mark, the Rx queue index and the frags
> info) but leaves skb->dev, skb->protocol, skb->pkt_type and the mac
> header unset, so the caller must initialize them, usually by calling
> eth_type_trans(). Make xdp_build_skb_from_buff() a static inline 
> wrapper
> that still calls eth_type_trans() as before, preserving the behavior of
> existing in-tree users. A follow-up patch will let stmmac use it.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> ---

> [...]

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

  reply	other threads:[~2026-11-22 19:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 17:28 [PATCH net-next v12 0/4] net: stmmac: introduce XDP rx multi-buff support Lorenzo Bianconi
2026-11-21 17:28 ` [PATCH net-next v12 1/4] net: xdp: add __xdp_build_skb_from_buff() helper Lorenzo Bianconi
2026-11-22 19:21   ` Nicolai Buchwitz [this message]
2026-11-22 19:45   ` Maxime Chevallier
2026-11-24  9:04     ` Lorenzo Bianconi
2026-11-24  9:14       ` Maxime Chevallier
2026-11-21 17:28 ` [PATCH net-next v12 2/4] net: xdp: add xdp_buff_shrink_tail() helper Lorenzo Bianconi
2026-11-21 17:28 ` [PATCH net-next v12 3/4] net: xdp: add __xdp_return_buff() helper Lorenzo Bianconi
2026-11-21 17:28 ` [PATCH net-next v12 4/4] net: stmmac: rework stmmac_rx to support XDP rx multi-buff Lorenzo Bianconi
2026-11-25 12:31   ` netdev-bot+sashiko
2026-11-25 14:55     ` Lorenzo Bianconi

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=c25a973e6efd6f626bb65d4f2500559b@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=boon.leong.ong@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=emil@etsalapatis.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lorenzo.bianconi@oss.qualcomm.com \
    --cc=martin.lau@linux.dev \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.