• Saeed Mahameed's avatar
    net/mlx5e: XDP, fix redirect resources availability check · 9622d9fb
    Saeed Mahameed authored
    [ Upstream commit 407e17b1 ]
    
    Currently mlx5 driver creates xdp redirect hw queues unconditionally on
    netdevice open, This is great until someone starts redirecting XDP traffic
    via ndo_xdp_xmit on mlx5 device and changes the device configuration at
    the same time, this might cause crashes, since the other device's napi
    is not aware of the mlx5 state change (resources un-availability).
    
    To fix this we must synchronize with other devices napi's on the system.
    Added a new flag under mlx5e_priv to determine XDP TX resources are
    available, set/clear it up when necessary and use synchronize_rcu()
    when the flag is turned off, so other napi's are in-sync with it, before
    we actually cleanup the hw resources.
    
    The flag is tested prior to committing to transmit on mlx5e_xdp_xmit, and
    it is sufficient to determine if it safe to transmit or not. The other
    two internal flags (MLX5E_STATE_OPENED and MLX5E_SQ_STATE_ENABLED) become
    unnecessary. Thus, they are removed from data path.
    
    Fixes: 58b99ee3 ("net/mlx5e: Add support for XDP_REDIRECT in device-out side")
    Reported-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
    Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    9622d9fb
Name
Last commit
Last update
..
3com Loading commit data...
8390 Loading commit data...
adaptec Loading commit data...
aeroflex Loading commit data...
agere Loading commit data...
alacritech Loading commit data...
allwinner Loading commit data...
alteon Loading commit data...
altera Loading commit data...
amazon Loading commit data...
amd Loading commit data...
apm Loading commit data...
apple Loading commit data...
aquantia Loading commit data...
arc Loading commit data...
atheros Loading commit data...
aurora Loading commit data...
broadcom Loading commit data...
brocade Loading commit data...
cadence Loading commit data...
calxeda Loading commit data...
cavium Loading commit data...
chelsio Loading commit data...
cirrus Loading commit data...
cisco Loading commit data...
cortina Loading commit data...
davicom Loading commit data...
dec Loading commit data...
dlink Loading commit data...
emulex Loading commit data...
ezchip Loading commit data...
faraday Loading commit data...
freescale Loading commit data...
fujitsu Loading commit data...
hisilicon Loading commit data...
hp Loading commit data...
huawei Loading commit data...
i825xx Loading commit data...
ibm Loading commit data...
intel Loading commit data...
marvell Loading commit data...
mediatek Loading commit data...
mellanox Loading commit data...
micrel Loading commit data...
microchip Loading commit data...
moxa Loading commit data...
mscc Loading commit data...
myricom Loading commit data...
natsemi Loading commit data...
neterion Loading commit data...
netronome Loading commit data...
ni Loading commit data...
nuvoton Loading commit data...
nvidia Loading commit data...
nxp Loading commit data...
oki-semi Loading commit data...
packetengines Loading commit data...
pasemi Loading commit data...
qlogic Loading commit data...
qualcomm Loading commit data...
rdc Loading commit data...
realtek Loading commit data...
renesas Loading commit data...
rocker Loading commit data...
samsung Loading commit data...
seeq Loading commit data...
sfc Loading commit data...
sgi Loading commit data...
silan Loading commit data...
sis Loading commit data...
smsc Loading commit data...
socionext Loading commit data...
stmicro Loading commit data...
sun Loading commit data...
synopsys Loading commit data...
tehuti Loading commit data...
ti Loading commit data...
toshiba Loading commit data...
tundra Loading commit data...
via Loading commit data...
wiznet Loading commit data...
xilinx Loading commit data...
xircom Loading commit data...
xscale Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
dnet.c Loading commit data...
dnet.h Loading commit data...
ec_bhf.c Loading commit data...
ethoc.c Loading commit data...
fealnx.c Loading commit data...
jme.c Loading commit data...
jme.h Loading commit data...
korina.c Loading commit data...
lantiq_etop.c Loading commit data...
lantiq_xrx200.c Loading commit data...
netx-eth.c Loading commit data...