Message ID | 20230814172928.1373311-1-yonghong.song@linux.dev (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | Add support for local percpu kptr | expand |
On 8/14/23 7:29 PM, Yonghong Song wrote: > Now 'BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + local percpu ptr' > can cover all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE functionality > and more. So mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated. > > Signed-off-by: Yonghong Song <yonghong.song@linux.dev> > --- > include/uapi/linux/bpf.h | 9 ++++++++- > tools/include/uapi/linux/bpf.h | 9 ++++++++- > 2 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index d21deb46f49f..5d1bb6b42ea2 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -932,7 +932,14 @@ enum bpf_map_type { > */ > BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, > BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, > - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs > + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + > + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * deprecated. > + */ > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > BPF_MAP_TYPE_QUEUE, > BPF_MAP_TYPE_STACK, > BPF_MAP_TYPE_SK_STORAGE, > diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h > index d21deb46f49f..5d1bb6b42ea2 100644 > --- a/tools/include/uapi/linux/bpf.h > +++ b/tools/include/uapi/linux/bpf.h > @@ -932,7 +932,14 @@ enum bpf_map_type { > */ > BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, > BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, > - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs > + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + > + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * deprecated. > + */ > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, This breaks bpftool tests in BPF CI, presumably it thinks doc is missing here: [...] bpftool_checks - Running bpftool checks... Comparing /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h (bpf_map_type) and /tmp/work/bpf/bpf/tools/bpf/bpftool/map.c (do_help() TYPE): {'percpu_cgroup_storage_deprecated', 'percpu_cgroup_storage'} Comparing /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h (bpf_map_type) and /tmp/work/bpf/bpf/tools/bpf/bpftool/Documentation/bpftool-map.rst (TYPE): {'percpu_cgroup_storage_deprecated', 'percpu_cgroup_storage'} bpftool checks returned 1. [...]
On 8/18/23 8:54 AM, Daniel Borkmann wrote: > On 8/14/23 7:29 PM, Yonghong Song wrote: >> Now 'BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + local percpu ptr' >> can cover all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE functionality >> and more. So mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated. >> >> Signed-off-by: Yonghong Song <yonghong.song@linux.dev> >> --- >> include/uapi/linux/bpf.h | 9 ++++++++- >> tools/include/uapi/linux/bpf.h | 9 ++++++++- >> 2 files changed, 16 insertions(+), 2 deletions(-) >> >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >> index d21deb46f49f..5d1bb6b42ea2 100644 >> --- a/include/uapi/linux/bpf.h >> +++ b/include/uapi/linux/bpf.h >> @@ -932,7 +932,14 @@ enum bpf_map_type { >> */ >> BPF_MAP_TYPE_CGROUP_STORAGE = >> BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, >> BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, >> - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, >> + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs >> + * attaching to a cgroup. The new mechanism >> (BPF_MAP_TYPE_CGRP_STORAGE + >> + * local percpu kptr) supports all >> BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * functionality and more. So mark * >> BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * deprecated. >> + */ >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = >> BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, >> BPF_MAP_TYPE_QUEUE, >> BPF_MAP_TYPE_STACK, >> BPF_MAP_TYPE_SK_STORAGE, >> diff --git a/tools/include/uapi/linux/bpf.h >> b/tools/include/uapi/linux/bpf.h >> index d21deb46f49f..5d1bb6b42ea2 100644 >> --- a/tools/include/uapi/linux/bpf.h >> +++ b/tools/include/uapi/linux/bpf.h >> @@ -932,7 +932,14 @@ enum bpf_map_type { >> */ >> BPF_MAP_TYPE_CGROUP_STORAGE = >> BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, >> BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, >> - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, >> + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs >> + * attaching to a cgroup. The new mechanism >> (BPF_MAP_TYPE_CGRP_STORAGE + >> + * local percpu kptr) supports all >> BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * functionality and more. So mark * >> BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * deprecated. >> + */ >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = >> BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > > This breaks bpftool tests in BPF CI, presumably it thinks doc is missing > here: > > [...] > bpftool_checks - Running bpftool checks... > Comparing /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h > (bpf_map_type) and /tmp/work/bpf/bpf/tools/bpf/bpftool/map.c (do_help() > TYPE): {'percpu_cgroup_storage_deprecated', 'percpu_cgroup_storage'} > Comparing /tmp/work/bpf/bpf/tools/include/uapi/linux/bpf.h > (bpf_map_type) and > /tmp/work/bpf/bpf/tools/bpf/bpftool/Documentation/bpftool-map.rst > (TYPE): {'percpu_cgroup_storage_deprecated', 'percpu_cgroup_storage'} > bpftool checks returned 1. > [...] Thanks, Daniel. Will take a look!
On Mon, Aug 14, 2023 at 10:30 AM Yonghong Song <yonghong.song@linux.dev> wrote: > > Now 'BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + local percpu ptr' I found this commit message very confusing until I realized there was a typo here. Shouldn't this be "Now 'BPF_MAP_TYPE_CGRP_STORAGE + local percpu ptr'"? > can cover all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE functionality > and more. So mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated. > > Signed-off-by: Yonghong Song <yonghong.song@linux.dev> > --- > include/uapi/linux/bpf.h | 9 ++++++++- > tools/include/uapi/linux/bpf.h | 9 ++++++++- > 2 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index d21deb46f49f..5d1bb6b42ea2 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -932,7 +932,14 @@ enum bpf_map_type { > */ > BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, > BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, > - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs > + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + > + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * deprecated. > + */ > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > BPF_MAP_TYPE_QUEUE, > BPF_MAP_TYPE_STACK, > BPF_MAP_TYPE_SK_STORAGE, > diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h > index d21deb46f49f..5d1bb6b42ea2 100644 > --- a/tools/include/uapi/linux/bpf.h > +++ b/tools/include/uapi/linux/bpf.h > @@ -932,7 +932,14 @@ enum bpf_map_type { > */ > BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, > BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, > - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs > + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + > + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE > + * deprecated. > + */ > + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, > BPF_MAP_TYPE_QUEUE, > BPF_MAP_TYPE_STACK, > BPF_MAP_TYPE_SK_STORAGE, > -- > 2.34.1 > >
On 8/18/23 11:26 AM, Zvi Effron wrote: > On Mon, Aug 14, 2023 at 10:30 AM Yonghong Song <yonghong.song@linux.dev> wrote: >> >> Now 'BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + local percpu ptr' > > I found this commit message very confusing until I realized there was a typo > here. Shouldn't this be "Now 'BPF_MAP_TYPE_CGRP_STORAGE + local percpu ptr'"? You are right. Thanks for pointing this out. Will fix in the next revision. > >> can cover all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE functionality >> and more. So mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated. >> >> Signed-off-by: Yonghong Song <yonghong.song@linux.dev> >> --- >> include/uapi/linux/bpf.h | 9 ++++++++- >> tools/include/uapi/linux/bpf.h | 9 ++++++++- >> 2 files changed, 16 insertions(+), 2 deletions(-) >> >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h >> index d21deb46f49f..5d1bb6b42ea2 100644 >> --- a/include/uapi/linux/bpf.h >> +++ b/include/uapi/linux/bpf.h >> @@ -932,7 +932,14 @@ enum bpf_map_type { >> */ >> BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, >> BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, >> - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, >> + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs >> + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + >> + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * deprecated. >> + */ >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, >> BPF_MAP_TYPE_QUEUE, >> BPF_MAP_TYPE_STACK, >> BPF_MAP_TYPE_SK_STORAGE, >> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h >> index d21deb46f49f..5d1bb6b42ea2 100644 >> --- a/tools/include/uapi/linux/bpf.h >> +++ b/tools/include/uapi/linux/bpf.h >> @@ -932,7 +932,14 @@ enum bpf_map_type { >> */ >> BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, >> BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, >> - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, >> + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs >> + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + >> + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE >> + * deprecated. >> + */ >> + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, >> BPF_MAP_TYPE_QUEUE, >> BPF_MAP_TYPE_STACK, >> BPF_MAP_TYPE_SK_STORAGE, >> -- >> 2.34.1 >> >> >
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index d21deb46f49f..5d1bb6b42ea2 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -932,7 +932,14 @@ enum bpf_map_type { */ BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + * deprecated. + */ + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK, BPF_MAP_TYPE_SK_STORAGE, diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index d21deb46f49f..5d1bb6b42ea2 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -932,7 +932,14 @@ enum bpf_map_type { */ BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED, BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, + /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs + * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE + + * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + * deprecated. + */ + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED, BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK, BPF_MAP_TYPE_SK_STORAGE,
Now 'BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE + local percpu ptr' can cover all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE functionality and more. So mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated. Signed-off-by: Yonghong Song <yonghong.song@linux.dev> --- include/uapi/linux/bpf.h | 9 ++++++++- tools/include/uapi/linux/bpf.h | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-)