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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux