Skip to content

Commit

Permalink
mlxsw: spectrum: Remove unnecessary RCU read-side critical section
Browse files Browse the repository at this point in the history
Since commit 7d8e8f3 ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Mar 14, 2021
1 parent 5ab6dc9 commit e1f78ec
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e1f78ec

Please sign in to comment.