]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fixes incorrect rx_ring_setup_done
authorKev Jackson <foamdino@gmail.com>
Mon, 7 Jun 2021 13:08:35 +0000 (14:08 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 8 Jun 2021 00:44:03 +0000 (17:44 -0700)
commit1625eea522b1079a8f472c94439d5bd2dd75928a
treec717125b61a601eb7fa7e0581b49022aa0396773
parentd950404688cf4981ffe09c9c2d1a8dd1377c4ec7
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.

Fixes: d8fb3a554c0f ("libbpf: Only create rx and tx XDP rings when necessary")
Signed-off-by: Kev Jackson <foamdino@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/YL4aU4f3Aaik7CN0@linux-dev
tools/lib/bpf/xsk.c