selftests: xsk: fix rx_full stats test
Subsystems (6)
PATCH 1/1 selftests: xsk: fix rx_full stats test
From: Magnus Karlsson <[email protected]>
Fix the rx_full stats test so that it correctly reports pass even when the fill ring is not full of buffers.
--- tools/testing/selftests/bpf/xdpxceiver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/xdpxceiver.c +4 -1
@@ -906,7 +906,10 @@ static bool rx_stats_are_valid(struct ifobject *ifobject)return true;case STAT_TEST_RX_FULL : xsk_stat = stats.rx_ring_full; - expected_stat -=RX_FULL_RXQSIZE ; +if (ifobject->umem->num_frames <XSK_RING_PROD__DEFAULT_NUM_DESCS ) + expected_stat = ifobject->umem->num_frames -RX_FULL_RXQSIZE ; +else + expected_stat =XSK_RING_PROD__DEFAULT_NUM_DESCS -RX_FULL_RXQSIZE ;break ;case STAT_TEST_RX_FILL_EMPTY : xsk_stat = stats.rx_fill_ring_empty_descs;
base-commit: 820e6e227c4053b6b631ae65ef1f65d560cb392b
Signature · 1 line
2.34.1
Quoted 7 lines · Magnus Karlsson
From: Magnus Karlsson <[email protected]>
Fix the
rx_fullstats test so that it correctly reports pass even when the fill ring is not full of buffers.Fixes 872a1184dbf2 ("selftests: xsk: Put the same buffer only once in the fill ring")Signed-off-by Magnus Karlsson <[email protected]>
Fixes xdpxceiver hang on my side.
Quoted 25 lines
--- tools/testing/selftests/bpf/xdpxceiver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tools/testing/selftests/bpf/xdpxceiver.c +4
-1@@ -906,7 +906,10 @@ static bool rx_stats_are_valid(struct ifobject *ifobject)return true;case STAT_TEST_RX_FULL : xsk_stat = stats.rx_ring_full; - expected_stat -=RX_FULL_RXQSIZE ; +if (ifobject->umem->num_frames <XSK_RING_PROD__DEFAULT_NUM_DESCS ) + expected_stat = ifobject->umem->num_frames -RX_FULL_RXQSIZE ; +else + expected_stat =XSK_RING_PROD__DEFAULT_NUM_DESCS -RX_FULL_RXQSIZE ;break ;case STAT_TEST_RX_FILL_EMPTY : xsk_stat = stats.rx_fill_ring_empty_descs;base-commit:
820e6e227c4053b6b631ae65ef1f65d560cb392bSignature · 1 line
2.34.1
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Quoted 9 lines · On Fri, 21 Jan 2022 13:35:08 +0100 you wrote:
From: Magnus Karlsson <[email protected]>
Fix the
rx_fullstats test so that it correctly reports pass even when the fill ring is not full of buffers.Fixes 872a1184dbf2 ("selftests: xsk: Put the same buffer only once in the fill ring")Signed-off-by Magnus Karlsson <[email protected]>[...]
Here is the summary with links:
- [bpf-next] selftests: xsk: fix rx_full stats test
https://git.kernel.org/bpf/bpf-next/c/b4ec6a192312
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html