Message ID | 20191104094944.14678-1-roid@mellanox.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev,v2] compat: Add compat fix for old kernels | expand |
On Mon, Nov 04, 2019 at 11:49:44AM +0200, Roi Dayan wrote: > In kernels older than 4.8, struct tcf_t didn't have the firstuse. > If openvswitch is compiled with the compat pkt_cls.h then there is > a struct size mismatch between openvswitch and the kernel which cause > parsing netlink actions to fail. > After this commit parsing the netlink actions pass even if compiled with > the compat pkt_cls.h. > > Signed-off-by: Roi Dayan <roid@mellanox.com> > --- > > v1->v2: > - fix mix of tabs and spaces in acinclude.m4 Thanks, applied to master and branch-2.8 ... branch-2.12 > acinclude.m4 | 8 ++++++++ > include/linux/pkt_cls.h | 2 ++ > 2 files changed, 10 insertions(+) > > diff --git a/acinclude.m4 b/acinclude.m4 > index a0507cfe019e..1e699191bb8b 100644 > --- a/acinclude.m4 > +++ b/acinclude.m4 > @@ -186,6 +186,14 @@ AC_DEFUN([OVS_CHECK_LINUX_TC], [ > [Define to 1 if TCA_FLOWER_KEY_ENC_IP_TTL_MASK is available.])]) > > AC_COMPILE_IFELSE([ > + AC_LANG_PROGRAM([#include <linux/pkt_cls.h>], [ > + struct tcf_t x; > + x.firstuse = 1; > + ])], > + [AC_DEFINE([HAVE_TCF_T_FIRSTUSE], [1], > + [Define to 1 if struct tcf_t have firstuse.])]) > + > + AC_COMPILE_IFELSE([ > AC_LANG_PROGRAM([#include <linux/tc_act/tc_vlan.h>], [ > int x = TCA_VLAN_PUSH_VLAN_PRIORITY; > ])], > diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h > index 4adea59e7c36..b6926a79a0af 100644 > --- a/include/linux/pkt_cls.h > +++ b/include/linux/pkt_cls.h > @@ -64,7 +64,9 @@ struct tcf_t { > __u64 install; > __u64 lastuse; > __u64 expires; > +#ifdef HAVE_TCF_T_FIRSTUSE > __u64 firstuse; > +#endif > }; > > #define tc_gen \ > -- > 2.8.4 >
On 2019-11-11 3:39 PM, Simon Horman wrote: > On Mon, Nov 04, 2019 at 11:49:44AM +0200, Roi Dayan wrote: >> In kernels older than 4.8, struct tcf_t didn't have the firstuse. >> If openvswitch is compiled with the compat pkt_cls.h then there is >> a struct size mismatch between openvswitch and the kernel which cause >> parsing netlink actions to fail. >> After this commit parsing the netlink actions pass even if compiled with >> the compat pkt_cls.h. >> >> Signed-off-by: Roi Dayan <roid@mellanox.com> >> --- >> >> v1->v2: >> - fix mix of tabs and spaces in acinclude.m4 > > Thanks, applied to master and branch-2.8 ... branch-2.12 thanks! > >> acinclude.m4 | 8 ++++++++ >> include/linux/pkt_cls.h | 2 ++ >> 2 files changed, 10 insertions(+) >> >> diff --git a/acinclude.m4 b/acinclude.m4 >> index a0507cfe019e..1e699191bb8b 100644 >> --- a/acinclude.m4 >> +++ b/acinclude.m4 >> @@ -186,6 +186,14 @@ AC_DEFUN([OVS_CHECK_LINUX_TC], [ >> [Define to 1 if TCA_FLOWER_KEY_ENC_IP_TTL_MASK is available.])]) >> >> AC_COMPILE_IFELSE([ >> + AC_LANG_PROGRAM([#include <linux/pkt_cls.h>], [ >> + struct tcf_t x; >> + x.firstuse = 1; >> + ])], >> + [AC_DEFINE([HAVE_TCF_T_FIRSTUSE], [1], >> + [Define to 1 if struct tcf_t have firstuse.])]) >> + >> + AC_COMPILE_IFELSE([ >> AC_LANG_PROGRAM([#include <linux/tc_act/tc_vlan.h>], [ >> int x = TCA_VLAN_PUSH_VLAN_PRIORITY; >> ])], >> diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h >> index 4adea59e7c36..b6926a79a0af 100644 >> --- a/include/linux/pkt_cls.h >> +++ b/include/linux/pkt_cls.h >> @@ -64,7 +64,9 @@ struct tcf_t { >> __u64 install; >> __u64 lastuse; >> __u64 expires; >> +#ifdef HAVE_TCF_T_FIRSTUSE >> __u64 firstuse; >> +#endif >> }; >> >> #define tc_gen \ >> -- >> 2.8.4 >>
On 2019-11-11 4:08 PM, Roi Dayan wrote: > > > On 2019-11-11 3:39 PM, Simon Horman wrote: >> On Mon, Nov 04, 2019 at 11:49:44AM +0200, Roi Dayan wrote: >>> In kernels older than 4.8, struct tcf_t didn't have the firstuse. >>> If openvswitch is compiled with the compat pkt_cls.h then there is >>> a struct size mismatch between openvswitch and the kernel which cause >>> parsing netlink actions to fail. >>> After this commit parsing the netlink actions pass even if compiled with >>> the compat pkt_cls.h. >>> >>> Signed-off-by: Roi Dayan <roid@mellanox.com> >>> --- >>> >>> v1->v2: >>> - fix mix of tabs and spaces in acinclude.m4 >> >> Thanks, applied to master and branch-2.8 ... branch-2.12 > > thanks! > Hi Simon, sorry for the trouble but there is also v3 for this patch. it uses ac_check_member instead of ac_compile. is it possible to take v3 which is a lot cleaner? Thanks, Roi >> >>> acinclude.m4 | 8 ++++++++ >>> include/linux/pkt_cls.h | 2 ++ >>> 2 files changed, 10 insertions(+) >>> >>> diff --git a/acinclude.m4 b/acinclude.m4 >>> index a0507cfe019e..1e699191bb8b 100644 >>> --- a/acinclude.m4 >>> +++ b/acinclude.m4 >>> @@ -186,6 +186,14 @@ AC_DEFUN([OVS_CHECK_LINUX_TC], [ >>> [Define to 1 if TCA_FLOWER_KEY_ENC_IP_TTL_MASK is available.])]) >>> >>> AC_COMPILE_IFELSE([ >>> + AC_LANG_PROGRAM([#include <linux/pkt_cls.h>], [ >>> + struct tcf_t x; >>> + x.firstuse = 1; >>> + ])], >>> + [AC_DEFINE([HAVE_TCF_T_FIRSTUSE], [1], >>> + [Define to 1 if struct tcf_t have firstuse.])]) >>> + >>> + AC_COMPILE_IFELSE([ >>> AC_LANG_PROGRAM([#include <linux/tc_act/tc_vlan.h>], [ >>> int x = TCA_VLAN_PUSH_VLAN_PRIORITY; >>> ])], >>> diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h >>> index 4adea59e7c36..b6926a79a0af 100644 >>> --- a/include/linux/pkt_cls.h >>> +++ b/include/linux/pkt_cls.h >>> @@ -64,7 +64,9 @@ struct tcf_t { >>> __u64 install; >>> __u64 lastuse; >>> __u64 expires; >>> +#ifdef HAVE_TCF_T_FIRSTUSE >>> __u64 firstuse; >>> +#endif >>> }; >>> >>> #define tc_gen \ >>> -- >>> 2.8.4 >>>
On Mon, Nov 11, 2019 at 04:49:18PM +0000, Roi Dayan wrote: > > > On 2019-11-11 4:08 PM, Roi Dayan wrote: > > > > > > On 2019-11-11 3:39 PM, Simon Horman wrote: > >> On Mon, Nov 04, 2019 at 11:49:44AM +0200, Roi Dayan wrote: > >>> In kernels older than 4.8, struct tcf_t didn't have the firstuse. > >>> If openvswitch is compiled with the compat pkt_cls.h then there is > >>> a struct size mismatch between openvswitch and the kernel which cause > >>> parsing netlink actions to fail. > >>> After this commit parsing the netlink actions pass even if compiled with > >>> the compat pkt_cls.h. > >>> > >>> Signed-off-by: Roi Dayan <roid@mellanox.com> > >>> --- > >>> > >>> v1->v2: > >>> - fix mix of tabs and spaces in acinclude.m4 > >> > >> Thanks, applied to master and branch-2.8 ... branch-2.12 > > > > thanks! > > > > Hi Simon, > > sorry for the trouble but there is also v3 for this patch. > it uses ac_check_member instead of ac_compile. > is it possible to take v3 which is a lot cleaner? Sorry for the mix up, would it be possible to provide an incremental patch to upgrade master to v3?
On 2019-11-12 10:12 AM, Simon Horman wrote: > On Mon, Nov 11, 2019 at 04:49:18PM +0000, Roi Dayan wrote: >> >> >> On 2019-11-11 4:08 PM, Roi Dayan wrote: >>> >>> >>> On 2019-11-11 3:39 PM, Simon Horman wrote: >>>> On Mon, Nov 04, 2019 at 11:49:44AM +0200, Roi Dayan wrote: >>>>> In kernels older than 4.8, struct tcf_t didn't have the firstuse. >>>>> If openvswitch is compiled with the compat pkt_cls.h then there is >>>>> a struct size mismatch between openvswitch and the kernel which cause >>>>> parsing netlink actions to fail. >>>>> After this commit parsing the netlink actions pass even if compiled with >>>>> the compat pkt_cls.h. >>>>> >>>>> Signed-off-by: Roi Dayan <roid@mellanox.com> >>>>> --- >>>>> >>>>> v1->v2: >>>>> - fix mix of tabs and spaces in acinclude.m4 >>>> >>>> Thanks, applied to master and branch-2.8 ... branch-2.12 >>> >>> thanks! >>> >> >> Hi Simon, >> >> sorry for the trouble but there is also v3 for this patch. >> it uses ac_check_member instead of ac_compile. >> is it possible to take v3 which is a lot cleaner? > > Sorry for the mix up, > > would it be possible to provide an incremental patch > to upgrade master to v3? > sure. i'll do that.
On 2019-11-12 10:28 AM, Roi Dayan wrote: > > > On 2019-11-12 10:12 AM, Simon Horman wrote: >> On Mon, Nov 11, 2019 at 04:49:18PM +0000, Roi Dayan wrote: >>> >>> >>> On 2019-11-11 4:08 PM, Roi Dayan wrote: >>>> >>>> >>>> On 2019-11-11 3:39 PM, Simon Horman wrote: >>>>> On Mon, Nov 04, 2019 at 11:49:44AM +0200, Roi Dayan wrote: >>>>>> In kernels older than 4.8, struct tcf_t didn't have the firstuse. >>>>>> If openvswitch is compiled with the compat pkt_cls.h then there is >>>>>> a struct size mismatch between openvswitch and the kernel which cause >>>>>> parsing netlink actions to fail. >>>>>> After this commit parsing the netlink actions pass even if compiled with >>>>>> the compat pkt_cls.h. >>>>>> >>>>>> Signed-off-by: Roi Dayan <roid@mellanox.com> >>>>>> --- >>>>>> >>>>>> v1->v2: >>>>>> - fix mix of tabs and spaces in acinclude.m4 >>>>> >>>>> Thanks, applied to master and branch-2.8 ... branch-2.12 >>>> >>>> thanks! >>>> >>> >>> Hi Simon, >>> >>> sorry for the trouble but there is also v3 for this patch. >>> it uses ac_check_member instead of ac_compile. >>> is it possible to take v3 which is a lot cleaner? >> >> Sorry for the mix up, >> >> would it be possible to provide an incremental patch >> to upgrade master to v3? >> > > sure. i'll do that. > I see the actual merged patch is v3 so nothing to do. thanks again.
On Tue, Nov 12, 2019 at 08:33:02AM +0000, Roi Dayan wrote: > > > On 2019-11-12 10:28 AM, Roi Dayan wrote: > > > > > > On 2019-11-12 10:12 AM, Simon Horman wrote: > >> On Mon, Nov 11, 2019 at 04:49:18PM +0000, Roi Dayan wrote: > >>> > >>> > >>> On 2019-11-11 4:08 PM, Roi Dayan wrote: > >>>> > >>>> > >>>> On 2019-11-11 3:39 PM, Simon Horman wrote: > >>>>> On Mon, Nov 04, 2019 at 11:49:44AM +0200, Roi Dayan wrote: > >>>>>> In kernels older than 4.8, struct tcf_t didn't have the firstuse. > >>>>>> If openvswitch is compiled with the compat pkt_cls.h then there is > >>>>>> a struct size mismatch between openvswitch and the kernel which cause > >>>>>> parsing netlink actions to fail. > >>>>>> After this commit parsing the netlink actions pass even if compiled with > >>>>>> the compat pkt_cls.h. > >>>>>> > >>>>>> Signed-off-by: Roi Dayan <roid@mellanox.com> > >>>>>> --- > >>>>>> > >>>>>> v1->v2: > >>>>>> - fix mix of tabs and spaces in acinclude.m4 > >>>>> > >>>>> Thanks, applied to master and branch-2.8 ... branch-2.12 > >>>> > >>>> thanks! > >>>> > >>> > >>> Hi Simon, > >>> > >>> sorry for the trouble but there is also v3 for this patch. > >>> it uses ac_check_member instead of ac_compile. > >>> is it possible to take v3 which is a lot cleaner? > >> > >> Sorry for the mix up, > >> > >> would it be possible to provide an incremental patch > >> to upgrade master to v3? > >> > > > > sure. i'll do that. > > > > I see the actual merged patch is v3 so nothing to do. thanks again. Thanks, sorry again for the mix-up.
diff --git a/acinclude.m4 b/acinclude.m4 index a0507cfe019e..1e699191bb8b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -186,6 +186,14 @@ AC_DEFUN([OVS_CHECK_LINUX_TC], [ [Define to 1 if TCA_FLOWER_KEY_ENC_IP_TTL_MASK is available.])]) AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([#include <linux/pkt_cls.h>], [ + struct tcf_t x; + x.firstuse = 1; + ])], + [AC_DEFINE([HAVE_TCF_T_FIRSTUSE], [1], + [Define to 1 if struct tcf_t have firstuse.])]) + + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([#include <linux/tc_act/tc_vlan.h>], [ int x = TCA_VLAN_PUSH_VLAN_PRIORITY; ])], diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 4adea59e7c36..b6926a79a0af 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h @@ -64,7 +64,9 @@ struct tcf_t { __u64 install; __u64 lastuse; __u64 expires; +#ifdef HAVE_TCF_T_FIRSTUSE __u64 firstuse; +#endif }; #define tc_gen \
In kernels older than 4.8, struct tcf_t didn't have the firstuse. If openvswitch is compiled with the compat pkt_cls.h then there is a struct size mismatch between openvswitch and the kernel which cause parsing netlink actions to fail. After this commit parsing the netlink actions pass even if compiled with the compat pkt_cls.h. Signed-off-by: Roi Dayan <roid@mellanox.com> --- v1->v2: - fix mix of tabs and spaces in acinclude.m4 acinclude.m4 | 8 ++++++++ include/linux/pkt_cls.h | 2 ++ 2 files changed, 10 insertions(+)