Skip to contentSkip to conversation

selftests/bpf: Don't refill on completion in xdp_metadata

PATCH Applied Stanislav Fomichev 2 participants 2 messages Feb 1, 2023 – Feb 2, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/bpf: Don't refill on completion in xdp_metadata

We only need to consume TX completion instead of refilling 'fill' ring.

It's currently not an issue because we never RX more than 8 packets.

Fixes e2a46d54d7a1 ("selftests/bpf: Verify xdp_metadata xdp->af_xdp path")
---
 tools/testing/selftests/bpf/prog_tests/xdp_metadata.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/testing/selftests/bpf/prog_tests/xdp_metadata.c +2 -3
index e033d48288c0..4be615fb7975 100644
@@ -205,9 +205,8 @@ static void complete_tx(struct xsk *xsk)
 	if (ASSERT_EQ(xsk_ring_cons__peek(&xsk->comp, 1, &idx), 1, "xsk_ring_cons__peek")) {
 		addr = *xsk_ring_cons__comp_addr(&xsk->comp, idx);
 
-		printf("%p: refill idx=%u addr=%llx\n", xsk, idx, addr);
-		*xsk_ring_prod__fill_addr(&xsk->fill, idx) = addr;
-		xsk_ring_prod__submit(&xsk->fill, 1);
+		printf("%p: complete tx idx=%u addr=%llx\n", xsk, idx, addr);
+		xsk_ring_cons__release(&xsk->comp, 1);
 	}
 }
 
Signature · 1 line
2.39.1.456.gfc5497dd1b-goog
#1 lore raw
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 8 lines · On Wed, 1 Feb 2023 15:36:40 -0800 you wrote:

We only need to consume TX completion instead of refilling 'fill' ring.

It's currently not an issue because we never RX more than 8 packets.

Fixes e2a46d54d7a1 ("selftests/bpf: Verify xdp_metadata xdp->af_xdp path")

[...]

Here is the summary with links:
- [bpf-next] selftests/bpf: Don't refill on completion in xdp_metadata

    https://git.kernel.org/bpf/bpf-next/c/8b79b34a66cd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html