;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
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
On Tue, May 30, 2017 at 06:35:37PM -0600, David Ahern wrote:
> On 5/30/17 6:08 PM, Martin KaFai Lau wrote:
> > This patch series:
> > 1) Introduce ID for both bpf_prog and bpf_map.
> > 2) Add bpf commands to iterate the prog IDs and map
> >IDs of the system.
>
;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 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/
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
.
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
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.
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
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
->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
and it is not meant to be a complete list. They can
be extended in the future patches.
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
On Thu, Apr 27, 2017 at 03:36:59PM +0200, Hannes Frederic Sowa wrote:
> It would help a lot if you could pass the prog_id back during program
> creation, otherwise it will be kind of difficult to get a hold on which
> program is where. ;)
Thanks for your feedback :). Make sense. I will look into
On Thu, Apr 27, 2017 at 09:23:18AM +0200, Alexander Alemayhu wrote:
> On Wed, Apr 26, 2017 at 11:24:49PM -0700, Martin KaFai Lau wrote:
> > Add test to exercise the bpf_prog id generation
> > and iteration.
> >
> Could test_prog_id be a function in tools/testing/se
The ID is generated by the existing idr_alloc_cyclic().
This patch also adds BPF_PROG_GET_NEXT_ID to allow userspace to iterate
all bpf_prog id(s). The API is trying to be consistent with the
existing BPF_MAP_GET_NEXT_KEY.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
include
Add test to exercise the bpf_prog id generation
and iteration.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
tools/include/uapi/linux/bpf.h | 6 ++
tools/lib/bpf/bpf.c| 11
tools/lib/bpf/bpf.h| 1 +
tools/testing/sel
This patchset introduces the bpf_prog ID and a new bpf cmd to
iterate all bpf_prog in the system.
It is still incomplete. The idea can be extended to bpf_map.
Martin KaFai Lau (2):
bpf: Introduce bpf_prog ID
bpf: Test for bpf_prog ID and BPF_PROG_GET_NEXT_ID
include/linux/filter.h
On Tue, Apr 25, 2017 at 09:17:29AM -0700, David Ahern wrote:
[...]
>
> All of those faults are fixed by regenerating the host route if the
> existing one has been moved to the gc list, something that can be
> determined by checking if the rt6i_ref counter is 0.
Acked-by: Martin K
On Mon, Apr 24, 2017 at 01:37:00PM -0600, David Ahern wrote:
> On 4/24/17 10:39 AM, Eric Dumazet wrote:
> >
> > Very nice changelog !
>
>
> Thanks. Given my aggressive brain cell recycling program, I needed to
> write down the analysis.
>
>
>
> >> diff --git a/net/ipv6/addrconf.c
On Sat, Apr 22, 2017 at 07:12:34PM -0600, David Ahern wrote:
> On 4/22/17 4:00 PM, Martin KaFai Lau wrote:
> > On Sat, Apr 22, 2017 at 09:40:37AM -0700, David Ahern wrote:
> > [...]
> >> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> >> index
On Sat, Apr 22, 2017 at 09:40:37AM -0700, David Ahern wrote:
[...]
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 08f9e8ea7a81..97e86158bbcb 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -3303,14 +3303,24 @@ static void addrconf_gre_config(struct net_device
On Fri, Apr 21, 2017 at 04:40:30PM -0700, David Ahern wrote:
> Taking down the loopback device wreaks havoc on IPv6 routes. By
> extension, taking a VRF device wreaks havoc on its table.
>
> Dmitry and Andrey both reported heap out-of-bounds reports in the IPv6
> FIB code while running syzkaller
rom mlx5e_update_vport_counters()
v1: Use temp and memcpy
Fixes: 9218b44dcc05 ("net/mlx5e: Statistics handling refactoring")
Suggested-by: Eric Dumazet <eric.duma...@gmail.com>
Suggested-by: Saeed Mahameed <sae...@mellanox.com>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/
On Thu, Apr 20, 2017 at 04:37:18PM -0700, Cong Wang wrote:
> On Thu, Apr 20, 2017 at 3:43 PM, David Ahern wrote:
> >
> > I scanned the others. It is not clear that others should fail with
> > EINVAL. Certainly a mask of unused flags can be added, but to me that is
> > on
On Thu, Apr 20, 2017 at 04:43:03PM -0600, David Ahern wrote:
> On 4/20/17 4:39 PM, Cong Wang wrote:
> > On Wed, Apr 19, 2017 at 2:19 PM, David Ahern
> > wrote:
> >>
> >> Fix by checking for the flag and failing with EINVAL.
> >>
> >
> > I am still not sure about this.
On Thu, Apr 20, 2017 at 08:00:41AM -0700, Eric Dumazet wrote:
> On Thu, 2017-04-20 at 07:15 -0700, Martin KaFai Lau wrote:
>
> > A follow-up patch approach by Gal will be nice.
>
> Note that I had a similar issue on mlx4.
>
> Stats are cleared/reset at open time, bu
On Thu, Apr 20, 2017 at 05:00:13PM +0300, Saeed Mahameed wrote:
> On Thu, Apr 20, 2017 at 2:32 AM, Martin KaFai Lau <ka...@fb.com> wrote:
> > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes
> > reported under /proc/net/dev. There is a race in mlx5e_update
>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 66c133757a5e
On Wed, Apr 19, 2017 at 01:24:38PM -0700, Eric Dumazet wrote:
> On Wed, 2017-04-19 at 11:29 -0700, Martin KaFai Lau wrote:
> > We have observed a sudden spike in rx/tx_packets and rx/tx_bytes
> > reported under /proc/net/dev. It seems there is a race in
> > mlx5e_up
ly inserted route appear
> as though it is a per-cpu route. ip6_rt_cache_alloc sees the flag set
> and expects rt->dst.from to be set - which it is not since it is not
> really a per-cpu copy. The subsequent call to __ip6_dst_alloc then
> generates the fault.
>
> Fix by checking
tries
to show what I have suspected and start the discussion.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +--
drivers/net/ethernet/mellanox/mlx5/core/en_main.c| 3 +++
2 file
test_lru_sanity3 is not applicable to BPF_F_NO_COMMON_LRU.
It just happens to work when PERCPU_FREE_TARGET == 16.
This patch:
1) Disable test_lru_sanity3 for BPF_F_NO_COMMON_LRU
2) Add test_lru_sanity6 to test list rotation for
the BPF_F_NO_COMMON_LRU map.
Signed-off-by: Martin KaFai Lau <
962743 (9.96M/s)
Notes that the max_entries for the map-in-map LRU test is 126 which
is the max_entries for each inner LRU map. 8 processes have been
started, so 8 * 126 = 1008 (~10M) which is close to what is
used in the BPF_F_NO_COMMON_LRU test.
Signed-off-by: Martin KaFai Lau <ka.
The first 4 patches make a few improvements to the LRU tests.
Patch 5/6 is to improve the performance of BPF_F_NO_COMMON_LRU map.
Patch 6/6 adds an example in using LRU map with map-in-map.
Martin KaFai Lau (6):
bpf: lru: Add test_lru_sanity6 for BPF_F_NO_COMMON_LRU
bpf: lru: Cleanup
to nocommon_lru_hash_map to avoid the confusion with percpu_hash_map.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@kernel.org>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
samples/bpf/map_perf_test_kern.c | 43 +++
0k.a0_01.out 4 1
nr_misses: 67036 (Before) vs 67031 (After)
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@kernel.org>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
kernel/bpf/bpf_lru_list.c | 2 +-
tools/testing/se
the max_entries
as a cmdline arg and then configure the bpf_map_def during
runtime.
This patch adds two cmdline args. One is to configure
the map's max_entries. Another is to configure the max_cnt
which controls how many times a syscall is called.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
This patch does the following cleanup on test_lru_map.c
1) Fix indentation (Replace spaces by tabs)
2) Remove redundant BPF_F_NO_COMMON_LRU test
3) Simplify some comments
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@kernel.org>
Acked-by: Daniel B
s not depend on the
outer_map. The inner_map_fd is merely used to initialize
the inner_map_meta of the outer_map.
Also, for the outer_map:
* It allows element update and delete from syscall
* It allows element lookup from bpf_prog
The above is similar to the current fd_array pattern.
Signed-off-by:
This patchset adds map-in-map support (map->map).
One use case is the (vips -> webservers) in the L4 load balancer so
that different vips can be backed by different set of webservers.
Please refer to the individual commit log for details.
Martin KaFai Lau (4):
bpf: Fix and simplific
Test cases for array of maps and hash of maps.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
samples/bpf/Makefile| 4 +
samples/bpf/bpf_helpers.h | 1 +
samples/bp
:
1. Calculate elem_size from map->value_size. It removes the
need for 'struct bpf_array' which makes the later map-in-map
implementation easier.
2. Remove the 'elem_size == 1' test
Fixes: 81ed18ab3098 ("bpf: add helper inlining infra and optimize map_array
lookup")
Signed
e without disallowing BPF_PROG_TYPE_PERF_EVENT from using
map-in-map first.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
Acked-by: Alexei Starovoitov <a...@kernel.org>
Acked-by: Daniel Borkmann <dan...@iogearbox.net>
---
include/linux/bpf.h | 2 +
include/uapi/linux/bpf.h |
On Wed, Mar 01, 2017 at 04:07:38PM -0800, David Ahern wrote:
> On 3/1/17 3:16 PM, Martin KaFai Lau wrote:
> > [ An unrelated topic. I wonder ip -6 r del xyz::/0 would delete
> > the gateway route...]
>
> a very related question ...
>
> ip -6 r del x::/0 comes down to
On Mon, Feb 27, 2017 at 04:14:04PM -0800, David Ahern wrote:
> On 2/27/17 4:07 PM, Cong Wang wrote:
> > Andrey reported a NULL pointer deref bug in ipv6_route_ioctl()
> > -> ip6_route_del() -> __ip6_del_rt_siblings() code path. This is
> > because ip6_null_entry is returned in this path since
itov <a...@kernel.org>
Cc: Daniel Borkmann <dan...@iogearbox.net>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
net/core/filter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index e466e0040137..ebaeaf2e46e8 10
e_tx;
2153}
2154}
Fixes: ec25bc04ed8e ("net/mlx4_en: Add resilience in low memory systems")
Cc: Eugenia Emantayev <euge...@mellanox.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Signed-off-by: Martin KaFai La
pport for fast rx drop bpf program")
Cc: Brenden Blanco <bbla...@plumgrid.com>
Cc: Saeed Mahameed <sae...@mellanox.com>
Cc: Tariq Toukan <tar...@mellanox.com>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 4 ++--
This patchset fixes misc bugs after reinitializing
queues (e.g. by ethtool -L).
v2:
* Add another fix to mem leak in tx_ring[t] and tx_cq[t]
* In mlx4_en_try_alloc_resources(),
move all xdp_prog logic after calling mlx4_en_alloc_resources()
Martin KaFai Lau (2):
mlx4: Fix memory leak after
On Mon, Jan 30, 2017 at 07:18:28PM +0200, Tariq Toukan wrote:
> Hi Martin,
>
> Thanks for your patch.
>
> It looks good to me, in general.
> I just have one small comment below.
Thanks for your feedback and sorry for the delay.
>
> On 28/01/2017 9:40 AM, Martin KaFai
On Tue, Jan 31, 2017 at 01:11:40PM -0500, David Miller wrote:
> From: Tariq Toukan
> Date: Mon, 30 Jan 2017 19:18:28 +0200
>
> > It looks good to me, in general.
> > I just have one small comment below.
>
> Martin, please address Tariq's feedback.
Sorry for the delay. I am
pport for fast rx drop bpf program")
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 4 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 52 -
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h| 3 +-
3 f
moved from en_main.c to en.h.
MLX5E_HW2SW_MTU is also moved to en.h for symmetric reason
but it is not a must.
v2:
- Keep the xdp specific logic in mlx5e_xdp_handle()
- Update dma_len after the sanity checks in mlx5e_xmit_xdp_frame()
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
989f ("bpf: Add tests for the LRU bpf_htab")
Reported-by: Daniel Borkmann <dan...@iogearbox.net>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
tools/testing/selftests/bpf/test_lru_map.c | 53 +++---
1 file changed, 27 insertions(+), 26 deletion
On Fri, Jan 13, 2017 at 03:58:46PM +0200, Saeed Mahameed wrote:
> >> > @@ -680,7 +687,7 @@ static inline void mlx5e_xmit_xdp_frame(struct
> >> > mlx5e_rq *rq,
> >> > memset(wqe, 0, sizeof(*wqe));
> >> >
> >> > /* copy the inline part */
> >> > -
moved from en_main.c to en.h.
MLX5E_HW2SW_MTU is also moved to en.h for symmetric reason
but it is not a must.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 4 ++
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 18 +++
first_node’ set but
> not used [-Wunused-but-set-variable]
>
> Cc: Martin KaFai Lau <ka...@fb.com>
> Signed-off-by: Tobias Klauser <tklau...@distanz.ch>
> ---
> kernel/bpf/bpf_lru_list.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/
t; building with 'W=1':
> >
> > kernel/bpf/bpf_lru_list.c:216:41: warning: variable ‘first_node’ set but
> > not used [-Wunused-but-set-variable]
> >
> > Cc: Martin KaFai Lau <ka...@fb.com>
> > Signed-off-by: Tobias Klauser <tklau...@distanz.ch>
> >
ru_list.c:577:6: warning: no previous prototype for
> > ‘bpf_percpu_lru_populate’ [-Wmissing-prototypes]
> >
> > Cc: Martin KaFai Lau <ka...@fb.com>
> > Signed-off-by: Tobias Klauser <tklau...@distanz.ch>
>
> Acked-by: Alexei Starovoitov <a...@kernel.org>
Thanks for the patch.
Acked-by: Martin KaFai Lau <ka...@fb.com>
On Tue, Jan 10, 2017 at 10:04:55PM +0200, Saeed Mahameed wrote:
> On Tue, Jan 10, 2017 at 7:41 PM, Martin KaFai Lau <ka...@fb.com> wrote:
> > In commit b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus
> > eth and vlan hdrs"),
> > it chan
On Tue, Jan 10, 2017 at 03:43:39PM +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 01/10/2017 01:13 AM, Martin KaFai Lau wrote:
>
> >In commit b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus
> >eth and vlan hdrs"),
> >it changed ENOTSUPP to
In commit b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth
and vlan hdrs"),
it changed EOPNOTSUPP to ENOTSUPP by mistake. This patch fixes it.
Fixes: b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth and
vlan hdrs")
Signed-off-by:
In commit b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth
and vlan hdrs"),
it changed ENOTSUPP to EOPNOTSUPP by mistake. This patch fixes it.
Fixes: b45f0674b997 ("mlx4: xdp: Allow raising MTU up to one page minus eth and
vlan hdrs")
Signed-off-by:
On Tue, Dec 20, 2016 at 02:02:05PM +0200, Tariq Toukan wrote:
> Thanks Martin, nice catch!
>
>
> On 20/12/2016 1:37 AM, Martin KaFai Lau wrote:
> >Hi Tariq,
> >
> >On Sat, Dec 17, 2016 at 02:18:03AM -0800, Martin KaFai Lau wrote:
> >>Hi All,
> >>
Hi Tariq,
On Sat, Dec 17, 2016 at 02:18:03AM -0800, Martin KaFai Lau wrote:
> Hi All,
>
> I have been debugging with XDP_TX and 16 rx-queues.
>
> 1) When 16 rx-queues is used and an XDP prog is doing XDP_TX,
> it seems that the packet cannot be XDP_TX out if the pkt
>
On Sun, Dec 18, 2016 at 12:31:30PM +0200, Tariq Toukan wrote:
> Hi Martin,
>
>
> On 17/12/2016 12:18 PM, Martin KaFai Lau wrote:
> >Hi All,
> >
> >I have been debugging with XDP_TX and 16 rx-queues.
> >
> >1) When 16 rx-queues is used and an XDP prog is
Hi All,
I have been debugging with XDP_TX and 16 rx-queues.
1) When 16 rx-queues is used and an XDP prog is doing XDP_TX,
it seems that the packet cannot be XDP_TX out if the pkt
is received from some particular CPUs (/rx-queues).
2) If 8 rx-queues is used, it does not have problem.
3) The 16
ead() in patch 1
2. Ensure no less than ETH_HLEN data in bpf_xdp_adjust_head() in patch 1
3. Some clarifications in commit log messages of patch 2 and 3
Thanks,
Martin
Martin KaFai Lau (4):
bpf: xdp: Allow head adjustment in XDP prog
mlx4: xdp: Allow raising MTU up to one page minus eth and vlan h
rgs
of the user prog.
Acked-by: Alexei Starovoitov <a...@kernel.org>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
samples/bpf/Makefile | 4 +
samples/bpf/bpf_helpers.h| 2 +
samples/bpf/bpf_load.c | 94 +
samples
this
patch is doing. It will be useful in the next patch which
allows XDP program to extend the packet by adding new header(s).
Note: In the earlier XDP patches, there is already existing guard
to ensure the page/pkt scheme only applies when XDP is active
in mlx4.
Signed-off-by: Martin KaFai Lau <
on skb.
This patch adds one "xdp_adjust_head" bit to bpf_prog for the
XDP-capable driver to check if the XDP prog requires
bpf_xdp_adjust_head() support. The driver can then decide
to error out during XDP_SETUP_PROG.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
arch/powerpc/ne
Reserve XDP_PACKET_HEADROOM for packet and enable bpf_xdp_adjust_head()
support. This patch only affects the code path when XDP is active.
After testing, the tx_dropped counter is incremented if the xdp_prog sends
more than wire MTU.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
d
On Wed, Dec 07, 2016 at 08:37:58AM -0800, Alexei Starovoitov wrote:
> On Wed, Dec 07, 2016 at 11:41:12AM +, Jakub Kicinski wrote:
> > > I see nothing wrong if this is exposed/made visible in the usual way
> > > through
> > > ethtool -k as well. I guess at least that would be the expected way
g>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
arch/powerpc/net/bpf_jit_comp64.c | 4 ++--
arch/s390/net/bpf_jit_comp.c | 2 +-
arch/x86/net/bpf_jit_comp.c| 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 3 +++
rgs
of the user prog.
Acked-by: Alexei Starovoitov <a...@kernel.org>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
samples/bpf/Makefile | 4 +
samples/bpf/bpf_helpers.h | 2 +
samples/bpf/bpf_load.c| 94 ++
samples/bpf/bpf_load.h
Reserve XDP_PACKET_HEADROOM for packet and enable bpf_xdp_adjust_head()
support. This patch only affects the code path when XDP is active.
After testing, the tx_dropped counter is incremented if the xdp_prog sends
more than wire MTU.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
d
3of4
v2:
1. Make a variable name change in bpf_xdp_adjust_head() in patch 1
2. Ensure no less than ETH_HLEN data in bpf_xdp_adjust_head() in patch 1
3. Some clarifications in commit log messages of patch 2 and 3
Thanks,
Martin
Martin KaFai Lau (4):
bpf: xdp: Allow head adjustment in XDP prog
this
patch is doing. It will be useful in the next patch which
allows XDP program to extend the packet by adding new header(s).
Note: In the earlier XDP patches, there is already existing guard
to ensure the page/pkt scheme only applies when XDP is active
in mlx4.
Signed-off-by: Martin KaFai Lau <
On Tue, Dec 06, 2016 at 11:40:19PM +0200, Saeed Mahameed wrote:
> On Tue, Dec 6, 2016 at 8:27 PM, Martin KaFai Lau <ka...@fb.com> wrote:
> > On Tue, Dec 06, 2016 at 06:50:47PM +0200, Saeed Mahameed wrote:
> >> On Mon, Dec 5, 2016 at 9:55 PM, Martin KaFai Lau <ka...@f
On Tue, Dec 06, 2016 at 09:35:31AM -0800, John Fastabend wrote:
> On 16-12-03 07:17 PM, Martin KaFai Lau wrote:
> > This patch allows XDP prog to extend/remove the packet
> > data at the head (like adding or removing header). It is
> > done by adding a new XDP helpe
On Tue, Dec 06, 2016 at 06:50:47PM +0200, Saeed Mahameed wrote:
> On Mon, Dec 5, 2016 at 9:55 PM, Martin KaFai Lau <ka...@fb.com> wrote:
> > On Mon, Dec 05, 2016 at 02:54:06AM +0200, Saeed Mahameed wrote:
> >> On Sun, Dec 4, 2016 at 5:17 AM, Martin KaFai Lau <ka...@fb
On Mon, Dec 05, 2016 at 02:54:06AM +0200, Saeed Mahameed wrote:
> On Sun, Dec 4, 2016 at 5:17 AM, Martin KaFai Lau <ka...@fb.com> wrote:
> > Reserve XDP_PACKET_HEADROOM and honor bpf_xdp_adjust_head()
> > when XDP prog is active. This patch only affects the code
> &
On Fri, Dec 02, 2016 at 04:07:09PM -0800, Rick Jones wrote:
> On 12/02/2016 03:23 PM, Martin KaFai Lau wrote:
> >When XDP prog is attached, it is currently limiting
> >MTU to be FRAG_SZ0 - ETH_HLEN - (2 * VLAN_HLEN) which is 1514
> >in x86.
> >
> >AFAICT, since
Reserve XDP_PACKET_HEADROOM and honor bpf_xdp_adjust_head()
when XDP prog is active. This patch only affects the code
path when XDP is active.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 17 +++--
drivers/net/ethernet/me
rgs
of the user prog.
Acked-by: Alexei Starovoitov <a...@kernel.org>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
samples/bpf/Makefile | 4 +
samples/bpf/bpf_helpers.h | 2 +
samples/bpf/bpf_load.c| 94 ++
samples/bpf/bpf_load.h
This series adds a helper to allow head adjusting in XDP prog. mlx4
driver has been modified to support this feature. An example is written
to encapsulate a packet with an IPv4/v6 header and then XDP_TX it
out.
v2:
1. Make a variable name change in bpf_xdp_adjust_head() in patch 1
2. Ensure no
on skb.
Acked-by: Alexei Starovoitov <a...@kernel.org>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
arch/powerpc/net/bpf_jit_comp64.c | 4 ++--
arch/s390/net/bpf_jit_comp.c | 2 +-
arch/x86/net/bpf_jit_comp.c | 2 +-
include/linux/filter.h| 2 +-
includ
this
patch is doing. It will be useful in the next patch which
allows XDP program to extend the packet by adding new header(s).
Note: In the earlier XDP patches, there is already existing guard
to ensure the page/pkt scheme only applies when XDP is active
in mlx4.
Signed-off-by: Martin KaFai Lau <
On Sat, Dec 03, 2016 at 04:24:13PM +0100, Jesper Dangaard Brouer wrote:
> On Fri, 2 Dec 2016 15:23:30 -0800
> Martin KaFai Lau <ka...@fb.com> wrote:
>
> > -bool bpf_helper_changes_skb_data(void *func)
> > +BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, off
On Sat, Dec 03, 2016 at 01:22:05AM +0100, Daniel Borkmann wrote:
> On 12/03/2016 12:23 AM, Martin KaFai Lau wrote:
> >This patch allows XDP prog to extend/remove the packet
> >data at the head (like adding or removing header). It is
> >done by adding a new XDP helpe
On Fri, Dec 02, 2016 at 06:15:26PM -0800, Eric Dumazet wrote:
> On Fri, 2016-12-02 at 16:53 -0800, Alexei Starovoitov wrote:
> > On 12/2/16 4:38 PM, Eric Dumazet wrote:
> > > On Fri, 2016-12-02 at 15:23 -0800, Martin KaFai Lau wrote:
> > >> When XDP prog is atta
Reserve XDP_PACKET_HEADROOM when XDP prog is active.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 17 +++--
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 23 +--
drivers/net/ethernet/mellanox/mlx4/e
on skb.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
arch/powerpc/net/bpf_jit_comp64.c | 4 ++--
arch/s390/net/bpf_jit_comp.c | 2 +-
arch/x86/net/bpf_jit_comp.c | 2 +-
include/linux/filter.h| 2 +-
include/uapi/linux/bpf.h | 11 ++-
kernel/bpf/
. It will be useful in the next patch which allows
XDP program to extend the packet by adding new header(s).
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 28 +++-
drivers/net/ethernet/mellanox/mlx4/en_rx.c
rgs
of the user prog.
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
samples/bpf/Makefile | 4 +
samples/bpf/bpf_helpers.h | 2 +
samples/bpf/bpf_load.c| 94 ++
samples/bpf/bpf_load.h| 1 +
samples/bpf/xdp1_user.c
This series adds a helper to allow head adjustment in XDP prog. mlx4
driver has been modified to support this feature. An example is written
to encapsulate a packet with an IPv4/v6 header and then XDP_TX it
out.
Thanks,
--Martin
On Wed, Nov 16, 2016 at 11:36:47AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the net-next tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> kernel/bpf/bpf_lru_list.c: In function
> '__bpf_lru_list_rotate_inactive.isra.3':
>
ile() loop which must have >=1
iterations.
This patch initializes next to get rid of the compiler warning.
Fixes: 3a08c2fd7634 ("bpf: LRU List")
Reported-by: David Miller <da...@davemloft.net>
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
kernel/bpf/bpf_lru_list.c | 2 +-
On Tue, Nov 15, 2016 at 11:59:24AM -0500, David Miller wrote:
> From: David Miller <da...@redhat.com>
> Date: Tue, 15 Nov 2016 11:51:23 -0500 (EST)
>
> > From: Martin KaFai Lau <ka...@fb.com>
> > Date: Fri, 11 Nov 2016 10:55:05 -0800
> >
> >
t 32 $i | awk '{r += $3}END{print r " updates"}'; done
1 cpus: 2896553 updates
4 cpus: 9766395 updates
8 cpus: 17460553 updates
Signed-off-by: Martin KaFai Lau <ka...@fb.com>
---
samples/bpf/Makefile | 2 +
samples/bpf/map_perf_test_kern.c
401 - 500 of 724 matches
Mail list logo