summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-01-06 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-01-06 08:00:00 +0000
commit7a0c7a708a15cf13640c171e596e626d40579427 (patch)
tree50aa7dfe00d89ef2a5499a081bd55d0d24b6aa99
parentb502b1fd1cc11a9b9341cb380039bac03fdde627 (diff)
downloadstrace-7a0c7a708a15cf13640c171e596e626d40579427.tar.gz
xlat: update BPF_* constants
* src/xlat/bpf_map_types.in (BPF_MAP_TYPE_CGRP_STORAGE): New constant introduced by Linux kernel commit v6.2-rc1~99^2~309^2~7^2~6. * NEWS: Mention this change. * tests/bpf.c (BPF_MAP_CREATE_checks): Update.
-rw-r--r--NEWS2
-rw-r--r--src/xlat/bpf_map_types.in1
-rw-r--r--tests/bpf.c10
3 files changed, 7 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 73b58f54f..17ed842ef 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ Noteworthy changes in release ?.? (????-??-??)
==============================================
* Improvements
- * Updated lists of ALG_* constants.
+ * Updated lists of ALG_* and BPF_* constants.
Noteworthy changes in release 6.1 (2022-12-12)
==============================================
diff --git a/src/xlat/bpf_map_types.in b/src/xlat/bpf_map_types.in
index f5bd88fb5..a431b9dae 100644
--- a/src/xlat/bpf_map_types.in
+++ b/src/xlat/bpf_map_types.in
@@ -31,3 +31,4 @@ BPF_MAP_TYPE_INODE_STORAGE 28
BPF_MAP_TYPE_TASK_STORAGE 29
BPF_MAP_TYPE_BLOOM_FILTER 30
BPF_MAP_TYPE_USER_RINGBUF 31
+BPF_MAP_TYPE_CGRP_STORAGE 32
diff --git a/tests/bpf.c b/tests/bpf.c
index 5af9484a9..0cfd63f43 100644
--- a/tests/bpf.c
+++ b/tests/bpf.c
@@ -272,7 +272,7 @@ init_BPF_MAP_CREATE_attr7(struct bpf_attr_check *check, size_t idx)
attr->map_ifindex = ifindex_lo();
}
-static_assert(ARRAY_SIZE(bpf_map_types_xdata) == 32,
+static_assert(ARRAY_SIZE(bpf_map_types_xdata) == 33,
"The map_type for tests 1 and 2 below needs to be updated");
static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
{
@@ -283,7 +283,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
},
{ /* 1 */
.data = { .BPF_MAP_CREATE_data = {
- .map_type = 31,
+ .map_type = 32,
.key_size = 4,
.value_size = 8,
.max_entries = 256,
@@ -293,7 +293,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
.map_name = "0123456789abcde",
} },
.size = offsetof(struct BPF_MAP_CREATE_struct, map_name) + 8,
- .str = "map_type=BPF_MAP_TYPE_USER_RINGBUF, key_size=4"
+ .str = "map_type=BPF_MAP_TYPE_CGRP_STORAGE, key_size=4"
", value_size=8, max_entries=256"
", map_flags=BPF_F_NO_PREALLOC|BPF_F_NO_COMMON_LRU"
"|BPF_F_NUMA_NODE|BPF_F_RDONLY|BPF_F_WRONLY"
@@ -305,7 +305,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
},
{ /* 2 */
.data = { .BPF_MAP_CREATE_data = {
- .map_type = 32,
+ .map_type = 33,
.key_size = 0xface1e55,
.value_size = 0xbadc0ded,
.max_entries = 0xbeefcafe,
@@ -316,7 +316,7 @@ static struct bpf_attr_check BPF_MAP_CREATE_checks[] = {
.map_ifindex = 3141592653,
} },
.size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex),
- .str = "map_type=0x20 /* BPF_MAP_TYPE_??? */"
+ .str = "map_type=0x21 /* BPF_MAP_TYPE_??? */"
", key_size=4207812181, value_size=3134983661"
", max_entries=3203386110"
", map_flags=0xffffe000 /* BPF_F_??? */"