netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next] bpf: support map offload
@ 2018-01-17  7:50 Jakub Kicinski
  2018-01-17  9:09 ` Daniel Borkmann
  2018-01-19 20:36 ` David Ahern
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2018-01-17  7:50 UTC (permalink / raw)
  To: dsahern, stephen, daniel; +Cc: netdev, oss-drivers, Jakub Kicinski

When program is loaded with a specified ifindex, use that
ifindex also when creating maps.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 lib/bpf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bpf.c b/lib/bpf.c
index d32f1b808180..2db151e4dd3c 100644
--- a/lib/bpf.c
+++ b/lib/bpf.c
@@ -1208,7 +1208,7 @@ static int bpf_log_realloc(struct bpf_elf_ctx *ctx)
 
 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)
+			  uint32_t flags, int inner_fd, uint32_t ifindex)
 {
 	union bpf_attr attr = {};
 
@@ -1218,6 +1218,7 @@ static int bpf_map_create(enum bpf_map_type type, uint32_t size_key,
 	attr.max_entries = max_elem;
 	attr.map_flags = flags;
 	attr.inner_map_fd = inner_fd;
+	attr.map_ifindex = ifindex;
 
 	return bpf(BPF_MAP_CREATE, &attr, sizeof(attr));
 }
@@ -1632,7 +1633,9 @@ static int bpf_map_attach(const char *name, struct bpf_elf_ctx *ctx,
 
 	errno = 0;
 	fd = bpf_map_create(map->type, map->size_key, map->size_value,
-			    map->max_elem, map->flags, map_inner_fd);
+			    map->max_elem, map->flags, map_inner_fd,
+			    ctx->ifindex);
+
 	if (fd < 0 || ctx->verbose) {
 		bpf_map_report(fd, name, map, ctx, map_inner_fd);
 		if (fd < 0)
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next] bpf: support map offload
  2018-01-17  7:50 [PATCH iproute2-next] bpf: support map offload Jakub Kicinski
@ 2018-01-17  9:09 ` Daniel Borkmann
  2018-01-19 20:36 ` David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2018-01-17  9:09 UTC (permalink / raw)
  To: Jakub Kicinski, dsahern, stephen; +Cc: netdev, oss-drivers

On 01/17/2018 08:50 AM, Jakub Kicinski wrote:
> When program is loaded with a specified ifindex, use that
> ifindex also when creating maps.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next] bpf: support map offload
  2018-01-17  7:50 [PATCH iproute2-next] bpf: support map offload Jakub Kicinski
  2018-01-17  9:09 ` Daniel Borkmann
@ 2018-01-19 20:36 ` David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2018-01-19 20:36 UTC (permalink / raw)
  To: Jakub Kicinski, stephen, daniel; +Cc: netdev, oss-drivers

On 1/16/18 11:50 PM, Jakub Kicinski wrote:
> When program is loaded with a specified ifindex, use that
> ifindex also when creating maps.
> 
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
>  lib/bpf.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 

applied to iproute2-next

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-19 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17  7:50 [PATCH iproute2-next] bpf: support map offload Jakub Kicinski
2018-01-17  9:09 ` Daniel Borkmann
2018-01-19 20:36 ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).