[PATCH bpf-next 0/4] selftests/bpf: xsk improvements and new stats tests

2021-02-17 Thread Ciara Loftus
tals: pass:10 fail:0 xfail:0 xpass:0 skip:0 error:0 XSK KSELFTESTS: [ PASS ] This series applies on commit b646acd5eb48ec49ef90404336d7e8ee502ecd05 Ciara Loftus (3): selftests/bpf: expose debug arg to shell script for xsk tests selftests/bpf: restructure xsk selftests selftests/bpf: int

[PATCH bpf-next 1/4] selftest/bpf: make xsk tests less verbose

2021-02-17 Thread Ciara Loftus
verbose output: ./test_xsk.sh -v Signed-off-by: Magnus Karlsson Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh| 24 - tools/testing/selftests/bpf/xdpxceiver.c | 31 +- tools/testing/selftests/bpf/xdpxceiver.h | 13

[PATCH bpf-next 3/4] selftests/bpf: restructure xsk selftests

2021-02-17 Thread Ciara Loftus
ions from within the xdpxceiver program itself, using simple loops. Every test is run every time the C program is executed. Many of the CLI arguments can be removed as a result. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh| 112 +--- tools/testing/selfte

[PATCH bpf-next 4/4] selftests/bpf: introduce xsk statistics tests

2021-02-17 Thread Ciara Loftus
nfigures a scenario which should trigger the given error statistic. The test passes if the statistic is successfully incremented. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/xdpxceiver.c | 130 --- tools/testing/selftests/bpf/xdpxceiver.h | 13 +++ 2 files ch

[PATCH bpf-next 2/4] selftests/bpf: expose debug arg to shell script for xsk tests

2021-02-17 Thread Ciara Loftus
Launching xdpxceiver with -D enables debug mode. Make it possible to pass this flag to the app via the test_xsk.sh shell script like so: ./test_xsk.sh -d Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh| 7 ++- tools/testing/selftests/bpf/xsk_prereqs.sh | 3

[PATCH bpf-next v2 0/4] selftests/bpf: xsk improvements and new stats tests

2021-02-23 Thread Ciara Loftus
vs test failure This series applies on commit d310ec03a34e92a77302edb804f7d68ee4f01ba0 Ciara Loftus (3): selftests/bpf: expose and rename debug argument selftests/bpf: restructure xsk selftests selftests/bpf: introduce xsk statistics tests Magnus Karlsson (1): selftest/bpf: make xsk tests less verbose t

[PATCH bpf-next v2 1/4] selftest/bpf: make xsk tests less verbose

2021-02-23 Thread Ciara Loftus
verbose output: ./test_xsk.sh -v Signed-off-by: Magnus Karlsson Signed-off-by: Ciara Loftus Acked-by: Maciej Fijalkowski --- tools/testing/selftests/bpf/test_xsk.sh| 24 - tools/testing/selftests/bpf/xdpxceiver.c | 31 +- tools/testing/selftests/bpf

[PATCH bpf-next v2 2/4] selftests/bpf: expose and rename debug argument

2021-02-23 Thread Ciara Loftus
g to the app via the test_xsk.sh shell script like so: ./test_xsk.sh -D Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh| 7 ++- tools/testing/selftests/bpf/xdpxceiver.c | 6 +++--- tools/testing/selftests/bpf/xsk_prereqs.sh | 3 ++- 3 files changed, 11 insertions(+),

[PATCH bpf-next v2 3/4] selftests/bpf: restructure xsk selftests

2021-02-23 Thread Ciara Loftus
ions from within the xdpxceiver program itself, using simple loops. Every test is run every time the C program is executed. Many of the CLI arguments can be removed as a result. Signed-off-by: Ciara Loftus Reviewed-by: Maciej Fijalkowski --- tools/testing/selftests/bpf/test_xsk.sh| 112 +-

[PATCH bpf-next v2 4/4] selftests/bpf: introduce xsk statistics tests

2021-02-23 Thread Ciara Loftus
invalid value (umem frame size + 1). 3. rx ring full Reduce the size of the RX ring to a fraction of the fill ring size. 4. fill queue empty Do not populate the fill queue and then try to receive pkts. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/xdpxceiver.c | 137 ++

