Re: [ovs-dev] [PATCH v2] datapath: Fix build errors for 4.9.172+ kernels

2019-05-24 Thread Yifeng Sun
Thanks Yi-Hung for the review.

4.9 kernel is using ip6frag_init instead of ip6_frag_init, so the
original change
is essential. Otherwise, there will be compiling errors:
https://travis-ci.org/yifsun/ovs-travis/builds/536900954

I will add /* HAVE_INET_FRAGS_RND */ and submit a new version.
Yifeng

On Fri, May 24, 2019 at 10:59 AM Yi-Hung Wei  wrote:
>
> On Thu, May 23, 2019 at 4:58 PM Yifeng Sun  wrote:
> >
> > 4.9.172+ kernel backported upstream patch 70b095c843266
> > ("ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module")
> > and this caused compilation errors of OVS kernel module.
> >
> > This patch fixes it by checking and using new functions
> > introduced by the upstream patch.
> >
> > Travis tests passed at
> > https://travis-ci.org/yifsun/ovs-travis/builds/536527230
> > with latest Linux kernel version.
> >
> > In addition, this patch doesn't introduce failed tests for latest kernels
> > of Ubuntu (bionic, trusty, xenial), fedora, centos 73, rhel (74, 75, 76).
> >
> > Reported-by: Ilya Maximets 
> > Signed-off-by: Yifeng Sun 
> > ---
> > v1->v2: Fixed at bug that crashes certain kernels. Thanks YiHung!
> >
> >  datapath/linux/compat/nf_conntrack_reasm.c | 23 ++-
> >  1 file changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/datapath/linux/compat/nf_conntrack_reasm.c 
> > b/datapath/linux/compat/nf_conntrack_reasm.c
> > index 9d77d982712c..23904eef08d7 100644
> > --- a/datapath/linux/compat/nf_conntrack_reasm.c
> > +++ b/datapath/linux/compat/nf_conntrack_reasm.c
> >  int rpl_nf_ct_frag6_init(void)
> >  {
> > int ret = 0;
> > @@ -683,10 +698,16 @@ int rpl_nf_ct_frag6_init(void)
> >  #ifdef HAVE_INET_FRAGS_RND
> > nf_frags.hashfn = nf_hashfn;
> > nf_frags.match = ip6_frag_match;
> > +   nf_frags.constructor = ip6_frag_init;
> > +#else
> > +#ifdef HAVE_IPV6_FRAG_H
> > +   nf_frags.rhash_params = nfct_rhash_params;
> > +   nf_frags.constructor = ip6frag_init;
> >  #else
> > nf_frags.rhash_params = ip6_rhash_params;
> > -#endif
> > nf_frags.constructor = ip6_frag_init;
> > +#endif
> > +#endif
>
> Hi Yifeng,
>
> Thanks for the update. Are we replicating "nf_frags.constructor =
> ip6_frag_init;" for the 3 cases?
>
> How about the following change?
>
>  int rpl_nf_ct_frag6_init(void)
>  {
> int ret = 0;
> @@ -684,8 +699,12 @@ int rpl_nf_ct_frag6_init(void)
> nf_frags.hashfn = nf_hashfn;
> nf_frags.match = ip6_frag_match;
>  #else
> +#ifdef HAVE_IPV6_FRAG_H
> +   nf_frags.rhash_params = nfct_rhash_params;
> +#else
> nf_frags.rhash_params = ip6_rhash_params;
>  #endif
> +#endif /* HAVE_INET_FRAGS_RND */
> nf_frags.constructor = ip6_frag_init;
>
> -Yi-Hung
>
> > nf_frags.destructor = NULL;
> > nf_frags.qsize = sizeof(struct frag_queue);
> > nf_frags.frag_expire = nf_ct_frag6_expire;
> > --
> > 2.7.4
> >
> > ___
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] datapath: Fix build errors for 4.9.172+ kernels

2019-05-24 Thread Yi-Hung Wei
On Thu, May 23, 2019 at 4:58 PM Yifeng Sun  wrote:
>
> 4.9.172+ kernel backported upstream patch 70b095c843266
> ("ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module")
> and this caused compilation errors of OVS kernel module.
>
> This patch fixes it by checking and using new functions
> introduced by the upstream patch.
>
> Travis tests passed at
> https://travis-ci.org/yifsun/ovs-travis/builds/536527230
> with latest Linux kernel version.
>
> In addition, this patch doesn't introduce failed tests for latest kernels
> of Ubuntu (bionic, trusty, xenial), fedora, centos 73, rhel (74, 75, 76).
>
> Reported-by: Ilya Maximets 
> Signed-off-by: Yifeng Sun 
> ---
> v1->v2: Fixed at bug that crashes certain kernels. Thanks YiHung!
>
>  datapath/linux/compat/nf_conntrack_reasm.c | 23 ++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/datapath/linux/compat/nf_conntrack_reasm.c 
> b/datapath/linux/compat/nf_conntrack_reasm.c
> index 9d77d982712c..23904eef08d7 100644
> --- a/datapath/linux/compat/nf_conntrack_reasm.c
> +++ b/datapath/linux/compat/nf_conntrack_reasm.c
>  int rpl_nf_ct_frag6_init(void)
>  {
> int ret = 0;
> @@ -683,10 +698,16 @@ int rpl_nf_ct_frag6_init(void)
>  #ifdef HAVE_INET_FRAGS_RND
> nf_frags.hashfn = nf_hashfn;
> nf_frags.match = ip6_frag_match;
> +   nf_frags.constructor = ip6_frag_init;
> +#else
> +#ifdef HAVE_IPV6_FRAG_H
> +   nf_frags.rhash_params = nfct_rhash_params;
> +   nf_frags.constructor = ip6frag_init;
>  #else
> nf_frags.rhash_params = ip6_rhash_params;
> -#endif
> nf_frags.constructor = ip6_frag_init;
> +#endif
> +#endif

Hi Yifeng,

Thanks for the update. Are we replicating "nf_frags.constructor =
ip6_frag_init;" for the 3 cases?

How about the following change?

 int rpl_nf_ct_frag6_init(void)
 {
int ret = 0;
@@ -684,8 +699,12 @@ int rpl_nf_ct_frag6_init(void)
nf_frags.hashfn = nf_hashfn;
nf_frags.match = ip6_frag_match;
 #else
+#ifdef HAVE_IPV6_FRAG_H
+   nf_frags.rhash_params = nfct_rhash_params;
+#else
nf_frags.rhash_params = ip6_rhash_params;
 #endif
+#endif /* HAVE_INET_FRAGS_RND */
nf_frags.constructor = ip6_frag_init;

-Yi-Hung

> nf_frags.destructor = NULL;
> nf_frags.qsize = sizeof(struct frag_queue);
> nf_frags.frag_expire = nf_ct_frag6_expire;
> --
> 2.7.4
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] datapath: Fix build errors for 4.9.172+ kernels

2019-05-23 Thread Yifeng Sun
4.9.172+ kernel backported upstream patch 70b095c843266
("ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module")
and this caused compilation errors of OVS kernel module.

This patch fixes it by checking and using new functions
introduced by the upstream patch.

Travis tests passed at
https://travis-ci.org/yifsun/ovs-travis/builds/536527230
with latest Linux kernel version.

In addition, this patch doesn't introduce failed tests for latest kernels
of Ubuntu (bionic, trusty, xenial), fedora, centos 73, rhel (74, 75, 76).

Reported-by: Ilya Maximets 
Signed-off-by: Yifeng Sun 
---
v1->v2: Fixed at bug that crashes certain kernels. Thanks YiHung!

 datapath/linux/compat/nf_conntrack_reasm.c | 23 ++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/datapath/linux/compat/nf_conntrack_reasm.c 
b/datapath/linux/compat/nf_conntrack_reasm.c
index 9d77d982712c..23904eef08d7 100644
--- a/datapath/linux/compat/nf_conntrack_reasm.c
+++ b/datapath/linux/compat/nf_conntrack_reasm.c
@@ -41,6 +41,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -138,8 +139,12 @@ static void nf_ct_frag6_expire(unsigned long data)
 #ifdef HAVE_INET_FRAGS_RND
ip6_expire_frag_queue(net, fq, _frags);
 #else
+#ifdef HAVE_IPV6_FRAG_H
+   ip6frag_expire_frag_queue(net, fq);
+#else
ip6_expire_frag_queue(net, fq);
 #endif
+#endif
 }
 
 #ifdef HAVE_INET_FRAGS_RND
@@ -673,6 +678,16 @@ static struct pernet_operations nf_ct_net_ops = {
.exit = nf_ct_net_exit,
 };
 
+#ifdef HAVE_IPV6_FRAG_H
+static const struct rhashtable_params nfct_rhash_params = {
+   .head_offset= offsetof(struct inet_frag_queue, node),
+   .hashfn = ip6frag_key_hashfn,
+   .obj_hashfn = ip6frag_obj_hashfn,
+   .obj_cmpfn  = ip6frag_obj_cmpfn,
+   .automatic_shrinking= true,
+};
+#endif
+
 int rpl_nf_ct_frag6_init(void)
 {
int ret = 0;
@@ -683,10 +698,16 @@ int rpl_nf_ct_frag6_init(void)
 #ifdef HAVE_INET_FRAGS_RND
nf_frags.hashfn = nf_hashfn;
nf_frags.match = ip6_frag_match;
+   nf_frags.constructor = ip6_frag_init;
+#else
+#ifdef HAVE_IPV6_FRAG_H
+   nf_frags.rhash_params = nfct_rhash_params;
+   nf_frags.constructor = ip6frag_init;
 #else
nf_frags.rhash_params = ip6_rhash_params;
-#endif
nf_frags.constructor = ip6_frag_init;
+#endif
+#endif
nf_frags.destructor = NULL;
nf_frags.qsize = sizeof(struct frag_queue);
nf_frags.frag_expire = nf_ct_frag6_expire;
-- 
2.7.4

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev