1 dnl Checks for the in-box ib_core
2 AC_DEFUN([RDMA_CONFIG_COMPAT],
4 AC_MSG_CHECKING([if ib_verbs has ib_dma_map_single])
6 #include <linux/version.h>
9 #include <rdma/ib_verbs.h>
11 ib_dma_map_single(NULL, NULL, 0, 0);
15 AC_DEFINE(HAVE_INBOX_IB_DMA_MAP, 1,
16 [ib_dma_map_single defined])
21 AC_MSG_CHECKING([if ib_create_cq wants comp_vector])
22 LB_LINUX_TRY_COMPILE([
23 #include <linux/version.h>
24 #include <linux/pci.h>
25 #include <linux/gfp.h>
26 #include <rdma/ib_verbs.h>
28 ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
32 AC_DEFINE(HAVE_INBOX_IB_COMP_VECTOR, 1,
33 [has completion vector])
38 AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_ADDR_CHANGE])
39 LB_LINUX_TRY_COMPILE([
40 #include <linux/version.h>
41 #include <linux/pci.h>
42 #include <linux/gfp.h>
43 #include <rdma/rdma_cm.h>
45 return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
48 AC_DEFINE(HAVE_INBOX_RDMA_CMEV_ADDRCHANGE, 1,
49 [has completion vector])
54 AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_TIMEWAIT_EXIT])
55 LB_LINUX_TRY_COMPILE([
56 #include <linux/version.h>
57 #include <linux/pci.h>
58 #include <linux/gfp.h>
59 #include <rdma/rdma_cm.h>
61 return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
64 AC_DEFINE(HAVE_INBOX_RDMA_CMEV_TIMEWAIT_EXIT, 1,
65 [has completion vector])
70 AC_MSG_CHECKING([if rdma_cm has rdma_set_reuseaddr])
71 LB_LINUX_TRY_COMPILE([
72 #include <linux/version.h>
73 #include <linux/pci.h>
74 #include <linux/gfp.h>
75 #include <rdma/rdma_cm.h>
77 rdma_set_reuseaddr(NULL, 1);
81 AC_DEFINE(HAVE_INBOX_RDMA_SET_REUSEADDR, 1,
82 [rdma_set_reuse defined])
87 AC_MSG_CHECKING([if struct ib_wc has member named ts])
88 LB_LINUX_TRY_COMPILE([
89 #include <linux/version.h>
90 #include <rdma/ib_verbs.h>
98 AC_DEFINE(HAVE_INBOX_IB_WC_TS, 1,
99 [ib_wc has member named ts])
104 AC_MSG_CHECKING([if struct ib_ah_attr has member named dmac])
105 LB_LINUX_TRY_COMPILE([
106 #include <linux/version.h>
107 #include <rdma/ib_verbs.h>
109 struct ib_ah_attr *ah_attr;
110 memset(ah_attr->dmac, 0, 6);
115 AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_DMAC, 1,
116 [ah_attr has member named dmac])
121 AC_MSG_CHECKING([if struct ib_ah_attr has member named vlan_id])
122 LB_LINUX_TRY_COMPILE([
123 #include <linux/version.h>
124 #include <rdma/ib_verbs.h>
126 struct ib_ah_attr *ah_attr;
127 ah_attr->vlan_id = 0;
132 AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_VLAN_ID, 1,
133 [ah_attr has member named vlan_id])
139 dnl Examine kernel functionality
140 AC_DEFUN([LINUX_CONFIG_COMPAT],
142 AC_MSG_CHECKING([if file_system_type has mount method])
143 LB_LINUX_TRY_COMPILE([
144 #include <linux/fs.h>
146 struct file_system_type fst;
152 AC_DEFINE(HAVE_MOUNT_METHOD, 1,
153 [mount method defined])
158 AC_MSG_CHECKING([if kernel has get_next_ino])
159 LB_LINUX_TRY_COMPILE([
160 #include <linux/fs.h>
164 ino = get_next_ino();
168 AC_DEFINE(HAVE_GET_NEXT_INO, 1,
169 [get_next_ino defined])
174 AC_MSG_CHECKING([if kernel has ktime_get_ns])
175 LB_LINUX_TRY_COMPILE([
176 #include <linux/ktime.h>
178 unsigned long long ns;
184 AC_DEFINE(HAVE_KTIME_GET_NS, 1,
185 [ktime_get_ns defined])
190 AC_MSG_CHECKING([if kernel has ktime_get_boot_ns])
191 LB_LINUX_TRY_COMPILE([
192 #include <linux/ktime.h>
194 unsigned long long ns;
196 ns = ktime_get_boot_ns();
200 AC_DEFINE(HAVE_KTIME_GET_BOOT_NS, 1,
201 [ktime_get_boot_ns defined])
206 AC_MSG_CHECKING([if timekeeping.h has ktime_get_real_ns])
207 LB_LINUX_TRY_COMPILE([
208 #include <linux/ktime.h>
209 #include <linux/timekeeping.h>
216 AC_DEFINE(HAVE_KTIME_GET_REAL_NS, 1,
217 [ktime_get_real_ns is defined])
222 AC_MSG_CHECKING([if time.h has time64_to_tm])
223 LB_LINUX_TRY_COMPILE([
224 #include <linux/time.h>
229 time64_to_tm(now, 0, &tm);
234 AC_DEFINE(HAVE_TIME64_TO_TM, 1,
235 [time64_to_tm is defined])
240 AC_MSG_CHECKING([if svc_xprt_class has xcl_ident])
241 LB_LINUX_TRY_COMPILE([
242 #include <linux/sunrpc/xprt.h>
243 #include <linux/sunrpc/svc_xprt.h>
245 struct svc_xprt_class svc_rdma_class = {
246 .xcl_ident = XPRT_TRANSPORT_RDMA,
251 AC_DEFINE(HAVE_XCL_IDENT, 1,
257 AC_MSG_CHECKING([if struct ifla_vf_info has max_tx_rate])
258 LB_LINUX_TRY_COMPILE([
259 #include <linux/if_link.h>
261 struct ifla_vf_info *ivf;
263 ivf->max_tx_rate = 0;
264 ivf->min_tx_rate = 0;
269 AC_DEFINE(HAVE_TX_RATE_LIMIT, 1,
270 [max_tx_rate is defined])
275 AC_MSG_CHECKING([if netdev_master_upper_dev_link gets 4 parameters])
276 LB_LINUX_TRY_COMPILE([
277 #include <linux/netdevice.h>
279 netdev_master_upper_dev_link(NULL, NULL, NULL, NULL);
284 AC_DEFINE(NETDEV_MASTER_UPPER_DEV_LINK_4_PARAMS, 1,
285 [netdev_master_upper_dev_link gets 4 parameters])
290 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh])
291 LB_LINUX_TRY_COMPILE([
292 #include <linux/ethtool.h>
294 const struct ethtool_ops en_ethtool_ops = {
295 .get_rxfh_key_size = NULL,
303 AC_DEFINE(HAVE_GET_SET_RXFH, 1,
304 [get/set_rxfh is defined])
309 AC_MSG_CHECKING([if struct ethtool_ops has get_rxfh_indir_size])
310 LB_LINUX_TRY_COMPILE([
311 #include <linux/ethtool.h>
313 const struct ethtool_ops en_ethtool_ops = {
314 .get_rxfh_indir_size = NULL,
320 AC_DEFINE(HAVE_RXFH_INDIR_SIZE, 1,
321 [get_rxfh_indir_size is defined])
326 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_rxfh_indir_size])
327 LB_LINUX_TRY_COMPILE([
328 #include <linux/ethtool.h>
330 const struct ethtool_ops_ext en_ethtool_ops_ext = {
331 .get_rxfh_indir_size = NULL,
337 AC_DEFINE(HAVE_RXFH_INDIR_SIZE_EXT, 1,
338 [get_rxfh_indir_size is defined in ethtool_ops_ext])
343 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh_indir])
344 LB_LINUX_TRY_COMPILE([
345 #include <linux/ethtool.h>
347 int mlx4_en_get_rxfh_indir(struct net_device *d, u32 *r)
352 struct ethtool_ops en_ethtool_ops;
353 en_ethtool_ops.get_rxfh_indir = mlx4_en_get_rxfh_indir;
358 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
359 [get/set_rxfh_indir is defined])
364 AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable])
365 LB_LINUX_TRY_COMPILE([
366 #include <linux/ethtool.h>
368 const struct ethtool_ops en_ethtool_ops = {
376 AC_DEFINE(HAVE_GET_SET_TUNABLE, 1,
377 [get/set_tunable is defined])
382 AC_MSG_CHECKING([if exist struct ethtool_ops_ext])
383 LB_LINUX_TRY_COMPILE([
384 #include <linux/ethtool.h>
386 const struct ethtool_ops_ext en_ethtool_ops_ext = {
387 .size = sizeof(struct ethtool_ops_ext),
393 AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1,
394 [struct ethtool_ops_ext is defined])
399 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
400 LB_LINUX_TRY_COMPILE([
401 #include <linux/ethtool.h>
403 const struct ethtool_ops_ext en_ethtool_ops_ext = {
404 .get_rxfh_indir = NULL,
405 .set_rxfh_indir = NULL,
411 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR_EXT, 1,
412 [get/set_rxfh_indir is defined])
417 AC_MSG_CHECKING([if struct net_device has dev_port])
418 LB_LINUX_TRY_COMPILE([
419 #include <linux/netdevice.h>
421 struct net_device *dev = NULL;
428 AC_DEFINE(HAVE_NET_DEVICE_DEV_PORT, 1,
429 [dev_port is defined])
434 AC_MSG_CHECKING([if netdev_extended has dev_port])
435 LB_LINUX_TRY_COMPILE([
436 #include <linux/netdevice.h>
438 struct net_device *dev = NULL;
440 netdev_extended(dev)->dev_port = 0;
445 AC_DEFINE(HAVE_NETDEV_EXTENDED_DEV_PORT, 1,
451 AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
452 LB_LINUX_TRY_COMPILE([
453 #include <linux/ptp_clock_kernel.h>
455 struct ptp_clock_info *info;
461 AC_DEFINE(HAVE_PTP_CLOCK_INFO_N_PINS, 1,
467 AC_MSG_CHECKING([if pci.h pci_enable_msi_exact])
468 LB_LINUX_TRY_COMPILE([
469 #include <linux/pci.h>
471 int x = pci_enable_msi_exact(NULL, 0);
476 AC_DEFINE(HAVE_PCI_ENABLE_MSI_EXACT, 1,
477 [pci_enable_msi_exact is defined])
482 AC_MSG_CHECKING([if pci.h pci_enable_msix_range])
483 LB_LINUX_TRY_COMPILE([
484 #include <linux/pci.h>
486 int x = pci_enable_msix_range(NULL, 0, 0, 0);
491 AC_DEFINE(HAVE_PCI_ENABLE_MSIX_RANGE, 1,
492 [pci_enable_msix_range is defined])
497 AC_MSG_CHECKING([if pci.h pci_msix_vec_count])
498 LB_LINUX_TRY_COMPILE([
499 #include <linux/pci.h>
501 int x = pci_msix_vec_count(NULL);
506 AC_DEFINE(HAVE_PCI_MSIX_VEC_COUNT, 1,
507 [pci_msix_vec_count is defined])
512 AC_MSG_CHECKING([if pci_dev has msix_cap])
513 LB_LINUX_TRY_COMPILE([
514 #include <linux/pci.h>
522 AC_DEFINE(HAVE_PCI_MSIX_CAP, 1,
523 [msix_cap is defined])
528 AC_MSG_CHECKING([if mm_struct has pinned_vm])
529 LB_LINUX_TRY_COMPILE([
530 #include <linux/mm_types.h>
538 AC_DEFINE(HAVE_PINNED_VM, 1,
539 [pinned_vm is defined])
544 AC_MSG_CHECKING([if kernel has idr_alloc])
545 LB_LINUX_TRY_COMPILE([
546 #include <linux/idr.h>
549 x = idr_alloc(NULL, NULL, 0, 0, 0);
554 AC_DEFINE(HAVE_IDR_ALLOC, 1,
555 [idr_alloc is defined])
560 AC_MSG_CHECKING([if kernel has percpu variables])
561 LB_LINUX_TRY_COMPILE([
562 #include <linux/percpu.h>
564 static DEFINE_PER_CPU(unsigned int, x);
570 AC_DEFINE(HAVE_PERCPU_VARS, 1,
571 [percpu variables are defined])
576 AC_MSG_CHECKING([if struct iscsi_transport has attr_is_visible])
577 LB_LINUX_TRY_COMPILE([
578 #include <scsi/scsi_transport_iscsi.h>
580 static struct iscsi_transport iscsi_iser_transport = {
581 .attr_is_visible = NULL,
587 AC_DEFINE(HAVE_ISCSI_ATTR_IS_VISIBLE, 1,
588 [attr_is_visible is defined])
593 AC_MSG_CHECKING([if struct iscsi_transport has get_ep_param])
594 LB_LINUX_TRY_COMPILE([
595 #include <scsi/scsi_transport_iscsi.h>
597 static struct iscsi_transport iscsi_iser_transport = {
598 .get_ep_param = NULL,
604 AC_DEFINE(HAVE_ISCSI_GET_EP_PARAM, 1,
605 [get_ep_param is defined])
610 AC_MSG_CHECKING([if struct iscsi_transport has check_protection])
611 LB_LINUX_TRY_COMPILE([
612 #include <scsi/scsi_transport_iscsi.h>
614 static struct iscsi_transport iscsi_iser_transport = {
615 .check_protection = NULL,
621 AC_DEFINE(HAVE_ISCSI_CHECK_PROTECTION, 1,
622 [check_protection is defined])
627 AC_MSG_CHECKING([if iscsi_proto.h has struct iscsi_scsi_req])
628 LB_LINUX_TRY_COMPILE([
629 #include <scsi/iscsi_proto.h>
631 struct iscsi_scsi_req req = {
638 AC_DEFINE(HAVE_ISCSI_SCSI_REQ, 1,
639 [struct iscsi_scsi_req is defined])
644 AC_MSG_CHECKING([if struct request_queue has request_fn_active])
645 LB_LINUX_TRY_COMPILE([
646 #include <linux/blkdev.h>
648 struct request_queue rq = {
649 .request_fn_active = 0,
655 AC_DEFINE(HAVE_REQUEST_QUEUE_REQUEST_FN_ACTIVE, 1,
656 [struct request_queue has request_fn_active])
661 AC_MSG_CHECKING([if netdevice.h has select_queue_fallback_t])
662 LB_LINUX_TRY_COMPILE([
663 #include <linux/netdevice.h>
665 select_queue_fallback_t fallback;
672 AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T, 1,
673 [select_queue_fallback_t is defined])
678 AC_MSG_CHECKING([if netdevice.h has skb_set_hash])
679 LB_LINUX_TRY_COMPILE([
680 #include <linux/netdevice.h>
682 skb_set_hash(NULL, 0, PKT_HASH_TYPE_L3);
687 AC_DEFINE(HAVE_SKB_SET_HASH, 1,
688 [skb_set_hash is defined])
693 AC_MSG_CHECKING([if netdevice.h has alloc_netdev with 4 params])
694 LB_LINUX_TRY_COMPILE([
695 #include <linux/netdevice.h>
697 struct net_device *dev;
699 dev = alloc_netdev(0, NULL, 0, NULL);
704 AC_DEFINE(HAVE_ALLOC_NETDEV_4P, 1,
705 [alloc_netdev has 4 parameters])
710 AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
711 LB_LINUX_TRY_COMPILE([
712 #include <linux/sockios.h>
714 int x = SIOCGHWTSTAMP;
719 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
720 [SIOCGHWTSTAMP is defined])
725 AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
726 LB_LINUX_TRY_COMPILE([
729 inet_get_local_port_range(NULL, NULL, NULL);
734 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
735 [inet_get_local_port_range has 3 parameters])
740 AC_MSG_CHECKING([if net.h has net_get_random_once])
741 LB_LINUX_TRY_COMPILE([
742 #include <linux/net.h>
744 net_get_random_once(NULL, 0);
749 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
750 [net_get_random_once is defined])
755 AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
756 LB_LINUX_TRY_COMPILE([
757 #include <net/inet_sock.h>
759 __inet_ehashfn(0, 0, 0, 0, 0);
764 AC_DEFINE(HAVE_INET_EHASHFN, 1,
765 [__inet_ehashfn is defined])
770 AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
771 LB_LINUX_TRY_COMPILE([
772 #include <linux/err.h>
774 int x = PTR_ERR_OR_ZERO(NULL);
779 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
780 [PTR_ERR_OR_ZERO is defined])
785 AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
786 LB_LINUX_TRY_COMPILE([
787 #include <scsi/libiscsi.h>
789 struct iscsi_session session;
790 session.discovery_sess = 0;
795 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
796 [discovery_sess is defined])
801 AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
802 LB_LINUX_TRY_COMPILE([
803 #include <scsi/iscsi_if.h>
805 int x = ISCSI_PARAM_DISCOVERY_SESS;
810 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
811 [ISCSI_PARAM_DISCOVERY_SESS is defined])
816 AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
817 LB_LINUX_TRY_COMPILE([
818 #include <linux/pci.h>
819 #include <linux/pci_hotplug.h>
821 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
826 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
827 [pcie_link_width is defined])
832 AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
833 LB_LINUX_TRY_COMPILE([
834 #include <linux/pci.h>
835 #include <linux/pci_hotplug.h>
837 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
842 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
843 [pci_bus_speed is defined])
848 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
849 LB_LINUX_TRY_COMPILE([
850 #include <linux/netdevice.h>
852 struct netdev_phys_port_id *x = NULL;
857 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
858 [netdev_phys_port_id is defined])
863 AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
864 LB_LINUX_TRY_COMPILE([
865 #include <linux/if_link.h>
867 struct ifla_vf_info *x;
873 AC_DEFINE(HAVE_LINKSTATE, 1,
874 [linkstate is defined])
879 AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
880 LB_LINUX_TRY_COMPILE([
881 #include <net/busy_poll.h>
883 skb_mark_napi_id(NULL, NULL);
888 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
889 [skb_mark_napi_id is defined])
894 AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
895 LB_LINUX_TRY_COMPILE([
896 #include <linux/netdevice.h>
903 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
904 [napi_hash_add is defined])
909 AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
910 LB_LINUX_TRY_COMPILE([
911 #include <linux/netdevice.h>
913 netif_keep_dst(NULL);
918 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
919 [netif_keep_dst is defined])
924 AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
925 LB_LINUX_TRY_COMPILE([
926 #include <linux/netdevice.h>
928 dev_consume_skb_any(NULL);
933 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
934 [dev_consume_skb_any is defined])
939 AC_MSG_CHECKING([if netdevice.h has __dev_uc_sync])
940 LB_LINUX_TRY_COMPILE([
941 #include <linux/netdevice.h>
943 __dev_uc_sync(NULL, NULL, NULL);
948 AC_DEFINE(HAVE___DEV_UC_SYNC, 1,
949 [__dev_uc_sync is defined])
954 AC_MSG_CHECKING([if netdevice.h has __dev_mc_sync])
955 LB_LINUX_TRY_COMPILE([
956 #include <linux/netdevice.h>
958 __dev_mc_sync(NULL, NULL, NULL);
963 AC_DEFINE(HAVE___DEV_MC_SYNC, 1,
964 [__dev_mc_sync is defined])
969 AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
970 LB_LINUX_TRY_COMPILE([
971 #include <linux/netdevice.h>
973 netdev_txq_bql_complete_prefetchw(NULL);
974 netdev_txq_bql_enqueue_prefetchw(NULL);
979 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
980 [netdev_txq_bql_complete_prefetchw is defined])
985 AC_MSG_CHECKING([if struct sk_buff has xmit_more])
986 LB_LINUX_TRY_COMPILE([
987 #include <linux/skbuff.h>
995 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
996 [xmit_more is defined])
1001 AC_MSG_CHECKING([if struct sk_buff has encapsulation])
1002 LB_LINUX_TRY_COMPILE([
1003 #include <linux/skbuff.h>
1005 struct sk_buff *skb;
1006 skb->encapsulation = 0;
1011 AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
1012 [encapsulation is defined])
1017 AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
1018 LB_LINUX_TRY_COMPILE([
1019 #include <linux/etherdevice.h>
1021 eth_get_headlen(NULL, 0);
1026 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
1027 [eth_get_headlen is defined])
1032 AC_MSG_CHECKING([if struct sk_buff has csum_level])
1033 LB_LINUX_TRY_COMPILE([
1034 #include <linux/skbuff.h>
1036 struct sk_buff *skb;
1037 skb->csum_level = 0;
1042 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
1043 [csum_level is defined])
1048 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
1049 LB_LINUX_TRY_COMPILE([
1050 #include <linux/skbuff.h>
1052 skb_inner_transport_header(NULL);
1057 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
1058 [skb_inner_transport_header is defined])
1063 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
1064 LB_LINUX_TRY_COMPILE([
1065 #include <linux/skbuff.h>
1067 skb_inner_network_header(NULL);
1072 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
1073 [skb_inner_network_header is defined])
1078 AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
1079 LB_LINUX_TRY_COMPILE([
1080 #include <linux/if_vlan.h>
1082 vlan_dev_get_egress_qos_mask(NULL, 0);
1087 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
1088 [vlan_dev_get_egress_qos_mask is defined])
1093 AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
1094 LB_LINUX_TRY_COMPILE([
1095 #include <linux/netdevice.h>
1097 netdev_get_prio_tc_map(NULL, 0);
1102 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
1103 [netdev_get_prio_tc_map is defined])
1108 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
1109 LB_LINUX_TRY_COMPILE([
1110 #include <linux/if_vlan.h>
1112 __vlan_find_dev_deep_rcu(NULL, 0, 0);
1117 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
1118 [__vlan_find_dev_deep_rcu is defined])
1123 AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
1124 LB_LINUX_TRY_COMPILE([
1125 #include <linux/netdevice.h>
1127 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
1133 struct net_device_opts ndops;
1135 ndops.ndo_select_queue = select_queue;
1140 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
1141 [ndo_select_queue has accel_priv])
1146 AC_MSG_CHECKING([if include/net/bonding.h exists])
1147 LB_LINUX_TRY_COMPILE([
1148 #include <net/bonding.h>
1153 AC_DEFINE(HAVE_BONDING_H, 1,
1154 [include/net/bonding.h exists])
1159 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
1160 LB_LINUX_TRY_COMPILE([
1161 #include <net/bonding.h>
1163 struct bonding *bond = NULL;
1164 struct list_head *iter = NULL;
1165 struct slave *slave = NULL;
1167 bond_for_each_slave(bond, slave, iter) ;
1172 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
1173 [bond_for_each_slave has 3 parameters])
1179 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
1180 LB_LINUX_TRY_COMPILE([
1181 #include <linux/u64_stats_sync.h>
1183 struct u64_stats_sync sync;
1184 u64_stats_init(&sync);
1189 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
1190 [u64_stats_sync is defined])
1195 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
1196 LB_LINUX_TRY_COMPILE([
1197 #include <linux/u64_stats_sync.h>
1199 struct u64_stats_sync sync;
1200 u64_stats_fetch_begin_irq(&sync);
1205 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
1206 [u64_stats_fetch_begin_irq is defined])
1210 AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
1211 LB_LINUX_TRY_COMPILE([
1212 #include <linux/etherdevice.h>
1214 char dest[6], src[6];
1215 ether_addr_copy(&dest, &src);
1220 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
1221 [ether_addr_copy is defined])
1226 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
1227 LB_LINUX_TRY_COMPILE([
1228 #include <linux/netdevice.h>
1230 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
1236 struct net_device_ops netdev_ops;
1238 netdev_ops.ndo_set_vf_rate = set_vf_rate;
1242 AC_DEFINE(HAVE_SET_VF_RATE, 1,
1243 [ndo_set_vf_rate is defined])
1248 AC_MSG_CHECKING([if netdev_extended has hw_features])
1249 LB_LINUX_TRY_COMPILE([
1250 #include <linux/netdevice.h>
1252 struct net_device *dev = NULL;
1254 netdev_extended(dev)->hw_features = 0;
1259 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
1265 AC_MSG_CHECKING([if net_device_extended has _tx_ext])
1266 LB_LINUX_TRY_COMPILE([
1267 #include <linux/netdevice.h>
1269 struct net_device *dev = NULL;
1271 netdev_extended(dev)->_tx_ext = NULL;
1276 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
1282 AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
1283 LB_LINUX_TRY_COMPILE([
1284 #include <linux/netdevice.h>
1286 int busy_poll(struct napi_struct *napi)
1291 struct net_device *dev = NULL;
1293 netdev_extended(dev)->ndo_busy_poll = busy_poll;
1298 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
1304 AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
1305 LB_LINUX_TRY_COMPILE([
1306 #include <linux/netdevice.h>
1308 struct net_device *dev = NULL;
1310 set_netdev_hw_features(dev, 0);
1315 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
1321 AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
1322 LB_LINUX_TRY_COMPILE([
1323 #include <linux/netdevice.h>
1325 struct net_device *dev = NULL;
1327 netif_set_xps_queue(dev, NULL, 0);
1332 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
1339 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
1340 LB_LINUX_TRY_COMPILE([
1341 #include <linux/netdevice.h>
1343 int set_features(struct net_device *dev, netdev_features_t features)
1348 struct net_device_ops netdev_ops;
1350 netdev_ops.ndo_set_features = set_features;
1354 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1355 [ndo_set_features is defined])
1360 AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1361 LB_LINUX_TRY_COMPILE([
1362 #include <linux/netdevice.h>
1364 int rx_flow_steer(struct net_device *dev,
1365 const struct sk_buff *skb,
1372 struct net_device_ops netdev_ops;
1374 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1378 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1379 [ndo_rx_flow_steer is defined])
1384 AC_MSG_CHECKING([if struct net_device has priv_flags])
1385 LB_LINUX_TRY_COMPILE([
1386 #include <linux/netdevice.h>
1388 struct net_device *netdev;
1389 netdev->priv_flags = 0;
1394 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1395 [priv_flags is defined])
1400 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1401 LB_LINUX_TRY_COMPILE([
1402 #include <linux/netdevice.h>
1404 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1405 struct rtnl_link_stats64 *storage)
1407 struct rtnl_link_stats64 stats_64;
1411 struct net_device_ops netdev_ops;
1413 netdev_ops.ndo_get_stats64 = get_stats_64;
1418 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1419 [ndo_get_stats64 is defined])
1423 AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1424 LB_LINUX_TRY_COMPILE([
1425 #include <linux/netdevice.h>
1427 struct net_device_ops netdev_ops = {
1428 .ndo_bridge_setlink = NULL,
1429 .ndo_bridge_getlink = NULL,
1435 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1436 [ndo_bridge_set/getlink is defined])
1441 AC_MSG_CHECKING([if rtnetlink.h ndo_dflt_bridge_getlink has 7 params])
1442 LB_LINUX_TRY_COMPILE([
1443 #include <linux/rtnetlink.h>
1445 ndo_dflt_bridge_getlink(NULL, 0, 0, NULL, 0, 0, 0);
1450 AC_DEFINE(HAVE_NDO_DFLT_BRIDGE_GETLINK_7_PARAMS, 1,
1451 [ ndo_dflt_bridge_getlink with 7 params is defined])
1456 AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1457 LB_LINUX_TRY_COMPILE([
1458 #include <linux/netdevice.h>
1461 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1465 struct net_device_ops netdev_ops;
1467 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1468 netdev_ops.ndo_vlan_rx_add_vid (NULL, 1, 1) ;
1473 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1474 [ndo_vlan_rx_add_vid has 3 parameters])
1479 AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1480 LB_LINUX_TRY_COMPILE([
1481 #include <linux/netdevice.h>
1483 int get_phys_port_id(struct net_device *dev,
1484 struct netdev_phys_port_id *ppid)
1489 struct net_device_ops netdev_ops;
1491 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1496 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1502 AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1503 LB_LINUX_TRY_COMPILE([
1504 #include <linux/netdevice.h>
1506 struct net_device_ops_ext netdev_ops_ext = {
1507 .size = sizeof(struct net_device_ops_ext),
1513 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1514 [struct net_device_ops_ext is defined])
1519 AC_MSG_CHECKING([if struct net_device_ops_extended exist])
1520 LB_LINUX_TRY_COMPILE([
1521 #include <linux/netdevice.h>
1523 struct net_device_ops_extended ops_extended;
1528 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXTENDED, 1,
1529 [struct net_device_ops_extended is defined])
1534 AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1535 LB_LINUX_TRY_COMPILE([
1536 #include <linux/netdevice.h>
1538 int get_phys_port_id(struct net_device *dev,
1539 struct netdev_phys_port_id *ppid)
1544 struct net_device_ops_ext netdev_ops_ext;
1546 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1551 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1552 [ndo_get_phys_port_id is defined])
1557 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1558 LB_LINUX_TRY_COMPILE([
1559 #include <linux/netdevice.h>
1561 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1566 struct net_device_ops netdev_ops;
1568 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1573 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1574 [ndo_set_vf_spoofchk is defined in net_device_ops])
1579 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1580 LB_LINUX_TRY_COMPILE([
1581 #include <linux/netdevice.h>
1583 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1588 struct net_device_ops_ext netdev_ops_ext;
1590 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1595 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1596 [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1601 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1602 LB_LINUX_TRY_COMPILE([
1603 #include <linux/netdevice.h>
1605 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1610 struct net_device_ops netdev_ops;
1612 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1617 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1618 [ndo_set_vf_link_state is defined in net_device_ops])
1623 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1624 LB_LINUX_TRY_COMPILE([
1625 #include <linux/netdevice.h>
1627 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1632 struct net_device_ops_ext netdev_ops_ext;
1634 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1639 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1640 [ndo_set_vf_link_state is defined])
1646 AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1647 LB_LINUX_TRY_COMPILE([
1648 #include <linux/netdevice.h>
1650 struct net_device dev;
1652 ret = netif_set_real_num_tx_queues(&dev, 2);
1656 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1657 [netif_set_real_num_tx_queues returns int])
1662 AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1663 LB_LINUX_TRY_COMPILE([
1664 #include <linux/netdevice.h>
1672 AC_DEFINE(HAVE_XPS_MAP, 1,
1673 [struct xps_map is defined])
1678 AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1679 LB_LINUX_TRY_COMPILE([
1680 #include <linux/ethtool.h>
1682 const struct ethtool_ops en_ethtool_ops = {
1689 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1690 [set_phys_id is defined])
1695 AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1696 LB_LINUX_TRY_COMPILE([
1697 #include <linux/ethtool.h>
1699 const struct ethtool_ops en_ethtool_ops = {
1700 .get_channels = NULL,
1701 .set_channels = NULL,
1707 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1708 [get/set_channels is defined])
1713 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1714 LB_LINUX_TRY_COMPILE([
1715 #include <linux/ethtool.h>
1717 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1718 .get_channels = NULL,
1719 .set_channels = NULL,
1725 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1726 [get/set_channels is defined in ethtool_ops_ext])
1731 AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1732 LB_LINUX_TRY_COMPILE([
1733 #include <linux/ethtool.h>
1735 const struct ethtool_ops en_ethtool_ops = {
1736 .get_ts_info = NULL,
1742 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1743 [get_ts_info is defined])
1748 AC_MSG_CHECKING([if struct ethtool_ops has set_dump])
1749 LB_LINUX_TRY_COMPILE([
1750 #include <linux/ethtool.h>
1752 const struct ethtool_ops en_ethtool_ops = {
1759 AC_DEFINE(HAVE_ETHTOOL_OPS_SET_DUMP, 1,
1760 [set_dump is defined])
1765 AC_MSG_CHECKING([if struct ethtool_ops has get_module_info])
1766 LB_LINUX_TRY_COMPILE([
1767 #include <linux/ethtool.h>
1769 const struct ethtool_ops en_ethtool_ops = {
1770 .get_module_info = NULL,
1776 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_INFO, 1,
1777 [get_module_info is defined])
1782 AC_MSG_CHECKING([if struct ethtool_ops has get_module_eeprom])
1783 LB_LINUX_TRY_COMPILE([
1784 #include <linux/ethtool.h>
1786 const struct ethtool_ops en_ethtool_ops = {
1787 .get_module_eeprom = NULL,
1793 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_EEPROM, 1,
1794 [get_module_eeprom is defined])
1799 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1800 LB_LINUX_TRY_COMPILE([
1801 #include <linux/ethtool.h>
1803 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1804 .get_ts_info = NULL,
1810 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1811 [get_ts_info is defined in ethtool_ops_ext])
1816 AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
1817 LB_LINUX_TRY_COMPILE([
1818 #include <linux/ethtool.h>
1820 unsigned char mac[ETH_ALEN];
1821 struct ethtool_flow_ext h_ext;
1823 memcpy(&mac, h_ext.h_dest, ETH_ALEN);
1828 AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
1829 [ethtool_flow_ext has h_dest])
1834 AC_MSG_CHECKING([if netdevice.h has struct dev_addr_list])
1835 LB_LINUX_TRY_COMPILE([
1836 #include <linux/netdevice.h>
1838 struct dev_addr_list addr;
1842 AC_DEFINE(HAVE_NETDEV_DEV_ADDR, 1,
1843 [dev_addr_list is defined])
1848 AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1849 LB_LINUX_TRY_COMPILE([
1850 #include <linux/pci.h>
1852 struct pci_dev pdev;
1853 pci_vfs_assigned(&pdev);
1857 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1858 [pci_vfs_assigned is defined])
1863 AC_MSG_CHECKING([if vlan_insert_tag_set_proto is defined])
1864 LB_LINUX_TRY_COMPILE([
1865 #include <linux/if_vlan.h>
1867 struct sk_buff *skb;
1868 vlan_insert_tag_set_proto(skb, 0, 0);
1872 AC_DEFINE(HAVE_VLAN_INSERT_TAG_SET_PROTO, 1,
1873 [vlan_insert_tag_set_proto is defined])
1876 AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1877 LB_LINUX_TRY_COMPILE([
1878 #include <linux/if_vlan.h>
1880 struct sk_buff *skb;
1881 __vlan_put_tag(skb, 0, 0);
1885 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1886 [__vlan_put_tag has 3 parameters])
1892 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1893 LB_LINUX_TRY_COMPILE([
1894 #include <linux/if_vlan.h>
1896 struct sk_buff *skb;
1897 __vlan_hwaccel_put_tag(skb, 0, 0);
1902 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1903 [__vlan_hwaccel_put_tag has 3 parameters])
1908 AC_MSG_CHECKING([if struct inet6_ifaddr has if_next])
1909 LB_LINUX_TRY_COMPILE([
1910 #include <net/if_inet6.h>
1912 struct inet6_ifaddr ifp ;
1918 AC_DEFINE(HAVE_INETADDR_IF_NEXT, 1,
1919 [if_next is defined])
1924 AC_MSG_CHECKING([if struct net_device has hw_features])
1925 LB_LINUX_TRY_COMPILE([
1926 #include <linux/netdevice.h>
1928 struct net_device dev;
1929 dev.hw_features = 0;
1934 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1935 [hw_features is defined])
1940 AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1941 LB_LINUX_TRY_COMPILE([
1942 #include <linux/netdevice.h>
1944 struct net_device dev;
1945 dev.hw_enc_features = 0;
1950 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1951 [hw_enc_features is defined])
1956 AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1957 LB_LINUX_TRY_COMPILE([
1958 #include <linux/netdevice.h>
1960 struct net_device dev;
1961 dev.rx_cpu_rmap = NULL;
1966 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1967 [rx_cpu_rmap is defined])
1972 AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1973 LB_LINUX_TRY_COMPILE([
1974 #include <linux/if_vlan.h>
1976 struct sk_buff *skb;
1977 vlan_hwaccel_receive_skb(skb,0,0);
1981 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1982 [vlan_hwaccel_receive_skb is defined])
1987 AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1988 LB_LINUX_TRY_COMPILE([
1989 #include <linux/irq.h>
1990 #include <linux/irqdesc.h>
1992 struct irq_desc desc;
1993 struct irq_data *data = irq_desc_get_irq_data(&desc);
1998 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1999 [irq_desc_get_irq_data is defined])
2005 AC_MSG_CHECKING([if pci_dev has pcie_mpss])
2006 LB_LINUX_TRY_COMPILE([
2007 #include <linux/pci.h>
2009 struct pci_dev *pdev;
2011 pdev->pcie_mpss = 0;
2015 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
2016 [pcie_mpss is defined])
2021 AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
2022 LB_LINUX_TRY_COMPILE([
2023 #include <uapi/linux/if_ether.h>
2028 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
2029 [uapi/linux/if_ether.h exist])
2034 AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
2035 LB_LINUX_TRY_COMPILE([
2036 #include <linux/if_link.h>
2038 struct ifla_vf_info *ivf;
2044 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
2045 [spoofchk is defined])
2050 AC_MSG_CHECKING([if vxlan.h has vxlan_gso_check])
2051 LB_LINUX_TRY_COMPILE([
2052 #include <net/vxlan.h>
2054 vxlan_gso_check(NULL);
2059 AC_DEFINE(HAVE_VXLAN_GSO_CHECK, 1,
2060 [vxlan_gso_check is defined])
2065 AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
2066 LB_LINUX_TRY_COMPILE([
2067 #include <net/dst.h>
2069 struct neighbour *neigh = dst_get_neighbour(NULL);
2074 AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
2080 AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
2081 LB_LINUX_TRY_COMPILE([
2082 #include <linux/netlink.h>
2084 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
2089 AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
2095 AC_MSG_CHECKING([if netlink_dump_start has 5 parameters])
2096 LB_LINUX_TRY_COMPILE([
2097 #include <linux/netlink.h>
2099 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL);
2104 AC_DEFINE(HAVE_NETLINK_DUMP_START_5P, 1,
2110 AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
2111 LB_LINUX_TRY_COMPILE([
2112 #include <net/dcbnl.h>
2114 const struct dcbnl_rtnl_ops en_dcbnl_ops = {
2115 .ieee_getmaxrate = NULL,
2116 .ieee_setmaxrate = NULL,
2122 AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
2123 [ieee_getmaxrate/ieee_setmaxrate is defined])
2129 ac_c_werror_flag=yes
2130 save_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
2131 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
2133 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
2134 LB_LINUX_TRY_COMPILE([
2135 #include <net/bonding.h>
2137 struct bonding *bond = NULL;
2138 struct slave *slave = NULL;
2141 bond_for_each_slave(bond, slave, iter) ;
2146 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
2147 [bond_for_each_slave has int for 3rd parameter])
2151 EXTRA_KCFLAGS="$save_EXTRA_KCFLAGS"
2155 AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
2156 LB_LINUX_TRY_COMPILE([
2157 #include <linux/netdevice.h>
2159 netdev_master_upper_dev_get_rcu(NULL);
2164 AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
2165 [netdev_master_upper_dev_get_rcu is defined])
2170 AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
2171 LB_LINUX_TRY_COMPILE([
2172 #include <linux/if_vlan.h>
2174 __vlan_find_dev_deep(NULL, 0, 0);
2179 AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
2180 [__vlan_find_dev_deep has 3 paramters])
2185 AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
2186 LB_LINUX_TRY_COMPILE([
2187 #include <linux/skbuff.h>
2189 __skb_alloc_page(0, NULL);
2194 AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
2195 [sk_buff has __skb_alloc_page])
2200 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
2201 LB_LINUX_TRY_COMPILE([
2202 #include <linux/if_vlan.h>
2204 __vlan_hwaccel_put_tag(NULL, 0, 0);
2209 AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
2210 [__vlan_hwaccel_put_tag has 3 paramters])
2215 AC_MSG_CHECKING([if linux/mm_types.h has struct page_frag])
2216 LB_LINUX_TRY_COMPILE([
2217 #include <linux/mm_types.h>
2219 struct page_frag frag = {0};
2224 AC_DEFINE(HAVE_MM_TYPES_PAGE_FRAG, 1,
2225 [linux/mm_types.h has struct page_frag])
2230 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep])
2231 LB_LINUX_TRY_COMPILE([
2232 #include <linux/if_vlan.h>
2234 __vlan_find_dev_deep(NULL, 0);
2239 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP, 1,
2240 [__vlan_find_dev_deep is defined])
2245 AC_MSG_CHECKING([if idr .h has idr_Alloc])
2246 LB_LINUX_TRY_COMPILE([
2247 #include <linux/idr.h>
2249 idr_alloc(NULL, NULL, 0, 0, 0);
2253 AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
2254 [idr_Alloc is defined]) ],[
2258 AC_MSG_CHECKING([if idr.h has idr_is_empty])
2259 LB_LINUX_TRY_COMPILE([
2260 #include <linux/idr.h>
2262 bool x = idr_is_empty(NULL);
2266 AC_DEFINE(HAVE_IDR_IS_EMPTY, 1,
2267 [idr_is_empty is defined])
2272 AC_MSG_CHECKING([if completion.h has reinit_completion])
2273 LB_LINUX_TRY_COMPILE([
2274 #include <linux/completion.h>
2276 struct completion c;
2278 reinit_completion(&c);
2282 AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
2283 [reinit_completion is defined])
2288 AC_MSG_CHECKING([if dma-mapping.h has dma_set_mask_and_coherent])
2289 LB_LINUX_TRY_COMPILE([
2290 #include <linux/dma-mapping.h>
2292 dma_set_mask_and_coherent(NULL, 0);
2297 AC_DEFINE(HAVE_DMA_SET_MASK_AND_COHERENT, 1,
2298 [dma_set_mask_and_coherent is defined])
2303 AC_MSG_CHECKING([if in.h has proto_ports_offset])
2304 LB_LINUX_TRY_COMPILE([
2305 #include <linux/in.h>
2307 int x = proto_ports_offset(IPPROTO_TCP);
2311 AC_DEFINE(HAVE_PROTO_PORTS_OFFSET, 1,
2312 [proto_ports_offset is defined])
2317 LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
2318 [kernel/crash_dump.c],
2319 [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
2320 [elfcorehdr_addr is exported by the kernel])],
2323 AC_MSG_CHECKING([if netif_set_real_num_rx_queues is defined])
2324 LB_LINUX_TRY_COMPILE([
2325 #include <linux/netdevice.h>
2327 int rc = netif_set_real_num_rx_queues(NULL, 0);
2332 AC_DEFINE(HAVE_NETIF_SET_REAL_NUM_RX_QUEUES, 1,
2333 [netif_set_real_num_rx_queues is defined])
2338 AC_MSG_CHECKING([if if_vlan.h has is_vlan_dev])
2339 LB_LINUX_TRY_COMPILE([
2340 #include <linux/netdevice.h>
2341 #include <linux/if_vlan.h>
2343 struct net_device dev;
2349 AC_DEFINE(HAVE_IS_VLAN_DEV, 1,
2350 [is_vlan_dev is defined])
2355 AC_MSG_CHECKING([if linux/timecounter.h exists])
2356 LB_LINUX_TRY_COMPILE([
2357 #include <linux/timecounter.h>
2362 AC_DEFINE(HAVE_TIMECOUNTER_H, 1,
2363 [linux/timecounter.h exists])
2368 # timecounter_adjtime can be in timecounter.h or clocksource.h
2369 AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
2370 LB_LINUX_TRY_COMPILE([
2371 #include <linux/timecounter.h>
2373 struct timecounter x;
2375 timecounter_adjtime(&x, y);
2380 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
2381 [timecounter_adjtime is defined])
2386 AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
2387 LB_LINUX_TRY_COMPILE([
2388 #include <linux/clocksource.h>
2390 struct timecounter x;
2392 timecounter_adjtime(&x, y);
2397 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
2398 [timecounter_adjtime is defined])
2403 AC_MSG_CHECKING([if cyclecounter_cyc2ns has 4 parameters])
2404 LB_LINUX_TRY_COMPILE([
2405 #include <linux/timecounter.h>
2407 cyclecounter_cyc2ns(NULL, NULL, 0, NULL);
2412 AC_DEFINE(HAVE_CYCLECOUNTER_CYC2NS_4_PARAMS, 1,
2413 [cyclecounter_cyc2ns has 4 parameters])
2418 AC_MSG_CHECKING([if netdevice.h struct net_device_ops has ndo_features_check])
2419 LB_LINUX_TRY_COMPILE([
2420 #include <linux/netdevice.h>
2422 static const struct net_device_ops mlx4_netdev_ops = {
2423 .ndo_features_check = NULL,
2429 AC_DEFINE(HAVE_NETDEV_FEATURES_T, 1,
2430 [netdev_features_t is defined])
2435 AC_MSG_CHECKING([if struct ethtool_ops get_rxnfc gets u32 *rule_locs])
2436 LB_LINUX_TRY_COMPILE([
2437 #include <linux/ethtool.h>
2438 static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *c,
2444 struct ethtool_ops x = {
2445 .get_rxnfc = mlx4_en_get_rxnfc,
2451 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_RXNFC_U32_RULE_LOCS, 1,
2452 [ethtool_ops get_rxnfc gets u32 *rule_locs])
2457 AC_MSG_CHECKING([if ethtool.h enum ethtool_stringset has ETH_SS_RSS_HASH_FUNCS])
2458 LB_LINUX_TRY_COMPILE([
2459 #include <linux/ethtool.h>
2461 enum ethtool_stringset x = ETH_SS_RSS_HASH_FUNCS;
2466 AC_DEFINE(HAVE_ETH_SS_RSS_HASH_FUNCS, 1,
2467 [ETH_SS_RSS_HASH_FUNCS is defined])
2472 AC_MSG_CHECKING([if include/linux/irq_poll.h exists])
2473 LB_LINUX_TRY_COMPILE([
2474 #include <linux/irq_poll.h>
2479 AC_DEFINE(HAVE_IRQ_POLL_H, 1,
2480 [include/linux/irq_poll.h exists])
2485 AC_MSG_CHECKING([if linux/dma-mapping.h has struct dma_attrs])
2486 LB_LINUX_TRY_COMPILE([
2487 #include <linux/dma-mapping.h>
2489 struct dma_attrs *attrs;
2492 ret = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);
2497 AC_DEFINE(HAVE_STRUCT_DMA_ATTRS, 1,
2498 [struct dma_attrs is defined])
2503 AC_MSG_CHECKING([if pci.h has pcie_get_minimum_link])
2504 LB_LINUX_TRY_COMPILE([
2505 #include <linux/pci.h>
2508 ret = pcie_get_minimum_link(NULL, NULL, NULL);
2513 AC_DEFINE(HAVE_PCIE_GET_MINIMUM_LINK, 1,
2514 [pcie_get_minimum_link is defined])
2519 AC_MSG_CHECKING([if netdevice.h has netdev_for_each_all_upper_dev_rcu])
2520 LB_LINUX_TRY_COMPILE([
2521 #include <linux/netdevice.h>
2523 struct net_device *dev;
2524 struct net_device *upper;
2525 struct list_head *list;
2527 netdev_for_each_all_upper_dev_rcu(dev, upper, list);
2531 AC_DEFINE(HAVE_NETDEV_FOR_EACH_ALL_UPPER_DEV_RCU, 1,
2532 [netdev_master_upper_dev_get_rcu is defined])
2537 AC_MSG_CHECKING([if netdevice.h has netdev_has_upper_dev])
2538 LB_LINUX_TRY_COMPILE([
2539 #include <linux/netdevice.h>
2541 struct net_device *dev;
2542 struct net_device *upper;
2543 netdev_has_upper_dev(dev, upper);
2548 AC_DEFINE(HAVE_NETDEV_HAS_UPPER_DEV, 1,
2549 [netdev_has_upper_dev is defined])
2554 AC_MSG_CHECKING([if ethtool.h has __ethtool_get_link_ksettings])
2555 LB_LINUX_TRY_COMPILE([
2556 #include <linux/ethtool.h>
2558 __ethtool_get_link_ksettings(NULL, NULL);
2563 AC_DEFINE(HAVE___ETHTOOL_GET_LINK_KSETTINGS, 1,
2564 [__ethtool_get_link_ksettings is defined])
2569 AC_MSG_CHECKING([if addrconf.h has addrconf_ifid_eui48])
2570 LB_LINUX_TRY_COMPILE([
2571 #include <net/addrconf.h>
2573 int x = addrconf_ifid_eui48(NULL, NULL);
2578 AC_DEFINE(HAVE_ADDRCONF_IFID_EUI48, 1,
2579 [addrconf_ifid_eui48 is defined])
2584 AC_MSG_CHECKING([if mm.h get_user_pages_remote])
2585 LB_LINUX_TRY_COMPILE([
2586 #include <linux/mm.h>
2588 get_user_pages_remote(NULL, NULL, 0, 0, 0, 0, NULL, NULL);
2593 AC_DEFINE(HAVE_GET_USER_PAGES_REMOTE, 1,
2594 [get_user_pages_remote exist])
2599 AC_MSG_CHECKING([if ip_fib.h fib_lookup has 4 params])
2600 LB_LINUX_TRY_COMPILE([
2601 #include <linux/bug.h>
2602 #include <net/ip_fib.h>
2604 fib_lookup(NULL, NULL, NULL, 0);
2609 AC_DEFINE(HAVE_FIB_LOOKUP_4_PARAMS, 1,
2610 [fib_lookup has 4 params])
2615 AC_MSG_CHECKING([if include/net/devlink.h exists])
2616 LB_LINUX_TRY_COMPILE([
2617 #include <net/devlink.h>
2622 AC_DEFINE(HAVE_NET_DEVLINK_H, 1,
2623 [include/net/devlink.h exists])
2628 AC_MSG_CHECKING([if io_mapping_map_wc has 3 params])
2629 LB_LINUX_TRY_COMPILE([
2630 #include <linux/io-mapping.h>
2632 io_mapping_map_wc(NULL, 0, 0);
2637 AC_DEFINE(HAVE_IO_MAPPING_MAP_WC_3_PARAMS, 1,
2638 [io_mapping_map_wc has 3 params])
2643 AC_MSG_CHECKING([if include/net/dcbnl.h struct dcbnl_rtnl_ops has *ieee_getqcn])
2644 LB_LINUX_TRY_COMPILE([
2645 #include <linux/netdevice.h>
2646 #include <net/dcbnl.h>
2648 struct dcbnl_rtnl_ops x = {
2649 .ieee_getqcn = NULL,
2655 AC_DEFINE(HAVE_IEEE_GETQCN, 1,
2656 [ieee_getqcn is defined])
2661 AC_MSG_CHECKING([if dcbnl.h has struct ieee_qcn])
2662 LB_LINUX_TRY_COMPILE([
2663 #include <linux/netdevice.h>
2664 #include <net/dcbnl.h>
2671 AC_DEFINE(HAVE_STRUCT_IEEE_QCN, 1,
2672 [ieee_qcn is defined])
2677 AC_MSG_CHECKING([if netdevice.h has napi_consume_skb])
2678 LB_LINUX_TRY_COMPILE([
2679 #include <linux/skbuff.h>
2681 napi_consume_skb(NULL, 0);
2686 AC_DEFINE(HAVE_NAPI_CONSUME_SKB, 1,
2687 [napi_consume_skb is defined])
2692 AC_MSG_CHECKING([if include/linux/bpf.h exists])
2693 LB_LINUX_TRY_COMPILE([
2694 #include <linux/bpf.h>
2699 AC_DEFINE(HAVE_LINUX_BPF_H, 1,
2700 [include/linux/bpf.h exists])
2705 AC_MSG_CHECKING([if mm_types.h struct page has _count])
2706 LB_LINUX_TRY_COMPILE([
2707 #include <linux/mm.h>
2708 #include <linux/mm_types.h>
2711 p._count.counter = 0;
2716 AC_DEFINE(HAVE_MM_PAGE__COUNT, 1,
2717 [struct page has _count])
2722 AC_MSG_CHECKING([if include/linux/page_ref.h exists])
2723 LB_LINUX_TRY_COMPILE([
2724 #include <linux/page_ref.h>
2729 AC_DEFINE(HAVE_LINUX_PAGE_REF_H, 1,
2730 [include/linux/page_ref.h exists])
2735 AC_MSG_CHECKING([if linux/ethtool.h has ETHTOOL_xLINKSETTINGS API])
2736 LB_LINUX_TRY_COMPILE([
2737 #include <linux/ethtool.h>
2739 enum ethtool_link_mode_bit_indices x = ETHTOOL_LINK_MODE_TP_BIT;
2744 AC_DEFINE(HAVE_ETHTOOL_xLINKSETTINGS, 1,
2745 [ETHTOOL_xLINKSETTINGS API is defined])
2750 AC_MSG_CHECKING([if linux/printk.h exists])
2751 LB_LINUX_TRY_COMPILE([
2752 #include <linux/printk.h>
2757 AC_DEFINE(HAVE_LINUX_PRINTK_H, 1,
2758 [linux/printk.h is defined])
2763 AC_MSG_CHECKING([if printk.h has struct va_format])
2764 LB_LINUX_TRY_COMPILE([
2765 #include <linux/printk.h>
2772 AC_DEFINE(HAVE_VA_FORMAT, 1,
2773 [va_format is defined])
2778 AC_MSG_CHECKING([if irq.h irq_data has member affinity])
2779 LB_LINUX_TRY_COMPILE([
2780 #include <linux/irq.h>
2781 #include <linux/cpumask.h>
2784 struct irq_data y = {
2791 AC_DEFINE(HAVE_IRQ_DATA_AFFINITY, 1,
2792 [irq_data member affinity is defined])
2797 AC_MSG_CHECKING([if irq.h irq_data_get_affinity_mask])
2798 LB_LINUX_TRY_COMPILE([
2799 #include <linux/irq.h>
2801 irq_data_get_affinity_mask(NULL);
2806 AC_DEFINE(HAVE_IRQ_DATA_GET_AFFINITY_MASK, 1,
2807 [irq_data_get_affinity_mask exist])
2812 AC_MSG_CHECKING([if netdevice.h has netif_tx_napi_add])
2813 LB_LINUX_TRY_COMPILE([
2814 #include <linux/netdevice.h>
2816 netif_tx_napi_add(NULL, NULL, NULL, 0);
2821 AC_DEFINE(HAVE_NETIF_TX_NAPI_ADD, 1,
2822 [netif_tx_napi_add is defined])
2827 AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
2828 LB_LINUX_TRY_COMPILE([
2829 #include <linux/netdevice.h>
2831 struct net_device_ops x = {
2832 .ndo_setup_tc = NULL,
2838 AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
2839 [ndo_setup_tc is defined])
2844 AC_MSG_CHECKING([if ndo_setup_tc takes 4 parameters])
2845 LB_LINUX_TRY_COMPILE([
2846 #include <linux/netdevice.h>
2848 int mlx4_en_setup_tc(struct net_device *dev, u32 handle,
2849 __be16 protocol, struct tc_to_netdev *tc)
2854 struct net_device_ops x = {
2855 .ndo_setup_tc = mlx4_en_setup_tc,
2861 AC_DEFINE(HAVE_NDO_SETUP_TC_4_PARAMS, 1,
2862 [ndo_setup_tc takes 4 parameters])
2867 AC_MSG_CHECKING([if etherdevice.h has alloc_etherdev_mqs, alloc_etherdev_mqs, num_tc])
2868 LB_LINUX_TRY_COMPILE([
2869 #include <linux/etherdevice.h>
2870 #include <linux/netdevice.h>
2872 struct net_device x = {
2876 alloc_etherdev_mqs(0, 0, 0);
2881 AC_DEFINE(HAVE_NEW_TX_RING_SCHEME, 1,
2882 [alloc_etherdev_mqs, alloc_etherdev_mqs, num_tc is defined])
2887 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_tx_maxrate])
2888 LB_LINUX_TRY_COMPILE([
2889 #include <linux/netdevice.h>
2891 struct net_device_ops x = {
2892 .ndo_set_tx_maxrate = NULL,
2898 AC_DEFINE(HAVE_NDO_SET_TX_MAXRATE, 1,
2899 [ndo_set_tx_maxrate is defined])
2904 AC_MSG_CHECKING([if struct net_device has gso_partial_features])
2905 LB_LINUX_TRY_COMPILE([
2906 #include <linux/netdevice.h>
2908 struct net_device *dev = NULL;
2910 dev->gso_partial_features = 0;
2915 AC_DEFINE(HAVE_NET_DEVICE_GSO_PARTIAL_FEATURES, 1,
2916 [gso_partial_features is defined])
2921 AC_MSG_CHECKING([if vxlan have ndo_add_vxlan_port])
2922 LB_LINUX_TRY_COMPILE([
2923 #include <linux/netdevice.h>
2925 #if IS_ENABLED(CONFIG_VXLAN)
2926 void add_vxlan_port(struct net_device *dev, sa_family_t sa_family, __be16 port)
2932 struct net_device_ops netdev_ops;
2933 netdev_ops.ndo_add_vxlan_port = add_vxlan_port;
2938 AC_DEFINE(HAVE_VXLAN_DYNAMIC_PORT, 1,
2939 [ndo_add_vxlan_port is defined])
2944 AC_MSG_CHECKING([if vxlan has vxlan_get_rx_port])
2945 LB_LINUX_TRY_COMPILE([
2946 #if IS_ENABLED(CONFIG_VXLAN)
2947 #include <net/vxlan.h>
2950 vxlan_get_rx_port(NULL);
2955 AC_DEFINE(HAVE_VXLAN_ENABLED, 1,
2956 [vxlan_get_rx_port is defined])
2961 AC_MSG_CHECKING([if vxlan have ndo_udp_tunnel_add])
2962 LB_LINUX_TRY_COMPILE([
2963 #include <linux/netdevice.h>
2965 #if IS_ENABLED(CONFIG_VXLAN)
2966 void udp_tunnel_add(struct net_device *dev, sa_family_t sa_family, __be16 port)
2972 struct net_device_ops netdev_ops;
2973 netdev_ops.ndo_udp_tunnel_add = udp_tunnel_add;
2978 AC_DEFINE(HAVE_NDO_UDP_TUNNEL_ADD, 1,
2979 [ndo_udp_tunnel_add is defined])
2984 AC_MSG_CHECKING([if vxlan has udp_tunnel_get_rx_info])
2985 LB_LINUX_TRY_COMPILE([
2986 #include <net/udp_tunnel.h>
2988 udp_tunnel_get_rx_info(NULL);
2993 AC_DEFINE(HAVE_UDP_TUNNEL_GET_RX_INFO, 1,
2994 [udp_tunnel_get_rx_info is defined])
2999 AC_MSG_CHECKING([if netdevice.h has struct netdev_bonding_info])
3000 LB_LINUX_TRY_COMPILE([
3001 #include <linux/netdevice.h>
3003 struct netdev_bonding_info x;
3004 x.master.num_slaves = 0;
3009 AC_DEFINE(HAVE_NETDEV_BONDING_INFO, 1,
3010 [netdev_bonding_info is defined])
3015 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_item_id])
3016 LB_LINUX_TRY_COMPILE([
3017 #include <linux/netdevice.h>
3019 struct netdev_phys_item_id x;
3025 AC_DEFINE(HAVE_NETDEV_PHYS_ITEM_ID, 1,
3026 [netdev_phys_item_id is defined])
3031 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_mac])
3032 LB_LINUX_TRY_COMPILE([
3033 #include <linux/netdevice.h>
3035 int set_vf_mac(struct net_device *dev, int queue, u8 *mac)
3040 struct net_device_ops netdev_ops;
3041 netdev_ops.ndo_set_vf_mac = set_vf_mac;
3046 AC_DEFINE(HAVE_NDO_SET_VF_MAC, 1,
3047 [ndo_set_vf_mac is defined])
3052 AC_MSG_CHECKING([if getnumtcs returns int])
3053 LB_LINUX_TRY_COMPILE([
3054 #include <linux/netdevice.h>
3055 #include <net/dcbnl.h>
3057 static int mlx4_en_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
3064 struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = {
3065 .getnumtcs = mlx4_en_dcbnl_getnumtcs,
3071 AC_DEFINE(NDO_GETNUMTCS_RETURNS_INT, 1,
3072 [if getnumtcs returns int])
3077 AC_MSG_CHECKING([if getapp returns int])
3078 LB_LINUX_TRY_COMPILE([
3079 #include <linux/netdevice.h>
3080 #include <net/dcbnl.h>
3082 static int mlx4_en_dcbnl_getapp(struct net_device *netdev, u8 idtype,
3088 struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = {
3089 .getapp = mlx4_en_dcbnl_getapp,
3095 AC_DEFINE(NDO_GETAPP_RETURNS_INT, 1,
3096 [if getapp returns int])
3101 AC_MSG_CHECKING([if setapp returns int])
3102 LB_LINUX_TRY_COMPILE([
3103 #include <linux/netdevice.h>
3104 #include <net/dcbnl.h>
3106 static int mlx4_en_dcbnl_setapp(struct net_device *netdev, u8 idtype,
3113 struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = {
3114 .setapp = mlx4_en_dcbnl_setapp,
3120 AC_DEFINE(NDO_SETAPP_RETURNS_INT, 1,
3121 [if setapp returns int])
3126 AC_MSG_CHECKING([if linux/inetdevice.h inet_confirm_addr has 5 parameters])
3127 LB_LINUX_TRY_COMPILE([
3128 #include <linux/inetdevice.h>
3130 inet_confirm_addr(NULL, NULL, 0, 0, 0);
3135 AC_DEFINE(HAVE_INET_CONFIRM_ADDR_5_PARAMS, 1,
3136 [inet_confirm_addr has 5 parameters])
3141 LB_CHECK_SYMBOL_EXPORT([inet_confirm_addr],
3142 [net/ipv4/devinet.c],
3143 [AC_DEFINE(HAVE_INET_CONFIRM_ADDR_EXPORTED, 1,
3144 [inet_confirm_addr is exported by the kernel])],
3147 AC_MSG_CHECKING([if netdevice.h has netdev_rss_key_fill])
3148 LB_LINUX_TRY_COMPILE([
3149 #include <linux/netdevice.h>
3151 netdev_rss_key_fill(NULL, 0);
3156 AC_DEFINE(HAVE_NETDEV_RSS_KEY_FILL, 1,
3157 [netdev_rss_key_fill is defined])
3162 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_vf_stats])
3163 LB_LINUX_TRY_COMPILE([
3164 #include <linux/netdevice.h>
3166 int get_vf_stats(struct net_device *dev, int vf, struct ifla_vf_stats *vf_stats)
3171 struct net_device_ops netdev_ops;
3172 netdev_ops.ndo_get_vf_stats = get_vf_stats;
3177 AC_DEFINE(HAVE_NDO_GET_VF_STATS, 1,
3178 [ndo_get_vf_stats is defined])
3183 AC_MSG_CHECKING([if struct ifla_vf_stats has rx_dropped])
3184 LB_LINUX_TRY_COMPILE([
3185 #include <linux/if_link.h>
3187 struct ifla_vf_stats stat = {
3194 AC_DEFINE(HAVE_IFLA_VF_STATS_RX_DROPPED, 1,
3195 [struct ifla_vf_stats has rx_dropped])
3200 AC_MSG_CHECKING([if struct net_device_ops has ndo_set_vf_guid])
3201 LB_LINUX_TRY_COMPILE([
3202 #include <linux/netdevice.h>
3204 int set_vf_guid(struct net_device *dev, int vf, u64 guid, int guid_type)
3209 struct net_device_ops netdev_ops;
3210 netdev_ops.ndo_set_vf_guid = set_vf_guid;
3215 AC_DEFINE(HAVE_NDO_SET_VF_GUID, 1,
3216 [ndo_set_vf_guid is defined])
3221 AC_MSG_CHECKING([if netdevice.h has netif_trans_update])
3222 LB_LINUX_TRY_COMPILE([
3223 #include <linux/netdevice.h>
3225 netif_trans_update(NULL);
3230 AC_DEFINE(HAVE_NETIF_TRANS_UPDATE, 1,
3231 [netif_trans_update is defined])
3236 AC_MSG_CHECKING([if netdevice.h alloc_netdev_mqs has 6 params])
3237 LB_LINUX_TRY_COMPILE([
3238 #include <linux/netdevice.h>
3240 alloc_netdev_mqs(0, NULL, NET_NAME_UNKNOWN, NULL, 0, 0);
3245 AC_DEFINE(HAVE_ALLOC_NETDEV_MQS_6_PARAMS, 1,
3246 [alloc_netdev_mqs has 6 params])
3251 AC_MSG_CHECKING([if filter.h has XDP])
3252 LB_LINUX_TRY_COMPILE([
3253 #include <linux/filter.h>
3255 enum xdp_action action = XDP_ABORTED;
3260 AC_DEFINE(HAVE_FILTER_XDP, 1,
3266 AC_MSG_CHECKING([if struct xdp_buff has rxq])
3267 LB_LINUX_TRY_COMPILE([
3268 #include <linux/filter.h>
3270 struct xdp_buff x = {
3277 AC_DEFINE(HAVE_XDP_BUFF_RXQ, 1,
3278 [struct xdp_buff has rxq])
3283 AC_MSG_CHECKING([if firmware.h has request_firmware_direct])
3284 LB_LINUX_TRY_COMPILE([
3285 #include <linux/firmware.h>
3287 (void)request_firmware_direct(NULL, NULL, NULL);
3292 AC_DEFINE(HAVE_REQUEST_FIRMWARE_DIRECT, 1,
3293 [firmware.h has request_firmware_direct])
3298 AC_MSG_CHECKING([if pci.h has pci_set_vpd_size])
3299 LB_LINUX_TRY_COMPILE([
3300 #include <linux/pci.h>
3302 (void)pci_set_vpd_size(NULL, 0);
3307 AC_DEFINE(HAVE_PCI_SET_VPD_SIZE, 1,
3308 [pci.h has pci_set_vpd_size])
3313 AC_MSG_CHECKING([if ethtooL_drvinfo has erom_version])
3314 LB_LINUX_TRY_COMPILE([
3315 #include <linux/ethtool.h>
3317 struct ethtool_drvinfo e;
3319 return (e.erom_version);
3322 AC_DEFINE(HAVE_ETHTOOL_DRVINFO_EROM_VERSION, 1,
3323 [ethtool_drvinfo has erom_version])
3328 AC_MSG_CHECKING([if string_helpers.h string_get_size has 5 params])
3329 LB_LINUX_TRY_COMPILE([
3330 #include <linux/sched.h>
3331 #include <linux/bug.h>
3332 #include <linux/kernel.h>
3333 #include <linux/math64.h>
3334 #include <linux/export.h>
3335 #include <linux/ctype.h>
3336 #include <linux/errno.h>
3337 #include <linux/string.h>
3338 #include <linux/string_helpers.h>
3340 (void)string_get_size(0, 0, 0, NULL, 0);
3345 AC_DEFINE(HAVE_STRING_GET_SIZE_5_PARAMS, 1,
3346 [string_get_size has 5 params])
3351 AC_MSG_CHECKING([if debugfs.h debugfs_create_bool has bool pointer])
3352 LB_LINUX_TRY_COMPILE([
3353 #include <linux/debugfs.h>
3355 (void)debugfs_create_bool(NULL, 0, NULL, (bool *)0);
3360 AC_DEFINE(HAVE_DEBUGFS_CREATE_BOOL_USES_BOOL_PTR, 1,
3361 [debugfs_create_bool has bool pointer])
3366 AC_MSG_CHECKING([if pat_enabled is a function on X86])
3367 LB_LINUX_TRY_COMPILE([
3368 #if defined(CONFIG_X86)
3369 #include <asm/pat.h>
3374 #if defined(CONFIG_X86)
3382 AC_DEFINE(HAVE_PAT_ENABLED_FUNCTION_X86, 1,
3383 [pat_enabled is a function])
3388 AC_MSG_CHECKING([if include/net/switchdev.h exists])
3389 LB_LINUX_TRY_COMPILE([
3390 #include <net/switchdev.h>
3395 AC_DEFINE(HAVE_NET_SWITCHDEV_H, 1,
3396 [include/net/switchdev.h exists])
3401 AC_MSG_CHECKING([if net_device_ops has ndo_udp_tunnel_add])
3402 LB_LINUX_TRY_COMPILE([
3403 #include <linux/netdevice.h>
3405 void add_udp_tunnel(struct net_device *dev, struct udp_tunnel_info *ti)