[PATCH bpf-next v3 0/4] selftests/bpf: xsk improvements and new stats tests

2021-02-23 Thread Ciara Loftus
new statistics tests * Distinguish between exiting due to initialisation failure vs test failure This series applies on commit d310ec03a34e92a77302edb804f7d68ee4f01ba0 Ciara Loftus (3): selftests/bpf: expose and rename debug argument selftests/bpf: restructure xsk selftests selftests/bpf:

[PATCH bpf-next v3 1/4] selftest/bpf: make xsk tests less verbose

2021-02-23 Thread Ciara Loftus
verbose output: ./test_xsk.sh -v Signed-off-by: Magnus Karlsson Signed-off-by: Ciara Loftus Acked-by: Maciej Fijalkowski --- tools/testing/selftests/bpf/test_xsk.sh| 27 ++- tools/testing/selftests/bpf/xdpxceiver.c | 31 +- tools/testing/selftests/bpf

[PATCH bpf-next v3 2/4] selftests/bpf: expose and rename debug argument

2021-02-23 Thread Ciara Loftus
g to the app via the test_xsk.sh shell script like so: ./test_xsk.sh -D Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh| 10 +- tools/testing/selftests/bpf/xdpxceiver.c | 6 +++--- tools/testing/selftests/bpf/xsk_prereqs.sh | 3 ++- 3 files changed, 14 insert

[PATCH bpf-next v3 3/4] selftests/bpf: restructure xsk selftests

2021-02-23 Thread Ciara Loftus
ions from within the xdpxceiver program itself, using simple loops. Every test is run every time the C program is executed. Many of the CLI arguments can be removed as a result. Signed-off-by: Ciara Loftus Reviewed-by: Maciej Fijalkowski --- tools/testing/selftests/bpf/test_xsk.sh| 112 +-

[PATCH bpf-next v3 4/4] selftests/bpf: introduce xsk statistics tests

2021-02-23 Thread Ciara Loftus
invalid value (umem frame size + 1). 3. rx ring full Reduce the size of the RX ring to a fraction of the fill ring size. 4. fill queue empty Do not populate the fill queue and then try to receive pkts. Signed-off-by: Ciara Loftus Reviewed-by: Maciej Fijalkowski --- tools/testing/selftests/bp

[PATCH v2 bpf 0/3] AF_XDP Socket Creation Fixes

2021-03-26 Thread Ciara Loftus
as suggested by Magnus Karlsson. * Fixed the condition which determines whether to unmap umem rings when socket create fails. This series applies on commit 6032ebb54c60cae24329f6aba3ce0c1ca8ad6abe Ciara Loftus (3): libbpf: ensure umem pointer is non-NULL before dereferencing libbpf: restore u

[PATCH v2 bpf 1/3] libbpf: ensure umem pointer is non-NULL before dereferencing

2021-03-26 Thread Ciara Loftus
Calls to xsk_socket__create dereference the umem to access the fill_save and comp_save pointers. Make sure the umem is non-NULL before doing this. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Acked-by: Magnus Karlsson Signed-off-by: Ciara Loftus

[PATCH v2 bpf 2/3] libbpf: restore umem state after socket create failure

2021-03-26 Thread Ciara Loftus
umem during xsk_umem__create, since those maps existed before the call to xsk_socket__create and should remain in tact even in the event of failure. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Signed-off-by: Ciara Loftus --- tools/lib/bpf/

[PATCH v2 bpf 3/3] libbpf: ignore return values of setsockopt for XDP rings.

2021-03-26 Thread Ciara Loftus
ckets") Acked-by: Magnus Karlsson Signed-off-by: Ciara Loftus --- tools/lib/bpf/xsk.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index d4991ddff05a..cfc4abf505c3 100644 --- a/tools/lib/bpf/x

[PATCH v3 bpf 2/3] libbpf: restore umem state after socket create failure

2021-03-30 Thread Ciara Loftus
umem during xsk_umem__create, since those maps existed before the call to xsk_socket__create and should remain in tact even in the event of failure. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Signed-off-by: Ciara Loftus --- tools/lib/bpf/

