From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hajime Tazaki Subject: Re: [PATCH net-next] net: Fix vti use case with oif in dst lookups for IPv6 Date: Tue, 20 Oct 2015 21:31:28 +0900 Message-ID: References: <1444055571-82546-1-git-send-email-dsa@cumulusnetworks.com> <20151009071710.GJ7701@secunet.com> <5617F908.8060807@cumulusnetworks.com> <561A64B4.5080301@cumulusnetworks.com> <561AA3FA.7070001@cumulusnetworks.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: steffen.klassert@secunet.com, netdev@vger.kernel.org To: dsa@cumulusnetworks.com Return-path: Received: from mail-pa0-f54.google.com ([209.85.220.54]:35087 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750996AbbJTMbf (ORCPT ); Tue, 20 Oct 2015 08:31:35 -0400 Received: by pasz6 with SMTP id z6so20638012pas.2 for ; Tue, 20 Oct 2015 05:31:34 -0700 (PDT) In-Reply-To: <561AA3FA.7070001@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org List-ID: Hello David, sorry for the delay. At Sun, 11 Oct 2015 12:01:30 -0600, David Ahern wrote: > > On 10/11/15 8:24 AM, Hajime Tazaki wrote: > > > > I've faced this issue since the following patch was applied. > > > > commit 741a11d9e4103a8e1c590ef1280143fe654e4e33 > > Author: David Ahern > > Date: Mon Sep 28 10:12:13 2015 -0700 > > > > net: ipv6: Add RT6_LOOKUP_F_IFACE flag if oif is set > > > > I still couldn't spot which part (other than my posted call > > graph) is broken and am not sure whether the xfrm change > > affects or not (which I need to check the mip6 code again). > > Ok, this is a separate problem from what Steffen is hitting. agree. > > > >> Can you apply this patch, and then run: > >> > >> perf record -e fib6:* -a -g > >> perf script > > > > I'm using libos environment right now, so the perf trace > > can't be used as it is. > > ok. > > Some path in raw6_sendmsg is setting fl6.flowi6_oif. Can you instrument it? yes, this sendmsg uses non-zero flowi6_oif. the conditions are - sendmsg () with INET6/RAW socket (with IPPROTO_MH) - ip6_pktinfo.ipi6_addr (fl6.saddr) and ipi6_oif (fl6.flowi6_oif) are non-NULL. => ipi6_addr (fl6.saddr) is not the IP address of oif, but another interfaces (home address of mip6) - fib6_lookup() (in ip6_pol_route()) gives ip6_null_entry if RT6_LOOKUP_F_IFACE isn't set at ip6_route_output, it can look for a proper dst_entry of default route if not, it gives EINVAL. I'm sure that this is not the right fix for this issue, but the following patch solves my situation. diff --git a/net/ipv6/route.c b/net/ipv6/route.c index df24cff4a0cb..02e86989b3cb 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1079,6 +1079,12 @@ redo_rt6_select: fn = fib6_backtrack(fn, &fl6->saddr); if (fn) goto redo_rt6_select; + else if (strict & RT6_LOOKUP_F_IFACE) { + /* also consider non-interface route */ + strict &= ~RT6_LOOKUP_F_IFACE; + fn = saved_fn; + goto redo_rt6_select; + } else if (strict & RT6_LOOKUP_F_REACHABLE) { /* also consider unreachable route */ strict &= ~RT6_LOOKUP_F_REACHABLE; I'm trying to create a minimum reproducible code and spot the issue but not get it yet. let me know if you find any good idea. -- Hajime