summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorSankararaman Jayaraman <sankararaman.jayaraman@broadcom.com>2025-01-31 09:53:41 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 10:04:59 +0100
commit2bd762847d209d325604298dcbee017d4685a10c (patch)
tree23a5d32a7a8905776dac6e7f2d89532f0228fbb6 /tools/testing
parentf21d479c1f69ed40a80a926d9be19401fae630ac (diff)
downloadlinux-2bd762847d209d325604298dcbee017d4685a10c.tar.gz
linux-2bd762847d209d325604298dcbee017d4685a10c.tar.bz2
linux-2bd762847d209d325604298dcbee017d4685a10c.zip
vmxnet3: Fix tx queue race condition with XDP
[ Upstream commit 3f1baa91a1fdf3de9dbad4bd615b35fab347874b ] If XDP traffic runs on a CPU which is greater than or equal to the number of the Tx queues of the NIC, then vmxnet3_xdp_get_tq() always picks up queue 0 for transmission as it uses reciprocal scale instead of simple modulo operation. vmxnet3_xdp_xmit() and vmxnet3_xdp_xmit_frame() use the above returned queue without any locking which can lead to race conditions when multiple XDP xmits run in parallel on different CPU's. This patch uses a simple module scheme when the current CPU equals or exceeds the number of Tx queues on the NIC. It also adds locking in vmxnet3_xdp_xmit() and vmxnet3_xdp_xmit_frame() functions. Fixes: 54f00cce1178 ("vmxnet3: Add XDP support.") Signed-off-by: Sankararaman Jayaraman <sankararaman.jayaraman@broadcom.com> Signed-off-by: Ronak Doshi <ronak.doshi@broadcom.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250131042340.156547-1-sankararaman.jayaraman@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions