diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2025-10-29 17:32:57 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-11-03 17:40:47 -0800 |
| commit | bc7ebc569e8cc768342dfb01af1a26c7fbef513e (patch) | |
| tree | 9a1075bcaac24e992d9c5b9462b1ae67e95c493f /net/mpls/mpls_iptunnel.c | |
| parent | d8f9581e1b7f1fe2e1ac985f4ea508d044c90733 (diff) | |
mpls: Use in6_dev_rcu() and dev_net_rcu() in mpls_forward() and mpls_xmit().
mpls_forward() and mpls_xmit() are called under RCU.
Let's use in6_dev_rcu() and dev_net_rcu() there to annotate
as such.
Now we pass net to mpls_stats_inc_outucastpkts() not to read
dev_net_rcu() twice.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/20251029173344.2934622-6-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mpls/mpls_iptunnel.c')
| -rw-r--r-- | net/mpls/mpls_iptunnel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mpls/mpls_iptunnel.c b/net/mpls/mpls_iptunnel.c index 6e73da94af7f..cfbab7b2fec7 100644 --- a/net/mpls/mpls_iptunnel.c +++ b/net/mpls/mpls_iptunnel.c @@ -53,7 +53,7 @@ static int mpls_xmit(struct sk_buff *skb) /* Find the output device */ out_dev = dst->dev; - net = dev_net(out_dev); + net = dev_net_rcu(out_dev); if (!mpls_output_possible(out_dev) || !dst->lwtstate || skb_warn_if_lro(skb)) @@ -128,7 +128,7 @@ static int mpls_xmit(struct sk_buff *skb) bos = false; } - mpls_stats_inc_outucastpkts(out_dev, skb); + mpls_stats_inc_outucastpkts(net, out_dev, skb); if (rt) { if (rt->rt_gw_family == AF_INET6) |