-
-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_FIND_FIELD_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub],
- [dst_entry])
- 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_dst_lookup_flow.*net],
- [OVS_DEFINE([HAVE_IPV6_DST_LOOKUP_FLOW_NET])])
- OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_stub])
- OVS_GREP_IFELSE([$KSRC/include/net/addrconf.h], [ipv6_dst_lookup_flow])
-
- 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/jump_label.h],
- [DECLARE_STATIC_KEY_FALSE],
- [OVS_DEFINE([HAVE_DECLARE_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/if_vlan.h], [__vlan_hwaccel_clear_tag])
-
- 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_FIND_PARAM_IFELSE([$KSRC/include/linux/netdevice.h],
- [dev_change_flags], [extack],
- [OVS_DEFINE([HAVE_DEV_CHANGE_FLAGS_TAKES_EXTACK])])
-
- OVS_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_state])
- OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netfilter.h], [nf_hook_state],
- [struct net ], [OVS_DEFINE([HAVE_NF_HOOK_STATE_NET])])
- 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_GREP_IFELSE([$KSRC/include/linux/netfilter.h], [CONFIG_NF_NAT_NEEDED])
-
-
- 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.h],
- [nf_ct_invert_tuplepr])
- 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_nat.h], [nf_nat_packet],
- [OVS_DEFINE([HAVE_UPSTREAM_NF_NAT])])
- 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_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_count.h],
- [int nf_conncount_add],
- [],
[OVS_DEFINE([HAVE_UPSTREAM_NF_CONNCOUNT])])])
- OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_timeout.h],
[nf_ct_set_timeout])
- OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_timeout.h],
[struct nf_ct_timeout],
- [OVS_DEFINE([HAVE_NF_CT_TIMEOUT])])
- OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_timeout.h],
- [\(*nf_ct_timeout_find_get_hook\)], [net],
- [OVS_DEFINE([HAVE_NF_CT_TIMEOUT_FIND_GET_HOOK_NET])])
-
- OVS_GREP_IFELSE([$KSRC/include/linux/random.h],
- [prandom_u32[[\(]]],
- [OVS_DEFINE([HAVE_PRANDOM_U32])])
- OVS_GREP_IFELSE([$KSRC/include/linux/random.h], [prandom_u32_max])
- OVS_GREP_IFELSE([$KSRC/include/linux/prandom.h],
- [prandom_u32[[\(]]],
- [OVS_DEFINE([HAVE_PRANDOM_U32])])
- OVS_GREP_IFELSE([$KSRC/include/linux/prandom.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])
- OVS_FIND_PARAM_IFELSE([$KSRC/include/net/rtnetlink.h],
- [rtnl_create_link], [extack],
- [OVS_DEFINE([HAVE_RTNL_CREATE_LINK_TAKES_EXTACK])])
- OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [nf_reset_ct])
-
- # 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], [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], [__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_GREP_IFELSE([$KSRC/include/net/genetlink.h], [genl_validate_flags])
- 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/net/netlink.h], [nla_nest_start_noflag])
- 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], [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_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/net/netfilter/nf_conntrack_helper.h],
- [nf_nat_helper_try_module_get])
- OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_helper.h],
- [nf_nat_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_FIND_FIELD_IFELSE([$KSRC/include/linux/skbuff.h], [sk_buff],
- [vlan_present],
- [OVS_DEFINE([HAVE_SKBUFF_VLAN_PRESENT])])
- 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/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],
- [OVS_DEFINE([HAVE_KVMALLOC_NODE])])
- OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_l3proto.h],
- [nf_conntrack_l3proto],
- [OVS_DEFINE([HAVE_NF_CONNTRACK_L3PROATO_H])])
- OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_core.h],
- [nf_conntrack_in], [nf_hook_state],
-
[OVS_DEFINE([HAVE_NF_CONNTRACK_IN_TAKES_NF_HOOK_STATE])])
- OVS_GREP_IFELSE([$KSRC/include/net/ipv6_frag.h], [IP6_DEFRAG_CONNTRACK_IN],
- [OVS_DEFINE([HAVE_IPV6_FRAG_H])])
- OVS_FIND_PARAM_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_helper.h],
- [nf_ct_helper_ext_add], [nf_conntrack_helper],
- [OVS_DEFINE([HAVE_NF_CT_HELPER_EXT_ADD_TAKES_HELPER])])
- OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [gre_calc_hlen],
- [OVS_DEFINE([HAVE_GRE_CALC_HLEN])])
- OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [ip_gre_calc_hlen],
- [OVS_DEFINE([HAVE_IP_GRE_CALC_HLEN])])
- OVS_GREP_IFELSE([$KSRC/include/linux/rbtree.h], [rb_link_node_rcu],
- [OVS_DEFINE([HAVE_RBTREE_RB_LINK_NODE_RCU])])
- OVS_GREP_IFELSE([$KSRC/include/net/dst_ops.h], [bool confirm_neigh],
- [OVS_DEFINE([HAVE_DST_OPS_CONFIRM_NEIGH])])
- OVS_GREP_IFELSE([$KSRC/include/net/inet_frag.h], [fqdir],
- [OVS_DEFINE([HAVE_INET_FRAG_FQDIR])])
- OVS_FIND_FIELD_IFELSE([$KSRC/include/net/genetlink.h], [genl_ops],
- [policy],
- [OVS_DEFINE([HAVE_GENL_OPS_POLICY])])
- OVS_GREP_IFELSE([$KSRC/include/net/netlink.h],
- [nla_parse_deprecated_strict],
- [OVS_DEFINE([HAVE_NLA_PARSE_DEPRECATED_STRICT])])
- OVS_FIND_OP_PARAM_IFELSE([$KSRC/include/net/rtnetlink.h],
- [validate], [extack],
- [OVS_DEFINE([HAVE_RTNLOP_VALIDATE_WITH_EXTACK])])
- OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h],
- [__skb_set_hash])
- OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [sw_hash])
- OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_get_hash_raw])
-
- 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