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 svc_xprt_class has xcl_ident])
191 LB_LINUX_TRY_COMPILE([
192 #include <linux/sunrpc/xprt.h>
193 #include <linux/sunrpc/svc_xprt.h>
195 struct svc_xprt_class svc_rdma_class = {
196 .xcl_ident = XPRT_TRANSPORT_RDMA,
201 AC_DEFINE(HAVE_XCL_IDENT, 1,
207 AC_MSG_CHECKING([if struct ifla_vf_info has max_tx_rate])
208 LB_LINUX_TRY_COMPILE([
209 #include <linux/if_link.h>
211 struct ifla_vf_info *ivf;
213 ivf->max_tx_rate = 0;
214 ivf->min_tx_rate = 0;
219 AC_DEFINE(HAVE_TX_RATE_LIMIT, 1,
220 [max_tx_rate is defined])
225 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh])
226 LB_LINUX_TRY_COMPILE([
227 #include <linux/ethtool.h>
229 const struct ethtool_ops en_ethtool_ops = {
230 .get_rxfh_indir_size = NULL,
238 AC_DEFINE(HAVE_GET_SET_RXFH, 1,
239 [get/set_rxfh is defined])
245 AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable])
246 LB_LINUX_TRY_COMPILE([
247 #include <linux/ethtool.h>
249 const struct ethtool_ops en_ethtool_ops = {
257 AC_DEFINE(HAVE_GET_SET_TUNABLE, 1,
258 [get/set_tunable is defined])
263 AC_MSG_CHECKING([if exist struct ethtool_ops_ext])
264 LB_LINUX_TRY_COMPILE([
265 #include <linux/ethtool.h>
267 const struct ethtool_ops_ext en_ethtool_ops_ext = {
268 .size = sizeof(struct ethtool_ops_ext),
274 AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1,
275 [struct ethtool_ops_ext is defined])
280 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh])
281 LB_LINUX_TRY_COMPILE([
282 #include <linux/ethtool.h>
284 const struct ethtool_ops_ext en_ethtool_ops_ext = {
285 .get_rxfh_indir_size = NULL,
293 AC_DEFINE(HAVE_GET_SET_RXFH_OPS_EXT, 1,
294 [get/set_rxfh is defined])
299 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
300 LB_LINUX_TRY_COMPILE([
301 #include <linux/ethtool.h>
303 const struct ethtool_ops_ext en_ethtool_ops_ext = {
304 .get_rxfh_indir = NULL,
305 .set_rxfh_indir = NULL,
311 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
312 [get/set_rxfh_indir is defined])
317 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
318 LB_LINUX_TRY_COMPILE([
319 #include <linux/ethtool.h>
321 const struct ethtool_ops_ext en_ethtool_ops_ext = {
322 .get_rxfh_indir = NULL,
323 .set_rxfh_indir = NULL,
329 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR_EXT, 1,
330 [get/set_rxfh_indir is defined])
335 AC_MSG_CHECKING([if struct net_device has dev_port])
336 LB_LINUX_TRY_COMPILE([
337 #include <linux/netdevice.h>
339 struct net_device *dev = NULL;
346 AC_DEFINE(HAVE_NET_DEVICE_DEV_PORT, 1,
347 [dev_port is defined])
352 AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
353 LB_LINUX_TRY_COMPILE([
354 #include <linux/ptp_clock_kernel.h>
356 struct ptp_clock_info *info;
362 AC_DEFINE(HAVE_PTP_CLOCK_INFO_N_PINS, 1,
368 AC_MSG_CHECKING([if pci.h pci_enable_msi_exact])
369 LB_LINUX_TRY_COMPILE([
370 #include <linux/pci.h>
372 int x = pci_enable_msi_exact(NULL, 0);
377 AC_DEFINE(HAVE_PCI_ENABLE_MSI_EXACT, 1,
378 [pci_enable_msi_exact is defined])
383 AC_MSG_CHECKING([if pci.h pci_enable_msix_range])
384 LB_LINUX_TRY_COMPILE([
385 #include <linux/pci.h>
387 int x = pci_enable_msix_range(NULL, 0, 0, 0);
392 AC_DEFINE(HAVE_PCI_ENABLE_MSIX_RANGE, 1,
393 [pci_enable_msix_range is defined])
398 AC_MSG_CHECKING([if pci.h pci_msix_vec_count])
399 LB_LINUX_TRY_COMPILE([
400 #include <linux/pci.h>
402 int x = pci_msix_vec_count(NULL);
407 AC_DEFINE(HAVE_PCI_MSIX_VEC_COUNT, 1,
408 [pci_msix_vec_count is defined])
413 AC_MSG_CHECKING([if pci_dev has msix_cap])
414 LB_LINUX_TRY_COMPILE([
415 #include <linux/pci.h>
423 AC_DEFINE(HAVE_PCI_MSIX_CAP, 1,
424 [msix_cap is defined])
429 AC_MSG_CHECKING([if mm_struct has pinned_vm])
430 LB_LINUX_TRY_COMPILE([
431 #include <linux/mm_types.h>
439 AC_DEFINE(HAVE_PINNED_VM, 1,
440 [pinned_vm is defined])
445 AC_MSG_CHECKING([if kernel has idr_alloc])
446 LB_LINUX_TRY_COMPILE([
447 #include <linux/idr.h>
450 x = idr_alloc(NULL, NULL, 0, 0, 0);
455 AC_DEFINE(HAVE_IDR_ALLOC, 1,
456 [idr_alloc is defined])
461 AC_MSG_CHECKING([if kernel has percpu variables])
462 LB_LINUX_TRY_COMPILE([
463 #include <linux/percpu.h>
465 static DEFINE_PER_CPU(unsigned int, x);
471 AC_DEFINE(HAVE_PERCPU_VARS, 1,
472 [percpu variables are defined])
477 AC_MSG_CHECKING([if struct iscsi_transport has attr_is_visible])
478 LB_LINUX_TRY_COMPILE([
479 #include <scsi/scsi_transport_iscsi.h>
481 static struct iscsi_transport iscsi_iser_transport = {
482 .attr_is_visible = NULL,
488 AC_DEFINE(HAVE_ISCSI_ATTR_IS_VISIBLE, 1,
489 [attr_is_visible is defined])
494 AC_MSG_CHECKING([if struct iscsi_transport has get_ep_param])
495 LB_LINUX_TRY_COMPILE([
496 #include <scsi/scsi_transport_iscsi.h>
498 static struct iscsi_transport iscsi_iser_transport = {
499 .get_ep_param = NULL,
505 AC_DEFINE(HAVE_ISCSI_GET_EP_PARAM, 1,
506 [get_ep_param is defined])
511 AC_MSG_CHECKING([if struct iscsi_transport has check_protection])
512 LB_LINUX_TRY_COMPILE([
513 #include <scsi/scsi_transport_iscsi.h>
515 static struct iscsi_transport iscsi_iser_transport = {
516 .check_protection = NULL,
522 AC_DEFINE(HAVE_ISCSI_CHECK_PROTECTION, 1,
523 [check_protection is defined])
528 AC_MSG_CHECKING([if iscsi_proto.h has struct iscsi_scsi_req])
529 LB_LINUX_TRY_COMPILE([
530 #include <scsi/iscsi_proto.h>
532 struct iscsi_scsi_req req = {
539 AC_DEFINE(HAVE_ISCSI_SCSI_REQ, 1,
540 [struct iscsi_scsi_req is defined])
545 AC_MSG_CHECKING([if struct request_queue has request_fn_active])
546 LB_LINUX_TRY_COMPILE([
547 #include <linux/blkdev.h>
549 struct request_queue rq = {
550 .request_fn_active = 0,
556 AC_DEFINE(HAVE_REQUEST_QUEUE_REQUEST_FN_ACTIVE, 1,
557 [struct request_queue has request_fn_active])
562 AC_MSG_CHECKING([if netdevice.h has select_queue_fallback_t])
563 LB_LINUX_TRY_COMPILE([
564 #include <linux/netdevice.h>
566 select_queue_fallback_t fallback;
573 AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T, 1,
574 [select_queue_fallback_t is defined])
579 AC_MSG_CHECKING([if netdevice.h has skb_set_hash])
580 LB_LINUX_TRY_COMPILE([
581 #include <linux/netdevice.h>
583 skb_set_hash(NULL, 0, PKT_HASH_TYPE_L3);
588 AC_DEFINE(HAVE_SKB_SET_HASH, 1,
589 [skb_set_hash is defined])
594 AC_MSG_CHECKING([if netdevice.h has alloc_netdev with 4 params])
595 LB_LINUX_TRY_COMPILE([
596 #include <linux/netdevice.h>
598 struct net_device *dev;
600 dev = alloc_netdev(0, NULL, 0, NULL);
605 AC_DEFINE(HAVE_ALLOC_NETDEV_4P, 1,
606 [alloc_netdev has 4 parameters])
611 AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
612 LB_LINUX_TRY_COMPILE([
613 #include <linux/sockios.h>
615 int x = SIOCGHWTSTAMP;
620 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
621 [SIOCGHWTSTAMP is defined])
626 AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
627 LB_LINUX_TRY_COMPILE([
630 inet_get_local_port_range(NULL, NULL, NULL);
635 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
636 [inet_get_local_port_range has 3 parameters])
641 AC_MSG_CHECKING([if net.h has net_get_random_once])
642 LB_LINUX_TRY_COMPILE([
643 #include <linux/net.h>
645 net_get_random_once(NULL, 0);
650 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
651 [net_get_random_once is defined])
656 AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
657 LB_LINUX_TRY_COMPILE([
658 #include <net/inet_sock.h>
660 __inet_ehashfn(0, 0, 0, 0, 0);
665 AC_DEFINE(HAVE_INET_EHASHFN, 1,
666 [__inet_ehashfn is defined])
671 AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
672 LB_LINUX_TRY_COMPILE([
673 #include <linux/err.h>
675 int x = PTR_ERR_OR_ZERO(NULL);
680 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
681 [PTR_ERR_OR_ZERO is defined])
686 AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
687 LB_LINUX_TRY_COMPILE([
688 #include <scsi/libiscsi.h>
690 struct iscsi_session session;
691 session.discovery_sess = 0;
696 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
697 [discovery_sess is defined])
702 AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
703 LB_LINUX_TRY_COMPILE([
704 #include <scsi/iscsi_if.h>
706 int x = ISCSI_PARAM_DISCOVERY_SESS;
711 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
712 [ISCSI_PARAM_DISCOVERY_SESS is defined])
717 AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
718 LB_LINUX_TRY_COMPILE([
719 #include <linux/pci.h>
720 #include <linux/pci_hotplug.h>
722 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
727 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
728 [pcie_link_width is defined])
733 AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
734 LB_LINUX_TRY_COMPILE([
735 #include <linux/pci.h>
736 #include <linux/pci_hotplug.h>
738 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
743 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
744 [pci_bus_speed is defined])
749 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
750 LB_LINUX_TRY_COMPILE([
751 #include <linux/netdevice.h>
753 struct netdev_phys_port_id *x = NULL;
758 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
759 [netdev_phys_port_id is defined])
764 AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
765 LB_LINUX_TRY_COMPILE([
766 #include <linux/if_link.h>
768 struct ifla_vf_info *x;
774 AC_DEFINE(HAVE_LINKSTATE, 1,
775 [linkstate is defined])
780 AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
781 LB_LINUX_TRY_COMPILE([
782 #include <net/busy_poll.h>
784 skb_mark_napi_id(NULL, NULL);
789 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
790 [skb_mark_napi_id is defined])
795 AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
796 LB_LINUX_TRY_COMPILE([
797 #include <linux/netdevice.h>
804 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
805 [napi_hash_add is defined])
810 AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
811 LB_LINUX_TRY_COMPILE([
812 #include <linux/netdevice.h>
814 netif_keep_dst(NULL);
819 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
820 [netif_keep_dst is defined])
825 AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
826 LB_LINUX_TRY_COMPILE([
827 #include <linux/netdevice.h>
829 dev_consume_skb_any(NULL);
834 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
835 [dev_consume_skb_any is defined])
840 AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
841 LB_LINUX_TRY_COMPILE([
842 #include <linux/netdevice.h>
844 netdev_txq_bql_complete_prefetchw(NULL);
845 netdev_txq_bql_enqueue_prefetchw(NULL);
850 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
851 [netdev_txq_bql_complete_prefetchw is defined])
856 AC_MSG_CHECKING([if struct sk_buff has xmit_more])
857 LB_LINUX_TRY_COMPILE([
858 #include <linux/skbuff.h>
866 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
867 [xmit_more is defined])
872 AC_MSG_CHECKING([if struct sk_buff has encapsulation])
873 LB_LINUX_TRY_COMPILE([
874 #include <linux/skbuff.h>
877 skb->encapsulation = 0;
882 AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
883 [encapsulation is defined])
888 AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
889 LB_LINUX_TRY_COMPILE([
890 #include <linux/etherdevice.h>
892 eth_get_headlen(NULL, 0);
897 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
898 [eth_get_headlen is defined])
903 AC_MSG_CHECKING([if struct sk_buff has csum_level])
904 LB_LINUX_TRY_COMPILE([
905 #include <linux/skbuff.h>
913 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
914 [csum_level is defined])
919 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
920 LB_LINUX_TRY_COMPILE([
921 #include <linux/skbuff.h>
923 skb_inner_transport_header(NULL);
928 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
929 [skb_inner_transport_header is defined])
934 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
935 LB_LINUX_TRY_COMPILE([
936 #include <linux/skbuff.h>
938 skb_inner_network_header(NULL);
943 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
944 [skb_inner_network_header is defined])
949 AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
950 LB_LINUX_TRY_COMPILE([
951 #include <linux/if_vlan.h>
953 vlan_dev_get_egress_qos_mask(NULL, 0);
958 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
959 [vlan_dev_get_egress_qos_mask is defined])
964 AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
965 LB_LINUX_TRY_COMPILE([
966 #include <linux/netdevice.h>
968 netdev_get_prio_tc_map(NULL, 0);
973 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
974 [netdev_get_prio_tc_map is defined])
979 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
980 LB_LINUX_TRY_COMPILE([
981 #include <linux/if_vlan.h>
983 __vlan_find_dev_deep_rcu(NULL, 0, 0);
988 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
989 [__vlan_find_dev_deep_rcu is defined])
994 AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
995 LB_LINUX_TRY_COMPILE([
996 #include <linux/netdevice.h>
998 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
1004 struct net_device_opts ndops;
1006 ndops.ndo_select_queue = select_queue;
1011 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
1012 [ndo_select_queue has accel_priv])
1017 AC_MSG_CHECKING([if include/net/bonding.h exists])
1018 LB_LINUX_TRY_COMPILE([
1019 #include <net/bonding.h>
1024 AC_DEFINE(HAVE_BONDING_H, 1,
1025 [include/net/bonding.h exists])
1030 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
1031 LB_LINUX_TRY_COMPILE([
1032 #include <net/bonding.h>
1034 struct bonding *bond = NULL;
1035 struct list_head *iter = NULL;
1036 struct slave *slave = NULL;
1038 bond_for_each_slave(bond, slave, iter) ;
1043 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
1044 [bond_for_each_slave has 3 parameters])
1050 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
1051 LB_LINUX_TRY_COMPILE([
1052 #include <linux/u64_stats_sync.h>
1054 struct u64_stats_sync sync;
1055 u64_stats_init(&sync);
1060 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
1061 [u64_stats_sync is defined])
1066 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
1067 LB_LINUX_TRY_COMPILE([
1068 #include <linux/u64_stats_sync.h>
1070 struct u64_stats_sync sync;
1071 u64_stats_fetch_begin_irq(&sync);
1076 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
1077 [u64_stats_fetch_begin_irq is defined])
1081 AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
1082 LB_LINUX_TRY_COMPILE([
1083 #include <linux/etherdevice.h>
1085 char dest[6], src[6];
1086 ether_addr_copy(&dest, &src);
1091 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
1092 [ether_addr_copy is defined])
1097 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
1098 LB_LINUX_TRY_COMPILE([
1099 #include <linux/netdevice.h>
1101 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
1107 struct net_device_ops netdev_ops;
1109 netdev_ops.ndo_set_vf_rate = set_vf_rate;
1113 AC_DEFINE(HAVE_SET_VF_RATE, 1,
1114 [ndo_set_vf_rate is defined])
1119 AC_MSG_CHECKING([if netdev_extended has hw_features])
1120 LB_LINUX_TRY_COMPILE([
1121 #include <linux/netdevice.h>
1123 struct net_device *dev = NULL;
1125 netdev_extended(dev)->hw_features = 0;
1130 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
1136 AC_MSG_CHECKING([if net_device_extended has _tx_ext])
1137 LB_LINUX_TRY_COMPILE([
1138 #include <linux/netdevice.h>
1140 struct net_device *dev = NULL;
1142 netdev_extended(dev)->_tx_ext = NULL;
1147 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
1153 AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
1154 LB_LINUX_TRY_COMPILE([
1155 #include <linux/netdevice.h>
1157 int busy_poll(struct napi_struct *napi)
1162 struct net_device *dev = NULL;
1164 netdev_extended(dev)->ndo_busy_poll = busy_poll;
1169 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
1175 AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
1176 LB_LINUX_TRY_COMPILE([
1177 #include <linux/netdevice.h>
1179 struct net_device *dev = NULL;
1181 set_netdev_hw_features(dev, 0);
1186 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
1192 AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
1193 LB_LINUX_TRY_COMPILE([
1194 #include <linux/netdevice.h>
1196 struct net_device *dev = NULL;
1198 netif_set_xps_queue(dev, NULL, 0);
1203 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
1210 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
1211 LB_LINUX_TRY_COMPILE([
1212 #include <linux/netdevice.h>
1214 int set_features(struct net_device *dev, netdev_features_t features)
1219 struct net_device_ops netdev_ops;
1221 netdev_ops.ndo_set_features = set_features;
1225 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1226 [ndo_set_features is defined])
1231 AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
1232 LB_LINUX_TRY_COMPILE([
1233 #include <linux/netdevice.h>
1235 struct net_device_ops x = {
1236 .ndo_setup_tc = NULL,
1242 AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
1243 [ndo_setup_tc is defined])
1248 AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1249 LB_LINUX_TRY_COMPILE([
1250 #include <linux/netdevice.h>
1252 int rx_flow_steer(struct net_device *dev,
1253 const struct sk_buff *skb,
1260 struct net_device_ops netdev_ops;
1262 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1266 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1267 [ndo_rx_flow_steer is defined])
1272 AC_MSG_CHECKING([if struct net_device has priv_flags])
1273 LB_LINUX_TRY_COMPILE([
1274 #include <linux/netdevice.h>
1276 struct net_device *netdev;
1277 netdev->priv_flags = 0;
1282 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1283 [priv_flags is defined])
1288 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1289 LB_LINUX_TRY_COMPILE([
1290 #include <linux/netdevice.h>
1292 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1293 struct rtnl_link_stats64 *storage)
1295 struct rtnl_link_stats64 stats_64;
1299 struct net_device_ops netdev_ops;
1301 netdev_ops.ndo_get_stats64 = get_stats_64;
1306 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1307 [ndo_get_stats64 is defined])
1311 AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1312 LB_LINUX_TRY_COMPILE([
1313 #include <linux/netdevice.h>
1315 struct net_device_ops netdev_ops = {
1316 .ndo_bridge_setlink = NULL,
1317 .ndo_bridge_getlink = NULL,
1323 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1324 [ndo_bridge_set/getlink is defined])
1329 AC_MSG_CHECKING([if rtnetlink.h ndo_dflt_bridge_getlink has 7 params])
1330 LB_LINUX_TRY_COMPILE([
1331 #include <linux/rtnetlink.h>
1333 ndo_dflt_bridge_getlink(NULL, 0, 0, NULL, 0, 0, 0);
1338 AC_DEFINE(HAVE_NDO_DFLT_BRIDGE_GETLINK_7_PARAMS, 1,
1339 [ ndo_dflt_bridge_getlink with 7 params is defined])
1344 AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1345 LB_LINUX_TRY_COMPILE([
1346 #include <linux/netdevice.h>
1349 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1353 struct net_device_ops netdev_ops;
1355 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1356 netdev_ops.ndo_vlan_rx_add_vid (NULL, 1, 1) ;
1361 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1362 [ndo_vlan_rx_add_vid has 3 parameters])
1367 AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1368 LB_LINUX_TRY_COMPILE([
1369 #include <linux/netdevice.h>
1371 int get_phys_port_id(struct net_device *dev,
1372 struct netdev_phys_port_id *ppid)
1377 struct net_device_ops netdev_ops;
1379 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1384 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1390 AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1391 LB_LINUX_TRY_COMPILE([
1392 #include <linux/netdevice.h>
1394 struct net_device_ops_ext netdev_ops_ext = {
1395 .size = sizeof(struct net_device_ops_ext),
1401 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1402 [struct net_device_ops_ext is defined])
1407 AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1408 LB_LINUX_TRY_COMPILE([
1409 #include <linux/netdevice.h>
1411 int get_phys_port_id(struct net_device *dev,
1412 struct netdev_phys_port_id *ppid)
1417 struct net_device_ops_ext netdev_ops_ext;
1419 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1424 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1425 [ndo_get_phys_port_id is defined])
1430 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1431 LB_LINUX_TRY_COMPILE([
1432 #include <linux/netdevice.h>
1434 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1439 struct net_device_ops netdev_ops;
1441 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1446 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1447 [ndo_set_vf_spoofchk is defined in net_device_ops])
1452 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1453 LB_LINUX_TRY_COMPILE([
1454 #include <linux/netdevice.h>
1456 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1461 struct net_device_ops_ext netdev_ops_ext;
1463 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1468 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1469 [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1474 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1475 LB_LINUX_TRY_COMPILE([
1476 #include <linux/netdevice.h>
1478 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1483 struct net_device_ops netdev_ops;
1485 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1490 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1491 [ndo_set_vf_link_state is defined in net_device_ops])
1496 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1497 LB_LINUX_TRY_COMPILE([
1498 #include <linux/netdevice.h>
1500 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1505 struct net_device_ops_ext netdev_ops_ext;
1507 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1512 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1513 [ndo_set_vf_link_state is defined])
1519 AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1520 LB_LINUX_TRY_COMPILE([
1521 #include <linux/netdevice.h>
1523 struct net_device dev;
1525 ret = netif_set_real_num_tx_queues(&dev, 2);
1529 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1530 [netif_set_real_num_tx_queues returns int])
1535 AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1536 LB_LINUX_TRY_COMPILE([
1537 #include <linux/netdevice.h>
1545 AC_DEFINE(HAVE_XPS_MAP, 1,
1546 [struct xps_map is defined])
1551 AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1552 LB_LINUX_TRY_COMPILE([
1553 #include <linux/ethtool.h>
1555 const struct ethtool_ops en_ethtool_ops = {
1562 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1563 [set_phys_id is defined])
1568 AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1569 LB_LINUX_TRY_COMPILE([
1570 #include <linux/ethtool.h>
1572 const struct ethtool_ops en_ethtool_ops = {
1573 .get_channels = NULL,
1574 .set_channels = NULL,
1580 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1581 [get/set_channels is defined])
1586 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1587 LB_LINUX_TRY_COMPILE([
1588 #include <linux/ethtool.h>
1590 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1591 .get_channels = NULL,
1592 .set_channels = NULL,
1598 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1599 [get/set_channels is defined in ethtool_ops_ext])
1604 AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1605 LB_LINUX_TRY_COMPILE([
1606 #include <linux/ethtool.h>
1608 const struct ethtool_ops en_ethtool_ops = {
1609 .get_ts_info = NULL,
1615 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1616 [get_ts_info is defined])
1621 AC_MSG_CHECKING([if linux/timecounter.h exists])
1622 LB_LINUX_TRY_COMPILE([
1623 #include <linux/timecounter.h>
1628 AC_DEFINE(HAVE_TIMECOUNTER_H, 1,
1629 [linux/timecounter.h exists])
1634 # timecounter_adjtime can be in timecounter.h or clocksource.h
1635 AC_MSG_CHECKING([if linux/timecounter.h has timecounter_adjtime])
1636 LB_LINUX_TRY_COMPILE([
1637 #include <linux/timecounter.h>
1639 struct timecounter x;
1641 timecounter_adjtime(&x, y);
1646 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
1647 [timecounter_adjtime is defined])
1652 AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
1653 LB_LINUX_TRY_COMPILE([
1654 #include <linux/clocksource.h>
1656 struct timecounter x;
1658 timecounter_adjtime(&x, y);
1663 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
1664 [timecounter_adjtime is defined])
1669 AC_MSG_CHECKING([if struct ethtool_ops has set_dump])
1670 LB_LINUX_TRY_COMPILE([
1671 #include <linux/ethtool.h>
1673 const struct ethtool_ops en_ethtool_ops = {
1680 AC_DEFINE(HAVE_ETHTOOL_OPS_SET_DUMP, 1,
1681 [set_dump is defined])
1686 AC_MSG_CHECKING([if struct ethtool_ops has get_module_info])
1687 LB_LINUX_TRY_COMPILE([
1688 #include <linux/ethtool.h>
1690 const struct ethtool_ops en_ethtool_ops = {
1691 .get_module_info = NULL,
1697 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_INFO, 1,
1698 [get_module_info is defined])
1703 AC_MSG_CHECKING([if struct ethtool_ops has get_module_eeprom])
1704 LB_LINUX_TRY_COMPILE([
1705 #include <linux/ethtool.h>
1707 const struct ethtool_ops en_ethtool_ops = {
1708 .get_module_eeprom = NULL,
1714 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_EEPROM, 1,
1715 [get_module_eeprom is defined])
1720 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1721 LB_LINUX_TRY_COMPILE([
1722 #include <linux/ethtool.h>
1724 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1725 .get_ts_info = NULL,
1731 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1732 [get_ts_info is defined in ethtool_ops_ext])
1737 AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
1738 LB_LINUX_TRY_COMPILE([
1739 #include <linux/ethtool.h>
1741 unsigned char mac[ETH_ALEN];
1742 struct ethtool_flow_ext h_ext;
1744 memcpy(&mac, h_ext.h_dest, ETH_ALEN);
1749 AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
1750 [ethtool_flow_ext has h_dest])
1755 AC_MSG_CHECKING([if netdevice.h has struct dev_addr_list])
1756 LB_LINUX_TRY_COMPILE([
1757 #include <linux/netdevice.h>
1759 struct dev_addr_list addr;
1763 AC_DEFINE(HAVE_NETDEV_DEV_ADDR, 1,
1764 [dev_addr_list is defined])
1769 AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1770 LB_LINUX_TRY_COMPILE([
1771 #include <linux/pci.h>
1773 struct pci_dev pdev;
1774 pci_vfs_assigned(&pdev);
1778 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1779 [pci_vfs_assigned is defined])
1784 AC_MSG_CHECKING([if vlan_insert_tag_set_proto is defined])
1785 LB_LINUX_TRY_COMPILE([
1786 #include <linux/if_vlan.h>
1788 struct sk_buff *skb;
1789 vlan_insert_tag_set_proto(skb, 0, 0);
1793 AC_DEFINE(HAVE_VLAN_INSERT_TAG_SET_PROTO, 1,
1794 [vlan_insert_tag_set_proto is defined])
1797 AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1798 LB_LINUX_TRY_COMPILE([
1799 #include <linux/if_vlan.h>
1801 struct sk_buff *skb;
1802 __vlan_put_tag(skb, 0, 0);
1806 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1807 [__vlan_put_tag has 3 parameters])
1813 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1814 LB_LINUX_TRY_COMPILE([
1815 #include <linux/if_vlan.h>
1817 struct sk_buff *skb;
1818 __vlan_hwaccel_put_tag(skb, 0, 0);
1823 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1824 [__vlan_hwaccel_put_tag has 3 parameters])
1829 AC_MSG_CHECKING([if struct inet6_ifaddr has if_next])
1830 LB_LINUX_TRY_COMPILE([
1831 #include <net/if_inet6.h>
1833 struct inet6_ifaddr ifp ;
1839 AC_DEFINE(HAVE_INETADDR_IF_NEXT, 1,
1840 [if_next is defined])
1845 AC_MSG_CHECKING([if struct net_device has hw_features])
1846 LB_LINUX_TRY_COMPILE([
1847 #include <linux/netdevice.h>
1849 struct net_device dev;
1850 dev.hw_features = 0;
1855 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1856 [hw_features is defined])
1861 AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1862 LB_LINUX_TRY_COMPILE([
1863 #include <linux/netdevice.h>
1865 struct net_device dev;
1866 dev.hw_enc_features = 0;
1871 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1872 [hw_enc_features is defined])
1877 AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1878 LB_LINUX_TRY_COMPILE([
1879 #include <linux/netdevice.h>
1881 struct net_device dev;
1882 dev.rx_cpu_rmap = NULL;
1887 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1888 [rx_cpu_rmap is defined])
1893 AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1894 LB_LINUX_TRY_COMPILE([
1895 #include <linux/if_vlan.h>
1897 struct sk_buff *skb;
1898 vlan_hwaccel_receive_skb(skb,0,0);
1902 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1903 [vlan_hwaccel_receive_skb is defined])
1908 AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1909 LB_LINUX_TRY_COMPILE([
1910 #include <linux/irq.h>
1911 #include <linux/irqdesc.h>
1913 struct irq_desc desc;
1914 struct irq_data *data = irq_desc_get_irq_data(&desc);
1919 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1920 [irq_desc_get_irq_data is defined])
1926 AC_MSG_CHECKING([if pci_dev has pcie_mpss])
1927 LB_LINUX_TRY_COMPILE([
1928 #include <linux/pci.h>
1930 struct pci_dev *pdev;
1932 pdev->pcie_mpss = 0;
1936 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
1937 [pcie_mpss is defined])
1942 AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
1943 LB_LINUX_TRY_COMPILE([
1944 #include <uapi/linux/if_ether.h>
1949 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
1950 [uapi/linux/if_ether.h exist])
1955 AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
1956 LB_LINUX_TRY_COMPILE([
1957 #include <linux/if_link.h>
1959 struct ifla_vf_info *ivf;
1965 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
1966 [spoofchk is defined])
1971 AC_MSG_CHECKING([if vxlan.h has vxlan_gso_check])
1972 LB_LINUX_TRY_COMPILE([
1973 #include <net/vxlan.h>
1975 vxlan_gso_check(NULL);
1980 AC_DEFINE(HAVE_VXLAN_GSO_CHECK, 1,
1981 [vxlan_gso_check is defined])
1986 AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
1987 LB_LINUX_TRY_COMPILE([
1988 #include <net/dst.h>
1990 struct neighbour *neigh = dst_get_neighbour(NULL);
1995 AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
2001 AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
2002 LB_LINUX_TRY_COMPILE([
2003 #include <linux/netlink.h>
2005 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
2010 AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
2016 AC_MSG_CHECKING([if netlink_dump_start has 5 parameters])
2017 LB_LINUX_TRY_COMPILE([
2018 #include <linux/netlink.h>
2020 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL);
2025 AC_DEFINE(HAVE_NETLINK_DUMP_START_5P, 1,
2031 AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
2032 LB_LINUX_TRY_COMPILE([
2033 #include <net/dcbnl.h>
2035 const struct dcbnl_rtnl_ops en_dcbnl_ops = {
2036 .ieee_getmaxrate = NULL,
2037 .ieee_setmaxrate = NULL,
2043 AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
2044 [ieee_getmaxrate/ieee_setmaxrate is defined])
2050 ac_c_werror_flag=yes
2051 save_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
2052 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
2054 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
2055 LB_LINUX_TRY_COMPILE([
2056 #include <net/bonding.h>
2058 struct bonding *bond = NULL;
2059 struct slave *slave = NULL;
2062 bond_for_each_slave(bond, slave, iter) ;
2067 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
2068 [bond_for_each_slave has int for 3rd parameter])
2072 EXTRA_KCFLAGS="$save_EXTRA_KCFLAGS"
2076 AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
2077 LB_LINUX_TRY_COMPILE([
2078 #include <linux/netdevice.h>
2080 netdev_master_upper_dev_get_rcu(NULL);
2085 AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
2086 [netdev_master_upper_dev_get_rcu is defined])
2091 AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
2092 LB_LINUX_TRY_COMPILE([
2093 #include <linux/if_vlan.h>
2095 __vlan_find_dev_deep(NULL, 0, 0);
2100 AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
2101 [__vlan_find_dev_deep has 3 paramters])
2106 AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
2107 LB_LINUX_TRY_COMPILE([
2108 #include <linux/skbuff.h>
2110 __skb_alloc_page(0, NULL);
2115 AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
2116 [sk_buff has __skb_alloc_page])
2121 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
2122 LB_LINUX_TRY_COMPILE([
2123 #include <linux/if_vlan.h>
2125 __vlan_hwaccel_put_tag(NULL, 0, 0);
2130 AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
2131 [__vlan_hwaccel_put_tag has 3 paramters])
2136 AC_MSG_CHECKING([if linux/mm_types.h has struct page_frag])
2137 LB_LINUX_TRY_COMPILE([
2138 #include <linux/mm_types.h>
2140 struct page_frag frag = {0};
2145 AC_DEFINE(HAVE_MM_TYPES_PAGE_FRAG, 1,
2146 [linux/mm_types.h has struct page_frag])
2151 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep])
2152 LB_LINUX_TRY_COMPILE([
2153 #include <linux/if_vlan.h>
2155 __vlan_find_dev_deep(NULL, 0);
2160 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP, 1,
2161 [__vlan_find_dev_deep is defined])
2166 AC_MSG_CHECKING([if idr .h has idr_Alloc])
2167 LB_LINUX_TRY_COMPILE([
2168 #include <linux/idr.h>
2170 idr_alloc(NULL, NULL, 0, 0, 0);
2174 AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
2175 [idr_Alloc is defined]) ],[
2179 AC_MSG_CHECKING([if completion.h has reinit_completion])
2180 LB_LINUX_TRY_COMPILE([
2181 #include <linux/completion.h>
2183 struct completion c;
2185 reinit_completion(&c);
2189 AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
2190 [reinit_completion is defined])
2195 AC_MSG_CHECKING([if dma-mapping.h has dma_set_mask_and_coherent])
2196 LB_LINUX_TRY_COMPILE([
2197 #include <linux/dma-mapping.h>
2199 dma_set_mask_and_coherent(NULL, 0);
2204 AC_DEFINE(HAVE_DMA_SET_MASK_AND_COHERENT, 1,
2205 [dma_set_mask_and_coherent is defined])
2210 AC_MSG_CHECKING([if in.h has proto_ports_offset])
2211 LB_LINUX_TRY_COMPILE([
2212 #include <linux/in.h>
2214 int x = proto_ports_offset(IPPROTO_TCP);
2218 AC_DEFINE(HAVE_PROTO_PORTS_OFFSET, 1,
2219 [proto_ports_offset is defined])
2224 LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
2225 [kernel/crash_dump.c],
2226 [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
2227 [elfcorehdr_addr is exported by the kernel])],
2230 AC_MSG_CHECKING([if netif_set_real_num_rx_queues is defined])
2231 LB_LINUX_TRY_COMPILE([
2232 #include <linux/netdevice.h>
2234 int rc = netif_set_real_num_rx_queues(NULL, 0);
2239 AC_DEFINE(HAVE_NETIF_SET_REAL_NUM_RX_QUEUES, 1,
2240 [netif_set_real_num_rx_queues is defined])
2245 AC_MSG_CHECKING([if if_vlan.h has is_vlan_dev])
2246 LB_LINUX_TRY_COMPILE([
2247 #include <linux/netdevice.h>
2248 #include <linux/if_vlan.h>
2250 struct net_device dev;
2256 AC_DEFINE(HAVE_IS_VLAN_DEV, 1,
2257 [is_vlan_dev is defined])
2262 AC_MSG_CHECKING([if linux/timecounter.h exists])
2263 LB_LINUX_TRY_COMPILE([
2264 #include <linux/timecounter.h>
2269 AC_DEFINE(HAVE_TIMECOUNTER_H, 1,
2270 [linux/timecounter.h exists])
2275 # timecounter_adjtime can be in timecounter.h or clocksource.h
2276 AC_MSG_CHECKING([if linux/timecounter.h has timecounter_adjtime])
2277 LB_LINUX_TRY_COMPILE([
2278 #include <linux/timecounter.h>
2280 struct timecounter x;
2282 timecounter_adjtime(&x, y);
2287 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
2288 [timecounter_adjtime is defined])
2293 AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
2294 LB_LINUX_TRY_COMPILE([
2295 #include <linux/clocksource.h>
2297 struct timecounter x;
2299 timecounter_adjtime(&x, y);
2304 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
2305 [timecounter_adjtime is defined])
2310 AC_MSG_CHECKING([if cyclecounter_cyc2ns has 4 parameters])
2311 LB_LINUX_TRY_COMPILE([
2312 #include <linux/timecounter.h>
2314 cyclecounter_cyc2ns(NULL, NULL, 0, NULL);
2319 AC_DEFINE(HAVE_CYCLECOUNTER_CYC2NS_4_PARAMS, 1,
2320 [cyclecounter_cyc2ns has 4 parameters])
2325 AC_MSG_CHECKING([if netdevice.h struct net_device_ops has ndo_features_check])
2326 LB_LINUX_TRY_COMPILE([
2327 #include <linux/netdevice.h>
2329 static const struct net_device_ops mlx4_netdev_ops = {
2330 .ndo_features_check = NULL,
2336 AC_DEFINE(HAVE_NETDEV_FEATURES_T, 1,
2337 [netdev_features_t is defined])
2342 AC_MSG_CHECKING([if struct ethtool_ops get_rxnfc gets u32 *rule_locs])
2343 LB_LINUX_TRY_COMPILE([
2344 #include <linux/ethtool.h>
2345 static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *c,
2351 struct ethtool_ops x = {
2352 .get_rxnfc = mlx4_en_get_rxnfc,
2358 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_RXNFC_U32_RULE_LOCS, 1,
2359 [ethtool_ops get_rxnfc gets u32 *rule_locs])
2364 AC_MSG_CHECKING([if ethtool.h enum ethtool_stringset has ETH_SS_RSS_HASH_FUNCS])
2365 LB_LINUX_TRY_COMPILE([
2366 #include <linux/ethtool.h>
2368 enum ethtool_stringset x = ETH_SS_RSS_HASH_FUNCS;
2373 AC_DEFINE(HAVE_ETH_SS_RSS_HASH_FUNCS, 1,
2374 [ETH_SS_RSS_HASH_FUNCS is defined])
2380 # COMPAT_CONFIG_HEADERS
2382 # add -include config.h
2384 AC_DEFUN([COMPAT_CONFIG_HEADERS],[
2385 AC_CONFIG_HEADERS([config.h])
2386 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
2387 AC_SUBST(EXTRA_KCFLAGS)
2390 AC_DEFUN([OFA_PROG_LINUX],
2395 LB_LINUX_CONFIG([MODULES],[],[
2396 AC_MSG_ERROR([module support is required to build mlnx kernel modules.])
2398 LB_LINUX_CONFIG([MODVERSIONS])
2399 LB_LINUX_CONFIG([KALLSYMS],[],[
2400 AC_MSG_ERROR([compat_mlnx requires that CONFIG_KALLSYMS is enabled in your kernel.])
2404 COMPAT_CONFIG_HEADERS