Thread (7 messages) 7 messages, 3 authors, 2023-08-01

Re: [PATCH bpf-next v4 1/2] bpf, xdp: Add tracepoint to xdp attaching failure

From: Jakub Kicinski <kuba@kernel.org>
Date: 2023-08-01 02:43:44
Also in: bpf, linux-kselftest, linux-trace-kernel, lkml

On Sun, 30 Jul 2023 19:49:50 +0800 Leon Hwang wrote:
quoted hunk ↗ jump to hunk
@@ -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.
quoted hunk ↗ jump to hunk
 	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);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help