From: Jakub Kicinski <kuba@kernel.org>
To: Taehee Yoo <ap420073@gmail.com>
Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
andrew+netdev@lunn.ch, netdev@vger.kernel.org,
gospo@broadcom.com, somnath.kotur@broadcom.com, dw@davidwei.uk,
horms@kernel.org
Subject: Re: [PATCH net 1/3] eth: bnxt: fix truesize for mb-xdp-pass case
Date: Wed, 26 Feb 2025 18:07:29 -0800 [thread overview]
Message-ID: <20250226180729.332e9940@kernel.org> (raw)
In-Reply-To: <20250226061837.1435731-2-ap420073@gmail.com>
On Wed, 26 Feb 2025 06:18:35 +0000 Taehee Yoo wrote:
> When mb-xdp is set and return is XDP_PASS, packet is converted from
> xdp_buff to sk_buff with xdp_update_skb_shared_info() in
> bnxt_xdp_build_skb().
> bnxt_xdp_build_skb() passes incorrect truesize argument to
> xdp_update_skb_shared_info().
> truesize is calculated as BNXT_RX_PAGE_SIZE * sinfo->nr_frags but
> sinfo->nr_frags should not be used because sinfo->nr_frags is not yet
> updated.
"not yet updated" sounds misleading the problem is that calling
build_skb() wipes the shared info back to 0, but it was initialized.
> so it should use num_frags instead.
num_frags may be stale, tho. The program can trim the skb effectively
discarding the fragments. Maybe we should fix that also..
Could you follow up and switch to xdp_build_skb_from_buff() in net-next?
It does all the right things already.
> How to reproduce:
> <Node A>
> ip link set $interface1 xdp obj xdp_pass.o
> ip link set $interface1 mtu 9000 up
> ip a a 10.0.0.1/24 dev $interface1
> <Node B>
> ip link set $interfac2 mtu 9000 up
> ip a a 10.0.0.2/24 dev $interface2
> ping 10.0.0.1 -s 65000
Would you be willing to turn this into a selftest?
The xdp program I added for HDS recently is a PASS so we can reuse it.
29b036be1b0bfcf
--
pw-bot: cr
next prev parent reply other threads:[~2025-02-27 2:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 6:18 [PATCH net 0/3] eth: bnxt: fix several bugs in the bnxt module Taehee Yoo
2025-02-26 6:18 ` [PATCH net 1/3] eth: bnxt: fix truesize for mb-xdp-pass case Taehee Yoo
2025-02-26 8:20 ` Somnath Kotur
2025-02-27 2:07 ` Jakub Kicinski [this message]
2025-02-27 5:00 ` Taehee Yoo
2025-02-26 6:18 ` [PATCH net 2/3] eth: bnxt: return fail if interface is down in bnxt_queue_mem_alloc() Taehee Yoo
2025-02-26 6:42 ` Somnath Kotur
2025-02-27 2:08 ` Jakub Kicinski
2025-02-26 6:18 ` [PATCH net 3/3] eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic Taehee Yoo
2025-02-26 6:46 ` Somnath Kotur
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=20250226180729.332e9940@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=gospo@broadcom.com \
--cc=horms@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=somnath.kotur@broadcom.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 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.