ipv6: ip6_skb_dst_mtu() cleanups
Subsystems (3)
PATCH 1/1 ipv6: ip6_skb_dst_mtu() cleanups
From: Eric Dumazet <[email protected]>
Use const attribute where we can, and cache skb_dst()
Signed-off-by Eric Dumazet <[email protected]>
--- include/net/ip6_route.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
include/net/ip6_route.h +9 -9
@@ -263,19 +263,19 @@ static inline bool ipv6_anycast_destination(const struct dst_entry *dst,int ip6_fragment (struct net *net,struct sock *sk,struct sk_buff *skb,int (*output)(struct net *,struct sock *,struct sk_buff *)); -static inline unsigned int ip6_skb_dst_mtu (struct sk_buff *skb) +static inline unsigned int ip6_skb_dst_mtu (const struct sk_buff *skb) { -unsigned int mtu; - -struct ipv6_pinfo *np = skb->sk && !dev_recursion_level () ? +const struct ipv6_pinfo *np = skb->sk && !dev_recursion_level () ?inet6_sk (skb->sk) :NULL ; +const struct dst_entry *dst =skb_dst (skb); +unsigned int mtu;if (np && np->pmtudisc >=IPV6_PMTUDISC_PROBE ) { - mtu =READ_ONCE (skb_dst (skb)->dev->mtu); - mtu -=lwtunnel_headroom (skb_dst (skb)->lwtstate, mtu); - }else - mtu =dst_mtu (skb_dst (skb)); - + mtu =READ_ONCE (dst->dev->mtu); + mtu -=lwtunnel_headroom (dst->lwtstate, mtu); + }else { + mtu =dst_mtu (dst); + }return mtu; }
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 18 Nov 2021 18:23:55 -0800 you wrote:
From: Eric Dumazet <[email protected]>
Use const attribute where we can, and cache
skb_dst()Signed-off-by Eric Dumazet <[email protected]>--- include/net/ip6_route.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
Here is the summary with links:
- [net-next] ipv6: ip6_skb_dst_mtu() cleanups
https://git.kernel.org/netdev/net-next/c/8d22679dc89a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html