[PATCH v2 bpf-next 1/1] libbpf: make bpf_object__open default to UNSPEC

2018-11-23 Thread Nikita V. Shirokov
changing requirments for version's section to be present in object file. now it would reflect what we have today in kernel (only KPROBE prog type requires for version to be explicitly set). v1 -> v2: - RFC tag has been dropped Signed-off-by: Nikita V. Shirokov --- tools/lib/bpf/libbpf.c

[RFC PATCH bpf-next] libbpf: make bpf_object__open default to UNSPEC

2018-11-21 Thread Nikita V. Shirokov
that anyone is using this for kprobe type of programs (instead of, say, bcc or other tracing frameworks) other possible solutions (for discussion, would require more machinery): add another function like bpf_object__open w/ default to unspec Signed-off-by: Nikita V. Shirokov --- tools/lib/bpf

[PATCH v5 bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-20 Thread Nikita V. Shirokov
in patch description - initializing inner_map_fd to -1 by default v1->v2: - addressing nits - removing const identifier from fd in new helper - starting to check return val for bpf_map_update_elem Nikita V. Shirokov (2): bpf: adding support for map in map in libbpf bpf: adding tests for mapi

[PATCH v5 bpf-next 2/2] bpf: adding tests for map_in_map helpber in libbpf

2018-11-20 Thread Nikita V. Shirokov
adding test/example of bpf_map__set_inner_map_fd usage Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song --- tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/test_map_in_map.c | 49 +++ tools/testing/selftests/bpf/test_maps.c | 90

[PATCH v5 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Nikita V. Shirokov
) find (by name) map-in-map which you want to load and update w/ descriptor of inner map w/ a new helper from this patch 4) load bpf program w/ bpf_object__load Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song --- tools/lib/bpf/libbpf.c | 40

[PATCH v4 bpf-next 2/2] bpf: adding tests for mapinmap helpber in libbpf

2018-11-20 Thread Nikita V. Shirokov
adding test/example of bpf_map__add_inner_map_fd usage Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song --- tools/testing/selftests/bpf/Makefile| 3 +- tools/testing/selftests/bpf/test_mapinmap.c | 49 + tools/testing/selftests/bpf/test_maps.c | 82

[PATCH v4 bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-20 Thread Nikita V. Shirokov
ew helper - starting to check return val for bpf_map_update_elem Nikita V. Shirokov (2): bpf: adding support for map in map in libbpf bpf: adding tests for mapinmap helpber in libbpf tools/lib/bpf/libbpf.c | 33 +--- tools/lib/bpf/libbpf.h

[PATCH v4 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Nikita V. Shirokov
) find (by name) map-in-map which you want to load and update w/ descriptor of inner map w/ a new helper from this patch 4) load bpf program w/ bpf_object__load Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song --- tools/lib/bpf/libbpf.c | 33 +++-- tools/lib

[PATCH v3 bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-20 Thread Nikita V. Shirokov
;v3: - fixing typo in patch description - initializing inner_map_fd to -1 by default v1->v2: - addressing nits - removing const identifier from fd in new helper - starting to check return val for bpf_map_update_elem Nikita V. Shirokov (2): bpf: adding support for map in map in libbpf bpf:

[PATCH v3 bpf-next 2/2] bpf: adding tests for mapinmap helpber in libbpf

2018-11-20 Thread Nikita V. Shirokov
adding test/example of bpf_map__add_inner_map_fd usage Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song --- tools/testing/selftests/bpf/Makefile| 3 +- tools/testing/selftests/bpf/test_mapinmap.c | 49 + tools/testing/selftests/bpf/test_maps.c | 82

[PATCH v3 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Nikita V. Shirokov
) find (by name) map-in-map which you want to load and update w/ descriptor of inner map w/ a new helper from this patch 4) load bpf program w/ bpf_object__load inner_map_fd is ignored by any other maps aside from (hash|array) of maps Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song

[PATCH v2 bpf-next 2/2] bpf: adding tests for mapinmap helpber in libbpf

2018-11-19 Thread Nikita V. Shirokov
adding test/example of bpf_map__add_inner_map_fd usage Signed-off-by: Nikita V. Shirokov --- tools/testing/selftests/bpf/Makefile| 3 +- tools/testing/selftests/bpf/test_mapinmap.c | 49 + tools/testing/selftests/bpf/test_maps.c | 82 + 3

