diff mbox series

[ovs-dev] compat: Fix ipv6_dst_lookup build error

Message ID 1588195550-42566-1-git-send-email-yihung.wei@gmail.com
State Accepted
Commit 5519e384f6a17f564fef4c5eb39e471e16c77235
Headers show
Series [ovs-dev] compat: Fix ipv6_dst_lookup build error | expand

Commit Message

Yi-Hung Wei April 29, 2020, 9:25 p.m. UTC
The geneve/vxlan compat code base invokes ipv6_dst_lookup() which is
recently replaced by ipv6_dst_lookup_flow() in the stable kernel tree.

This causes travis build failure:
    * https://travis-ci.org/github/openvswitch/ovs/builds/681084038

This patch updates the backport logic to invoke the right function.

Related patch in
    git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

b9f3e457098e ("net: ipv6_stub: use ip6_dst_lookup_flow instead of
               ip6_dst_lookup")

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
---
Travis test: https://travis-ci.org/github/YiHungWei/ovs/builds/681179784
---
 acinclude.m4                   |  3 +++
 datapath/linux/compat/geneve.c | 11 +++++++----
 datapath/linux/compat/vxlan.c  | 14 ++++++++------
 3 files changed, 18 insertions(+), 10 deletions(-)

Comments

William Tu April 30, 2020, 12:53 a.m. UTC | #1
On Wed, Apr 29, 2020 at 2:41 PM Yi-Hung Wei <yihung.wei@gmail.com> wrote:
>
> The geneve/vxlan compat code base invokes ipv6_dst_lookup() which is
> recently replaced by ipv6_dst_lookup_flow() in the stable kernel tree.
>
> This causes travis build failure:
>     * https://travis-ci.org/github/openvswitch/ovs/builds/681084038
>
> This patch updates the backport logic to invoke the right function.
>
> Related patch in
>     git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
>
> b9f3e457098e ("net: ipv6_stub: use ip6_dst_lookup_flow instead of
>                ip6_dst_lookup")
>
> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
> ---
Looks good to me, thanks for fixing the issue.
CC Greg to see if he has more comments.

William

> Travis test: https://travis-ci.org/github/YiHungWei/ovs/builds/681179784
> ---
>  acinclude.m4                   |  3 +++
>  datapath/linux/compat/geneve.c | 11 +++++++----
>  datapath/linux/compat/vxlan.c  | 14 ++++++++------
>  3 files changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index 0e90c333211e..dabbffd01cf7 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -589,7 +589,10 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
>
>    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],
> +                  [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_FLOW_NET])])
>    OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
> +  OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup_flow])
>
>    OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [ERR_CAST])
>    OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [IS_ERR_OR_NULL])
> diff --git a/datapath/linux/compat/geneve.c b/datapath/linux/compat/geneve.c
> index 1551a37217ec..7bfc6d8822e5 100644
> --- a/datapath/linux/compat/geneve.c
> +++ b/datapath/linux/compat/geneve.c
> @@ -962,15 +962,18 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
>                         return dst;
>         }
>
> -#ifdef HAVE_IPV6_DST_LOOKUP_NET
> +#if 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)
> +       if (ipv6_stub->ipv6_dst_lookup_flow(gs6->sock->sk, &dst, fl6)) {
> +#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
>         if (ipv6_stub->ipv6_dst_lookup(geneve->net, gs6->sock->sk, &dst, fl6)) {
> -#else
> -#ifdef HAVE_IPV6_STUB
> +#elif defined(HAVE_IPV6_STUB)
>         if (ipv6_stub->ipv6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
>  #else
>         if (ip6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
>  #endif
> -#endif
>                 netdev_dbg(dev, "no route to %pI6\n", &fl6->daddr);
>                 return ERR_PTR(-ENETUNREACH);
>         }
> diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
> index f8f667e9748b..b334870b768e 100644
> --- a/datapath/linux/compat/vxlan.c
> +++ b/datapath/linux/compat/vxlan.c
> @@ -990,18 +990,20 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
>         fl6.fl6_dport = dport;
>         fl6.fl6_sport = sport;
>
> -#ifdef HAVE_IPV6_DST_LOOKUP_NET
> -       err = ipv6_stub->ipv6_dst_lookup(vxlan->net,
> -                                        sock6->sock->sk,
> +#if 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)
> +       err = ipv6_stub->ipv6_dst_lookup_flow(sock6->sock->sk, &ndst, &fl6);
> +#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
> +       err = ipv6_stub->ipv6_dst_lookup(vxlan->net, sock6->sock->sk,
>                                          &ndst, &fl6);
> -#else
> -#ifdef HAVE_IPV6_STUB
> +#elif defined(HAVE_IPV6_STUB)
>         err = ipv6_stub->ipv6_dst_lookup(vxlan->vn6_sock->sock->sk,
>                                          &ndst, &fl6);
>  #else
>         err = ip6_dst_lookup(vxlan->vn6_sock->sock->sk, &ndst, &fl6);
>  #endif
> -#endif
>         if (err < 0)
>                 return ERR_PTR(err);
>
> --
> 2.7.4
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Gregory Rose April 30, 2020, 5:36 p.m. UTC | #2
On 4/29/2020 5:53 PM, William Tu wrote:
> On Wed, Apr 29, 2020 at 2:41 PM Yi-Hung Wei <yihung.wei@gmail.com> wrote:
>>
>> The geneve/vxlan compat code base invokes ipv6_dst_lookup() which is
>> recently replaced by ipv6_dst_lookup_flow() in the stable kernel tree.
>>
>> This causes travis build failure:
>>      * https://travis-ci.org/github/openvswitch/ovs/builds/681084038
>>
>> This patch updates the backport logic to invoke the right function.
>>
>> Related patch in
>>      git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
>>
>> b9f3e457098e ("net: ipv6_stub: use ip6_dst_lookup_flow instead of
>>                 ip6_dst_lookup")
>>
>> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
>> ---
> Looks good to me, thanks for fixing the issue.
> CC Greg to see if he has more comments.

A backport all the way to 3.16.  That's not often.

LGTM.  Thanks Yi-Hung!

> 
> William
> 
>> Travis test: https://travis-ci.org/github/YiHungWei/ovs/builds/681179784
>> ---
>>   acinclude.m4                   |  3 +++
>>   datapath/linux/compat/geneve.c | 11 +++++++----
>>   datapath/linux/compat/vxlan.c  | 14 ++++++++------
>>   3 files changed, 18 insertions(+), 10 deletions(-)
>>
>> diff --git a/acinclude.m4 b/acinclude.m4
>> index 0e90c333211e..dabbffd01cf7 100644
>> --- a/acinclude.m4
>> +++ b/acinclude.m4
>> @@ -589,7 +589,10 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
>>
>>     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],
>> +                  [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_FLOW_NET])])
>>     OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
>> +  OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup_flow])
>>
>>     OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [ERR_CAST])
>>     OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [IS_ERR_OR_NULL])
>> diff --git a/datapath/linux/compat/geneve.c b/datapath/linux/compat/geneve.c
>> index 1551a37217ec..7bfc6d8822e5 100644
>> --- a/datapath/linux/compat/geneve.c
>> +++ b/datapath/linux/compat/geneve.c
>> @@ -962,15 +962,18 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
>>                          return dst;
>>          }
>>
>> -#ifdef HAVE_IPV6_DST_LOOKUP_NET
>> +#if 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)
>> +       if (ipv6_stub->ipv6_dst_lookup_flow(gs6->sock->sk, &dst, fl6)) {
>> +#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
>>          if (ipv6_stub->ipv6_dst_lookup(geneve->net, gs6->sock->sk, &dst, fl6)) {
>> -#else
>> -#ifdef HAVE_IPV6_STUB
>> +#elif defined(HAVE_IPV6_STUB)
>>          if (ipv6_stub->ipv6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
>>   #else
>>          if (ip6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
>>   #endif
>> -#endif
>>                  netdev_dbg(dev, "no route to %pI6\n", &fl6->daddr);
>>                  return ERR_PTR(-ENETUNREACH);
>>          }
>> diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
>> index f8f667e9748b..b334870b768e 100644
>> --- a/datapath/linux/compat/vxlan.c
>> +++ b/datapath/linux/compat/vxlan.c
>> @@ -990,18 +990,20 @@ static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
>>          fl6.fl6_dport = dport;
>>          fl6.fl6_sport = sport;
>>
>> -#ifdef HAVE_IPV6_DST_LOOKUP_NET
>> -       err = ipv6_stub->ipv6_dst_lookup(vxlan->net,
>> -                                        sock6->sock->sk,
>> +#if 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)
>> +       err = ipv6_stub->ipv6_dst_lookup_flow(sock6->sock->sk, &ndst, &fl6);
>> +#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
>> +       err = ipv6_stub->ipv6_dst_lookup(vxlan->net, sock6->sock->sk,
>>                                           &ndst, &fl6);
>> -#else
>> -#ifdef HAVE_IPV6_STUB
>> +#elif defined(HAVE_IPV6_STUB)
>>          err = ipv6_stub->ipv6_dst_lookup(vxlan->vn6_sock->sock->sk,
>>                                           &ndst, &fl6);
>>   #else
>>          err = ip6_dst_lookup(vxlan->vn6_sock->sock->sk, &ndst, &fl6);
>>   #endif
>> -#endif
>>          if (err < 0)
>>                  return ERR_PTR(err);
>>
>> --
>> 2.7.4
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
William Tu April 30, 2020, 6:39 p.m. UTC | #3
On Thu, Apr 30, 2020 at 10:36:20AM -0700, Gregory Rose wrote:
> 
> 
> On 4/29/2020 5:53 PM, William Tu wrote:
> >On Wed, Apr 29, 2020 at 2:41 PM Yi-Hung Wei <yihung.wei@gmail.com> wrote:
> >>
> >>The geneve/vxlan compat code base invokes ipv6_dst_lookup() which is
> >>recently replaced by ipv6_dst_lookup_flow() in the stable kernel tree.
> >>
> >>This causes travis build failure:
> >>     * https://travis-ci.org/github/openvswitch/ovs/builds/681084038
> >>
> >>This patch updates the backport logic to invoke the right function.
> >>
> >>Related patch in
> >>     git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> >>
> >>b9f3e457098e ("net: ipv6_stub: use ip6_dst_lookup_flow instead of
> >>                ip6_dst_lookup")
> >>
> >>Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
> >>---
> >Looks good to me, thanks for fixing the issue.
> >CC Greg to see if he has more comments.
> 
> A backport all the way to 3.16.  That's not often.
> 
> LGTM.  Thanks Yi-Hung!

Applied to master, thanks.
William
diff mbox series

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index 0e90c333211e..dabbffd01cf7 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -589,7 +589,10 @@  AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
 
   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],
+                  [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_FLOW_NET])])
   OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
+  OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup_flow])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [ERR_CAST])
   OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [IS_ERR_OR_NULL])
