diff mbox series

[net-next,08/11] mlxsw: spectrum: Remove unnecessary RCU read-side critical section

Message ID 20210314121940.2807621-9-idosch@idosch.org (mailing list archive)
State Accepted
Commit e1f78ecdfd59d560c42bc04b9bfb746ef8a9dfb1
Delegated to: Netdev Maintainers
Headers show
Series psample: Add additional metadata attributes | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Ido Schimmel March 14, 2021, 12:19 p.m. UTC
From: Ido Schimmel <idosch@nvidia.com>

Since commit 7d8e8f3433dc ("mlxsw: core: Increase scope of RCU read-side
critical section"), all Rx handlers are called from an RCU read-side
critical section.

Remove the unnecessary rcu_read_lock() / rcu_read_unlock().

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 3b15f8d728a3..3d8e8d8dfff5 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -2225,15 +2225,12 @@  void mlxsw_sp_sample_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb,
 		goto out;
 	}
 
-	rcu_read_lock();
 	sample = rcu_dereference(mlxsw_sp_port->sample);
 	if (!sample)
-		goto out_unlock;
+		goto out;
 	md.trunc_size = sample->truncate ? sample->trunc_size : skb->len;
 	md.in_ifindex = mlxsw_sp_port->dev->ifindex;
 	psample_sample_packet(sample->psample_group, skb, sample->rate, &md);
-out_unlock:
-	rcu_read_unlock();
 out:
 	consume_skb(skb);
 }