[PATCH v2 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-19 Thread Nikita V. Shirokov
) find (by name) map-in-map which you want to load and update w/ descriptor of inner map w/ a new helper from this patch 4) load bpf program w/ bpf_object__load inner_map_fd is ignored by any other maps asidef from (hash|array) of maps Signed-off-by: Nikita V. Shirokov --- tools/lib/bpf/libbpf.c

[PATCH v2 bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-19 Thread Nikita V. Shirokov
;v2: - addressing nits - removing const identifier from fd in new helper - starting to check return val for bpf_map_update_elem Nikita V. Shirokov (2): bpf: adding support for map in map in libbpf bpf: adding tests for mapinmap helpber in libbpf tools/lib/bpf/libbpf.c |

Re: [PATCH bpf-next 2/2] bpf: adding tests for mapinmap helpber in libbpf

2018-11-19 Thread Nikita V. Shirokov
O Mon, Nov 19, 2018 at 05:18:46PM -0800, Y Song wrote: > On Mon, Nov 19, 2018 at 4:13 PM Nikita V. Shirokov > wrote: > > > > adding test/example of bpf_map__add_inner_map_fd usage > > > > Signed-off-by: Nikita V. Shirokov > > --- > > tools/

Re: [PATCH bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-19 Thread Nikita V. Shirokov
On Mon, Nov 19, 2018 at 05:12:43PM -0800, Y Song wrote: > On Mon, Nov 19, 2018 at 4:13 PM Nikita V. Shirokov > wrote: > > > > idea is pretty simple. for specified map (pointed by struct bpf_map) > > we would provide descriptor of already loaded map, which is going to be

[PATCH bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-19 Thread Nikita V. Shirokov
) find (by name) map-in-map which you want to load and update w/ descriptor of inner map w/ a new helper from this patch 4) load bpf program w/ bpf_object__load inner_map_fd is ignored by any other maps asidef from (hash|array) of maps Signed-off-by: Nikita V. Shirokov --- tools/lib/bpf/libbpf.c

[PATCH bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-19 Thread Nikita V. Shirokov
in this patch series i'm adding a helper for libbpf which would allow it to load map-in-map(BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS). first patch contains new helper + explains proposed workflow second patch contains tests which also could be used as example of usage Nikita V

[PATCH bpf-next 2/2] bpf: adding tests for mapinmap helpber in libbpf

2018-11-19 Thread Nikita V. Shirokov
adding test/example of bpf_map__add_inner_map_fd usage Signed-off-by: Nikita V. Shirokov --- tools/testing/selftests/bpf/Makefile| 3 +- tools/testing/selftests/bpf/test_mapinmap.c | 53 tools/testing/selftests/bpf/test_maps.c | 76

[PATCH bpf-next] adding selftest for bpf's (set|get)_sockopt for SAVE_SYN

2018-08-31 Thread Nikita V. Shirokov
adding selftest for feature, introduced in commit 9452048c79404 ("bpf: add TCP_SAVE_SYN/TCP_SAVED_SYN options for bpf_(set|get)sockopt") Signed-off-by: Nikita V. Shirokov --- .../testing/selftests/bpf/test_tcpbpf_kern.c | 38 +-- .../testing/selftests/bpf/test_tcp

[PATCH v3 bpf-next 0/2] bpf tcp save syn set/get sockoptions

2018-08-30 Thread Nikita V. Shirokov
point of view v2->v3: - make patch series public v1->v2: - adding proper SPDX license Nikita V. Shirokov (2): new options for bpf_(set|get)sockopt new sample bpf prog net/core/filter.c | 25 +++-- samples/bpf/Makefile | 1 + sampl

[PATCH v3 bpf-next 1/2] new options for bpf_(set|get)sockopt

2018-08-30 Thread Nikita V. Shirokov
adding support for two new bpf's get/set sockopts: TCP_SAVE_SYN (set) and TCP_SAVED_SYN (get). this would allow for bpf program to build logic based on data from ingress SYN packet Signed-off-by: Nikita V. Shirokov --- net/core/filter.c | 25 + 1 file changed, 21

[PATCH v3 bpf-next 2/2] new sample bpf prog

2018-08-30 Thread Nikita V. Shirokov
sample program which shows TCP_SAVE_SYN/TCP_SAVED_SYN usage example: bpf's program which is doing TOS/TCLASS reflection (server would reply with a same TOS/TCLASS as client) Signed-off-by: Nikita V. Shirokov --- samples/bpf/Makefile | 1 + samples/bpf/tcp_tos_reflect_kern.c | 87

Re: ixgbe hangs when XDP_TX is enabled

2018-08-21 Thread Nikita V. Shirokov
On Tue, Aug 21, 2018 at 08:58:15AM -0700, Alexander Duyck wrote: > On Mon, Aug 20, 2018 at 12:32 PM Nikita V. Shirokov > wrote: > > > > we are getting such errors: > > > > [ 408.737313] ixgbe :03:00.0 eth0: Detected Tx Unit Hang (XDP) > >

ixgbe hangs when XDP_TX is enabled

2018-08-20 Thread Nikita V. Shirokov
is Up 10 Gbps, Flow Control: RX/TX while running XDP prog on ixgbe nic. right now i'm seing this on bpfnext kernel (latest commit from Wed Aug 15 15:04:25 2018 -0700 ; 9a76aba02a37718242d7cdc294f0a3901928aa57) looks like this is the same issue as reported by Brenden in https://www.spinics.net/lists/netdev/msg439438.html -- Nikita V. Shirokov

[PATCH bpf-next] bpf: fix xdp_generic for bpf_adjust_tail usecase

2018-04-25 Thread Nikita V. Shirokov
this diff is fixing this. Fixes: 198d83bb3 (" bpf: make generic xdp compatible w/ bpf_xdp_adjust_tail") Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- Notes: original tests missed this because it looks like tap interface ignores incorrect ethernet FCS (all tests wer

[PATCH bpf-next] bpf: fix virtio-net's length calc for XDP_PASS

2018-04-22 Thread Nikita V. Shirokov
bytes. Fixes:6870de435b90 ("bpf: make virtio compatible w/ bpf_xdp_adjust_tail") Reported-by: David Ahern <dsah...@gmail.com> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- Notes: unfortunately it looks like that xdp_tx is still broken because fix by Jason (i

Re: XDP breakage with virtio due to 6870de435b90c083ae0f3f7f341287976ef56f03

2018-04-22 Thread Nikita V. Shirokov
On Sun, Apr 22, 2018 at 04:47:48PM -0600, David Ahern wrote: > This commit breaks my FIB forwarding program: > > commit 6870de435b90c083ae0f3f7f341287976ef56f03 > Author: Nikita V. Shirokov <tehn...@tehnerd.com> > Date: Tue Apr 17 21:42:20 2018 -0700 > > bp

Re: [PATCH bpf-next v2 02/11] bpf: make generic xdp compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
On Wed, Apr 18, 2018 at 02:48:18PM +0200, Jesper Dangaard Brouer wrote: > On Tue, 17 Apr 2018 21:29:42 -0700 > "Nikita V. Shirokov" <tehn...@tehnerd.com> wrote: > > > w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as > > well (only &quo

Re: [PATCH bpf-next v2 00/11] introduction of bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
On Wed, Apr 18, 2018 at 02:37:40PM +0200, Daniel Borkmann wrote: > On 04/18/2018 06:29 AM, Nikita V. Shirokov wrote: > > In this patch series i'm add new bpf helper which allow to manupulate > > xdp's data_end pointer. right now only "shrinking" (reduce packet's s

[PATCH bpf-next v3 09/11] bpf: making bpf_prog_test run aware of possible data_end ptr change

2018-04-18 Thread Nikita V. Shirokov
after introduction of bpf_xdp_adjust_tail helper packet length could be changed not only if xdp->data pointer has been changed but xdp->data_end as well. making bpf_prog_test_run aware of this possibility Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- net/bpf/test_run.

[PATCH bpf-next v3 02/11] bpf: make generic xdp compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
ter Acked-by: Alexei Starovoitov <a...@kernel.org> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- net/core/dev.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index 969462ebb296..11c789231a03 100644 --- a/ne

[PATCH bpf-next v3 05/11] bpf: make cavium thunder compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
by: Alexei Starovoitov <a...@kernel.org> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/e

[PATCH bpf-next v3 07/11] bpf: make tun compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
the packet if it was passed to the TCP/IP stack (in case if after xdp's prog run data_end pointer was adjusted) Reviewed-by: Jason Wang <jasow...@redhat.com> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) di

[PATCH bpf-next v3 04/11] bpf: make bnxt compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
tarovoitov <a...@kernel.org> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom

[PATCH bpf-next v3 06/11] bpf: make netronome nfp compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
tarovoitov <a...@kernel.org> Acked-by: Jakub Kicinski <jakub.kicin...@netronome.com> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver

[PATCH bpf-next v3 11/11] bpf: add bpf_xdp_adjust_tail sample prog

2018-04-18 Thread Nikita V. Shirokov
adding bpf's sample program which is using bpf_xdp_adjust_tail helper by generating ICMPv4 "packet to big" message if ingress packet's size is bigger then 600 bytes Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- samples/bpf/Makefile |

[PATCH bpf-next v3 01/11] bpf: adding bpf_xdp_adjust_tail helper

2018-04-18 Thread Nikita V. Shirokov
Adding new bpf helper which would allow us to manipulate xdp's data_end pointer, and allow us to reduce packet's size indended use case: to generate ICMP messages from XDP context, where such message would contain truncated original packet. Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.

[PATCH bpf-next v3 00/11] introduction of bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
uffling in patches order (tests now in the end) Nikita V. Shirokov (11): bpf: making bpf_prog_test run aware of possible data_end ptr change bpf: adding tests for bpf_xdp_adjust_tail bpf: adding bpf_xdp_adjust_tail helper bpf: make generic xdp compatible w/ bpf_xdp_adjust_tail bpf: make mlx4

[PATCH bpf-next v3 03/11] bpf: make mlx4 compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
's already being done in mlx5) Acked-by: Alexei Starovoitov <a...@kernel.org> Acked-by: Tariq Toukan <tar...@mellanox.com> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[PATCH bpf-next v3 10/11] bpf: adding tests for bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
adding selftests for bpf_xdp_adjust_tail helper. in this synthetic test we are testing that 1) if data_end < data helper will return EINVAL 2) for normal use case packet's length would be reduced. Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- tools/include/uapi/li

[PATCH bpf-next v3 08/11] bpf: make virtio compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
the packet if it was passed to the TCP/IP stack Reviewed-by: Jason Wang <jasow...@redhat.com> Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/virtio_net.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/

[PATCH bpf-next v2 01/11] bpf: adding bpf_xdp_adjust_tail helper

2018-04-18 Thread Nikita V. Shirokov
Adding new bpf helper which would allow us to manipulate xdp's data_end pointer, and allow us to reduce packet's size indended use case: to generate ICMP messages from XDP context, where such message would contain truncated original packet. --- include/uapi/linux/bpf.h | 10 +-

[PATCH bpf-next v2 06/11] bpf: make netronome nfp compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for nfp driver we will just calculate packet's length unconditionally Acked-by: Alexei Starovoitov

[PATCH bpf-next v2 03/11] bpf: make mlx4 compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for mlx4 driver we will just calculate packet's length unconditionally (the same way as it's already

[PATCH bpf-next v2 07/11] bpf: make tun compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for tun driver we need to adjust XDP_PASS handling by recalculating length of the packet if it was

[PATCH bpf-next v2 08/11] bpf: make virtio compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for virtio driver we need to adjust XDP_PASS handling by recalculating length of the packet if it was

[PATCH bpf-next v2 05/11] bpf: make cavium thunder compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for cavium's thunder driver we will just calculate packet's length unconditionally Acked-by: Alexei

[PATCH bpf-next v2 09/11] bpf: making bpf_prog_test run aware of possible data_end ptr change

2018-04-18 Thread Nikita V. Shirokov
after introduction of bpf_xdp_adjust_tail helper packet length could be changed not only if xdp->data pointer has been changed but xdp->data_end as well. making bpf_prog_test_run aware of this possibility --- net/bpf/test_run.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH bpf-next v2 10/11] bpf: adding tests for bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
adding selftests for bpf_xdp_adjust_tail helper. in this synthetic test we are testing that 1) if data_end < data helper will return EINVAL 2) for normal use case packet's length would be reduced. --- tools/include/uapi/linux/bpf.h | 10 +++-

[PATCH bpf-next v2 11/11] bpf: add bpf_xdp_adjust_tail sample prog

2018-04-18 Thread Nikita V. Shirokov
adding bpf's sample program which is using bpf_xdp_adjust_tail helper by generating ICMPv4 "packet to big" message if ingress packet's size is bigger then 600 bytes --- samples/bpf/Makefile | 4 + samples/bpf/xdp_adjust_tail_kern.c| 152

[PATCH bpf-next v2 04/11] bpf: make bnxt compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for bnxt driver we will just calculate packet's length unconditionally Acked-by: Alexei Starovoitov

[PATCH bpf-next v2 02/11] bpf: make generic xdp compatible w/ bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for generic XDP we need to reflect this packet's length change by adjusting skb's tail pointer

[PATCH bpf-next v2 00/11] introduction of bpf_xdp_adjust_tail

2018-04-18 Thread Nikita V. Shirokov
ted, but if tail's one as well. v1->v2: * fixed kbuild warning * made offset eq 0 invalid for xdp_bpf_adjust_tail * splitted bpf_prog_test_run fix and selftests in sep commits * added SPDX licence where applicable * some reshuffling in patches order (tests now in the end) Nikit

[PATCH bpf-next 10/10] [bpf]: make virtio compatible w/ bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
the packet if it was passed to the TCP/IP stack Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/virtio_net.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7b187ec7411e..115d85f7360a 100644 -

[PATCH bpf-next 09/10] [bpf]: make tun compatible w/ bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
the packet if it was passed to the TCP/IP stack (in case if after xdp's prog run data_end pointer was adjusted) Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c in

[PATCH bpf-next 08/10] [bpf]: make netronome nfp compatible w/ bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for nfp driver we will just calculate packet's length unconditionally Signed-off-by

[PATCH bpf-next 02/10] [bpf]: adding tests for bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
ate packet's length if only data_end pointer was changed Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- net/bpf/test_run.c | 3 ++- tools/include/uapi/linux/bpf.h | 11 - tools/testing/selftests/bpf/Makefile | 2 +- tool

[PATCH bpf-next 05/10] [bpf]: make mlx4 compatible w/ bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
's already being done in mlx5) Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c in

[PATCH bpf-next 04/10] [bpf]: make generic xdp compatible w/ bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
er Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- net/core/dev.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index 969462ebb296..11c789231a03 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3996,9 +3996

[PATCH bpf-next 00/10] introduction of bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
as adjusted, but if tail's one as well. Nikita V. Shirokov (10): [bpf]: adding bpf_xdp_adjust_tail helper [bpf]: adding tests for bpf_xdp_adjust_tail [bpf]: add bpf_xdp_adjust_tail sample prog [bpf]: make generic xdp compatible w/ bpf_xdp_adjust_tail [bpf]: make mlx4 compatible w/ bpf_xdp_

[PATCH bpf-next 06/10] [bpf]: make bnxt compatible w/ bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
w/ bpf_xdp_adjust_tail helper xdp's data_end pointer could be changed as well (only "decrease" of pointer's location is going to be supported). changing of this pointer will change packet's size. for bnxt driver we will just calculate packet's length unconditionally Signed-off-by

[PATCH bpf-next 07/10] [bpf]: make cavium thunder compatible w/ bpf_xdp_adjust_tail

2018-04-17 Thread Nikita V. Shirokov
Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 707db3304396..713

[PATCH bpf-next 01/10] [bpf]: adding bpf_xdp_adjust_tail helper

2018-04-17 Thread Nikita V. Shirokov
Adding new bpf helper which would allow us to manipulate xdp's data_end pointer, and allow us to reduce packet's size indended use case: to generate ICMP messages from XDP context, where such message would contain truncated original packet. Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.

[PATCH bpf-next 03/10] [bpf]: add bpf_xdp_adjust_tail sample prog

2018-04-17 Thread Nikita V. Shirokov
adding bpf's sample program which is using bpf_xdp_adjust_tail helper by generating ICMPv4 "packet to big" message if ingress packet's size is bigger then 600 bytes Signed-off-by: Nikita V. Shirokov <tehn...@tehnerd.com> --- samples/bpf/Makefile |

[PATCH bpf-next]: add sock_ops R/W access to ipv4 tos

2018-03-26 Thread Nikita V. Shirokov
bpf: Add sock_ops R/W access to ipv4 tos Sample usage for tos: bpf_getsockopt(skops, SOL_IP, IP_TOS, , sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Nikita V. Shirokov <tehn...@fb.com> --- net/core/filter.

[PATCH net v2] adding missing rcu_read_unlock in ipxip6_rcv

2017-12-06 Thread Nikita V. Shirokov
nt skb leakage) Signed-off-by: Nikita V. Shirokov <tehn...@fb.com> --- net/ipv6/ip6_tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 3d3092a..db84f52 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel

[PATCH net] adding missing rcu_read_unlock in ipxip6_rcv

2017-12-06 Thread Nikita V. Shirokov
commit 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") introduced new exit point in ipxip6_rcv. however rcu_read_unlock is missing there. this diff is fixing this Signed-off-by: Nikita V. Shirokov <tehn...@fb.com> --- net/ipv6/ip6_tunnel.c | 4 +++- 1 file chang