libbpf: Fixes incorrect rx_ring_setup_done
Subsystems (4)
PATCH 1/1 libbpf: Fixes incorrect rx_ring_setup_done
When calling xsk_socket__create_shared(), the logic at line 1097 marks a boolean flag true within the xsk_umem structure to track setup progress in order to support multiple calls to the function. However, instead of marking umem->tx_ring_setup_done, the code incorrectly sets umem->rx_ring_setup_done. This leads to improper behaviour when creating and destroying xsk and umem structures.
Multiple calls to this function is documented as supported.
--- tools/lib/bpf/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/xsk.c +1 -1
@@ -1094,7 +1094,7 @@ int xsk_socket__create_shared(struct xsk_socket **xsk_ptr, goto out_put_ctx; }if (xsk->fd == umem->fd) - umem->rx_ring_setup_done = true; + umem->tx_ring_setup_done = true; } err =xsk_get_mmap_offsets (xsk->fd, &off);
Signature · 1 line
2.30.2
Quoted 10 lines · Kev Jackson
When calling
xsk_socket__create_shared(), the logic at line 1097 marks a boolean flag true within thexsk_umemstructure to track setup progress in order to support multiple calls to the function. However, instead of markingumem->tx_ring_setup_done, the code incorrectly setsumem->rx_ring_setup_done. This leads to improper behaviour when creating and destroying xsk and umem structures.Multiple calls to this function is documented as supported.
Signed-off-by Kev Jackson <[email protected]>
Andrii Nakryiko
AppliedQuoted 11 lines · Yonghong Song
Quoted 7 lines · Kev Jackson
When calling
xsk_socket__create_shared(), the logic at line 1097 marks a boolean flag true within thexsk_umemstructure to track setup progress in order to support multiple calls to the function. However, instead of markingumem->tx_ring_setup_done, the code incorrectly setsumem->rx_ring_setup_done. This leads to improper behaviour when creating and destroying xsk and umem structures.
Quoted 5 lines
Quoted 3 lines
Multiple calls to this function is documented as supported.
Signed-off-by Kev Jackson <[email protected]>Acked-by Yonghong Song <[email protected]>
Applied to bpf tree, thanks. Also added
Please don't forget Fixes: tag in the future.
This patch was applied to bpf/bpf.git (refs/heads/master):
Hello:
This patch was applied to bpf/bpf.git (refs/heads/master):
Quoted 8 lines · On Mon, 7 Jun 2021 14:08:35 +0100 you wrote:
When calling
xsk_socket__create_shared(), the logic at line 1097 marks a boolean flag true within thexsk_umemstructure to track setup progress in order to support multiple calls to the function. However, instead of markingumem->tx_ring_setup_done, the code incorrectly setsumem->rx_ring_setup_done. This leads to improper behaviour when creating and destroying xsk and umem structures.[...]
Here is the summary with links:
- libbpf: Fixes incorrect rx_ring_setup_done
https://git.kernel.org/bpf/bpf/c/11fc79fc9f2e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html