* Re: [PATCH iproute2]fix missing eBPF name
[not found] <4079d76a.5b33.184195d2368.Coremail.mrpre@163.com>
@ 2022-10-27 15:38 ` Stephen Hemminger
2022-10-30 7:32 ` [PATCH v2] fix missing map name when creating a eBPF map mrpre
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2022-10-27 15:38 UTC (permalink / raw)
To: mrpre; +Cc: netdev
On Thu, 27 Oct 2022 20:14:05 +0800 (CST)
mrpre <mrpre@163.com> wrote:
> Signed-off-by: mrpre <mrpre@163.com>
>
>
>
>
> missing map name when creating a eBPF map
>
> ---
Makes sense, but this patch is not formatted properly and is missing
a valid Signed-off-by line.
Please follow same style and contribution rules for iproute2
(see kernel documentation on writing patches).
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] fix missing map name when creating a eBPF map
2022-10-27 15:38 ` [PATCH iproute2]fix missing eBPF name Stephen Hemminger
@ 2022-10-30 7:32 ` mrpre
2022-11-01 14:09 ` Daniel Borkmann
0 siblings, 1 reply; 4+ messages in thread
From: mrpre @ 2022-10-30 7:32 UTC (permalink / raw)
To: stephen; +Cc: netdev, mrpre
Signed-off-by: mrpre <mrpre@163.com>
---
lib/bpf_legacy.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c
index 4fabdcc8..0fff035b 100644
--- a/lib/bpf_legacy.c
+++ b/lib/bpf_legacy.c
@@ -1264,7 +1264,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
uint32_t size_value, uint32_t max_elem,
uint32_t flags, int inner_fd, int btf_fd,
uint32_t ifindex, uint32_t btf_id_key,
- uint32_t btf_id_val)
+ uint32_t btf_id_val, const char *name)
{
union bpf_attr attr = {};
@@ -1278,6 +1278,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
attr.btf_fd = btf_fd;
attr.btf_key_type_id = btf_id_key;
attr.btf_value_type_id = btf_id_val;
+ strncpy(attr.map_name, name, sizeof(attr.map_name));
return bpf(BPF_MAP_CREATE, &attr, sizeof(attr));
}
@@ -1682,7 +1683,7 @@ probe:
errno = 0;
fd = bpf_map_create(map->type, map->size_key, map->size_value,
map->max_elem, map->flags, map_inner_fd, ctx->btf_fd,
- ifindex, ext->btf_id_key, ext->btf_id_val);
+ ifindex, ext->btf_id_key, ext->btf_id_val, name);
if (fd < 0 || ctx->verbose) {
bpf_map_report(fd, name, map, ctx, map_inner_fd);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] fix missing map name when creating a eBPF map
2022-10-30 7:32 ` [PATCH v2] fix missing map name when creating a eBPF map mrpre
@ 2022-11-01 14:09 ` Daniel Borkmann
2022-11-02 7:05 ` [PATCH iproute2 v2] fix missing map name when creating eBPF maps mrpre
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Borkmann @ 2022-11-01 14:09 UTC (permalink / raw)
To: mrpre, stephen; +Cc: netdev
Hi mrpre,
On 10/30/22 8:32 AM, mrpre wrote:
> Signed-off-by: mrpre <mrpre@163.com>
Small form letter: Please indicate iproute2 in subject, add a proper commit message /
bug report and please also use an actual name instead of "mrpre" for the Signed-off-by.
Thanks a lot,
Daniel
> ---
> lib/bpf_legacy.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c
> index 4fabdcc8..0fff035b 100644
> --- a/lib/bpf_legacy.c
> +++ b/lib/bpf_legacy.c
> @@ -1264,7 +1264,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
> uint32_t size_value, uint32_t max_elem,
> uint32_t flags, int inner_fd, int btf_fd,
> uint32_t ifindex, uint32_t btf_id_key,
> - uint32_t btf_id_val)
> + uint32_t btf_id_val, const char *name)
> {
> union bpf_attr attr = {};
>
> @@ -1278,6 +1278,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
> attr.btf_fd = btf_fd;
> attr.btf_key_type_id = btf_id_key;
> attr.btf_value_type_id = btf_id_val;
> + strncpy(attr.map_name, name, sizeof(attr.map_name));
>
> return bpf(BPF_MAP_CREATE, &attr, sizeof(attr));
> }
> @@ -1682,7 +1683,7 @@ probe:
> errno = 0;
> fd = bpf_map_create(map->type, map->size_key, map->size_value,
> map->max_elem, map->flags, map_inner_fd, ctx->btf_fd,
> - ifindex, ext->btf_id_key, ext->btf_id_val);
> + ifindex, ext->btf_id_key, ext->btf_id_val, name);
>
> if (fd < 0 || ctx->verbose) {
> bpf_map_report(fd, name, map, ctx, map_inner_fd);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH iproute2 v2] fix missing map name when creating eBPF maps
2022-11-01 14:09 ` Daniel Borkmann
@ 2022-11-02 7:05 ` mrpre
0 siblings, 0 replies; 4+ messages in thread
From: mrpre @ 2022-11-02 7:05 UTC (permalink / raw)
To: daniel, stephen; +Cc: netdev, mrpre
fix missing map name when creating eBPF maps
Signed-off-by: Chen Jiayuan <mrpre@163.com>
---
lib/bpf_legacy.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c
index 4fabdcc8..0fff035b 100644
--- a/lib/bpf_legacy.c
+++ b/lib/bpf_legacy.c
@@ -1264,7 +1264,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
uint32_t size_value, uint32_t max_elem,
uint32_t flags, int inner_fd, int btf_fd,
uint32_t ifindex, uint32_t btf_id_key,
- uint32_t btf_id_val)
+ uint32_t btf_id_val, const char *name)
{
union bpf_attr attr = {};
@@ -1278,6 +1278,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
attr.btf_fd = btf_fd;
attr.btf_key_type_id = btf_id_key;
attr.btf_value_type_id = btf_id_val;
+ strncpy(attr.map_name, name, sizeof(attr.map_name));
return bpf(BPF_MAP_CREATE, &attr, sizeof(attr));
}
@@ -1682,7 +1683,7 @@ probe:
errno = 0;
fd = bpf_map_create(map->type, map->size_key, map->size_value,
map->max_elem, map->flags, map_inner_fd, ctx->btf_fd,
- ifindex, ext->btf_id_key, ext->btf_id_val);
+ ifindex, ext->btf_id_key, ext->btf_id_val, name);
if (fd < 0 || ctx->verbose) {
bpf_map_report(fd, name, map, ctx, map_inner_fd);
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-02 7:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4079d76a.5b33.184195d2368.Coremail.mrpre@163.com>
2022-10-27 15:38 ` [PATCH iproute2]fix missing eBPF name Stephen Hemminger
2022-10-30 7:32 ` [PATCH v2] fix missing map name when creating a eBPF map mrpre
2022-11-01 14:09 ` Daniel Borkmann
2022-11-02 7:05 ` [PATCH iproute2 v2] fix missing map name when creating eBPF maps mrpre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox