From: sashiko-bot@kernel.org
To: "Leon Hwang" <leon.hwang@linux.dev>, bpf@vger.kernel.org
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 2/6] bpf: Add syscall common attrs support for xdp link_create
Date: Tue, 20 Oct 2026 15:37:54 +0000 [thread overview]
Message-ID: <sashiko-outbox-179266@kernel.org> (raw)
In-Reply-To: <20261020152804.39863-3-leon.hwang@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] net: missing struct bpf_verifier_log forward declaration in netdevice.h
--
commit 6d93234cac5f9d8bd1858f0479e625aeca6428c5
Author: Leon Hwang <leon.hwang@linux.dev>
bpf: Add syscall common attrs support for xdp link_create
This commit adds syscall common attributes support to bpf_xdp_link_attach() so
that invalid target_ifindex errors and underlying driver extack error messages
can be reported through bpf_log(). It also defines a no-op stub for bpf_log()
when CONFIG_BPF_SYSCALL is disabled.
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 3cff2174dc03a..4548b0fd824db 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -4417,7 +4417,8 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d
> struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
> struct netdev_queue *txq, int *ret);
>
> -int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
> +int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog,
> + struct bpf_verifier_log *log);
[Severity: Low]
Does include/linux/netdevice.h need a forward declaration for
struct bpf_verifier_log alongside struct bpf_prog?
Without a file-scope forward declaration in include/linux/netdevice.h, any
translation unit that includes <linux/netdevice.h> before <linux/bpf.h>,
<linux/btf.h>, or <linux/bpf_verifier.h> declares struct bpf_verifier_log for
the first time inside the parameter list of bpf_xdp_link_attach(), triggering
-Wvisibility warnings.
In net/core/dev.c, <linux/netdevice.h> is included before <linux/bpf.h> and
<linux/bpf_verifier.h>:
#include <linux/netdevice.h>
...
#include <linux/bpf.h>
#include <linux/bpf_trace.h>
#include <linux/bpf_verifier.h>
This causes the prototype in include/linux/netdevice.h to use a
parameter-scoped struct bpf_verifier_log while the definition of
bpf_xdp_link_attach() in net/core/dev.c uses the file-scoped
struct bpf_verifier_log from <linux/bpf_verifier.h>, resulting in a
conflicting types compilation error.
[ ... ]
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 18dc88990510a..96be63b9331e8 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -97,6 +97,7 @@
> #include <linux/kthread.h>
> #include <linux/bpf.h>
> #include <linux/bpf_trace.h>
> +#include <linux/bpf_verifier.h>
> #include <net/net_namespace.h>
> #include <net/sock.h>
> #include <net/busy_poll.h>
> @@ -10771,7 +10772,8 @@ static const struct bpf_link_ops bpf_xdp_link_lops = {
> .update_prog = bpf_xdp_link_update,
> };
>
> -int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
> +int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog,
> + struct bpf_verifier_log *log)
> {
[ ... ]
> return fd;
[ ... ]
> }
[ ... ]
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261020152804.39863-1-leon.hwang@linux.dev?part=2
next prev parent reply other threads:[~2026-10-20 15:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 15:27 [PATCH bpf-next v3 0/6] bpf: Add syscall common attrs support for xdp link_create Leon Hwang
2026-10-20 15:27 ` [PATCH bpf-next v3 1/6] bpf: Add syscall common attrs support for link_create Leon Hwang
2026-10-20 15:44 ` sashiko-bot
2026-10-20 15:28 ` [PATCH bpf-next v3 2/6] bpf: Add syscall common attrs support for xdp link_create Leon Hwang
2026-10-20 15:37 ` sashiko-bot [this message]
2026-10-21 1:25 ` Jakub Kicinski
2026-10-21 3:04 ` Alexei Starovoitov
2026-10-20 15:28 ` [PATCH bpf-next v3 3/6] bpf: Retire tracepoint bpf_xdp_link_attach_failed Leon Hwang
2026-10-20 15:28 ` [PATCH bpf-next v3 4/6] libbpf: Factor out __sys_bpf_fd helper Leon Hwang
2026-10-20 15:28 ` [PATCH bpf-next v3 5/6] libbpf: Add bpf_link_create_log API Leon Hwang
2026-10-20 15:28 ` [PATCH bpf-next v3 6/6] selftests/bpf: Add tests to verify link_create logs Leon Hwang
2026-10-20 21:00 ` [PATCH bpf-next v3 0/6] bpf: Add syscall common attrs support for xdp link_create patchwork-bot+netdevbpf
2026-10-21 1:27 ` Jakub Kicinski
2026-10-21 3:05 ` Alexei Starovoitov
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=sashiko-outbox-179266@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=leon.hwang@linux.dev \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-reviews@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox