[ovs-dev,ovn,3/4] configure: Remove checks that are unlikely to ever be of use to OVN.
diff mbox series

Message ID 20190925163400.1171-3-blp@ovn.org
State New
Headers show
Series
  • [ovs-dev,ovn,1/4] configure: Improve checks for OVS source and build directories.
Related show

Commit Message

Ben Pfaff Sept. 25, 2019, 4:33 p.m. UTC
OVN should not have its own kernel module, and so on, so these checks
aren't useful to it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 Makefile.am  |   7 -
 acinclude.m4 | 891 ---------------------------------------------------
 configure.ac |  10 +-
 m4/ovn.m4    |  46 ---
 4 files changed, 1 insertion(+), 953 deletions(-)

Patch
diff mbox series

diff --git a/Makefile.am b/Makefile.am
index 97dc309e3c5d..33c18c5d83c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,13 +52,6 @@  AM_CFLAGS = -Wstrict-prototypes
 AM_CFLAGS += $(WARNING_FLAGS)
 AM_CFLAGS += $(OVS_CFLAGS)
 
-if DPDK_NETDEV
-AM_CFLAGS += -D_FILE_OFFSET_BITS=64
-DPDKSTRIP_FLAGS = --dpdk
-else
-DPDKSTRIP_FLAGS = --nodpdk
-endif
-
 if NDEBUG
 AM_CPPFLAGS += -DNDEBUG
 AM_CFLAGS += -fomit-frame-pointer
diff --git a/acinclude.m4 b/acinclude.m4
index 6c3993e83b48..414deccabe2b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -42,897 +42,6 @@  AC_DEFUN([OVS_ENABLE_WERROR],
    fi
    AC_SUBST([SPARSE_WERROR])])
 
