From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, jiri@nvidia.com,
yotam.gi@gmail.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
roopa@nvidia.com, peter.phaal@inmon.com, neil.mckee@inmon.com,
mlxsw@nvidia.com, Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 08/11] mlxsw: spectrum: Remove unnecessary RCU read-side critical section
Date: Sun, 14 Mar 2021 14:19:37 +0200 [thread overview]
Message-ID: <20210314121940.2807621-9-idosch@idosch.org> (raw)
In-Reply-To: <20210314121940.2807621-1-idosch@idosch.org>
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 --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);
}
--
2.29.2
next prev parent reply other threads:[~2021-03-14 12:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-14 12:19 [PATCH net-next 00/11] psample: Add additional metadata attributes Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 01/11] psample: Encapsulate packet metadata in a struct Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 02/11] psample: Add additional metadata attributes Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 03/11] netdevsim: Add dummy psample implementation Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 04/11] selftests: netdevsim: Test psample functionality Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 05/11] mlxsw: pci: Add more metadata fields to CQEv2 Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 06/11] mlxsw: Create dedicated field for Rx metadata in skb control block Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 07/11] mlxsw: pci: Set extra " Ido Schimmel
2021-03-14 12:19 ` Ido Schimmel [this message]
2021-03-14 12:19 ` [PATCH net-next 09/11] mlxsw: spectrum: Remove mlxsw_sp_sample_receive() Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 10/11] mlxsw: spectrum: Report extra metadata to psample module Ido Schimmel
2021-03-14 12:19 ` [PATCH net-next 11/11] selftests: mlxsw: Add tc sample tests Ido Schimmel
2021-03-14 22:40 ` [PATCH net-next 00/11] psample: Add additional metadata attributes patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210314121940.2807621-9-idosch@idosch.org \
--to=idosch@idosch.org \
--cc=davem@davemloft.net \
--cc=idosch@nvidia.com \
--cc=jhs@mojatatu.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=neil.mckee@inmon.com \
--cc=netdev@vger.kernel.org \
--cc=peter.phaal@inmon.com \
--cc=roopa@nvidia.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yotam.gi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).