With kernel 4.18.0-477.x.y there was a compilation error:

/builddir/build/BUILD/openvswitch-2.17.3/_4.18.0-477.10.1.el8_8.x86_64/../datapath/linux/compat/include/linux/mm.h:13:21:
 error: redefinition of 'kvmalloc'
 static inline void *kvmalloc(size_t size, gfp_t flags)
                     ^~~~~~~~
In file included from ./include/linux/crypto.h:24,
                 from ./include/crypto/hash.h:16,
                 from ./include/linux/uio.h:16,
                 from ./include/linux/socket.h:8,
                 from ./include/linux/skbuff.h:23,
                 from 
/builddir/build/BUILD/openvswitch-2.17.3/_4.18.0-477.10.1.el8_8.x86_64/../datapath/linux/compat/include/linux/skbuff.h:17,
                 from 
/builddir/build/BUILD/openvswitch-2.17.3/_4.18.0-477.10.1.el8_8.x86_64/datapath/linux/actions.c:21:
./include/linux/slab.h:740:21: note: previous definition of 'kvmalloc' was here

This was introduced by upstream kernel commit [0].
This patch fixes this error adding a new path to searched functions to lookup.

0: 
https://lore.kernel.org/all/20211105203507.gvgl5bzmw%25a...@linux-foundation.org/

Signed-off-by: Vladislav Odintsov <odiv...@gmail.com>
---
 acinclude.m4 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index c981f90bc..bffbd1cef 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1179,9 +1179,15 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   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_DEFINE([HAVE_KVMALLOC_ARRAY])],
+                  [OVS_GREP_IFELSE([$KSRC/include/linux/slab.h],
+                                   [kvmalloc_array],
+                                   [OVS_DEFINE([HAVE_KVMALLOC_ARRAY])])])
   OVS_GREP_IFELSE([$KSRC/include/linux/mm.h], [kvmalloc_node],
-                  [OVS_DEFINE([HAVE_KVMALLOC_NODE])])
+                  [OVS_DEFINE([HAVE_KVMALLOC_NODE])],
+                  [OVS_GREP_IFELSE([$KSRC/include/linux/slab.h],
+                                   [kvmalloc_array],
+                                   [OVS_DEFINE([HAVE_KVMALLOC_ARRAY])])])
   OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h],
                   [nf_conntrack_l3proto],
                   [OVS_DEFINE([HAVE_NF_CONNTRACK_L3PROATO_H])])
-- 
2.30.0

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

Reply via email to