diff mbox series

[v1,net-next] ipv6: rpl: Remove redundant skb_dst_drop().

Message ID 20230710213511.5364-1-kuniyu@amazon.com (mailing list archive)
State Accepted
Commit c5ec13e38af5527f69f647c46ce15ebaa6b35e6c
Delegated to: Netdev Maintainers
Headers show
Series [v1,net-next] ipv6: rpl: Remove redundant skb_dst_drop(). | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1341 this patch: 1341
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 1364 this patch: 1364
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1364 this patch: 1364
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 23 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Kuniyuki Iwashima July 10, 2023, 9:35 p.m. UTC
RPL code has a pattern where skb_dst_drop() is called before
ip6_route_input().

However, ip6_route_input() calls skb_dst_drop() internally,
so we need not call skb_dst_drop() before ip6_route_input().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
---
 net/ipv6/exthdrs.c      | 2 --
 net/ipv6/rpl_iptunnel.c | 3 +--
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

Simon Horman July 12, 2023, 11:39 a.m. UTC | #1
On Mon, Jul 10, 2023 at 02:35:11PM -0700, Kuniyuki Iwashima wrote:
> RPL code has a pattern where skb_dst_drop() is called before
> ip6_route_input().
> 
> However, ip6_route_input() calls skb_dst_drop() internally,
> so we need not call skb_dst_drop() before ip6_route_input().
> 
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
David Ahern July 12, 2023, 2:42 p.m. UTC | #2
On 7/12/23 5:39 AM, Simon Horman wrote:
> On Mon, Jul 10, 2023 at 02:35:11PM -0700, Kuniyuki Iwashima wrote:
>> RPL code has a pattern where skb_dst_drop() is called before
>> ip6_route_input().
>>
>> However, ip6_route_input() calls skb_dst_drop() internally,
>> so we need not call skb_dst_drop() before ip6_route_input().
>>
>> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> 
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> 

I have been ignoring net-next patches since net-next status still shows
as closed.
David Ahern July 12, 2023, 2:54 p.m. UTC | #3
On 7/12/23 8:42 AM, David Ahern wrote:
> On 7/12/23 5:39 AM, Simon Horman wrote:
>> On Mon, Jul 10, 2023 at 02:35:11PM -0700, Kuniyuki Iwashima wrote:
>>> RPL code has a pattern where skb_dst_drop() is called before
>>> ip6_route_input().
>>>
>>> However, ip6_route_input() calls skb_dst_drop() internally,
>>> so we need not call skb_dst_drop() before ip6_route_input().
>>>
>>> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
>>
>> Reviewed-by: Simon Horman <simon.horman@corigine.com>
>>
> 
> I have been ignoring net-next patches since net-next status still shows
> as closed.

I was shown the error of my ways (i.e., pointed to the new URL for
net-next status)

Reviewed-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org July 13, 2023, 12:20 a.m. UTC | #4
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 10 Jul 2023 14:35:11 -0700 you wrote:
> RPL code has a pattern where skb_dst_drop() is called before
> ip6_route_input().
> 
> However, ip6_route_input() calls skb_dst_drop() internally,
> so we need not call skb_dst_drop() before ip6_route_input().
> 
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> 
> [...]

Here is the summary with links:
  - [v1,net-next] ipv6: rpl: Remove redundant skb_dst_drop().
    https://git.kernel.org/netdev/net-next/c/c5ec13e38af5

You are awesome, thank you!
Simon Horman July 13, 2023, 8:53 a.m. UTC | #5
On Wed, Jul 12, 2023 at 08:42:27AM -0600, David Ahern wrote:
> On 7/12/23 5:39 AM, Simon Horman wrote:
> > On Mon, Jul 10, 2023 at 02:35:11PM -0700, Kuniyuki Iwashima wrote:
> >> RPL code has a pattern where skb_dst_drop() is called before
> >> ip6_route_input().
> >>
> >> However, ip6_route_input() calls skb_dst_drop() internally,
> >> so we need not call skb_dst_drop() before ip6_route_input().
> >>
> >> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> > 
> > Reviewed-by: Simon Horman <simon.horman@corigine.com>
> > 
> 
> I have been ignoring net-next patches since net-next status still shows
> as closed.

Yes, sorry that I may have been a bit hasty there.
diff mbox series

Patch

diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 202fc3aaa83c..f4bfccae003c 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -612,8 +612,6 @@  static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 
 	kfree(buf);
 
-	skb_dst_drop(skb);
-
 	ip6_route_input(skb);
 
 	if (skb_dst(skb)->error) {
diff --git a/net/ipv6/rpl_iptunnel.c b/net/ipv6/rpl_iptunnel.c
index b1c028df686e..a013b92cbb86 100644
--- a/net/ipv6/rpl_iptunnel.c
+++ b/net/ipv6/rpl_iptunnel.c
@@ -272,8 +272,6 @@  static int rpl_input(struct sk_buff *skb)
 	dst = dst_cache_get(&rlwt->cache);
 	preempt_enable();
 
-	skb_dst_drop(skb);
-
 	if (!dst) {
 		ip6_route_input(skb);
 		dst = skb_dst(skb);
@@ -284,6 +282,7 @@  static int rpl_input(struct sk_buff *skb)
 			preempt_enable();
 		}
 	} else {
+		skb_dst_drop(skb);
 		skb_dst_set(skb, dst);
 	}