diff options
author | 2021-06-24 18:06:07 +0200 | |
---|---|---|
committer | 2021-06-24 19:46:12 +0200 | |
commit | 7b6ee873ff20c22af355661b241defa7f6ed7582 (patch) | |
tree | b6da2f486bf7f2f4c65f6bef23aab6793f11a3ff /drivers/net/ethernet/socionext | |
parent | sfc: Remove rcu_read_lock() around XDP program invocation (diff) | |
download | linux-7b6ee873ff20c22af355661b241defa7f6ed7582.tar.gz linux-7b6ee873ff20c22af355661b241defa7f6ed7582.tar.bz2 linux-7b6ee873ff20c22af355661b241defa7f6ed7582.zip |
netsec: Remove rcu_read_lock() around XDP program invocation
The netsec driver has a rcu_read_lock()/rcu_read_unlock() pair around the
full RX loop, covering everything up to and including xdp_do_flush(). This
is actually the correct behaviour, but because it all happens in a single
NAPI poll cycle (and thus under local_bh_disable()), it is also technically
redundant.
With the addition of RCU annotations to the XDP_REDIRECT map types that
take bh execution into account, lockdep even understands this to be safe,
so there's really no reason to keep the rcu_read_lock() around anymore, so
let's just remove it.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Link: https://lore.kernel.org/bpf/20210624160609.292325-18-toke@redhat.com
Diffstat (limited to 'drivers/net/ethernet/socionext')
-rw-r--r-- | drivers/net/ethernet/socionext/netsec.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c index dfc85cc68173..20d148c019d8 100644 --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -958,7 +958,6 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) xdp_init_buff(&xdp, PAGE_SIZE, &dring->xdp_rxq); - rcu_read_lock(); xdp_prog = READ_ONCE(priv->xdp_prog); dma_dir = page_pool_get_dma_dir(dring->page_pool); @@ -1069,8 +1068,6 @@ next: } netsec_finalize_xdp_rx(priv, xdp_act, xdp_xmit); - rcu_read_unlock(); - return done; } |