[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230731194336.5b4bd065@kernel.org>
Date: Mon, 31 Jul 2023 19:43:36 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Leon Hwang <hffilwlqm@...il.com>
Cc: ast@...nel.org, daniel@...earbox.net, john.fastabend@...il.com,
andrii@...nel.org, martin.lau@...ux.dev, song@...nel.org,
yonghong.song@...ux.dev, kpsingh@...nel.org, sdf@...gle.com,
haoluo@...gle.com, jolsa@...nel.org, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, hawk@...nel.org,
rostedt@...dmis.org, mhiramat@...nel.org, mykolal@...com, shuah@...nel.org,
tangyeechou@...il.com, kernel-patches-bot@...com, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH bpf-next v4 1/2] bpf, xdp: Add tracepoint to xdp
attaching failure
On Sun, 30 Jul 2023 19:49:50 +0800 Leon Hwang wrote:
> @@ -9472,6 +9473,7 @@ int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
> struct bpf_link_primer link_primer;
> struct bpf_xdp_link *link;
> struct net_device *dev;
> + struct netlink_ext_ack extack;
This is not initialized. Also, while fixing that, move it up
to maintain the line order by decreasing line length.
> int err, fd;
>
> rtnl_lock();
> @@ -9497,12 +9499,13 @@ int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
> goto unlock;
> }
>
> - err = dev_xdp_attach_link(dev, NULL, link);
> + err = dev_xdp_attach_link(dev, &extack, link);
> rtnl_unlock();
>
> if (err) {
> link->dev = NULL;
> bpf_link_cleanup(&link_primer);
> + trace_bpf_xdp_link_attach_failed(extack._msg);
Powered by blists - more mailing lists