From: Craig Gallek <kraigatgoog@gmail.com>
To: Alexei Starovoitov <ast@fb.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <brouer@redhat.com>,
"David S . Miller" <davem@davemloft.net>
Cc: Chonggang Li <chonggangli@google.com>, netdev@vger.kernel.org
Subject: [PATCH net-next v3 2/2] libbpf: use map_flags when creating maps
Date: Thu, 5 Oct 2017 10:41:58 -0400 [thread overview]
Message-ID: <20171005144158.14860-3-kraigatgoog@gmail.com> (raw)
In-Reply-To: <20171005144158.14860-1-kraigatgoog@gmail.com>
From: Craig Gallek <kraig@google.com>
This is required to use BPF_MAP_TYPE_LPM_TRIE or any other map type
which requires flags.
Signed-off-by: Craig Gallek <kraig@google.com>
---
tools/lib/bpf/libbpf.c | 2 +-
tools/lib/bpf/libbpf.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 23152890ec60..5aa45f89da93 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -942,7 +942,7 @@ bpf_object__create_maps(struct bpf_object *obj)
def->key_size,
def->value_size,
def->max_entries,
- 0);
+ def->map_flags);
if (*pfd < 0) {
size_t j;
int err = *pfd;
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 7959086eb9c9..6e20003109e0 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -207,6 +207,7 @@ struct bpf_map_def {
unsigned int key_size;
unsigned int value_size;
unsigned int max_entries;
+ unsigned int map_flags;
};
/*
--
2.14.2.920.gcf0c67979c-goog
next prev parent reply other threads:[~2017-10-05 14:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 14:41 [PATCH net-next v3 0/2] libbpf: support more map options Craig Gallek
2017-10-05 14:41 ` [PATCH net-next v3 1/2] libbpf: parse maps sections of varying size Craig Gallek
2017-10-05 17:52 ` Jesper Dangaard Brouer
2017-10-05 19:25 ` Daniel Borkmann
2017-10-05 14:41 ` Craig Gallek [this message]
2017-10-05 19:26 ` [PATCH net-next v3 2/2] libbpf: use map_flags when creating maps Daniel Borkmann
2017-10-05 16:17 ` [PATCH net-next v3 0/2] libbpf: support more map options Alexei Starovoitov
2017-10-06 4:42 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171005144158.14860-3-kraigatgoog@gmail.com \
--to=kraigatgoog@gmail.com \
--cc=ast@fb.com \
--cc=brouer@redhat.com \
--cc=chonggangli@google.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).