[PATCH v3 bpf 0/3] AF_XDP Socket Creation Fixes

2021-03-30 Thread Ciara Loftus
tus as suggested by Alexei. v1->v2: * Simplified restoring the _save pointers as suggested by Magnus. * Fixed the condition which determines whether to unmap umem rings when socket create fails. This series applies on commit 861de02e5f3f2a104eecc5af1d248cb7bf8c5f75 Ciara Loftus (3):

[PATCH v3 bpf 3/3] libbpf: only create rx and tx XDP rings when necessary

2021-03-30 Thread Ciara Loftus
before setting up the rings for sockets which share the fd with the UMEM. Fixes: 1cad07884239 ("libbpf: add support for using AF_XDP sockets") Signed-off-by: Ciara Loftus --- tools/lib/bpf/xsk.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/too

[PATCH v3 bpf 1/3] libbpf: ensure umem pointer is non-NULL before dereferencing

2021-03-30 Thread Ciara Loftus
Calls to xsk_socket__create dereference the umem to access the fill_save and comp_save pointers. Make sure the umem is non-NULL before doing this. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Acked-by: Magnus Karlsson Signed-off-by: Ciara Loftus

[PATCH v4 bpf 1/3] libbpf: ensure umem pointer is non-NULL before dereferencing

2021-03-30 Thread Ciara Loftus
Calls to xsk_socket__create dereference the umem to access the fill_save and comp_save pointers. Make sure the umem is non-NULL before doing this. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Acked-by: Magnus Karlsson Signed-off-by: Ciara Loftus

[PATCH v4 bpf 0/3] AF_XDP Socket Creation Fixes

2021-03-30 Thread Ciara Loftus
implified restoring the _save pointers as suggested by Magnus. * Fixed the condition which determines whether to unmap umem rings when socket create fails. This series applies on commit 861de02e5f3f2a104eecc5af1d248cb7bf8c5f75 Ciara Loftus (3): libbpf: ensure umem pointer is non-NULL before dere

[PATCH v4 bpf 2/3] libbpf: restore umem state after socket create failure

2021-03-30 Thread Ciara Loftus
umem during xsk_umem__create, since those maps existed before the call to xsk_socket__create and should remain in tact even in the event of failure. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Signed-off-by: Ciara Loftus --- tools/lib/bpf/

[PATCH v4 bpf 3/3] libbpf: only create rx and tx XDP rings when necessary

2021-03-30 Thread Ciara Loftus
the ring setup status and using them to determine whether or not to set up the rings. Fixes: 1cad07884239 ("libbpf: add support for using AF_XDP sockets") Signed-off-by: Ciara Loftus --- tools/lib/bpf/xsk.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --g

[PATCH bpf] libbpf: fix potential NULL pointer dereference

2021-04-07 Thread Ciara Loftus
Wait until after the UMEM is checked for null to dereference it. Fixes: 43f1bc1efff1 ("libbpf: Restore umem state after socket create failure") Signed-off-by: Ciara Loftus --- tools/lib/bpf/xsk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/xsk

[PATCH bpf-next 2/6] selftests/bpf: restructure setting the packet count

2021-01-25 Thread Ciara Loftus
Prior to this, the packet count was fixed at 1 for every test. Future tracing tests need to modify the count, so make it possible to set the count from test_xsk.h using the -C opt. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh| 17 + tools

[PATCH bpf-next 1/6] xsk: add tracepoints for packet drops

2021-01-25 Thread Ciara Loftus
This commit introduces static perf tracepoints for AF_XDP which report information about packet drops, such as the netdev, qid and high level reason for the drop. The tracepoint can be enabled/disabled by toggling /sys/kernel/debug/tracing/events/xsk/xsk_packet_drop/enable Signed-off-by: Ciara

[PATCH bpf-next 0/6] AF_XDP Packet Drop Tracing

2021-01-25 Thread Ciara Loftus
acket_drop: netdev: eth0 qid 0 reason: fq empty The event can also be monitored using perf: perf stat -a -e xsk:xsk_packet_drop Three selftests are added which each ensure the appropriate traces are generated for the following scenarios: * rx queue full * packet too big * fill queue empty Ciara

