netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vrf: Remove unnecessary RCU-bh critical section
@ 2023-08-21 14:23 Ido Schimmel
  2023-08-22  7:32 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2023-08-21 14:23 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, pabeni, edumazet, dsahern, mlxsw, Ido Schimmel

dev_queue_xmit_nit() already uses rcu_read_lock() / rcu_read_unlock()
and nothing suggests that softIRQs should be disabled around it.
Therefore, remove the rcu_read_lock_bh() / rcu_read_unlock_bh()
surrounding it.

Tested using [1] with lockdep enabled.

[1]
 #!/bin/bash

 ip link add name vrf1 up type vrf table 100
 ip link add name veth0 type veth peer name veth1
 ip link set dev veth1 master vrf1
 ip link set dev veth0 up
 ip link set dev veth1 up
 ip address add 192.0.2.1/24 dev veth0
 ip address add 192.0.2.2/24 dev veth1
 ip rule add pref 32765 table local
 ip rule del pref 0
 tcpdump -i vrf1 -c 20 -w /dev/null &
 sleep 10
 ping -i 0.1 -c 10 -q 192.0.2.2

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/vrf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 6043e63b42f9..43f374444684 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -638,9 +638,7 @@ static void vrf_finish_direct(struct sk_buff *skb)
 		eth_zero_addr(eth->h_dest);
 		eth->h_proto = skb->protocol;
 
-		rcu_read_lock_bh();
 		dev_queue_xmit_nit(skb, vrf_dev);
-		rcu_read_unlock_bh();
 
 		skb_pull(skb, ETH_HLEN);
 	}
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-22 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-21 14:23 [PATCH net-next] vrf: Remove unnecessary RCU-bh critical section Ido Schimmel
2023-08-22  7:32 ` Simon Horman
2023-08-22 15:29 ` David Ahern
2023-08-22 18:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).