Skip to content
Commit c0b56aa9 authored by David Thompson's avatar David Thompson Committed by Greg Kroah-Hartman
Browse files

mlxbf_gige: fix receive packet race condition

[ Upstream commit dcea1bd4 ]

Under heavy traffic, the BlueField Gigabit interface can
become unresponsive. This is due to a possible race condition
in the mlxbf_gige_rx_packet function, where the function exits
with producer and consumer indices equal but there are remaining
packet(s) to be processed. In order to prevent this situation,
read receive consumer index *before* the HW replenish so that
the mlxbf_gige_rx_packet function returns an accurate return
value even if a packet is received into just-replenished buffer
prior to exiting this routine. If the just-replenished buffer
is received and occupies the last RX ring entry, the interface
would not recover and instead would encounter RX packet drops
related to internal buffer shortages since the driver RX logic
is not being triggered to drain the RX ring. This patch will
address and prevent this "ring full" condition.

Fixes: f92e1869

 ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: default avatarAsmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: default avatarDavid Thompson <davthompson@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 271567af
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment