2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/net/vmxnet3
Sankararaman Jayaraman 3f1baa91a1 vmxnet3: Fix tx queue race condition with XDP
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: 54f00cce11 ("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>
2025-02-01 17:17:32 -08:00
..
Makefile vmxnet3: prepare for version 9 changes 2024-06-05 15:56:47 -07:00
upt1_defs.h vmxnet3: prepare for version 7 changes 2022-06-09 12:42:00 +02:00
vmxnet3_defs.h vmxnet3: add command to allow disabling of offloads 2024-06-05 15:56:48 -07:00
vmxnet3_drv.c vmxnet3: support higher link speeds from vmxnet3 v9 2024-10-07 17:04:41 -07:00
vmxnet3_ethtool.c vmxnet3: prepare for version 9 changes 2024-06-05 15:56:47 -07:00
vmxnet3_int.h vmxnet3: update to version 9 2024-06-05 15:56:48 -07:00
vmxnet3_xdp.c vmxnet3: Fix tx queue race condition with XDP 2025-02-01 17:17:32 -08:00
vmxnet3_xdp.h vmxnet3: Add XDP support. 2023-08-14 08:03:52 +01:00