[PATCH bpf-next v2 0/6] AF_XDP Packet Drop Tracing

2021-01-26 Thread Ciara Loftus
: * Rebase on top of Björn's cleanup series. * Fixed packet count for trace tests which don't need EOT frame. This series applies on commit 190d1c921ad0862da14807e1670f54020f48e889 Ciara Loftus (6): xsk: add tracepoints for packet drops selftests/bpf: restructure setting the packet cou

[PATCH bpf-next v2 2/6] selftests/bpf: restructure setting the packet count

2021-01-26 Thread Ciara Loftus
Prior to this, the packet count was fixed at 1 for every test. Future tracing tests need to modify the count, so make it possible to set the count from test_xsk.h using the -C opt. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh| 17 + tools

[PATCH bpf-next v2 1/6] xsk: add tracepoints for packet drops

2021-01-26 Thread Ciara Loftus
This commit introduces static perf tracepoints for AF_XDP which report information about packet drops, such as the netdev, qid and high level reason for the drop. The tracepoint can be enabled/disabled by toggling /sys/kernel/debug/tracing/events/xsk/xsk_packet_drop/enable Signed-off-by: Ciara

[PATCH bpf-next v2 5/6] selftests/bpf: XSK_TRACE_DROP_PKT_TOO_BIG test

2021-01-26 Thread Ciara Loftus
This test increases the UMEM headroom to a size that will cause packets to be dropped. Traces which report these drops are expected. The test validates that these traces were successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24

[PATCH bpf-next v2 6/6] selftests/bpf: XSK_TRACE_DROP_FQ_EMPTY test

2021-01-26 Thread Ciara Loftus
This test skips the populating of the fill queue which causes packet drops and traces reporting the drop. The test validates that these traces were successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing

[PATCH bpf-next v2 4/6] selftests/bpf: XSK_TRACE_DROP_RXQ_FULL test

2021-01-26 Thread Ciara Loftus
This test limits the size of the RXQ and does not read from it. Packets are transmitted. Traces are expected which report packet drops for packets which could not fit in the limited size rxq. The test validates that these traces were successfully generated. Signed-off-by: Ciara Loftus --- tools

[PATCH bpf-next v2 3/6] selftests/bpf: add framework for xsk selftests

2021-01-26 Thread Ciara Loftus
This commit introduces framework to the xsk selftests for testing the xsk_packet_drop traces. The '-t' or '--trace-enable' args enable the trace, and disable it on exit unless it was already enabled before the test. Signed-off-by: Ciara Loftus --- tools/testing/selftests/b

[PATCH bpf-next 6/6] selftests/bpf: XSK_TRACE_DROP_FQ_EMPTY test

2021-01-26 Thread Ciara Loftus
This test skips the populating of the fill queue which causes packet drops and traces reporting the drop. The test validates that these traces were successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing

[PATCH bpf-next 5/6] selftests/bpf: XSK_TRACE_DROP_PKT_TOO_BIG test

2021-01-26 Thread Ciara Loftus
This test increases the UMEM headroom to a size that will cause packets to be dropped. Traces which report these drops are expected. The test validates that these traces were successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24

[PATCH bpf-next 4/6] selftests/bpf: XSK_TRACE_DROP_RXQ_FULL test

2021-01-26 Thread Ciara Loftus
This test limits the size of the RXQ and does not read from it. Packets are transmitted. Traces are expected which report packet drops for packets which could not fit in the limited size rxq. The test validates that these traces were successfully generated. Signed-off-by: Ciara Loftus --- tools

[PATCH bpf-next 3/6] selftests/bpf: add framework for xsk selftests

2021-01-26 Thread Ciara Loftus
This commit introduces framework to the xsk selftests for testing the xsk_packet_drop traces. The '-t' or '--trace-enable' args enable the trace, and disable it on exit unless it was already enabled before the test. Signed-off-by: Ciara Loftus --- tools/testing/selftests/b

[PATCH bpf-next v3 2/6] selftests/bpf: restructure setting the packet count

2021-02-02 Thread Ciara Loftus
Prior to this, the packet count was fixed at 1 for every test. Future tracing tests need to modify the count in order to ensure the trace buffer does not become full. So, make it possible to set the count from test_xsk.h using the -C opt. Signed-off-by: Ciara Loftus --- tools/testing

[PATCH bpf-next v3 5/6] selftests/bpf: XSK_TRACE_INVALID_FILLADDR test

2021-02-02 Thread Ciara Loftus
generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing/selftests/bpf/xdpxceiver.c | 29 ++-- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools

[PATCH bpf-next v3 4/6] selftests/bpf: XSK_TRACE_DROP_PKT_TOO_BIG test

2021-02-02 Thread Ciara Loftus
generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 25 ++ tools/testing/selftests/bpf/xdpxceiver.c | 102 --- tools/testing/selftests/bpf/xdpxceiver.h | 6 ++ 3 files changed, 123 insertions(+), 10 deletions(-) diff --git a/tools

[PATCH bpf-next v3 6/6] selftests/bpf: XSK_TRACE_INVALID_DESC_TX test

2021-02-02 Thread Ciara Loftus
traces were successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing/selftests/bpf/xdpxceiver.c | 22 ++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf

[PATCH bpf-next v3 3/6] selftests/bpf: add framework for xsk selftests

2021-02-02 Thread Ciara Loftus
This commit introduces framework to the xsk selftests for testing the xsk_packet_drop traces. The '-t' or '--trace-enable' args enable the trace, and disable it on exit unless it was already enabled before the test. Signed-off-by: Ciara Loftus --- tools/testing/selftests/b

[PATCH bpf-next v3 0/6] AF_XDP Packet Drop Tracing

2021-02-02 Thread Ciara Loftus
iptor validation on RX and TX and selftests for both v1->v2: * Rebase on top of Björn's cleanup series. * Fixed packet count for trace tests which don't need EOT frame. This series applies on commit 61ca36c8c4eb3bae35a285b1ae18c514cde65439 Ciara Loftus (6): xsk: add tracepoints for pac

[PATCH bpf-next v3 1/6] xsk: add tracepoints for packet drops

2021-02-02 Thread Ciara Loftus
t drops by providing this extra level of detail which is not available through use of simple counters. The tracepoint can be enabled/disabled by toggling /sys/kernel/debug/tracing/events/xsk/xsk_packet_drop/enable Signed-off-by: Ciara Loftus --- MAINTAINERS | 1 + inc

[PATCH bpf-next v4 0/6] AF_XDP Packet Drop Tracing

2021-02-03 Thread Ciara Loftus
;t need EOT frame. This series applies on commit 1132b9987a3f6c7c396633d5a675075911f1ce32 Ciara Loftus (6): xsk: add tracepoints for packet drops selftests/bpf: restructure setting the packet count selftests/bpf: add framework for xsk selftests selftests/bpf: XSK_TRACE_DROP_PKT_TOO_BIG test

[PATCH bpf-next v4 2/6] selftests/bpf: restructure setting the packet count

2021-02-03 Thread Ciara Loftus
Prior to this, the packet count was fixed at 1 for every test. Future tracing tests need to modify the count in order to ensure the trace buffer does not become full. So, make it possible to set the count from test_xsk.h using the -C opt. Signed-off-by: Ciara Loftus --- tools/testing

[PATCH bpf-next v4 5/6] selftests/bpf: XSK_TRACE_INVALID_FILLADDR test

2021-02-03 Thread Ciara Loftus
successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing/selftests/bpf/xdpxceiver.c | 29 ++-- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/bpf/test_xsk.sh b

[PATCH bpf-next v4 6/6] selftests/bpf: XSK_TRACE_INVALID_DESC_TX test

2021-02-03 Thread Ciara Loftus
traces were successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing/selftests/bpf/xdpxceiver.c | 22 ++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf

[PATCH bpf-next v4 3/6] selftests/bpf: add framework for xsk selftests

2021-02-03 Thread Ciara Loftus
This commit introduces framework to the xsk selftests for testing the xsk_packet_drop traces. The '-t' or '--trace-enable' args enable the trace, and disable it on exit unless it was already enabled before the test. Signed-off-by: Ciara Loftus --- tools/testing/selftests/b

