]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bnxt_en: Prevent XDP redirect from running when stopping TX queue
authorRay Jui <ray.jui@broadcom.com>
Sat, 2 Apr 2022 00:21:12 +0000 (20:21 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:03:15 +0000 (20:03 +0200)
commite89de1cd85b660c34ec66993b2022081773db32b
treef361d2a3127a14323dd11171d42cf909a6987c56
parent1d3475b8c0e0f9c6d862137122b8a6379c04132c
bnxt_en: Prevent XDP redirect from running when stopping TX queue

[ Upstream commit 27d4073f8d9af0340362554414f4961643a4f4de ]

Add checks in the XDP redirect callback to prevent XDP from running when
the TX ring is undergoing shutdown.

Also remove redundant checks in the XDP redirect callback to validate the
txr and the flag that indicates the ring supports XDP. The modulo
arithmetic on 'tx_nr_rings_xdp' already guarantees the derived TX
ring is an XDP ring.  txr is also guaranteed to be valid after checking
BNXT_STATE_OPEN and within RCU grace period.

Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support")
Reviewed-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c