diff mbox series

[bpf-next,v2,3/4] bpftool: support BPF_CGROUP_INET_SOCK_RELEASE

Message ID 20200626165231.672001-3-sdf@google.com
State Changes Requested
Delegated to: BPF Maintainers
Headers show
Series [bpf-next,v2,1/4] bpf: add BPF_CGROUP_INET_SOCK_RELEASE hook | expand

Commit Message

Stanislav Fomichev June 26, 2020, 4:52 p.m. UTC
Support attaching to sock_release from the bpftool.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/bpf/bpftool/main.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Borkmann June 26, 2020, 11:07 p.m. UTC | #1
On 6/26/20 6:52 PM, Stanislav Fomichev wrote:
> Support attaching to sock_release from the bpftool.
> 
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
>   tools/bpf/bpftool/main.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
> index 5cdf0bc049bd..0a281d3cceb8 100644
> --- a/tools/bpf/bpftool/main.h
> +++ b/tools/bpf/bpftool/main.h
> @@ -92,6 +92,7 @@ static const char * const attach_type_name[__MAX_BPF_ATTACH_TYPE] = {
>   	[BPF_CGROUP_INET_INGRESS] = "ingress",
>   	[BPF_CGROUP_INET_EGRESS] = "egress",
>   	[BPF_CGROUP_INET_SOCK_CREATE] = "sock_create",
> +	[BPF_CGROUP_INET_SOCK_RELEASE] = "sock_release",
>   	[BPF_CGROUP_SOCK_OPS] = "sock_ops",
>   	[BPF_CGROUP_DEVICE] = "device",
>   	[BPF_CGROUP_INET4_BIND] = "bind4",

This one is not on latest bpf-next, needs rebase due to 16d37ee3d2b1 ("tools, bpftool: Define
attach_type_name array only once").

Thanks,
Daniel
Stanislav Fomichev June 26, 2020, 11:52 p.m. UTC | #2
On Fri, Jun 26, 2020 at 4:08 PM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> On 6/26/20 6:52 PM, Stanislav Fomichev wrote:
> > Support attaching to sock_release from the bpftool.
> >
> > Signed-off-by: Stanislav Fomichev <sdf@google.com>
> > ---
> >   tools/bpf/bpftool/main.h | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
> > index 5cdf0bc049bd..0a281d3cceb8 100644
> > --- a/tools/bpf/bpftool/main.h
> > +++ b/tools/bpf/bpftool/main.h
> > @@ -92,6 +92,7 @@ static const char * const attach_type_name[__MAX_BPF_ATTACH_TYPE] = {
> >       [BPF_CGROUP_INET_INGRESS] = "ingress",
> >       [BPF_CGROUP_INET_EGRESS] = "egress",
> >       [BPF_CGROUP_INET_SOCK_CREATE] = "sock_create",
> > +     [BPF_CGROUP_INET_SOCK_RELEASE] = "sock_release",
> >       [BPF_CGROUP_SOCK_OPS] = "sock_ops",
> >       [BPF_CGROUP_DEVICE] = "device",
> >       [BPF_CGROUP_INET4_BIND] = "bind4",
>
> This one is not on latest bpf-next, needs rebase due to 16d37ee3d2b1 ("tools, bpftool: Define
> attach_type_name array only once").
Sure, will follow up with a v3 to address Andrii's suggestions + will
rebase on top of the latest bpf-next!
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index 5cdf0bc049bd..0a281d3cceb8 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -92,6 +92,7 @@  static const char * const attach_type_name[__MAX_BPF_ATTACH_TYPE] = {
 	[BPF_CGROUP_INET_INGRESS] = "ingress",
 	[BPF_CGROUP_INET_EGRESS] = "egress",
 	[BPF_CGROUP_INET_SOCK_CREATE] = "sock_create",
+	[BPF_CGROUP_INET_SOCK_RELEASE] = "sock_release",
 	[BPF_CGROUP_SOCK_OPS] = "sock_ops",
 	[BPF_CGROUP_DEVICE] = "device",
 	[BPF_CGROUP_INET4_BIND] = "bind4",