diff mbox series

[ovs-dev] compat: Backport ipv6_stub change

Message ID 1590098043-9304-1-git-send-email-gvrose8192@gmail.com
State Accepted
Commit 33f9c873b19a4993183e0c29a76a114646ca2977
Headers show
Series [ovs-dev] compat: Backport ipv6_stub change | expand

Commit Message

Gregory Rose May 21, 2020, 9:54 p.m. UTC
A patch backported to the Linux stable 4.14 tree and present in the
latest stable 4.14.181 kernel breaks ipv6_stub usage.

The commit is
8ab8786f78c3 ("net ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup").

Create the compat layer define to check for it and fixup usage in vxlan
and geneve modules.

Passes Travis here:
https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/689798733

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 acinclude.m4                   |  2 ++
 datapath/linux/compat/geneve.c | 11 ++++++++++-
 datapath/linux/compat/vxlan.c  | 18 +++++++++++++++++-
 3 files changed, 29 insertions(+), 2 deletions(-)

Comments

William Tu May 24, 2020, 5:59 p.m. UTC | #1
On Thu, May 21, 2020 at 02:54:03PM -0700, Greg Rose wrote:
> A patch backported to the Linux stable 4.14 tree and present in the
> latest stable 4.14.181 kernel breaks ipv6_stub usage.
> 
> The commit is
> 8ab8786f78c3 ("net ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup").
> 
> Create the compat layer define to check for it and fixup usage in vxlan
> and geneve modules.
> 
> Passes Travis here:
> https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/689798733
> 
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Thanks for fixing the travis failure.
Applied to master.
William
Ilya Maximets May 25, 2020, 5:01 p.m. UTC | #2
On 5/24/20 7:59 PM, William Tu wrote:
> On Thu, May 21, 2020 at 02:54:03PM -0700, Greg Rose wrote:
>> A patch backported to the Linux stable 4.14 tree and present in the
>> latest stable 4.14.181 kernel breaks ipv6_stub usage.
>>
>> The commit is
>> 8ab8786f78c3 ("net ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup").
>>
>> Create the compat layer define to check for it and fixup usage in vxlan
>> and geneve modules.
>>
>> Passes Travis here:
>> https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/689798733
>>
>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> Thanks for fixing the travis failure.
> Applied to master.
> William

We need to backport this to 2.13 to avoid TravisCI failure on this branch.

Best regards, Ilya Maximets.
Ilya Maximets May 25, 2020, 5:49 p.m. UTC | #3
On 5/25/20 7:01 PM, Ilya Maximets wrote:
> On 5/24/20 7:59 PM, William Tu wrote:
>> On Thu, May 21, 2020 at 02:54:03PM -0700, Greg Rose wrote:
>>> A patch backported to the Linux stable 4.14 tree and present in the
>>> latest stable 4.14.181 kernel breaks ipv6_stub usage.
>>>
>>> The commit is
>>> 8ab8786f78c3 ("net ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup").
>>>
>>> Create the compat layer define to check for it and fixup usage in vxlan
>>> and geneve modules.
>>>
>>> Passes Travis here:
>>> https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/689798733
>>>
>>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>> Thanks for fixing the travis failure.
>> Applied to master.
>> William
> 
> We need to backport this to 2.13 to avoid TravisCI failure on this branch.

And 2.12.
William Tu May 26, 2020, 1:24 p.m. UTC | #4
On Mon, May 25, 2020 at 10:50 AM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> On 5/25/20 7:01 PM, Ilya Maximets wrote:
> > On 5/24/20 7:59 PM, William Tu wrote:
> >> On Thu, May 21, 2020 at 02:54:03PM -0700, Greg Rose wrote:
> >>> A patch backported to the Linux stable 4.14 tree and present in the
> >>> latest stable 4.14.181 kernel breaks ipv6_stub usage.
> >>>
> >>> The commit is
> >>> 8ab8786f78c3 ("net ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup").
> >>>
> >>> Create the compat layer define to check for it and fixup usage in vxlan
> >>> and geneve modules.
> >>>
> >>> Passes Travis here:
> >>> https://travis-ci.org/github/gvrose8192/ovs-experimental/builds/689798733
> >>>
> >>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> >> Thanks for fixing the travis failure.
> >> Applied to master.
> >> William
> >
> > We need to backport this to 2.13 to avoid TravisCI failure on this branch.
>
> And 2.12.
>
Done! Thank you.
William
diff mbox series

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index dabbffd..3b0eea0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -587,6 +587,8 @@  AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/net/ip6_fib.h], [rt6_get_cookie],
                   [OVS_DEFINE([HAVE_RT6_GET_COOKIE])])
 
