• 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: 's avatarToke Høiland-Jørgensen <toke@redhat.com>
    Reviewed-by: 's avatarTariq Toukan <tariqt@mellanox.com>
    Signed-off-by: 's avatarSaeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    9622d9fb
Name
Last commit
Last update
..
appletalk Loading commit data...
arcnet Loading commit data...
bonding Loading commit data...
caif Loading commit data...
can Loading commit data...
dsa Loading commit data...
ethernet Loading commit data...
fddi Loading commit data...
fjes Loading commit data...
hamradio Loading commit data...
hippi Loading commit data...
hyperv Loading commit data...
ieee802154 Loading commit data...
ipvlan Loading commit data...
netdevsim Loading commit data...
phy Loading commit data...
plip Loading commit data...
ppp Loading commit data...
slip Loading commit data...
team Loading commit data...
usb Loading commit data...
vmxnet3 Loading commit data...
wan Loading commit data...
wimax Loading commit data...
wireless Loading commit data...
xen-netback Loading commit data...
Kconfig Loading commit data...
LICENSE.SRC Loading commit data...
Makefile Loading commit data...
Space.c Loading commit data...
dummy.c Loading commit data...
eql.c Loading commit data...
geneve.c Loading commit data...
gtp.c Loading commit data...
ifb.c Loading commit data...
loopback.c Loading commit data...
macsec.c Loading commit data...
macvlan.c Loading commit data...
macvtap.c Loading commit data...
mdio.c Loading commit data...
mii.c Loading commit data...
net_failover.c Loading commit data...
netconsole.c Loading commit data...
nlmon.c Loading commit data...
ntb_netdev.c Loading commit data...
rionet.c Loading commit data...
sb1000.c Loading commit data...
sungem_phy.c Loading commit data...
tap.c Loading commit data...
thunderbolt.c Loading commit data...
tun.c Loading commit data...
veth.c Loading commit data...
virtio_net.c Loading commit data...
vrf.c Loading commit data...
vsockmon.c Loading commit data...
vxlan.c Loading commit data...
xen-netfront.c Loading commit data...