[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46cabc2c-fc7f-5699-dfcb-b8be686ed200@linux.dev>
Date: Thu, 6 Oct 2022 13:10:32 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: razor@...ckwall.org, ast@...nel.org, andrii@...nel.org,
john.fastabend@...il.com, joannelkoong@...il.com, memxor@...il.com,
toke@...hat.com, joe@...ium.io, netdev@...r.kernel.org,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next 02/10] bpf: Implement BPF link handling for tc
BPF programs
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?
Powered by blists - more mailing lists