[PATCH bpf-next v4 4/6] selftests/bpf: XSK_TRACE_DROP_PKT_TOO_BIG test

2021-02-03 Thread Ciara Loftus
generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 25 ++ tools/testing/selftests/bpf/xdpxceiver.c | 102 --- tools/testing/selftests/bpf/xdpxceiver.h | 6 ++ 3 files changed, 123 insertions(+), 10 deletions(-) diff --git a/tools

[PATCH bpf-next v4 1/6] xsk: add tracepoints for packet drops

2021-02-03 Thread Ciara Loftus
t drops by providing this extra level of detail which is not available through use of simple counters. The tracepoint can be enabled/disabled by toggling /sys/kernel/debug/tracing/events/xsk/xsk_packet_drop/enable Signed-off-by: Ciara Loftus --- MAINTAINERS | 1 + inc

[PATCH bpf-next v5 1/6] xsk: add tracepoints for packet drops

2021-02-08 Thread Ciara Loftus
t drops by providing this extra level of detail which is not available through use of simple counters. The tracepoint can be enabled/disabled by toggling /sys/kernel/debug/tracing/events/xsk/xsk_packet_drop/enable Signed-off-by: Ciara Loftus --- MAINTAINERS | 1 + inc

[PATCH bpf-next v5 0/6] AF_XDP Packet Drop Tracing

2021-02-08 Thread Ciara Loftus
on top of Björn's cleanup series. * Fixed packet count for trace tests which don't need EOT frame. This series applies on commit 23a2d70c7a2f28eb1a8f6bc19d68d23968cad0ce Ciara Loftus (6): xsk: add tracepoints for packet drops selftests/bpf: restructure setting the packet co

[PATCH bpf-next v5 2/6] selftests/bpf: restructure setting the packet count

2021-02-08 Thread Ciara Loftus
Prior to this, the packet count was fixed at 1 for every test. Future tracing tests need to modify the count in order to ensure the trace buffer does not become full. So, make it possible to set the count from test_xsk.h using the -C opt. Signed-off-by: Ciara Loftus --- tools/testing

[PATCH bpf-next v5 3/6] selftests/bpf: add framework for xsk selftests

2021-02-08 Thread Ciara Loftus
This commit introduces framework to the xsk selftests for testing the xsk_packet_drop traces. The '-t' or '--trace-enable' args enable the trace, and disable it on exit unless it was already enabled before the test. Signed-off-by: Ciara Loftus --- tools/testing/selftests/b

[PATCH bpf-next v5 4/6] selftests/bpf: XSK_TRACE_DROP_PKT_TOO_BIG test

2021-02-08 Thread Ciara Loftus
generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 25 ++ tools/testing/selftests/bpf/xdpxceiver.c | 102 --- tools/testing/selftests/bpf/xdpxceiver.h | 6 ++ 3 files changed, 123 insertions(+), 10 deletions(-) diff --git a/tools

[PATCH bpf-next v5 5/6] selftests/bpf: XSK_TRACE_INVALID_FILLADDR test

2021-02-08 Thread Ciara Loftus
successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing/selftests/bpf/xdpxceiver.c | 29 ++-- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/bpf/test_xsk.sh b

[PATCH bpf-next v5 6/6] selftests/bpf: XSK_TRACE_INVALID_DESC_TX test

2021-02-08 Thread Ciara Loftus
traces were successfully generated. Signed-off-by: Ciara Loftus --- tools/testing/selftests/bpf/test_xsk.sh | 24 tools/testing/selftests/bpf/xdpxceiver.c | 22 ++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf

[PATCH bpf 1/3] libbpf: ensure umem pointer is non-NULL before dereferencing

2021-03-24 Thread Ciara Loftus
Calls to xsk_socket__create dereference the umem to access the fill_save and comp_save pointers. Make sure the umem is non-NULL before doing this. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Signed-off-by: Ciara Loftus --- tools/lib/bpf/xsk.c | 3 +

[PATCH bpf 0/3] AF_XDP Socket Creation Fixes

