net: socionext: netsec: always grab descriptor lock
authorLorenzo Bianconi <lorenzo@kernel.org>
Tue, 1 Oct 2019 08:33:51 +0000 (10:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Oct 2019 16:07:47 +0000 (09:07 -0700)
commit55131dec2b1c7417d216f861ea7a29dc7c4d2d20
treebed0df6621bc972500953f636a16452ffd1bbb9c
parent68ce6688a5baefde30914fc07fc27292dbbe8320
net: socionext: netsec: always grab descriptor lock

Always acquire tx descriptor spinlock even if a xdp program is not loaded
on the netsec device since ndo_xdp_xmit can run concurrently with
netsec_netdev_start_xmit and netsec_clean_tx_dring. This can happen
loading a xdp program on a different device (e.g virtio-net) and
xdp_do_redirect_map/xdp_do_redirect_slow can redirect to netsec even if
we do not have a xdp program on it.

Fixes: ba2b232108d3 ("net: netsec: add XDP support")
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/socionext/netsec.c