a0038000 t bpf_prog_a04f5eef06a7f555__123456789ABCDE
a005 t bpf_prog_a04f5eef06a7f555
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
Acked-by: Alexei Starovoitov <a...@fb.com>
---
kernel/bpf/core.c | 17 +++--
The first two patches make improvements on the bpf obj name.
The last patch adds the prog name to kallsyms.
Martin KaFai Lau (3):
bpf: Change bpf_obj_name_cpy() to better ensure map's name is init by
0
bpf: Use char in prog and map name
bpf: Append prog->aux->name in bpf_get_pro
On Sat, Sep 30, 2017 at 02:07:46AM +, Jakub Kicinski wrote:
> Hi Martin!
>
> On Wed, 27 Sep 2017 14:37:53 -0700, Martin KaFai Lau wrote:
> > diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> > index 33ccc474fb04..252f4bc9eb25 100644
> > --- a/include/linux/bp
This patch uses u64_to_user_ptr() to cast info.map_ids to a userspace ptr.
It also tags the user_map_ids with '__user' for sparse check.
Fixes: cb4d2b3f03d8 ("bpf: Add name, load_time, uid and map_ids to
bpf_prog_info")
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
kernel/b
On Fri, Sep 29, 2017 at 06:54:16AM +, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
> master
> head: fa8fefaa678ea390b873195d19c09930da84a4bb
> commit: cb4d2b3f03d8eed90be3a194e5b54b734ec4bbe9 [332/339] bpf: Add name,
> load_time, uid
r bpf_prog, bpf_load.c does
not collect the function symbol name. We can consider to collect
them later if there is a need to continue supporting the bpf_load.c.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogear
This patch allows userspace to specify a name for a map
during BPF_MAP_CREATE.
The map's name can later be exported to user space
via BPF_OBJ_GET_INFO_BY_FD.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan..
ted to
the newly added members 'nr_map_ids' and 'map_ids' of
the bpf_prog_info. On the input, nr_map_ids tells how
big the userspace's map_ids buffer is. On the output,
nr_map_ids tells the exact user_map_cnt and it will only
copy up to the userspace's map_ids buffer is allowed.
Signed-off-by: Martin KaFai
This patch tests newly added fields of the bpf_attr,
bpf_prog_info and bpf_map_info.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
tools/testing/selftests/bpf/
This patch series adds more fields to bpf_prog_info and bpf_map_info.
Please see individual patch for details.
Martin KaFai Lau (5):
bpf: Add name, load_time, uid and map_ids to bpf_prog_info
bpf: Add map_name to bpf_map_info
bpf: libbpf: Provide basic API support to specify BPF obj name
This patch swaps the checking order. It now checks the map_info
first and then prog_info. It is a prep work for adding
test to the newly added fields (the map_ids of prog_info field
in particular).
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.c
On Wed, Sep 27, 2017 at 06:03:33PM +, Eric Dumazet wrote:
> >> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>
> >
> > Hi Paolo,
> >
> > Eric and I discussed about this issue recently as well :).
> >
> > What about the following change:
> >
> > diff --git a/include/net/dst.h
On Tue, Sep 26, 2017 at 01:16:05AM +, Wei Wang wrote:
> On Mon, Sep 25, 2017 at 5:56 PM, Martin KaFai Lau <ka...@fb.com> wrote:
> > On Mon, Sep 25, 2017 at 05:35:22PM +, Wei Wang wrote:
> >> From: Wei Wang <wei...@google.com>
> >>
> >> fib6
On Mon, Sep 25, 2017 at 05:35:22PM +, Wei Wang wrote:
> From: Wei Wang
>
> fib6_del() generates WARN_ON() when rt->dst.obsolete > 0. This does not
> make sense because it is possible that the route passed in is already
> deleted by some other thread and rt->dst.obsolete is
cpu saw 1 -> 0 transition in
> dst_release() and queued the dst for freeing after one RCU grace period.
>
> Lets unify skb_dst_force() and skb_dst_force_safe(), since we should
> always perform the complete check against dst refcount, and not assume
> it is not zero.
Acke
er solution would be to change htab_map_delete_elem() to
> defer the free_htab_elem() call after
> raw_spin_unlock_irqrestore(>lock, flags), but this might be not
> enough to cover other code paths.
Thanks for fixing it.
Acked-by: Martin KaFai Lau <ka...@fb.com>
f 0b
> 66 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 41
> RIP: cache_alloc_node+0x1d4/0x1e0 mm/slab.c:3292 RSP: 8801c0c97638
> ---[ end trace d745f355da2e33ce ]---
> Kernel panic - not syncing: Fatal exception
>
> Fixes: 96eabe7a40aa ("bpf: Allow selecting numa node during ma
LRU hash
Second column: Number of lookups/s
Before:
> echo "$((2**20+1)): $(./map_perf_test 1024 1 $((2**20+1)) 1000 | awk
> '{print $3}')"
1048577: 260097
After:
> echo "$((2**20+1)): $(./map_perf_test 1024 1 $((2**20+1)) 1000 | awk
> '{print $3}')"
1048577
This patchset improves the lookup performance of the LRU map.
Please see individual patch for details.
Martin KaFai Lau (3):
bpf: Add lru_hash_lookup performance test
bpf: Inline LRU map lookup
bpf: Only set node->ref = 1 if it has not been set
kernel/bpf/bpf_lru_list.h|
8193: 773731
16385: 729673
32769: 721989
65537: 715530
131073: 671665
262145: 516987
524289: 321125
1048577: 260048
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
kernel/bpf/hashtab.c | 19 +++
1 file changed, 19 insertions(+)
diff --git a/kernel/bpf/hashtab.c b/k
rly
name the test params in stress_lru_hmap_alloc() in map_perf_test_kern.c.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
samples/bpf/map_perf_test_kern.c | 44 +++
samples/bpf/map_perf_test_user.c | 77 ++--
2 files cha
consistently cannot allocate new buffers. Improve it by counting
> -ENOMEM event as 1 towards the NAPI budget.
>
> Cc: Martin KaFai Lau <ka...@fb.com>
> Signed-off-by: Michael Chan <michael.c...@broadcom.com>
Thanks for fixing it.
Reported-by: Martin KaFai Lau <ka...
bj_get_info_by_fd()"),
> which made bpf_obj_get_info_by_fd() usable for retrieving
> the image dumps.
Acked-by: Martin KaFai Lau <ka...@fb.com>
>
> Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com>
> ---
> tools/testing/selftests/bpf/test_progs.c |
gt; rcu API is used for it.
> After this fix, sparse no longer generates the above warning.
>
> Fixes: c5cff8561d2d ("ipv6: add rcu grace period before freeing fib6_node")
> Signed-off-by: Wei Wang <wei...@google.com>
> Acked-by: Eric Dumazet <eduma...@google.com>
Acke
hash of maps support")
> Signed-off-by: Daniel Borkmann <dan...@iogearbox.net>
> Acked-by: Alexei Starovoitov <a...@kernel.org>
Acked-by: Martin KaFai Lau <ka...@fb.com>
> ---
> kernel/bpf/hashtab.c | 30 +-
> 1 file changed, 17 insertio
On Sat, Aug 19, 2017 at 11:33:13PM -0700, David Miller wrote:
> From: kbuild test robot
> Date: Sun, 20 Aug 2017 13:43:54 +0800
>
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
> > master
> > head: 228498596c44041c710f5a633904205bc1cd9177
On Sun, Aug 20, 2017 at 01:43:54PM +0800, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
> master
> head: 228498596c44041c710f5a633904205bc1cd9177
> commit: 96eabe7a40aa17e613cf3db2c742ee8b1fc764d0 [1184/1189] bpf: Allow
> selecting numa
g fib6_node and
> makes sure the functions that dereference it takes rcu_read_lock().
>
> Note: there is no "Fixes" tag because this bug was there in a very
> early stage.
>
> Signed-off-by: Wei Wang <wei...@google.com>
> Acked-by: Eric Dumazet <eduma...@google.c
bool status = false;
> >> +
> >> + rcu_read_lock();
> >> + fn = rcu_dereference(rt->rt6i_node);
> >> +
> >> + if (fn) {
> >> + *cookie = fn->fn_sernum;
> >> + status = true;
> >>
On Fri, Aug 18, 2017 at 05:36:55PM -0700, Wei Wang wrote:
> From: Wei Wang
>
> We currently keep rt->rt6i_node pointing to the fib6_node for the route.
> And some functions make use of this pointer to dereference the fib6_node
> from rt structure, e.g. rt6_check(). However, as
On Fri, Aug 18, 2017 at 07:50:03AM -0700, Tom Herbert wrote:
> > We had been using the auto_flowlabels=1 (i.e. essentially enable flowlabel)
> > mainly because we want to take the benefit of dst_negative_advice() when
> > tcp_write_timeout() happens.
> >
> > During our test, our system handles
This series allows user to pick the numa node during map creation.
The first patch has the details
Martin KaFai Lau (2):
bpf: Allow selecting numa node during map creation
bpf: Allow numa selection in INNER_LRU_HASH_PREALLOC test of
map_perf_test
include/linux/bpf.h
ugh to stay in the cache.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
Acked-by: Alexei Starovoitov <a...@fb.com>
---
include/linux/bpf.h | 10 +-
include/uapi/linux/bpf.h | 10 +-
kernel/bpf/arraymap.c|
This patch makes the needed changes to allow each process of
the INNER_LRU_HASH_PREALLOC test to provide its numa node id
when creating the lru map.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
Acked-by: Alexei Starovoitov
m>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
kernel/bpf/verifier.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 40f669ddb571..4f6e7eb42ba0 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1523,6
On Tue, Aug 15, 2017 at 05:15:46PM -0700, Tom Herbert wrote:
> On Tue, Aug 15, 2017 at 3:42 PM, Shaohua Li wrote:
> > On Tue, Aug 15, 2017 at 07:08:31AM -0700, Tom Herbert wrote:
> >> On Mon, Aug 14, 2017 at 7:52 PM, Shaohua Li wrote:
> >> > On Fri, Aug 11, 2017
_size(prog->len) also
> includes the size of struct bpf_prog itself plus program instructions
> and is usually used either in context of accounting or for bpf_prog_alloc()
> et al, thus we copy out of bounds in bpf_prog_get_info_by_fd()
> potentially. Use the correct bpf_prog_insn_size() ins
ixing it. (I am on PTO and cannot use my usual email account).
Acked-by: Martin KaFai Lau <ka...@fb.com>
>
> Fixes: 1e2709769086 ("bpf: Add BPF_OBJ_GET_INFO_BY_FD")
> Signed-off-by: Daniel Borkmann <dan...@iogearbox.net>
> ---
> kernel/bpf/syscall.c
R10=fp
> 11: (b7) r0 = 0
> 12: (95) exit
>
> Prevent this by checking xadd src reg for pointer types. Also
> add a couple of test cases related to this.
>
> Fixes: 1be7f75d1668 ("bpf: enable non-root eBPF programs")
> Fixes: 17a5267067f3 ("bpf: verifier (add verifier core)")
> Signed-off-by: Daniel Borkmann <dan...@iogearbox.net>
Acked-by: Martin KaFai Lau <ka...@fb.com>
22.350984]
==
Fixes: b870aa901f4b ("bpf: use different interpreter depending on required
stack size")
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
kerne
Checks are added to the existing sockex3 and test_map_in_map test.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
samples/bpf/sockex3_user.c | 15 ++-
samples/bpf/test_map_in_map_user.c | 17 ++
-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/linux/bpf.h | 3 +++
kernel/bpf/arraymap.c | 27 +++
kernel/bpf/hashtab.c| 21 +
kernel/bpf/map_in_map.c | 5 +
kernel/bpf/map_i
This patchset adds BPF_MAP_LOOKUP_ELEM syscall support for
BPF_MAP_TYPE_PROG_ARRAY,
BPF_MAP_TYPE_ARRAY_OF_MAPS and
BPF_MAP_TYPE_HASH_OF_MAPS
Martin KaFai Lau (2):
bpf: Add syscall lookup support for fd array and htab
bpf: Add test for syscall on fd array/htab lookup
include/linux/bpf.h
This patch adds support to the newly added IFLA_XDP_PROG_ID.
./ip link show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdpgeneric/id:2 qdisc [...]
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
include/linux/if_link.h | 1 +
ip/iplink_xdp.c | 12 +++
GET_FD_BY_ID command, and dump related prog info via
> BPF_OBJ_GET_INFO_BY_FD command for bpf(2).
Acked-by: Martin KaFai Lau <ka...@fb.com>
Add support to qede to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Mintz Yuval <yuval.mi...@cavium.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/net/ethernet/q
Add support to thunderx to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Sunil Goutham <sgout...@cavium.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/net
Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <
Add support to virtio_net to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: John Fastabend <john.fastab...@gmail.com>
Cc: Jason Wang <jasow...@redhat.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkma
Add support to ixgbe to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Alexander Duyck <alexander.h.du...@intel.com>
Cc: John Fastabend <john.fastab...@gmail.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-
by Jakub Kicinski. The existing prog_attached
and the new prog_id are put under a struct for XDP_QUERY_PROG.
Martin KaFai Lau (9):
net: Add IFLA_XDP_PROG_ID
bpf: mlx4: Report bpf_prog ID during XDP_QUERY_PROG
bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG
bpf: virtio_net: Report bpf_prog
Add support to mlx4 to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@
Add support to bnxt to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Michael Chan <michael.c...@broadcom.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/ne
Add support to nfp to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Jakub Kicinski <jakub.kicin...@netronome.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/ne
th0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdp(prog_id:1) qdisc
fq_codel state UP mode DEFAULT group default qlen 1000
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
includ
On Tue, Jun 13, 2017 at 07:19:50PM -0700, Jakub Kicinski wrote:
> On Tue, 13 Jun 2017 17:37:50 -0700, Martin KaFai Lau wrote:
> > On Tue, Jun 13, 2017 at 04:52:32PM -0700, Jakub Kicinski wrote:
> > > On Tue, 13 Jun 2017 14:08:40 -0700, Martin KaFai Lau wrote:
> > > &g
On Tue, Jun 13, 2017 at 04:52:32PM -0700, Jakub Kicinski wrote:
> On Tue, 13 Jun 2017 14:08:40 -0700, Martin KaFai Lau wrote:
> > - case XDP_QUERY_PROG:
> > - xdp->prog_attached = !!nn->dp.xdp_prog;
> > + case XDP_QUERY_PROG: {
> > +
Add support to nfp to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Jakub Kicinski <jakub.kicin...@netronome.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/ne
Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <
Add support to bnxt to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Michael Chan <michael.c...@broadcom.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/ne
Add support to qede to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Mintz Yuval <yuval.mi...@cavium.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/net/ethernet/q
th0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdp(prog_id:1) qdisc
fq_codel state UP mode DEFAULT group default qlen 1000
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
includ
Add support to thunderx to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Sunil Goutham <sgout...@cavium.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/net
Add support to ixgbe to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Alexander Duyck <alexander.h.du...@intel.com>
Cc: John Fastabend <john.fastab...@gmail.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-
.
Martin KaFai Lau (9):
net: Add IFLA_XDP_PROG_ID
bpf: mlx4: Report bpf_prog ID during XDP_QUERY_PROG
bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG
bpf: virtio_net: Report bpf_prog ID during XDP_QUERY_PROG
bpf: bnxt: Report bpf_prog ID during XDP_QUERY_PROG
bpf: thunderx: Report
Add support to virtio_net to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: John Fastabend <john.fastab...@gmail.com>
Cc: Jason Wang <jasow...@redhat.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkma
Add support to mlx4 to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@
On Tue, Jun 13, 2017 at 07:04:26PM +0300, Saeed Mahameed wrote:
> On Tue, Jun 13, 2017 at 4:00 AM, Martin KaFai Lau <ka...@fb.com> wrote:
> > Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.
> >
> > Signed-off-by: Martin KaFai Lau <ka...@fb.
On Mon, Jun 12, 2017 at 06:26:02PM -0700, Jakub Kicinski wrote:
> On Mon, 12 Jun 2017 18:00:15 -0700, Martin KaFai Lau wrote:
> > This is the first usage of the new bpf_prog ID. It is for
> > reporting the ID of a xdp_prog through netlink.
> >
> > It rides on the exi
On Mon, Jun 12, 2017 at 06:28:42PM -0700, Jakub Kicinski wrote:
> On Mon, 12 Jun 2017 18:00:23 -0700, Martin KaFai Lau wrote:
> > + case XDP_QUERY_PROG: {
> > + const struct bpf_prog *xdp_prog;
> > +
> > + xdp_prog = READ_ONCE(nn->dp.xdp_prog)
Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@
Add support to mlx4 to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@
Add support to qede to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Mintz, Yuval <yuval.mi...@cavium.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/net/ethernet/q
Add support to ixgbe to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Alexander Duyck <alexander.h.du...@intel.com>
Cc: John Fastabend <john.fastab...@gmail.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-
default qlen 1000
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/linux/netdevice.h| 3 ++-
include/uapi/linux/if_link.h | 1 +
net/core/dev.c | 23 +++
prog_attached can be implied by prog_id (!!prog_id) and
all drivers supporting xdp has been stopped setting prog_attached.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/linu
Add support to nfp to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Jakub Kicinski <jakub.kicin...@netronome.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/ne
Add support to bnxt to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Michael Chan <michael.c...@broadcom.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/ne
Add support to virtio_net to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: John Fastabend <john.fastab...@gmail.com>
Cc: Jason Wang <jasow...@redhat.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkma
is changed one by one. The final patch
removes the prog_attached from 'struct netdev_xdp' because
prog_id > 0 implies the presence of xdp_prog.
I have tested with generic_xdp, mlx4 and mlx5.
Martin KaFai Lau (10):
net: Add IFLA_XDP_PROG_ID
bpf: mlx4: Report bpf_prog ID during XDP_QUERY_PROG
Add support to thunderx to report bpf_prog ID during XDP_QUERY_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Sunil Goutham <sgout...@cavium.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
drivers/net
to remove after making changes.
Fixes: 95b9afd3987f ("bpf: Test for bpf ID")
Reported-by: Yonghong Song <y...@fb.com>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
tools/testing/selftests/bpf/test_progs.c | 19 +++
1 file changed, 15 insertions(+), 4 deletions(
304329)
This patch makes changes to the section name and the function name.
Fixes: 95b9afd3987f ("bpf: Test for bpf ID")
Reported-by: Alexei Starovoitov <a...@fb.com>
Reported-by: Yonghong Song <y...@fb.com>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
tools/testing
to the prog_idr.
After bpf_prog_select_runtime(), the prog is read-only. Hence,
the id is stored in 'struct bpf_prog_aux'.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include
Add jited_len to struct bpf_prog. It will be
useful for the struct bpf_prog_info which will
be added in the later patch.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
arch/arm64/
the bpf_attr.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/linux/filter.h | 2 -
include/uapi/linux/bpf.h | 28
kernel/bpf/s
.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/uapi/linux/bpf.h | 7 +++
kernel/bpf/syscall.c | 38 ++
2 files changed, 45 inserti
This patch generates an unique ID for each created bpf_map.
The approach is similar to the earlier patch for bpf_prog ID.
It is worth to note that the bpf_map's ID and bpf_prog's ID
are in two independent ID spaces and both have the same valid range:
[1, INT_MAX).
Signed-off-by: Martin KaFai Lau
;id.
In the error path of bpf_map_inc_not_zero(), it may have to
call __bpf_map_put(map, false) which does not need
to take the map_idr_lock when freeing the map->id.
It is currently limited to CAP_SYS_ADMIN which we can
consider to lift it in followup patches.
Signed-off-by: Martin KaFai L
Add test to exercise the bpf_prog/map id generation,
bpf_(prog|map)_get_next_id(), bpf_(prog|map)_get_fd_by_id() and
bpf_get_obj_info_by_fd().
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.
info_by_fd().
Martin KaFai Lau (8):
bpf: Introduce bpf_prog ID
bpf: Introduce bpf_map ID
bpf: Add BPF_(PROG|MAP)_GET_NEXT_ID command
bpf: Add BPF_PROG_GET_FD_BY_ID
bpf: Add BPF_MAP_GET_FD_BY_ID
bpf: Add jited_len to struct bpf_prog
bpf: Add BPF_OBJ_GET_INFO_BY_FD
bpf: Test for bpf ID
->id.
In the error path of bpf_prog_inc_not_zero(), it may have to
call __bpf_prog_put(map, false) which does not need
to take the prog_idr_lock when freeing the prog->id.
It is currently limited to CAP_SYS_ADMIN which we can
consider to lift it in followup patches.
Signed-off-by: Martin KaF
On Wed, May 31, 2017 at 07:35:18PM -0400, David Miller wrote:
> From: Martin KaFai Lau <ka...@fb.com>
> Date: Wed, 31 May 2017 11:58:54 -0700
>
> > This patch series:
> > 1) Introduce ID for both bpf_prog and bpf_map.
> > 2) Add bpf commands to iterate the prog IDs
Add test to exercise the bpf_prog/map id generation,
bpf_(prog|map)_get_next_id(), bpf_(prog|map)_get_fd_by_id() and
bpf_get_obj_info_by_fd().
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.
.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/uapi/linux/bpf.h | 7 +++
kernel/bpf/syscall.c | 38 ++
2 files changed, 45 inserti
This patch generates an unique ID for each created bpf_map.
The approach is similar to the earlier patch for bpf_prog ID.
It is worth to note that the bpf_map's ID and bpf_prog's ID
are in two independent ID spaces and both have the same valid range:
[1, INT_MAX).
Signed-off-by: Martin KaFai Lau
->id.
In the error path of bpf_prog_inc_not_zero(), it may have to
call __bpf_prog_put(map, false) which does not need
to take the prog_idr_lock when freeing the prog->id.
It is currently limited to CAP_SYS_ADMIN which we can
consider to lift it in followup patches.
Signed-off-by: Martin KaF
in bpf_prog_get_info_by_fd()
and bpf_map_get_info_by_fd().
Martin KaFai Lau (8):
bpf: Introduce bpf_prog ID
bpf: Introduce bpf_map ID
bpf: Add BPF_(PROG|MAP)_GET_NEXT_ID command
bpf: Add BPF_PROG_GET_FD_BY_ID
bpf: Add BPF_MAP_GET_FD_BY_ID
bpf: Add jited_len to struct bpf_prog
bpf: Add
Add jited_len to struct bpf_prog. It will be
useful for the struct bpf_prog_info which will
be added in the later patch.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
arch/arm64/
the bpf_attr.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@fb.com>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/linux/filter.h | 2 -
include/uapi/linux/bpf.h | 28
kernel/bpf/s
301 - 400 of 724 matches
Mail list logo