2021-03-24 Thread Ciara Loftus
87d77e59d1ebc31850697341ab15ca013004b81b Ciara Loftus (3): libbpf: ensure umem pointer is non-NULL before dereferencing libbpf: restore umem state after socket create failure libbpf: ignore return values of setsockopt for XDP rings. tools/lib/bpf/xsk.c | 66 + 1 file

[PATCH bpf 2/3] libbpf: restore umem state after socket create failure

2021-03-24 Thread Ciara Loftus
("libbpf: Support shared umems between queues and devices") Signed-off-by: Ciara Loftus --- tools/lib/bpf/xsk.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 443b0cfb45e8..ec3c23299

[PATCH bpf 3/3] libbpf: ignore return values of setsockopt for XDP rings.

2021-03-24 Thread Ciara Loftus
ckets") Signed-off-by: Ciara Loftus --- tools/lib/bpf/xsk.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index ec3c23299329..1f1c4c11c292 100644 --- a/tools/lib/bpf/xsk.c +++ b/tools/lib

[PATCH iproute2-next] ss: add support for xdp statistics

2020-09-24 Thread Ciara Loftus
The patch exposes statistics for XDP sockets which can be useful for debugging purposes. The stats exposed are: rx dropped rx invalid rx queue full rx fill ring empty tx invalid tx ring empty Signed-off-by: Ciara Loftus --- misc/ss.c | 22 +- 1 file

[PATCH bpf-next 3/3] samples: bpf: driver interrupt statistics in xdpsock

2020-10-02 Thread Ciara Loftus
string which is specific to their interface in the /proc/interrupts file on the command line. Usage: ./xdpsock ... -I eg. for queue 0 of i40e device eth0: ./xdpsock ... -I i40e-eth0-TxRx-0 Signed-off-by: Ciara Loftus --- samples/bpf/xdpsock_user.c | 120 - 1

[PATCH bpf-next 1/3] samples: bpf: split xdpsock stats into new struct

2020-10-02 Thread Ciara Loftus
New statistics will be added in future commits. In preparation for this, let's split out the existing statistics into their own struct. Signed-off-by: Ciara Loftus --- samples/bpf/xdpsock_user.c | 123 + 1 file changed, 69 insertions(+), 54 deletions(-)

[PATCH bpf-next 2/3] samples: bpf: count syscalls in xdpsock

2020-10-02 Thread Ciara Loftus
tx_wakeup_sendtos: sendtos issued when tx ring needs waking up opt_polls: polls issued since the '-p' flag is set Print the stats using '-a' on the xdpsock command line. Signed-off-by: Ciara Loftus --- samples/bpf/xdpsock_user.c | 113 +

[PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output

2020-06-23 Thread Ciara Loftus
Prior to this, only the rx and tx ring statistics were dumped. The xdp ring statistics are now dumped as well. Signed-off-by: Ciara Loftus --- .../net/ethernet/intel/i40e/i40e_debugfs.c| 41 +++ 1 file changed, 41 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e

[PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats

2020-06-23 Thread Ciara Loftus
Prior to this, only rx and tx ring statistics were accounted for. Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e

[PATCH net-next v2 3/3] i40e: introduce new dump desc xdp command

2020-06-23 Thread Ciara Loftus
Interfaces already exist for dumping rx and tx descriptor information. Introduce another for doing the same for xdp descriptors. Signed-off-by: Ciara Loftus --- v1 -> v2: - Fix variable name in description of dump_desc function .../net/ethernet/intel/i40e/i40e_debugfs.c|

[PATCH bpf-next 2/3] ixgbe: fix xdp handle calculations

2019-09-11 Thread Ciara Loftus
run_xdp_zc. This commit removes the latter addition and fixes the case where the headroom is non-zero. Fixes: 7cbbf9f1fa23 ("ixgbe: fix xdp handle calculations") Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH bpf-next 3/3] samples/bpf: fix xdpsock l2fwd tx for unaligned mode

2019-09-11 Thread Ciara Loftus
Preserve the offset of the address of the received descriptor, and include it in the address set for the tx descriptor, so the kernel can correctly locate the start of the packet data. Fixes: 03895e63ff97 ("samples/bpf: add buffer recycling for unaligned chunks to xdpsock") Signed-off

[PATCH bpf-next 1/3] i40e: fix xdp handle calculations

2019-09-11 Thread Ciara Loftus
p_zc. This commit removes the latter addition and fixes the case where the headroom is non-zero. Fixes: 4c5d9a7fa149 ("i40e: fix xdp handle calculations") Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH bpf-next v2 0/3] AF_XDP fixes for i40e, ixgbe and xdpsock

