From: Paolo Abeni <pabeni@redhat.com>
To: Suyuan Wang <shyckless@gmail.com>,
john.fastabend@gmail.com, davem@davemloft.net,
daniel@iogearbox.net, andrew+netdev@lunn.ch, edumazet@kernel.org,
hawk@kernel.org, ast@kernel.org, kuba@kernel.org
Cc: netdev@vger.kernel.org, lorenzo@kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org, sdf@fomichev.me
Subject: Re: [PATCH net] qede: Don't advertise XDP features on VFs without XDP support
Date: Tue, 1 Dec 2026 15:25:16 +0100 [thread overview]
Message-ID: <3995193b-ad07-43ec-a760-4916856ec7fa@redhat.com> (raw)
In-Reply-To: <20261124-qede-vf-xdp-v1-1-6fd99227d178@gmail.com>
On 11/24/26 05:28, Suyuan Wang wrote:
> From: Suyuan Wang <stevewong@hust.edu.cn>
>
> A VF without XDP support gets qede_netdev_vf_ops, which has neither
> .ndo_bpf nor .ndo_xdp_xmit, but qede_init_ndev() still sets
>
> ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
> NETDEV_XDP_ACT_NDO_XMIT;
>
> for every device. The devmap code only allocates dev->xdp_bulkq when
> the device has .ndo_xdp_xmit, but the XDP redirect paths use
> NETDEV_XDP_ACT_NDO_XMIT to decide whether they can call bq_enqueue(),
> which dereferences dev->xdp_bulkq. So an XDP program running on another
> device can redirect a frame to such a VF, through a devmap or
> bpf_redirect(), and bq_enqueue() then dereferences a NULL xdp_bulkq.
>
> Only set the XDP features when the device uses ops with XDP support,
> that is on a PF or on a VF with xdp_supported.
>
> Found with a static analysis tool and checked by hand.
>
> Fixes: 66c0e13ad236 ("drivers: net: turn on XDP features")
> Cc: stable@vger.kernel.org
> Co-developed-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Suyuan Wang <stevewong@hust.edu.cn>
We can't push to net, even less to stable driver code with no H/W testing,
even if reasonable. I'll apply this one to net.
/P
next prev parent reply other threads:[~2026-12-01 14:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 4:28 [PATCH net] qede: Don't advertise XDP features on VFs without XDP support Suyuan Wang via B4 Relay
2026-12-01 14:25 ` Paolo Abeni [this message]
2026-12-01 14:30 ` patchwork-bot+netdevbpf
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=3995193b-ad07-43ec-a760-4916856ec7fa@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sdf@fomichev.me \
--cc=shyckless@gmail.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