]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Apr 2022 11:44:50 +0000 (12:44 +0100)
commit77010bee67d0f64c46dafef90e535f7832f37aed
treec0b77380116d9b9c3a1fb6f5e6a3b4fcb160b01b
parent795a4f218a1e1d9f6f79ea26b9c19a1f1ab6d7a3
bnxt_en: Prevent XDP redirect from running when stopping TX queue

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: 0323aa29d818 ("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>
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c