-dnl OVS_CHECK_LINUX
-dnl
-dnl Configure linux kernel source tree
-AC_DEFUN([OVS_CHECK_LINUX], [
-  AC_ARG_WITH([linux],
-              [AC_HELP_STRING([--with-linux=/path/to/linux],
-                              [Specify the Linux kernel build directory])])
-  AC_ARG_WITH([linux-source],
-              [AC_HELP_STRING([--with-linux-source=/path/to/linux-source],
-                              [Specify the Linux kernel source directory
-                               (usually figured out automatically from build
-                               directory)])])
-
-  # Deprecated equivalents to --with-linux, --with-linux-source.
-  AC_ARG_WITH([l26])
-  AC_ARG_WITH([l26-source])
-
-  if test X"$with_linux" != X; then
-    KBUILD=$with_linux
-  elif test X"$with_l26" != X; then
-    KBUILD=$with_l26
-    AC_MSG_WARN([--with-l26 is deprecated, please use --with-linux instead])
-  else
-    KBUILD=
-  fi
-
-  if test X"$KBUILD" != X; then
-    if test X"$with_linux_source" != X; then
-      KSRC=$with_linux_source
-    elif test X"$with_l26_source" != X; then
-      KSRC=$with_l26_source
-      AC_MSG_WARN([--with-l26-source is deprecated, please use --with-linux-source instead])
-    else
-      KSRC=
-    fi
-  elif test X"$with_linux_source" != X || test X"$with_l26_source" != X; then
-    AC_MSG_ERROR([Linux source directory may not be specified without Linux build directory])
-  fi
-
-  if test -n "$KBUILD"; then
-    KBUILD=`eval echo "$KBUILD"`
-    case $KBUILD in
-        /*) ;;
-        *) KBUILD=`pwd`/$KBUILD ;;
-    esac
-
-    # The build directory is what the user provided.
-    # Make sure that it exists.
-    AC_MSG_CHECKING([for Linux build directory])
-    if test -d "$KBUILD"; then
-        AC_MSG_RESULT([$KBUILD])
-        AC_SUBST(KBUILD)
-    else
-        AC_MSG_RESULT([no])
-        AC_ERROR([source dir $KBUILD doesn't exist])
-    fi
-
-    # Debian breaks kernel headers into "source" header and "build" headers.
-    # We want the source headers, but $KBUILD gives us the "build" headers.
-    # Use heuristics to find the source headers.
-    AC_MSG_CHECKING([for Linux source directory])
-    if test -n "$KSRC"; then
-      KSRC=`eval echo "$KSRC"`
-      case $KSRC in
-          /*) ;;
-          *) KSRC=`pwd`/$KSRC ;;
-      esac
-      if test ! -e $KSRC/include/linux/kernel.h; then
-        AC_MSG_ERROR([$KSRC is not a kernel source directory])
-      fi
-    else
-      KSRC=$KBUILD
-      if test ! -e $KSRC/include/linux/kernel.h; then
-        # Debian kernel build Makefiles tend to include a line of the form:
-        # MAKEARGS := -C /usr/src/linux-headers-3.2.0-1-common O=/usr/src/linux-headers-3.2.0-1-486
-        # First try to extract the source directory from this line.
-        KSRC=`sed -n 's/.*-C \([[^ ]]*\).*/\1/p' "$KBUILD"/Makefile`
-        if test ! -e "$KSRC"/include/linux/kernel.h; then
-          # Didn't work.  Fall back to name-based heuristics that used to work.
-          case `echo "$KBUILD" | sed 's,/*$,,'` in # (
-            */build)
-              KSRC=`echo "$KBUILD" | sed 's,/build/*$,/source,'`
-              ;; # (
-            *)
-              KSRC=`(cd $KBUILD && pwd -P) | sed 's,-[[^-]]*$,-common,'`
-              ;;
-          esac
-        fi
-      fi
-      if test ! -e "$KSRC"/include/linux/kernel.h; then
-        AC_MSG_ERROR([cannot find source directory (please use --with-linux-source)])
-      fi
-    fi
-    AC_MSG_RESULT([$KSRC])
-
-    AC_MSG_CHECKING([for kernel version])
-    version=`sed -n 's/^VERSION = //p' "$KSRC/Makefile"`
-    patchlevel=`sed -n 's/^PATCHLEVEL = //p' "$KSRC/Makefile"`
-    sublevel=`sed -n 's/^SUBLEVEL = //p' "$KSRC/Makefile"`
-    if test X"$version" = X || test X"$patchlevel" = X; then
-       AC_ERROR([cannot determine kernel version])
-    elif test X"$sublevel" = X; then
-       kversion=$version.$patchlevel
-    else
-       kversion=$version.$patchlevel.$sublevel
-    fi
-    AC_MSG_RESULT([$kversion])
-
-    if test "$version" -ge 4; then
-       if test "$version" = 4 && test "$patchlevel" -le 18; then
-          : # Linux 4.x
-       else
-          AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.18.x is not supported (please refer to the FAQ for advice)])
-       fi
-    elif test "$version" = 3 && test "$patchlevel" -ge 10; then
-       : # Linux 3.x
-    else
-       AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version 3.10 or later is required])
-    fi
-    if (test ! -e "$KBUILD"/include/linux/version.h && \
-        test ! -e "$KBUILD"/include/generated/uapi/linux/version.h)|| \
-       (test ! -e "$KBUILD"/include/linux/autoconf.h && \
-        test ! -e "$KBUILD"/include/generated/autoconf.h); then
-        AC_MSG_ERROR([Linux kernel source in $KBUILD is not configured])
-    fi
-    OVS_CHECK_LINUX_COMPAT
-  fi
-  AM_CONDITIONAL(LINUX_ENABLED, test -n "$KBUILD")
-])
-
-dnl OVS_CHECK_LINUX_TC
-dnl
-dnl Configure Linux tc compat.
-AC_DEFUN([OVS_CHECK_LINUX_TC], [
-  AC_COMPILE_IFELSE([
-    AC_LANG_PROGRAM([#include <linux/pkt_cls.h>], [
-        int x = TCA_FLOWER_KEY_ENC_IP_TTL_MASK;
-    ])],
-    [AC_DEFINE([HAVE_TCA_FLOWER_KEY_ENC_IP_TTL_MASK], [1],
-               [Define to 1 if TCA_FLOWER_KEY_ENC_IP_TTL_MASK is available.])])
-
-  AC_COMPILE_IFELSE([
-    AC_LANG_PROGRAM([#include <linux/tc_act/tc_vlan.h>], [
-        int x = TCA_VLAN_PUSH_VLAN_PRIORITY;
-    ])],
-    [AC_DEFINE([HAVE_TCA_VLAN_PUSH_VLAN_PRIORITY], [1],
-               [Define to 1 if TCA_VLAN_PUSH_VLAN_PRIORITY is available.])])
-
-  AC_COMPILE_IFELSE([
-    AC_LANG_PROGRAM([#include <linux/tc_act/tc_tunnel_key.h>], [
-        int x = TCA_TUNNEL_KEY_ENC_TTL;
-    ])],
-    [AC_DEFINE([HAVE_TCA_TUNNEL_KEY_ENC_TTL], [1],
-               [Define to 1 if TCA_TUNNEL_KEY_ENC_TTL is available.])])
-
-  AC_COMPILE_IFELSE([
-    AC_LANG_PROGRAM([#include <linux/tc_act/tc_pedit.h>], [
-        int x = TCA_PEDIT_KEY_EX_HDR_TYPE_UDP;
-    ])],
-    [AC_DEFINE([HAVE_TCA_PEDIT_KEY_EX_HDR_TYPE_UDP], [1],
-               [Define to 1 if TCA_PEDIT_KEY_EX_HDR_TYPE_UDP is available.])])
-
-  AC_COMPILE_IFELSE([
-    AC_LANG_PROGRAM([#include <linux/tc_act/tc_skbedit.h>], [
-        int x = TCA_SKBEDIT_FLAGS;
-    ])],
-    [AC_DEFINE([HAVE_TCA_SKBEDIT_FLAGS], [1],
-               [Define to 1 if TCA_SKBEDIT_FLAGS is available.])])
-])
-
-dnl OVS_FIND_DEPENDENCY(FUNCTION, SEARCH_LIBS, NAME_TO_PRINT)
-dnl
-dnl Check for a function in a library list.
-AC_DEFUN([OVS_FIND_DEPENDENCY], [
-  AC_SEARCH_LIBS([$1], [$2], [], [
-    AC_MSG_ERROR([unable to find $3, install the dependency package])
-  ])
-])
-
-dnl OVS_CHECK_DPDK
-dnl
-dnl Configure DPDK source tree
-AC_DEFUN([OVS_CHECK_DPDK], [
-  AC_ARG_WITH([dpdk],
-              [AC_HELP_STRING([--with-dpdk=/path/to/dpdk],
-                              [Specify the DPDK build directory])],
-              [have_dpdk=true])
-
-  AC_MSG_CHECKING([whether dpdk datapath is enabled])
-  if test "$have_dpdk" != true || test "$with_dpdk" = no; then
-    AC_MSG_RESULT([no])
-    DPDKLIB_FOUND=false
-  else
-    AC_MSG_RESULT([yes])
-    case "$with_dpdk" in
-      yes)
-        DPDK_AUTO_DISCOVER="true"
-        PKG_CHECK_MODULES_STATIC([DPDK], [libdpdk], [
-            DPDK_INCLUDE="$DPDK_CFLAGS"
-            DPDK_LIB="$DPDK_LIBS"], [
-            DPDK_INCLUDE="-I/usr/local/include/dpdk -I/usr/include/dpdk"
-            DPDK_LIB="-ldpdk"])
-        ;;
-      *)
-        DPDK_AUTO_DISCOVER="false"
-        DPDK_INCLUDE_PATH="$with_dpdk/include"
-        # If 'with_dpdk' is passed install directory, point to headers
-        # installed in $DESTDIR/$prefix/include/dpdk
-        if test -e "$DPDK_INCLUDE_PATH/rte_config.h"; then
-           DPDK_INCLUDE="-I$DPDK_INCLUDE_PATH"
-        elif test -e "$DPDK_INCLUDE_PATH/dpdk/rte_config.h"; then
-           DPDK_INCLUDE="-I$DPDK_INCLUDE_PATH/dpdk"
-        fi
-        DPDK_LIB_DIR="$with_dpdk/lib"
-        DPDK_LIB="-ldpdk"
-        ;;
-    esac
-
-    ovs_save_CFLAGS="$CFLAGS"
-    ovs_save_LDFLAGS="$LDFLAGS"
-    CFLAGS="$CFLAGS $DPDK_INCLUDE"
-    if test "$DPDK_AUTO_DISCOVER" = "false"; then
-      LDFLAGS="$LDFLAGS -L${DPDK_LIB_DIR}"
-    fi
-
-    AC_CHECK_HEADERS([rte_config.h], [], [
-      AC_MSG_ERROR([unable to find rte_config.h in $with_dpdk])
-    ], [AC_INCLUDES_DEFAULT])
-
-    AC_CHECK_DECLS([RTE_LIBRTE_VHOST_NUMA, RTE_EAL_NUMA_AWARE_HUGEPAGES], [
-      OVS_FIND_DEPENDENCY([get_mempolicy], [numa], [libnuma])
-    ], [], [[#include <rte_config.h>]])
-
-    AC_CHECK_DECL([RTE_LIBRTE_VHOST_NUMA], [
-      AC_DEFINE([VHOST_NUMA], [1], [NUMA Aware vHost support detected in DPDK.])
-    ], [], [[#include <rte_config.h>]])
-
-    AC_CHECK_DECL([RTE_LIBRTE_PMD_PCAP], [
-      OVS_FIND_DEPENDENCY([pcap_dump], [pcap], [libpcap])
-      AC_CHECK_DECL([RTE_LIBRTE_PDUMP], [
-        AC_DEFINE([DPDK_PDUMP], [1], [DPDK pdump enabled in OVS.])
-      ], [], [[#include <rte_config.h>]])
-    ], [], [[#include <rte_config.h>]])
-
-    AC_CHECK_DECL([RTE_LIBRTE_MLX5_PMD], [dnl found
-      OVS_FIND_DEPENDENCY([mnl_attr_put], [mnl], [libmnl])
-      AC_CHECK_DECL([RTE_LIBRTE_MLX5_DLOPEN_DEPS], [], [dnl not found
-        OVS_FIND_DEPENDENCY([mlx5dv_create_wq], [mlx5], [libmlx5])
-        OVS_FIND_DEPENDENCY([verbs_init_cq], [ibverbs], [libibverbs])
-      ], [[#include <rte_config.h>]])
-    ], [], [[#include <rte_config.h>]])
-
-    AC_CHECK_DECL([RTE_LIBRTE_MLX4_PMD], [dnl found
-      AC_CHECK_DECL([RTE_LIBRTE_MLX4_DLOPEN_DEPS], [], [dnl not found
-        OVS_FIND_DEPENDENCY([mlx4dv_init_obj], [mlx4], [libmlx4])
-        OVS_FIND_DEPENDENCY([verbs_init_cq], [ibverbs], [libibverbs])
-      ], [[#include <rte_config.h>]])
-    ], [], [[#include <rte_config.h>]])
-
-    # DPDK uses dlopen to load plugins.
-    OVS_FIND_DEPENDENCY([dlopen], [dl], [libdl])
-
-    AC_MSG_CHECKING([whether linking with dpdk works])
-    LIBS="$DPDK_LIB $LIBS"
-    AC_LINK_IFELSE(
-      [AC_LANG_PROGRAM([#include <rte_config.h>
-                        #include <rte_eal.h>],
-                       [int rte_argc; char ** rte_argv;
-                        rte_eal_init(rte_argc, rte_argv);])],
-      [AC_MSG_RESULT([yes])
-       DPDKLIB_FOUND=true],
-      [AC_MSG_RESULT([no])
-       if test "$DPDK_AUTO_DISCOVER" = "true"; then
-         AC_MSG_ERROR(m4_normalize([
-            Could not find DPDK library in default search path, Use --with-dpdk
-            to specify the DPDK library installed in non-standard location]))
-       else
-         AC_MSG_ERROR([Could not find DPDK libraries in $DPDK_LIB_DIR])
-       fi
-      ])
-
-    CFLAGS="$ovs_save_CFLAGS"
-    LDFLAGS="$ovs_save_LDFLAGS"
-    if test "$DPDK_AUTO_DISCOVER" = "false"; then
-      OVS_LDFLAGS="$OVS_LDFLAGS -L$DPDK_LIB_DIR"
-    fi
-    OVS_CFLAGS="$OVS_CFLAGS $DPDK_INCLUDE"
-    OVS_ENABLE_OPTION([-mssse3])
-
-    # DPDK pmd drivers are not linked unless --whole-archive is used.
-    #
-    # This happens because the rest of the DPDK code doesn't use any symbol in
-    # the pmd driver objects, and the drivers register themselves using an
-    # __attribute__((constructor)) function.
-    #
-    # These options are specified inside a single -Wl directive to prevent
-    # autotools from reordering them.
-    #
-    # OTOH newer versions of dpdk pkg-config (generated with Meson)
-    # will already have flagged just the right set of libs with
-    # --whole-archive - in those cases do not wrap it once more.
-    case "$DPDK_LIB" in
-      *whole-archive*) DPDK_vswitchd_LDFLAGS=$DPDK_LIB;;
-      *) DPDK_vswitchd_LDFLAGS=-Wl,--whole-archive,$DPDK_LIB,--no-whole-archive
-    esac
-    AC_SUBST([DPDK_vswitchd_LDFLAGS])
-    AC_DEFINE([DPDK_NETDEV], [1], [System uses the DPDK module.])
-  fi
-
-  AM_CONDITIONAL([DPDK_NETDEV], test "$DPDKLIB_FOUND" = true)
-])
-
-dnl OVS_GREP_IFELSE(FILE, REGEX, [IF-MATCH], [IF-NO-MATCH])
-dnl
-dnl Greps FILE for REGEX.  If it matches, runs IF-MATCH, otherwise IF-NO-MATCH.
-dnl If IF-MATCH is empty then it defines to OVS_DEFINE(HAVE_<REGEX>), with
-dnl <REGEX> translated to uppercase.
-AC_DEFUN([OVS_GREP_IFELSE], [
-  AC_MSG_CHECKING([whether $2 matches in $1])
-  if test -f $1; then
-    grep '$2' $1 >/dev/null 2>&1
-    status=$?
-    case $status in
-      0)
-        AC_MSG_RESULT([yes])
-        m4_if([$3], [], [OVS_DEFINE([HAVE_]m4_toupper([$2]))], [$3])
-        ;;
-      1)
-        AC_MSG_RESULT([no])
-        $4
-        ;;
-      *)
-        AC_MSG_ERROR([grep exited with status $status])
-        ;;
-    esac
-  else
-    AC_MSG_RESULT([file not found])
-    $4
-  fi
-])
-
-dnl OVS_FIND_FIELD_IFELSE(FILE, STRUCTURE, REGEX, [IF-MATCH], [IF-NO-MATCH])
-dnl
-dnl Looks for STRUCTURE in FILE. If it is found, greps for REGEX within the
-dnl structure definition. If this is successful, runs IF-MATCH, otherwise
-dnl IF_NO_MATCH. If IF-MATCH is empty then it defines to
-dnl OVS_DEFINE(HAVE_<STRUCTURE>_WITH_<REGEX>), with <STRUCTURE> and <REGEX>
-dnl translated to uppercase.
-AC_DEFUN([OVS_FIND_FIELD_IFELSE], [
-  AC_MSG_CHECKING([whether $2 has member $3 in $1])
-  if test -f $1; then
-    awk '/$2.{/,/^}/' $1 2>/dev/null | grep '$3' >/dev/null
-    status=$?
-    case $status in
-      0)
-        AC_MSG_RESULT([yes])
-        m4_if([$4], [], [OVS_DEFINE([HAVE_]m4_toupper([$2])[_WITH_]m4_toupper([$3]))], [$4])
-        ;;
-      1)
-        AC_MSG_RESULT([no])
-        $5
-        ;;
-      *)
-        AC_MSG_ERROR([grep exited with status $status])
-        ;;
-    esac
-  else
-    AC_MSG_RESULT([file not found])
-    $5
-  fi
-])
-
-dnl OVS_FIND_PARAM_IFELSE(FILE, FUNCTION, REGEX, [IF-MATCH], [IF-NO-MATCH])
-dnl
-dnl Looks for FUNCTION in FILE. If it is found, greps for REGEX within
-dnl the function signature starting from the line matching FUNCTION
-dnl and ending with the line containing the closing parenthesis.  If
-dnl this is successful, runs IF-MATCH, otherwise IF_NO_MATCH.  If
-dnl IF-MATCH is empty then it defines to
-dnl OVS_DEFINE(HAVE_<FUNCTION>_WITH_<REGEX>), with <FUNCTION> and
-dnl <REGEX> translated to uppercase.
-AC_DEFUN([OVS_FIND_PARAM_IFELSE], [
-  AC_MSG_CHECKING([whether $2 has parameter $3 in $1])
-  if test -f $1; then
-    awk '/$2[[ \t\n]]*\(/,/\)/' $1 2>/dev/null | grep '$3' >/dev/null
-    status=$?
-    case $status in
-      0)
-        AC_MSG_RESULT([yes])
-        m4_if([$4], [], [OVS_DEFINE([HAVE_]m4_toupper([$2])[_WITH_]m4_toupper([$3]))], [$4])
-        ;;
-      1)
-        AC_MSG_RESULT([no])
-        $5
-        ;;
-      *)
-        AC_MSG_ERROR([grep exited with status $status])
-        ;;
-    esac
-  else
-    AC_MSG_RESULT([file not found])
-    $5
-  fi
-])
-
-dnl OVS_DEFINE(NAME)
-dnl
-dnl Defines NAME to 1 in kcompat.h.
-AC_DEFUN([OVS_DEFINE], [
-  echo '#define $1 1' >> datapath/linux/kcompat.h.new
-])
-
-dnl OVS_CHECK_LINUX_COMPAT
-dnl
-dnl Runs various Autoconf checks on the Linux kernel source in
-dnl the directory in $KBUILD.
-AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
-  rm -f datapath/linux/kcompat.h.new
-  mkdir -p datapath/linux
-  : > datapath/linux/kcompat.h.new
-
-  echo '#include <linux/version.h>
-#ifndef RHEL_RELEASE_CODE
-#define RHEL_RELEASE_CODE 0
-#define RHEL_RELEASE_VERSION(a, b) 0
-#endif' >> datapath/linux/kcompat.h.new
-
-  OVS_GREP_IFELSE([$KSRC/arch/x86/include/asm/checksum_32.h], [src_err,],
-                  [OVS_DEFINE([HAVE_CSUM_COPY_DBG])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/ip6_fib.h], [rt6_get_cookie],
-                  [OVS_DEFINE([HAVE_RT6_GET_COOKIE])])
-
-  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_stub])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [ERR_CAST])
-  OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [IS_ERR_OR_NULL])
-  OVS_GREP_IFELSE([$KSRC/include/linux/err.h], [PTR_ERR_OR_ZERO])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/jump_label.h], [static_branch_unlikely(],
-                  [OVS_DEFINE([HAVE_UPSTREAM_STATIC_KEY])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/jump_label.h], [DEFINE_STATIC_KEY_FALSE],
-                  [OVS_DEFINE([HAVE_DEFINE_STATIC_KEY])])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/etherdevice.h], [eth_hw_addr_random])
-  OVS_GREP_IFELSE([$KSRC/include/linux/etherdevice.h], [ether_addr_copy])
-
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_link.h], [IFLA_GENEVE_TOS])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_link.h], [rtnl_link_stats64])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_link.h], [rtnl_link_stats64])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_hwaccel_push_inside])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast])
-  OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [proto_ports_offset])
-  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry],
-                  [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])])
-  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*net],
-                  [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_NET])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [inet_get_local_port_range.*net],
-                  [OVS_DEFINE([HAVE_INET_GET_LOCAL_PORT_RANGE_USING_NET])])
-  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [ip_defrag.*net],
-                  [OVS_DEFINE([HAVE_IP_DEFRAG_TAKES_NET])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/ip.h],
-                        [ip_do_fragment], [net],
-                        [OVS_DEFINE([HAVE_IP_DO_FRAGMENT_TAKES_NET])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/ip.h],
-                        [ip_local_out], [net],
-                        [OVS_DEFINE([HAVE_IP_LOCAL_OUT_TAKES_NET])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [ip_skb_dst_mtu])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [IPSKB_FRAG_PMTU],
-                  [OVS_DEFINE([HAVE_CORRECT_MRU_HANDLING])])
-  OVS_GREP_IFELSE([$KSRC/include/net/ip_tunnels.h], [__ip_tunnel_change_mtu])
-  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [hashfn.*const],
-                  [OVS_DEFINE([HAVE_INET_FRAGS_CONST])])
-  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [last_in],
-                  [OVS_DEFINE([HAVE_INET_FRAGS_LAST_IN])])
-  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_evicting])
-  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_evictor])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frags],
-                        [frags_work])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frags],
-                        [rwlock])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_queue],
-                        [list_evictor])
-  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frag_lru_move])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/inet_frag.h],
-                        [sub_frag_mem_limit], [struct.netns_frags],
-                        [OVS_DEFINE([HAVE_SUB_FRAG_MEM_LIMIT_ARG_STRUCT_NETNS_FRAGS])])
-  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [void.*inet_frags_init],
-                  [OVS_DEFINE([HAVE_VOID_INET_FRAGS_INIT])])
-  OVS_GREP_IFELSE([$KSRC/include/net/inetpeer.h], [vif],
-                  [OVS_DEFINE([HAVE_INETPEER_VIF_SUPPORT])])
-
-  dnl Check for dst_cache and ipv6 lable to use backported tunnel infrastructure.
-  dnl OVS does not really need ipv6 label field, but its presence signifies that
-  dnl the stack has all required ipv6 support.
-  dnl OVS also does not need dst_cache But this dependency allows us to write
-  dnl much cleaner code.
-
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/ip_tunnels.h], [ip_tunnel_key],
-                        [label],
-                        [OVS_GREP_IFELSE([$KSRC/include/net/ip_tunnels.h],
-                                         [iptunnel_pull_offloads],
-                        [OVS_GREP_IFELSE([$KSRC/include/net/dst_cache.h], [dst_cache],
-                        [OVS_GREP_IFELSE([$KSRC/include/net/erspan.h], [erspan_md2],
-                                         [OVS_DEFINE([USE_UPSTREAM_TUNNEL])])])])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/dst_cache.h], [dst_cache],
-                  [OVS_DEFINE([USE_BUILTIN_DST_CACHE])])
-  OVS_GREP_IFELSE([$KSRC/include/net/mpls.h], [mpls_hdr],
-                  [OVS_DEFINE([MPLS_HEADER_IS_L3])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/net.h], [sock_create_kern.*net],
-                  [OVS_DEFINE([HAVE_SOCK_CREATE_KERN_NET])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [ndo_fill_metadata_dst])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_by_index_rcu])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_recursion_level])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [__skb_gso_segment])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [skb_gso_error_unwind])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [can_checksum_protocol])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [ndo_get_iflink])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [ndo_features_check],
-                  [OVS_DEFINE([USE_UPSTREAM_TUNNEL_GSO])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [ndo_add_vxlan_port])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [ndo_add_geneve_port])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [ndo_udp_tunnel_add])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [netdev_features_t])
-  dnl Ubuntu kernel 3.13 has defined this struct but not used for netdev->tstats.
-  dnl So check type of tstats.
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [pcpu_sw_netstats.*tstats],
-                  [OVS_DEFINE([HAVE_PCPU_SW_NETSTATS])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [netif_needs_gso.*net_device],
-                  [OVS_DEFINE([HAVE_NETIF_NEEDS_GSO_NETDEV])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [skb_csum_hwoffload_help])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [udp_offload])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [udp_offload.*uoff],
-                  [OVS_DEFINE([HAVE_UDP_OFFLOAD_ARG_UOFF])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [gro_remcsum])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [IFF_PHONY_HEADROOM])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device_ops],
-                        [extended])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h],
-                        [netdev_master_upper_dev_link], [upper_priv],
-                        [OVS_DEFINE([HAVE_NETDEV_MASTER_UPPER_DEV_LINK_PRIV])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h],
-                  [netdev_master_upper_dev_link_rh],
-                  [OVS_DEFINE([HAVE_NETDEV_MASTER_UPPER_DEV_LINK_RH])])
-
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device],
-                        [max_mtu])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device_ops_extended],
-                        [ndo_change_mtu], [OVS_DEFINE([HAVE_RHEL7_MAX_MTU])])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_state])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_register_net_hook])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hookfn.*nf_hook_ops],
-                  [OVS_DEFINE([HAVE_NF_HOOKFN_ARG_OPS])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hookfn], [priv],
-                  [OVS_DEFINE([HAVE_NF_HOOKFN_ARG_PRIV])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_ops],
-                        [owner], [OVS_DEFINE([HAVE_NF_HOOKS_OPS_OWNER])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [NFPROTO_INET])
-
-
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netfilter_ipv6.h], [nf_ipv6_ops],
-                        [fragment.*sock], [OVS_DEFINE([HAVE_NF_IPV6_OPS_FRAGMENT])])
-
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
-                        [nf_conn], [struct timer_list[[ \t]]*timeout],
-                        [OVS_DEFINE([HAVE_NF_CONN_TIMER])])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
-                  [nf_ct_delete(], [OVS_DEFINE([HAVE_NF_CT_DELETE])])
-
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
-                  [nf_ct_tmpl_alloc], [nf_conntrack_zone],
-                  [OVS_DEFINE([HAVE_NF_CT_TMPL_ALLOC_TAKES_STRUCT_ZONE])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
-                  [nf_ct_get_tuplepr], [struct.net],
-                  [OVS_DEFINE([HAVE_NF_CT_GET_TUPLEPR_TAKES_STRUCT_NET])])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
-                  [nf_ct_set])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack.h],
-                  [nf_ct_is_untracked])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_zones.h],
-                  [nf_ct_zone_init])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h],
-                  [net_ns_get])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
-                  [nf_connlabels_get])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
-                  [nf_connlabels_get], [int bit],
-                  [OVS_DEFINE([HAVE_NF_CONNLABELS_GET_TAKES_BIT])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
-                        [nf_conn_labels], [words])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_nat.h], [nf_ct_nat_ext_add])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_nat.h], [nf_nat_alloc_null_binding])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_nat.h], [nf_nat_range2])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_seqadj.h], [nf_ct_seq_adjust])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_count.h], [nf_conncount_gc_list],
-                  [OVS_DEFINE([HAVE_UPSTREAM_NF_CONNCOUNT])])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32])
-  OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/rtnetlink.h], [get_link_net])
-  OVS_GREP_IFELSE([$KSRC/include/net/rtnetlink.h], [name_assign_type])
-  OVS_GREP_IFELSE([$KSRC/include/net/rtnetlink.h], [rtnl_create_link.*src_net],
-                  [OVS_DEFINE([HAVE_RTNL_CREATE_LINK_SRC_NET])])
-  OVS_GREP_IFELSE([$KSRC/include/net/net_namespace.h], [possible_net_t])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/rcupdate.h], [rcu_read_lock_held], [],
-                  [OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h],
-                                   [rcu_read_lock_held])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], [lockdep_rtnl_is_held])
-  OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], [net_rwsem])
-
-  # Check for the proto_data_valid member in struct sk_buff.  The [^@]
-  # is necessary because some versions of this header remove the
-  # member but retain the kerneldoc comment that describes it (which
-  # starts with @).  The brackets must be doubled because of m4
-  # quoting rules.
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [[[^@]]proto_data_valid],
-                  [OVS_DEFINE([HAVE_PROTO_DATA_VALID])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_checksum_start_offset])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [inner_protocol])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [inner_protocol_type])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_inner_transport_offset])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [kfree_skb_list])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [rxhash])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u16.*rxhash],
-                  [OVS_DEFINE([HAVE_U16_RXHASH])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_dst(],
-                  [OVS_DEFINE([HAVE_SKB_DST_ACCESSOR_FUNCS])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
-                  [skb_copy_from_linear_data_offset])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
-                  [skb_reset_tail_pointer])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_cow_head])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_warn_if_lro],
-                  [OVS_DEFINE([HAVE_SKB_WARN_LRO])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [consume_skb])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_frag_page])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_has_frag_list])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [__skb_fill_page_desc])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_reset_mac_len])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_unclone])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_orphan_frags])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_get_hash(],
-                  [OVS_DEFINE([HAVE_SKB_GET_HASH])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_clear_hash])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [int.skb_zerocopy(],
-                  [OVS_DEFINE([HAVE_SKB_ZEROCOPY])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u8.*l4_rxhash],
-                  [OVS_DEFINE([HAVE_L4_RXHASH])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_ensure_writable])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_vlan_pop])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [__skb_vlan_pop])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_vlan_push])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_clear_hash_if_not_l4])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_postpush_rcsum])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [lco_csum])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_nfct])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_put_zero])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/types.h], [bool],
-                  [OVS_DEFINE([HAVE_BOOL_TYPE])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/types.h], [__wsum],
-                  [OVS_DEFINE([HAVE_CSUM_TYPES])])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/types.h], [__wsum],
-                  [OVS_DEFINE([HAVE_CSUM_TYPES])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_replace4])
-  OVS_GREP_IFELSE([$KSRC/include/net/checksum.h], [csum_unfold])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/dst.h], [dst_discard_sk])
-  OVS_GREP_IFELSE([$KSRC/include/net/dst.h], [__skb_dst_copy])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genl_has_listeners])
-  OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [mcgrp_offset])
-  OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [parallel_ops])
-  OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [netlink_has_listeners(net->genl_sock],
-                  [OVS_DEFINE([HAVE_GENL_HAS_LISTENERS_TAKES_NET])])
-  OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genlmsg_parse])
-  OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genl_notify.*family],
-                  [OVS_DEFINE([HAVE_GENL_NOTIFY_TAKES_FAMILY])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/genetlink.h],
-                        [genl_notify], [net],
-                        [OVS_DEFINE([HAVE_GENL_NOTIFY_TAKES_NET])])
-
-
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/genetlink.h],
-                        [genl_multicast_group], [id])
-  OVS_GREP_IFELSE([$KSRC/include/net/geneve.h], [geneve_hdr])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [gre_cisco_register])
-  OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [gre_handle_offloads])
-  OVS_GREP_IFELSE([$KSRC/include/net/ipv6.h], [IP6_FH_F_SKIP_RH])
-  OVS_GREP_IFELSE([$KSRC/include/net/ipv6.h], [ip6_local_out_sk])
-  OVS_GREP_IFELSE([$KSRC/include/net/ipv6.h], [__ipv6_addr_jhash])
-  OVS_GREP_IFELSE([$KSRC/include/net/ip6_fib.h], [rt6i.*u.dst],
-                  [OVS_DEFINE([HAVE_RT6INFO_DST_UNION])])
-  OVS_GREP_IFELSE([$KSRC/include/net/ip6_route.h], [ip6_frag.*sock],
-                  [OVS_DEFINE([HAVE_IP_FRAGMENT_TAKES_SOCK])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_64bit])
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_get_be16])
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be16])
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be32])
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be64])
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_in_addr])
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_find_nested])
-  OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_is_last])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netlink.h], [void.*netlink_set_err],
-                  [OVS_DEFINE([HAVE_VOID_NETLINK_SET_ERR])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netlink.h],
-                        [nla_parse], [netlink_ext_ack],
-                        [OVS_DEFINE([HAVE_NETLINK_EXT_ACK])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/sctp/checksum.h], [sctp_compute_cksum])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [ADD_ALL_VLANS_CMD],
-                  [OVS_DEFINE([HAVE_VLAN_BUG_WORKAROUND])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_insert_tag_set_proto])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [__vlan_insert_tag])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_get_protocol])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [skb_vlan_tagged])
-  OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [eth_type_vlan])
-
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/dst_metadata.h],
-                        [metadata_dst_alloc], [metadata_type])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/u64_stats_sync.h], [u64_stats_fetch_begin_irq])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/vxlan.h], [struct vxlan_metadata],
-                  [OVS_DEFINE([HAVE_VXLAN_METADATA])])
-  OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [udp_flow_src_port],
-                  [OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [inet_get_local_port_range(net],
-                                   [OVS_DEFINE([HAVE_UDP_FLOW_SRC_PORT])])])
-  OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [udp_v4_check])
-  OVS_GREP_IFELSE([$KSRC/include/net/udp_tunnel.h], [udp_tunnel_gro_complete])
-  OVS_GREP_IFELSE([$KSRC/include/net/udp_tunnel.h], [sk_buff.*udp_tunnel_handle_offloads],
-                  [OVS_DEFINE([HAVE_UDP_TUNNEL_HANDLE_OFFLOAD_RET_SKB])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/udp_tunnel.h], [udp_tunnel_sock_cfg],
-                        [gro_receive])
-
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [ignore_df],
-                  [OVS_DEFINE([HAVE_IGNORE_DF_RENAME])])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/netdevice.h], [NET_NAME_UNKNOWN],
-                  [OVS_DEFINE([HAVE_NET_NAME_UNKNOWN])])
-
-  OVS_GREP_IFELSE([$KSRC/include/net/sock.h], [sk_no_check_tx])
-  OVS_GREP_IFELSE([$KSRC/include/linux/udp.h], [no_check6_tx])
-  OVS_GREP_IFELSE([$KSRC/include/linux/utsrelease.h], [el6],
-                  [OVS_DEFINE([HAVE_RHEL6_PER_CPU])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/protocol.h],
-                        [udp_add_offload], [net],
-                        [OVS_DEFINE([HAVE_UDP_ADD_OFFLOAD_TAKES_NET])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/ipv6/nf_defrag_ipv6.h],
-                        [nf_defrag_ipv6_enable], [net],
-                        [OVS_DEFINE([HAVE_DEFRAG_ENABLE_TAKES_NET])])
-  OVS_GREP_IFELSE([$KSRC/include/net/genetlink.h], [family_list],
-                        [OVS_DEFINE([HAVE_GENL_FAMILY_LIST])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device],
-                        [needs_free_netdev],
-                        [OVS_DEFINE([HAVE_NEEDS_FREE_NETDEV])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/vxlan.h], [vxlan_dev], [cfg],
-                        [OVS_DEFINE([HAVE_VXLAN_DEV_CFG])])
-  OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_helper.h],
-                  [nf_conntrack_helper_put],
-                  [OVS_DEFINE(HAVE_NF_CONNTRACK_HELPER_PUT)])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],[[[[:space:]]]SKB_GSO_UDP[[[:space:]]]],
-                  [OVS_DEFINE([HAVE_SKB_GSO_UDP])])
-  OVS_GREP_IFELSE([$KSRC/include/net/dst.h],[DST_NOCACHE],
-                  [OVS_DEFINE([HAVE_DST_NOCACHE])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/rtnetlink.h], [rtnl_link_ops],
-                        [extack],
-                  [OVS_DEFINE([HAVE_EXT_ACK_IN_RTNL_LINKOPS])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_ops],
-                        [list],
-                        [OVS_DEFINE([HAVE_LIST_IN_NF_HOOK_OPS])])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/netfilter/nf_conntrack_common.h],
-                  [IP_CT_UNTRACKED])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h],
-                        [netdev_master_upper_dev_link], [extack],
-                        [OVS_DEFINE([HAVE_UPPER_DEV_LINK_EXTACK])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/compiler_types.h],
-                  [__LINUX_COMPILER_TYPES_H],
-                  [OVS_DEFINE([HAVE_LINUX_COMPILER_TYPES_H])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/timekeeping.h],
-                  [ktime_get_ts64],
-                  [OVS_DEFINE([HAVE_KTIME_GET_TS64])])
-  OVS_GREP_IFELSE([$KSRC/include/net/net_namespace.h],
-                  [EXPORT_SYMBOL_GPL(peernet2id_alloc)],
-                  [OVS_DEFINE([HAVE_PEERNET2ID_ALLOC])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/timekeeping.h],
-                  [ktime_get_ns],
-                  [OVS_DEFINE([HAVE_KTIME_GET_NS])])
-  OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h],
-                  frag_percpu_counter_batch[],
-                  [OVS_DEFINE([HAVE_FRAG_PERCPU_COUNTER_BATCH])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
-                  [null_compute_pseudo],
-                  [OVS_DEFINE([HAVE_NULL_COMPUTE_PSEUDO])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
-                  [__skb_checksum_convert],
-                  [OVS_DEFINE([HAVE_SKB_CHECKSUM_CONVERT])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device],
-                        [max_mtu],
-                        [OVS_DEFINE([HAVE_NET_DEVICE_MAX_MTU])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/ip6_tunnel.h], [__ip6_tnl_parm],
-                        [erspan_ver],
-                        [OVS_DEFINE([HAVE_IP6_TNL_PARM_ERSPAN_VER])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
-                  [SKB_GSO_IPXIP6],
-                  [OVS_DEFINE([HAVE_SKB_GSO_IPXIP6])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/ipv6.h],
-                        [ip6_make_flowlabel], [fl6],
-                        [OVS_DEFINE([HAVE_IP6_MAKE_FLOWLABEL_FL6])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/ipv6.h], [netns_sysctl_ipv6],
-                        [auto_flowlabels],
-                        [OVS_DEFINE([HAVE_NETNS_SYSCTL_IPV6_AUTO_FLOWLABELS])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h],
-                  [netif_keep_dst],
-                  [OVS_DEFINE([HAVE_NETIF_KEEP_DST])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device_ops],
-                        [ndo_get_iflink],
-                        [OVS_DEFINE([HAVE_NDO_GET_IFLINK])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
-                  [skb_set_inner_ipproto],
-                  [OVS_DEFINE([HAVE_SKB_SET_INNER_IPPROTO])])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [tunnel_encap_types],
-                  [OVS_DEFINE([HAVE_TUNNEL_ENCAP_TYPES])])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_IPTUN_ENCAP_TYPE],
-                  [OVS_DEFINE([HAVE_IFLA_IPTUN_ENCAP_TYPE])])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_IPTUN_COLLECT_METADATA],
-                  [OVS_DEFINE([HAVE_IFLA_IPTUN_COLLECT_METADATA])])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_GRE_ENCAP_DPORT])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_GRE_COLLECT_METADATA])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_GRE_IGNORE_DF])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_GRE_FWMARK])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_GRE_ERSPAN_INDEX])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_GRE_ERSPAN_HWID])
-  OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
-                  [IFLA_IPTUN_FWMARK])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/skbuff.h], [sk_buff],
-                        [csum_valid],
-                        [OVS_DEFINE([HAVE_SKBUFF_CSUM_VALID])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
-                  [skb_checksum_simple_validate])
-  OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h],
-                  [void.*ndo_get_stats64],
-                  [OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable],
-                  [OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])])
-  OVS_FIND_PARAM_IFELSE([$KSRC/include/net/ip_tunnels.h],
-                        [ip_tunnel_info_opts_set], [flags],
-                        [OVS_DEFINE([HAVE_IP_TUNNEL_INFO_OPTS_SET_FLAGS])])
-  OVS_FIND_FIELD_IFELSE([$KSRC/include/net/inet_frag.h], [inet_frags],
-                        [rnd],
-                        [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/mm.h], [kvmalloc_array],
-                  [OVS_DEFINE([HAVE_KVMALLOC_ARRAY])])
-  OVS_GREP_IFELSE([$KSRC/include/linux/mm.h], [kvmalloc_node],
-                  [OVS_DEFINE([HAVE_KVMALLOC_NODE])])
-
-  if cmp -s datapath/linux/kcompat.h.new \
-            datapath/linux/kcompat.h >/dev/null 2>&1; then
-    rm datapath/linux/kcompat.h.new
-  else
-    mv datapath/linux/kcompat.h.new datapath/linux/kcompat.h
-  fi
-])
-
 dnl Checks for net/if_dl.h.
 dnl
 dnl (We use this as a proxy for checking whether we're building on FreeBSD
diff --git a/configure.ac b/configure.ac
index 65c57c7990fb..78498181cfd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,15 +82,12 @@  AC_SEARCH_LIBS([pthread_rwlock_tryrdlock], [pthread])
 AC_SEARCH_LIBS([pthread_rwlockattr_destroy], [pthread])
 AC_FUNC_STRERROR_R
 
-OVS_CHECK_ESX
 OVS_CHECK_WIN64
 OVS_CHECK_WIN32
 OVS_CHECK_VISUAL_STUDIO_DDK
 OVN_CHECK_COVERAGE
 OVS_CHECK_NDEBUG
-OVS_CHECK_NETLINK
 OVS_CHECK_OPENSSL
-OVN_CHECK_LIBCAPNG
 OVN_CHECK_LOGDIR
 OVN_CHECK_PYTHON2
 OVN_CHECK_PYTHON3
@@ -109,7 +106,7 @@  AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [],
   [[#include <sys/socket.h>
 #include <sys/types.h>
 #include <netinet/in.h>]])
-AC_CHECK_FUNCS([mlockall strnlen getloadavg statvfs getmntent_r sendmmsg clock_gettime])
+AC_CHECK_FUNCS([strnlen getloadavg statvfs getmntent_r sendmmsg clock_gettime])
 AC_CHECK_HEADERS([mntent.h sys/statvfs.h linux/types.h linux/if_ether.h])
 AC_CHECK_HEADERS([linux/net_namespace.h stdatomic.h bits/floatn-common.h])
 AC_CHECK_HEADERS([net/if_mib.h], [], [], [[#include <sys/types.h>
@@ -172,11 +169,6 @@  OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
 OVS_ENABLE_WERROR
 OVS_ENABLE_SPARSE
 
-AC_ARG_VAR(KARCH, [Kernel Architecture String])
-AC_SUBST(KARCH)
-OVS_CHECK_LINUX
-OVS_CHECK_LINUX_TC
-OVS_CHECK_DPDK
 OVS_CHECK_PRAGMA_MESSAGE
 OVN_CHECK_OVS
 OVS_CTAGS_IDENTIFIERS
diff --git a/m4/ovn.m4 b/m4/ovn.m4
index 4d19a8d9e94f..277468f7f8ba 100644
--- a/m4/ovn.m4
+++ b/m4/ovn.m4
@@ -60,16 +60,6 @@  AC_DEFUN([OVS_CHECK_NDEBUG],
      [ndebug=false])
    AM_CONDITIONAL([NDEBUG], [test x$ndebug = xtrue])])
 
-dnl Checks for ESX.
-AC_DEFUN([OVS_CHECK_ESX],
-  [AC_CHECK_HEADER([vmware.h],
-                   [ESX=yes],
-                   [ESX=no])
-   AM_CONDITIONAL([ESX], [test "$ESX" = yes])
-   if test "$ESX" = yes; then
-      AC_DEFINE([ESX], [1], [Define to 1 if building on ESX.])
-   fi])
-
 dnl Checks for MSVC x64 compiler.
 AC_DEFUN([OVS_CHECK_WIN64],
   [AC_CACHE_CHECK(
@@ -203,42 +193,6 @@  AC_ARG_WITH([vstudiotargetver],
   AM_CONDITIONAL([VSTUDIO_DDK], [test -n "$VSTUDIO_CONFIG"])
 ])
 
-dnl Checks for libcap-ng.
-AC_DEFUN([OVN_CHECK_LIBCAPNG],
-  [AC_ARG_ENABLE(
-     [libcapng],
-     [AC_HELP_STRING([--disable-libcapng], [Disable Linux capability support])],
-     [case "${enableval}" in
-        (yes) libcapng=true ;;
-        (no)  libcapng=false ;;
-        (*) AC_MSG_ERROR([bad value ${enableval} for --enable-libcapng]) ;;
-      esac],
-     [libcapng=check])
-
-   if test "$libcapng" != false; then
-       AC_CHECK_LIB([cap-ng], [capng_clear], [HAVE_LIBCAPNG=yes])
-
-       if test "$HAVE_LIBCAPNG" != yes; then
-           if test "$libcapng" = true ; then
-                AC_MSG_ERROR([libcap-ng support requested, but not found])
-           fi
-           if test "$libcapng" = check ; then
-                 AC_MSG_WARN([cannot find libcap-ng.
---user option will not be supported on Linux.
-(you may use --disable-libcapng to suppress this warning). ])
-           fi
-       fi
-   fi
-
-   AC_SUBST([HAVE_LIBCAPNG])
-   AM_CONDITIONAL([HAVE_LIBCAPNG], [test "$HAVE_LIBCAPNG" = yes])
-   if test "$HAVE_LIBCAPNG" = yes; then
-      AC_DEFINE([HAVE_LIBCAPNG], [1],
-                [Define to 1 if libcap-ng is available.])
-      CAPNG_LDADD="-lcap-ng"
-      AC_SUBST([CAPNG_LDADD])
-   fi])
-
 dnl Checks for OpenSSL.
 AC_DEFUN([OVS_CHECK_OPENSSL],
   [AC_ARG_ENABLE(