[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALDO+SbGYqG6jskUhp-dzxTPa2Mf5ge794Z_L0AC8MLxoKXMnA@mail.gmail.com>
Date: Fri, 24 Jan 2025 08:45:56 -0800
From: William Tu <u9012063@...il.com>
To: Sankararaman Jayaraman <sankararaman.jayaraman@...adcom.com>
Cc: netdev@...r.kernel.org, ronak.doshi@...adcom.com,
bcm-kernel-feedback-list@...adcom.com, andrew+netdev@...n.ch,
davem@...emloft.net, kuba@...nel.org, edumazet@...gle.com, pabeni@...hat.com,
ast@...nel.org, alexandr.lobakin@...el.com, alexanderduyck@...com,
bpf@...r.kernel.org, daniel@...earbox.net, hawk@...nel.org,
john.fastabend@...il.com
Subject: Re: [PATCH net] vmxnet3: Fix tx queue race condition with XDP
On Fri, Jan 24, 2025 at 1:00 AM Sankararaman Jayaraman
<sankararaman.jayaraman@...adcom.com> wrote:
>
> 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@...adcom.com>
> Signed-off-by: Ronak Doshi <ronak.doshi@...adcom.com>
> ---
LGTM
Acked-by: William Tu <u9012063@...il.com>
Powered by blists - more mailing lists