+  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub],
+                        [dst_entry])
   OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup.*net],
                   [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_NET])])
   OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup_flow.*net],
diff --git a/datapath/linux/compat/geneve.c b/datapath/linux/compat/geneve.c
index 7bfc6d8..02c6403 100644
--- a/datapath/linux/compat/geneve.c
+++ b/datapath/linux/compat/geneve.c
@@ -962,7 +962,16 @@  static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
 			return dst;
 	}
 
-#if defined(HAVE_IPV6_DST_LOOKUP_FLOW_NET)
+#if defined(HAVE_IPV6_STUB_WITH_DST_ENTRY) && defined(HAVE_IPV6_DST_LOOKUP_FLOW)
+#ifdef HAVE_IPV6_DST_LOOKUP_FLOW_NET
+	dst = ipv6_stub->ipv6_dst_lookup_flow(geneve->net, gs6->sock->sk, fl6,
+					      NULL);
+#else
+	dst = ipv6_stub->ipv6_dst_lookup_flow(gs6->sock->sk, fl6,
+					      NULL);
+#endif
+	if (IS_ERR(dst)) {
+#elif defined(HAVE_IPV6_DST_LOOKUP_FLOW_NET)
 	if (ipv6_stub->ipv6_dst_lookup_flow(geneve->net, gs6->sock->sk, &dst,
                                             fl6)) {
 #elif defined(HAVE_IPV6_DST_LOOKUP_FLOW)
diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
index b334870..e65d955 100644
--- a/datapath/linux/compat/vxlan.c
+++ b/datapath/linux/compat/vxlan.c
@@ -967,7 +967,10 @@  static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
 	bool use_cache = (dst_cache && ip_tunnel_dst_cache_usable(skb, info));
 	struct dst_entry *ndst;
 	struct flowi6 fl6;
+#if !defined(HAVE_IPV6_STUB_WITH_DST_ENTRY) || \
+    !defined(HAVE_IPV6_DST_LOOKUP_FLOW)
 	int err;
+#endif
 
 	if (!sock6)
 		return ERR_PTR(-EIO);
@@ -990,7 +993,15 @@  static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
 	fl6.fl6_dport = dport;
 	fl6.fl6_sport = sport;
 
-#if defined(HAVE_IPV6_DST_LOOKUP_FLOW_NET)
+#if defined(HAVE_IPV6_STUB_WITH_DST_ENTRY) && defined(HAVE_IPV6_DST_LOOKUP_FLOW)
+#ifdef HAVE_IPV6_DST_LOOKUP_FLOW_NET
+	ndst = ipv6_stub->ipv6_dst_lookup_flow(vxlan->net, sock6->sock->sk,
+					       &fl6, NULL);
+#else
+	ndst = ipv6_stub->ipv6_dst_lookup_flow(sock6->sock->sk, &fl6, NULL);
+#endif
+	if (unlikely(IS_ERR(ndst))) {
+#elif defined(HAVE_IPV6_DST_LOOKUP_FLOW_NET)
 	err = ipv6_stub->ipv6_dst_lookup_flow(vxlan->net, sock6->sock->sk,
 					      &ndst, &fl6);
 #elif defined(HAVE_IPV6_DST_LOOKUP_FLOW)
@@ -1004,8 +1015,13 @@  static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
 #else
 	err = ip6_dst_lookup(vxlan->vn6_sock->sock->sk, &ndst, &fl6);
 #endif
+#if defined(HAVE_IPV6_STUB_WITH_DST_ENTRY) && defined(HAVE_IPV6_DST_LOOKUP_FLOW)
+		return ERR_PTR(-ENETUNREACH);
+	}
+#else
 	if (err < 0)
 		return ERR_PTR(err);
+#endif
 
 	*saddr = fl6.saddr;
 	if (use_cache)