Re: [PATCH bpf-next 02/10] bpf: Implement BPF link handling for tc BPF programs

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

 



On 10/4/22 4:11 PM, Daniel Borkmann wrote:
  static int __xtc_prog_detach(struct net_device *dev, bool ingress, u32 limit,
-			     u32 prio)
+			     u32 id, u32 prio)
  {
  	struct bpf_prog_array_item *item, *tmp;
  	struct bpf_prog *oprog, *fprog = NULL;
@@ -126,8 +133,11 @@ static int __xtc_prog_detach(struct net_device *dev, bool ingress, u32 limit,
  		if (item->bpf_priority != prio) {
  			tmp->prog = oprog;
  			tmp->bpf_priority = item->bpf_priority;
+			tmp->bpf_id = item->bpf_id;
  			j++;
  		} else {
+			if (item->bpf_id != id)
+				return -EBUSY;

A nit. Should this be -ENOENT? I think the cgroup detach is also returning -ENOENT for the not found case.

btw, this case should only happen from the BPF_PROG_DETACH but not the BPF_LINK_DETACH?





[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