# -*- autoconf -*-
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
dnl OVS_CHECK_LINUX
dnl
-dnl Configure linux kernel source tree
+dnl Configure linux kernel source tree
AC_DEFUN([OVS_CHECK_LINUX], [
AC_ARG_WITH([linux],
[AC_HELP_STRING([--with-linux=/path/to/linux],
AC_MSG_RESULT([$kversion])
if test "$version" -ge 4; then
- if test "$version" = 4 && test "$patchlevel" -le 6; then
+ if test "$version" = 4 && test "$patchlevel" -le 11; then
: # Linux 4.x
else
- AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.6.x is not supported (please refer to the FAQ for advice)])
+ AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 4.11.x is not supported (please refer to the FAQ for advice)])
fi
elif test "$version" = 3 && test "$patchlevel" -ge 10; then
: # Linux 3.x
AC_LANG_PROGRAM(
[
#include <rte_config.h>
-#if !RTE_LIBRTE_VHOST_USER
+#if RTE_LIBRTE_VHOST_NUMA
#error
#endif
], [])
], [],
- [AC_DEFINE([VHOST_CUSE], [1], [DPDK vhost-cuse support enabled, vhost-user disabled.])
- DPDK_EXTRA_LIB="-lfuse"])
+ [AC_SEARCH_LIBS([get_mempolicy],[numa],[],[AC_MSG_ERROR([unable to find libnuma, install the dependency package])])
+ DPDK_EXTRA_LIB="-lnuma"
+ AC_DEFINE([VHOST_NUMA], [1], [NUMA Aware vHost support detected in DPDK.])])
- AC_SEARCH_LIBS([get_mempolicy],[numa],[],[AC_MSG_ERROR([unable to find libnuma, install the dependency package])])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [
+ #include <rte_config.h>
+#if RTE_LIBRTE_PMD_PCAP
+#error
+#endif
+ ], [])
+ ], [],
+ [AC_SEARCH_LIBS([pcap_dump],[pcap],[],[AC_MSG_ERROR([unable to find libpcap, install the dependency package])])
+ DPDK_EXTRA_LIB="-lpcap"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [
+ #include <rte_config.h>
+#if RTE_LIBRTE_PDUMP
+#error
+#endif
+ ], [])
+ ], [],
+ [AC_DEFINE([DPDK_PDUMP], [1], [DPDK pdump enabled in OVS.])])
+ ])
# On some systems we have to add -ldl to link with dpdk
#
DPDKLIB_FOUND=false
save_LIBS=$LIBS
for extras in "" "-ldl"; do
- LIBS="$DPDK_LIB $extras $save_LIBS $DPDK_EXTRA_LIB -lnuma"
+ LIBS="$DPDK_LIB $extras $save_LIBS $DPDK_EXTRA_LIB"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <rte_config.h>
#include <rte_eal.h>],
grep '$2' $1 >/dev/null 2>&1
status=$?
case $status in
- 0)
+ 0)
AC_MSG_RESULT([yes])
m4_if([$3], [], [OVS_DEFINE([HAVE_]m4_toupper([$2]))], [$3])
;;
- 1)
+ 1)
AC_MSG_RESULT([no])
$4
;;
- *)
+ *)
AC_MSG_ERROR([grep exited with status $status])
;;
esac
[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])])
[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/dst_cache.h], [dst_cache],
[OVS_DEFINE([USE_UPSTREAM_TUNNEL])])])])
OVS_GREP_IFELSE([$KSRC/include/linux/net.h], [sock_create_kern.*net],
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [__skb_gso_segment])
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], [netdev_features_t])
[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_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device],
+ [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_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_zones.h],
[nf_ct_zone_init])
OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_labels.h],
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_GREP_IFELSE([$KSRC/include/net/netfilter/ipv6/nf_defrag_ipv6.h],
- [nf_ct_frag6_consume_orig])
- OVS_GREP_IFELSE([$KSRC/include/net/netfilter/ipv6/nf_defrag_ipv6.h],
- [nf_ct_frag6_output])
+ 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_conntrack_seqadj.h], [nf_ct_seq_adjust])
[OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h],
[rcu_read_lock_held])])
OVS_GREP_IFELSE([$KSRC/include/linux/rtnetlink.h], [lockdep_rtnl_is_held])
-
+
# 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
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], [skb_scrub_packet.*xnet],
- [OVS_DEFINE([HAVE_SKB_SCRUB_PACKET_XNET])])
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],
+ 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_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/types.h], [bool],
[OVS_DEFINE([HAVE_BOOL_TYPE])])
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_GREP_IFELSE([$KSRC/include/linux/u64_stats_sync.h], [u64_stats_fetch_begin_irq])
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])])
+
if cmp -s datapath/linux/kcompat.h.new \
datapath/linux/kcompat.h >/dev/null 2>&1; then
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([_OVS_CHECK_CC_OPTION], [dnl
- m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-=], [__])])dnl
+ m4_define([ovs_cv_name], [ovs_cv_[]m4_translit([$1], [-= ], [__])])dnl
AC_CACHE_CHECK([whether $CC accepts $1], [ovs_cv_name],
[ovs_save_CFLAGS="$CFLAGS"
dnl Include -Werror in the compiler options, because without -Werror
dnl 0
dnl %
CFLAGS="$CFLAGS $WERROR $1"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], [if test -s conftest.err && grep "unrecognized option" conftest.err; then ovs_cv_name[]=no; else ovs_cv_name[]=yes; fi], [ovs_cv_name[]=no])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int x;])],
+ [if test -s conftest.err && grep "unrecognized option" conftest.err
+ then
+ ovs_cv_name[]=no
+ else
+ ovs_cv_name[]=yes
+ fi],
+ [ovs_cv_name[]=no])
CFLAGS="$ovs_save_CFLAGS"])
if test $ovs_cv_name = yes; then
m4_if([$2], [], [:], [$2])
;;
esac])
-dnl OVS_MAKE_HAS_IF([if-true], [if-false])
-dnl
-dnl Checks whether make has the GNU make $(if condition,then,else) extension.
-dnl Runs 'if-true' if so, 'if-false' otherwise.
-AC_DEFUN([OVS_CHECK_MAKE_IF],
- [AC_CACHE_CHECK(
- [whether ${MAKE-make} has GNU make \$(if) extension],
- [ovs_cv_gnu_make_if],
- [cat <<'EOF' > conftest.mk
-conftest.out:
- echo $(if x,y,z) > conftest.out
-.PHONY: all
-EOF
- rm -f conftest.out
- AS_ECHO(["$as_me:$LINENO: invoking ${MAKE-make} -f conftest.mk all:"]) >&AS_MESSAGE_LOG_FD 2>&1
- ${MAKE-make} -f conftest.mk conftest.out >&AS_MESSAGE_LOG_FD 2>&1
- AS_ECHO(["$as_me:$LINENO: conftest.out contains:"]) >&AS_MESSAGE_LOG_FD 2>&1
- cat conftest.out >&AS_MESSAGE_LOG_FD 2>&1
- result=`cat conftest.out`
- rm -f conftest.mk conftest.out
- if test "X$result" = "Xy"; then
- ovs_cv_gnu_make_if=yes
- else
- ovs_cv_gnu_make_if=no
- fi])])
-
-dnl OVS_CHECK_GNU_MAKE
-dnl
-dnl Checks whether make is GNU make (because Linux kernel Makefiles
-dnl only work with GNU make).
-AC_DEFUN([OVS_CHECK_GNU_MAKE],
- [AC_CACHE_CHECK(
- [whether ${MAKE-make} is GNU make],
- [ovs_cv_gnu_make],
- [rm -f conftest.out
- AS_ECHO(["$as_me:$LINENO: invoking ${MAKE-make} --version:"]) >&AS_MESSAGE_LOG_FD 2>&1
- ${MAKE-make} --version >conftest.out 2>&1
- cat conftest.out >&AS_MESSAGE_LOG_FD 2>&1
- result=`cat conftest.out`
- rm -f conftest.mk conftest.out
-
- case $result in # (
- GNU*) ovs_cv_gnu_make=yes ;; # (
- *) ovs_cv_gnu_make=no ;;
- esac])
- AM_CONDITIONAL([GNU_MAKE], [test $ovs_cv_gnu_make = yes])])
-
dnl OVS_CHECK_SPARSE_TARGET
dnl
dnl The "cgcc" script from "sparse" isn't very good at detecting the
dnl OVS_ENABLE_SPARSE
AC_DEFUN([OVS_ENABLE_SPARSE],
[AC_REQUIRE([OVS_CHECK_SPARSE_TARGET])
- AC_REQUIRE([OVS_CHECK_MAKE_IF])
AC_REQUIRE([OVS_SPARSE_EXTRA_INCLUDES])
: ${SPARSE=sparse}
AC_SUBST([SPARSE])
AC_CONFIG_COMMANDS_PRE(
- [if test $ovs_cv_gnu_make_if = yes; then
- CC='$(if $(C),env REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc $(CGCCFLAGS),'"$CC"')'
- fi])])
+ [CC='$(if $(C),env REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I $(top_srcdir)/include/sparse $(SPARSEFLAGS) $(SPARSE_EXTRA_INCLUDES) " cgcc $(CGCCFLAGS),'"$CC"')'])])
dnl OVS_PTHREAD_SET_NAME
dnl