diff --git a/datapath/linux/compat/geneve.c b/datapath/linux/compat/geneve.c
index 1551a37217ec..7bfc6d8822e5 100644
--- a/datapath/linux/compat/geneve.c
+++ b/datapath/linux/compat/geneve.c
@@ -962,15 +962,18 @@  static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
 			return dst;
 	}
 
-#ifdef HAVE_IPV6_DST_LOOKUP_NET
+#if 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)
+	if (ipv6_stub->ipv6_dst_lookup_flow(gs6->sock->sk, &dst, fl6)) {
+#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
 	if (ipv6_stub->ipv6_dst_lookup(geneve->net, gs6->sock->sk, &dst, fl6)) {
-#else
-#ifdef HAVE_IPV6_STUB
+#elif defined(HAVE_IPV6_STUB)
 	if (ipv6_stub->ipv6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
 #else
 	if (ip6_dst_lookup(gs6->sock->sk, &dst, fl6)) {
 #endif
-#endif
 		netdev_dbg(dev, "no route to %pI6\n", &fl6->daddr);
 		return ERR_PTR(-ENETUNREACH);
 	}
diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
index f8f667e9748b..b334870b768e 100644
--- a/datapath/linux/compat/vxlan.c
+++ b/datapath/linux/compat/vxlan.c
@@ -990,18 +990,20 @@  static struct dst_entry *vxlan6_get_route(struct vxlan_dev *vxlan,
 	fl6.fl6_dport = dport;
 	fl6.fl6_sport = sport;
 
-#ifdef HAVE_IPV6_DST_LOOKUP_NET
-	err = ipv6_stub->ipv6_dst_lookup(vxlan->net,
-					 sock6->sock->sk,
+#if 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)
+	err = ipv6_stub->ipv6_dst_lookup_flow(sock6->sock->sk, &ndst, &fl6);
+#elif defined(HAVE_IPV6_DST_LOOKUP_NET)
+	err = ipv6_stub->ipv6_dst_lookup(vxlan->net, sock6->sock->sk,
 					 &ndst, &fl6);
-#else
-#ifdef HAVE_IPV6_STUB
+#elif defined(HAVE_IPV6_STUB)
 	err = ipv6_stub->ipv6_dst_lookup(vxlan->vn6_sock->sock->sk,
 					 &ndst, &fl6);
 #else
 	err = ip6_dst_lookup(vxlan->vn6_sock->sock->sk, &ndst, &fl6);
 #endif
-#endif
 	if (err < 0)
 		return ERR_PTR(err);