Hi Greg, I saw the compilation error for kernel 4.14.111 because `struct_size` isn't defined in kernel source tree. I didn't dig into it though.
Thanks, Yifeng On Fri, Apr 26, 2019 at 1:13 PM Gregory Rose <[email protected]> wrote: > > > On 4/26/2019 11:07 AM, Yifeng Sun wrote: > > CC: Greg Rose <[email protected]> > > Fixes: f72469405eec9 ("datapath: meter: Use struct_size() in kzalloc()") > > Signed-off-by: Yifeng Sun <[email protected]> > > --- > > acinclude.m4 | 2 ++ > > datapath/linux/compat/include/linux/overflow.h | 2 +- > > datapath/meter.c | 1 + > > 3 files changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/acinclude.m4 b/acinclude.m4 > > index 1607d5f4b1d9..548cbe9ef100 100644 > > --- a/acinclude.m4 > > +++ b/acinclude.m4 > > @@ -920,6 +920,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ > > [OVS_DEFINE([HAVE_INET_FRAGS_RND])]) > > OVS_GREP_IFELSE([$KSRC/include/linux/overflow.h], [__LINUX_OVERFLOW_H], > > [OVS_DEFINE([HAVE_OVERFLOW_H])]) > > + OVS_GREP_IFELSE([$KSRC/include/linux/overflow.h], [struct_size], > > + [OVS_DEFINE([HAVE_STRUCT_SIZE])]) > > OVS_GREP_IFELSE([$KSRC/include/linux/mm.h], [kvmalloc_array], > > [OVS_DEFINE([HAVE_KVMALLOC_ARRAY])]) > > OVS_GREP_IFELSE([$KSRC/include/linux/mm.h], [kvmalloc_node], > > diff --git a/datapath/linux/compat/include/linux/overflow.h > > b/datapath/linux/compat/include/linux/overflow.h > > index ff84356db16c..8f1b5b005491 100644 > > --- a/datapath/linux/compat/include/linux/overflow.h > > +++ b/datapath/linux/compat/include/linux/overflow.h > > @@ -1,5 +1,5 @@ > > /* SPDX-License-Identifier: GPL-2.0 OR MIT */ > > -#ifdef HAVE_OVERFLOW_H > > +#if defined(HAVE_OVERFLOW_H) && defined(HAVE_STRUCT_SIZE) > > #include_next <linux/overflow.h> > > #else > > #ifndef __LINUX_OVERFLOW_H > > diff --git a/datapath/meter.c b/datapath/meter.c > > index 51ec1495033a..eda14682fb96 100644 > > --- a/datapath/meter.c > > +++ b/datapath/meter.c > > @@ -13,6 +13,7 @@ > > #include <linux/ip.h> > > #include <linux/kernel.h> > > #include <linux/openvswitch.h> > > +#include <linux/overflow.h> > > #include <linux/netlink.h> > > #include <linux/rculist.h> > > > > Thanks for the patch Yifeng, it looks good but I'm curious because when > I posted the original patch for this it was passing travis build > checks. Or I thought so at the time. It bugs me if I missed something. > > In any case I'll give it a quick check and regression test. > > - Greg _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
