From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Chenguang Zhao <chenguang.zhao@linux.dev>
Cc: <anthony.l.nguyen@intel.com>, <przemyslaw.kitszel@intel.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
Chenguang Zhao <zhaochenguang@kylinos.cn>
Subject: Re: [Intel-wired-lan] [PATCH net v2] i40e: xsk: fix multi-buffer XDP_PASS skb construction
Date: Mon, 20 Jul 2026 17:03:00 +0200 [thread overview]
Message-ID: <eb4f3a70-533a-45e7-8213-4f286ddf5f85@intel.com> (raw)
In-Reply-To: <20260717012416.168107-1-chenguang.zhao@linux.dev>
From: Chenguang Zhao <chenguang.zhao@linux.dev>
Date: Fri, 17 Jul 2026 09:24:16 +0800
> From: Chenguang Zhao <zhaochenguang@kylinos.cn>
>
> When AF_XDP ZC receives a multi-buffer frame and XDP returns XDP_PASS,
> i40e_construct_skb_zc() copied frags incorrectly: memcpy used
> skb_frag_page() (page metadata) and __skb_fill_page_desc_noacc() was
> given a virtual address instead of a struct page *.
>
> Drop the custom helper and use xdp_build_skb_from_zc() instead. On
> failure, free the xdp buff in the caller. Push the Ethernet header
> back before eth_skb_pad()/i40e_process_skb_fields() because
> xdp_build_skb_from_zc() already called eth_type_trans().
>
> Fixes: 1c9ba9c14658 ("i40e: xsk: add RX multi-buffer support")
> Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
One nit below tho.
[...]
> @@ -372,14 +309,20 @@ static void i40e_handle_xdp_result_zc(struct i40e_ring *rx_ring,
> * BIT(I40E_RXD_QW1_ERROR_SHIFT). This is due to that
> * SBP is *not* set in PRT_SBPVSI (default not set).
> */
> - skb = i40e_construct_skb_zc(rx_ring, xdp_buff);
> + skb = xdp_build_skb_from_zc(xdp_buff);
> if (!skb) {
> + xsk_buff_free(xdp_buff);
> rx_ring->rx_stats.alloc_buff_failed++;
> *rx_packets = 0;
> *rx_bytes = 0;
> return;
> }
>
> + /* xdp_build_skb_from_zc() already ran eth_type_trans();
> + * restore the header for eth_skb_pad()/process_skb_fields().
> + */
The netdev rules prefer generic comment style over what we used in the
past for some time already. I.e.
/*
* xdp_build_skb_from_zc() ...
* restore ...
*/
> + __skb_push(skb, skb->data - skb_mac_header(skb));
> +
> if (eth_skb_pad(skb)) {
> *rx_packets = 0;
> *rx_bytes = 0;
Thanks,
Olek
next prev parent reply other threads:[~2026-07-20 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 1:24 [PATCH net v2] i40e: xsk: fix multi-buffer XDP_PASS skb construction Chenguang Zhao
2026-07-20 15:03 ` Alexander Lobakin [this message]
2026-07-21 23:15 ` Jason Xing
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=eb4f3a70-533a-45e7-8213-4f286ddf5f85@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=chenguang.zhao@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=zhaochenguang@kylinos.cn \
/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