Commit ac4a474
Izabela Bakollari
vmxnet3: Fix tx queue race condition with XDP
JIRA: https://issues.redhat.com/browse/RHEL-96969
commit 3f1baa9
Author: Sankararaman Jayaraman <sankararaman.jayaraman@broadcom.com>
Date: Fri Jan 31 09:53:41 2025 +0530
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: 54f00cc ("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: Izabela Bakollari <ibakolla@redhat.com>1 parent c59a544 commit ac4a474
1 file changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
145 | | - | |
| 147 | + | |
| 148 | + | |
146 | 149 | | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
182 | 186 | | |
183 | 187 | | |
184 | 188 | | |
| 189 | + | |
185 | 190 | | |
186 | 191 | | |
187 | 192 | | |
| |||
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
| 233 | + | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
| |||
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
239 | 248 | | |
240 | 249 | | |
241 | 250 | | |
242 | 251 | | |
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
| 255 | + | |
246 | 256 | | |
247 | 257 | | |
248 | 258 | | |
| |||
0 commit comments