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
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
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
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
) 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
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
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
) 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
;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:
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
) 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
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
) 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
;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 |
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/
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
) 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
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
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
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
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
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
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
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)
> >
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
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
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
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
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
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
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.
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
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
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
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
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
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 |
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.
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
'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(
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
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/
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 +-
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
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
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
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
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
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
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 +++-
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
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
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
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
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
-
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
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
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
'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
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
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_
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
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
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.
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 |
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.
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
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
68 matches
Mail list logo