2019-09-13 Thread Ciara Loftus
unaligned mode. This patch set has been applied against commit a2c11b034142 ("kcm: use BPF_PROG_RUN") --- v2: - Rearranged local variable order in i40e_run_xdp_zc and ixgbe_run_xdp_zc to comply with coding standards. Ciara Loftus (3): i40e: fix xdp handle calculations i

[PATCH bpf-next v2 1/3] i40e: fix xdp handle calculations

2019-09-13 Thread Ciara Loftus
p_zc. This commit removes the latter addition and fixes the case where the headroom is non-zero. Fixes: 4c5d9a7fa149 ("i40e: fix xdp handle calculations") Signed-off-by: Ciara Loftus Tested-by: Andrew Bowers --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 ++-- 1 file changed

[PATCH bpf-next v2 2/3] ixgbe: fix xdp handle calculations

2019-09-13 Thread Ciara Loftus
run_xdp_zc. This commit removes the latter addition and fixes the case where the headroom is non-zero. Fixes: 7cbbf9f1fa23 ("ixgbe: fix xdp handle calculations") Signed-off-by: Ciara Loftus Tested-by: Andrew Bowers --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 4 ++-- 1 file changed

[PATCH bpf-next v2 3/3] samples/bpf: fix xdpsock l2fwd tx for unaligned mode

2019-09-13 Thread Ciara Loftus
Preserve the offset of the address of the received descriptor, and include it in the address set for the tx descriptor, so the kernel can correctly locate the start of the packet data. Fixes: 03895e63ff97 ("samples/bpf: add buffer recycling for unaligned chunks to xdpsock") Signed-off

[PATCH net 2/3] i40e: protect ring accesses with READ- and WRITE_ONCE

2020-06-09 Thread Ciara Loftus
READ_ONCE should be used when reading rings prior to accessing the statistics pointer. Introduce this as well as the corresponding WRITE_ONCE usage when allocating and freeing the rings, to ensure protected access. Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/i40e/i40e_main.c | 29

[PATCH net 3/3] ice: protect ring accesses with WRITE_ONCE

2020-06-09 Thread Ciara Loftus
The READ_ONCE macro is used when reading rings prior to accessing the statistics pointer. The corresponding WRITE_ONCE usage when allocating and freeing the rings to ensure protected access was not in place. Introduce this. Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/ice

[PATCH net 1/3] ixgbe: protect ring accesses with READ- and WRITE_ONCE

2020-06-09 Thread Ciara Loftus
READ_ONCE should be used when reading rings prior to accessing the statistics pointer. Introduce this as well as the corresponding WRITE_ONCE usage when allocating and freeing the rings, to ensure protected access. Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c

[PATCH net-next 1/3] i40e: add xdp ring statistics to vsi stats

2020-06-22 Thread Ciara Loftus
Prior to this, only rx and tx ring statistics were accounted for. Signed-off-by: Ciara Loftus --- drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e

[PATCH net-next 2/3] i40e: add xdp ring statistics to dump vsi debug output

2020-06-22 Thread Ciara Loftus
Prior to this, only the rx and tx ring statistics were dumped. The xdp ring statistics are now dumped as well. Signed-off-by: Ciara Loftus --- .../net/ethernet/intel/i40e/i40e_debugfs.c| 41 +++ 1 file changed, 41 insertions(+) diff --git a/drivers/net/ethernet/intel/i40e

[PATCH net-next 3/3] i40e: introduce new dump desc xdp command

2020-06-22 Thread Ciara Loftus
Interfaces already exist for dumping rx and tx descriptor information. Introduce another for doing the same for xdp descriptors. Signed-off-by: Ciara Loftus --- .../net/ethernet/intel/i40e/i40e_debugfs.c| 59 +++ 1 file changed, 48 insertions(+), 11 deletions(-) diff --git