Re: [PATCH bpf-next v4 2/3] bpf, xdp: move offload check into dev_xdp_install()

Jakub Kicinski <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.bpf,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
On Mon, 10 Aug 2026 13:06:00 +0800 Jiayuan Chen wrote:
> bpf_xdp_link_update() calls dev_xdp_install() directly and skips
> dev_xdp_attach(), so the checks in dev_xdp_attach() do not run. A user can
> make an XDP link with a normal program and then swap in an offloaded or
> device-bound program with BPF_LINK_UPDATE, which puts it on the software
> path.
> 
> Move the three program checks (offloaded, bound to another device, and
> device-bound in generic mode) from dev_xdp_attach() into
> dev_xdp_install(), so both the attach path and the link update path are
> covered.

Shouldn't we move all the checks that are not explicitly about the
netlink API (so all but the first?)

It may be better to split the series and send this patch to net,
the netdev CI has a netdevsim test for the prog offload, would be
good to run that.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.