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_key_size = NULL,
238 AC_DEFINE(HAVE_GET_SET_RXFH, 1,
239 [get/set_rxfh is defined])
244 AC_MSG_CHECKING([if struct ethtool_ops has get_rxfh_indir_size])
245 LB_LINUX_TRY_COMPILE([
246 #include <linux/ethtool.h>
248 const struct ethtool_ops en_ethtool_ops = {
249 .get_rxfh_indir_size = NULL,
255 AC_DEFINE(HAVE_RXFH_INDIR_SIZE, 1,
256 [get_rxfh_indir_size is defined])
261 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_rxfh_indir_size])
262 LB_LINUX_TRY_COMPILE([
263 #include <linux/ethtool.h>
265 const struct ethtool_ops_ext en_ethtool_ops_ext = {
266 .get_rxfh_indir_size = NULL,
272 AC_DEFINE(HAVE_RXFH_INDIR_SIZE_EXT, 1,
273 [get_rxfh_indir_size is defined in ethtool_ops_ext])
278 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh_indir])
279 LB_LINUX_TRY_COMPILE([
280 #include <linux/ethtool.h>
282 int mlx4_en_get_rxfh_indir(struct net_device *d, u32 *r)
287 struct ethtool_ops en_ethtool_ops;
288 en_ethtool_ops.get_rxfh_indir = mlx4_en_get_rxfh_indir;
293 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
294 [get/set_rxfh_indir is defined])
299 AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable])
300 LB_LINUX_TRY_COMPILE([
301 #include <linux/ethtool.h>
303 const struct ethtool_ops en_ethtool_ops = {
311 AC_DEFINE(HAVE_GET_SET_TUNABLE, 1,
312 [get/set_tunable is defined])
317 AC_MSG_CHECKING([if exist struct ethtool_ops_ext])
318 LB_LINUX_TRY_COMPILE([
319 #include <linux/ethtool.h>
321 const struct ethtool_ops_ext en_ethtool_ops_ext = {
322 .size = sizeof(struct ethtool_ops_ext),
328 AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1,
329 [struct ethtool_ops_ext is defined])
335 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
336 LB_LINUX_TRY_COMPILE([
337 #include <linux/ethtool.h>
339 const struct ethtool_ops_ext en_ethtool_ops_ext = {
340 .get_rxfh_indir = NULL,
341 .set_rxfh_indir = NULL,
347 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
348 [get/set_rxfh_indir is defined])
353 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
354 LB_LINUX_TRY_COMPILE([
355 #include <linux/ethtool.h>
357 const struct ethtool_ops_ext en_ethtool_ops_ext = {
358 .get_rxfh_indir = NULL,
359 .set_rxfh_indir = NULL,
365 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR_EXT, 1,
366 [get/set_rxfh_indir is defined])
371 AC_MSG_CHECKING([if struct net_device has dev_port])
372 LB_LINUX_TRY_COMPILE([
373 #include <linux/netdevice.h>
375 struct net_device *dev = NULL;
382 AC_DEFINE(HAVE_NET_DEVICE_DEV_PORT, 1,
383 [dev_port is defined])
388 AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
389 LB_LINUX_TRY_COMPILE([
390 #include <linux/ptp_clock_kernel.h>
392 struct ptp_clock_info *info;
398 AC_DEFINE(HAVE_PTP_CLOCK_INFO_N_PINS, 1,
404 AC_MSG_CHECKING([if pci.h pci_enable_msi_exact])
405 LB_LINUX_TRY_COMPILE([
406 #include <linux/pci.h>
408 int x = pci_enable_msi_exact(NULL, 0);
413 AC_DEFINE(HAVE_PCI_ENABLE_MSI_EXACT, 1,
414 [pci_enable_msi_exact is defined])
419 AC_MSG_CHECKING([if pci.h pci_enable_msix_range])
420 LB_LINUX_TRY_COMPILE([
421 #include <linux/pci.h>
423 int x = pci_enable_msix_range(NULL, 0, 0, 0);
428 AC_DEFINE(HAVE_PCI_ENABLE_MSIX_RANGE, 1,
429 [pci_enable_msix_range is defined])
434 AC_MSG_CHECKING([if pci.h pci_msix_vec_count])
435 LB_LINUX_TRY_COMPILE([
436 #include <linux/pci.h>
438 int x = pci_msix_vec_count(NULL);
443 AC_DEFINE(HAVE_PCI_MSIX_VEC_COUNT, 1,
444 [pci_msix_vec_count is defined])
449 AC_MSG_CHECKING([if pci_dev has msix_cap])
450 LB_LINUX_TRY_COMPILE([
451 #include <linux/pci.h>
459 AC_DEFINE(HAVE_PCI_MSIX_CAP, 1,
460 [msix_cap is defined])
465 AC_MSG_CHECKING([if mm_struct has pinned_vm])
466 LB_LINUX_TRY_COMPILE([
467 #include <linux/mm_types.h>
475 AC_DEFINE(HAVE_PINNED_VM, 1,
476 [pinned_vm is defined])
481 AC_MSG_CHECKING([if kernel has idr_alloc])
482 LB_LINUX_TRY_COMPILE([
483 #include <linux/idr.h>
486 x = idr_alloc(NULL, NULL, 0, 0, 0);
491 AC_DEFINE(HAVE_IDR_ALLOC, 1,
492 [idr_alloc is defined])
497 AC_MSG_CHECKING([if kernel has percpu variables])
498 LB_LINUX_TRY_COMPILE([
499 #include <linux/percpu.h>
501 static DEFINE_PER_CPU(unsigned int, x);
507 AC_DEFINE(HAVE_PERCPU_VARS, 1,
508 [percpu variables are defined])
513 AC_MSG_CHECKING([if struct iscsi_transport has attr_is_visible])
514 LB_LINUX_TRY_COMPILE([
515 #include <scsi/scsi_transport_iscsi.h>
517 static struct iscsi_transport iscsi_iser_transport = {
518 .attr_is_visible = NULL,
524 AC_DEFINE(HAVE_ISCSI_ATTR_IS_VISIBLE, 1,
525 [attr_is_visible is defined])
530 AC_MSG_CHECKING([if struct iscsi_transport has get_ep_param])
531 LB_LINUX_TRY_COMPILE([
532 #include <scsi/scsi_transport_iscsi.h>
534 static struct iscsi_transport iscsi_iser_transport = {
535 .get_ep_param = NULL,
541 AC_DEFINE(HAVE_ISCSI_GET_EP_PARAM, 1,
542 [get_ep_param is defined])
547 AC_MSG_CHECKING([if struct iscsi_transport has check_protection])
548 LB_LINUX_TRY_COMPILE([
549 #include <scsi/scsi_transport_iscsi.h>
551 static struct iscsi_transport iscsi_iser_transport = {
552 .check_protection = NULL,
558 AC_DEFINE(HAVE_ISCSI_CHECK_PROTECTION, 1,
559 [check_protection is defined])
564 AC_MSG_CHECKING([if iscsi_proto.h has struct iscsi_scsi_req])
565 LB_LINUX_TRY_COMPILE([
566 #include <scsi/iscsi_proto.h>
568 struct iscsi_scsi_req req = {
575 AC_DEFINE(HAVE_ISCSI_SCSI_REQ, 1,
576 [struct iscsi_scsi_req is defined])
581 AC_MSG_CHECKING([if struct request_queue has request_fn_active])
582 LB_LINUX_TRY_COMPILE([
583 #include <linux/blkdev.h>
585 struct request_queue rq = {
586 .request_fn_active = 0,
592 AC_DEFINE(HAVE_REQUEST_QUEUE_REQUEST_FN_ACTIVE, 1,
593 [struct request_queue has request_fn_active])
598 AC_MSG_CHECKING([if netdevice.h has select_queue_fallback_t])
599 LB_LINUX_TRY_COMPILE([
600 #include <linux/netdevice.h>
602 select_queue_fallback_t fallback;
609 AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T, 1,
610 [select_queue_fallback_t is defined])
615 AC_MSG_CHECKING([if netdevice.h has skb_set_hash])
616 LB_LINUX_TRY_COMPILE([
617 #include <linux/netdevice.h>
619 skb_set_hash(NULL, 0, PKT_HASH_TYPE_L3);
624 AC_DEFINE(HAVE_SKB_SET_HASH, 1,
625 [skb_set_hash is defined])
630 AC_MSG_CHECKING([if netdevice.h has alloc_netdev with 4 params])
631 LB_LINUX_TRY_COMPILE([
632 #include <linux/netdevice.h>
634 struct net_device *dev;
636 dev = alloc_netdev(0, NULL, 0, NULL);
641 AC_DEFINE(HAVE_ALLOC_NETDEV_4P, 1,
642 [alloc_netdev has 4 parameters])
647 AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
648 LB_LINUX_TRY_COMPILE([
649 #include <linux/sockios.h>
651 int x = SIOCGHWTSTAMP;
656 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
657 [SIOCGHWTSTAMP is defined])
662 AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
663 LB_LINUX_TRY_COMPILE([
666 inet_get_local_port_range(NULL, NULL, NULL);
671 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
672 [inet_get_local_port_range has 3 parameters])
677 AC_MSG_CHECKING([if net.h has net_get_random_once])
678 LB_LINUX_TRY_COMPILE([
679 #include <linux/net.h>
681 net_get_random_once(NULL, 0);
686 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
687 [net_get_random_once is defined])
692 AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
693 LB_LINUX_TRY_COMPILE([
694 #include <net/inet_sock.h>
696 __inet_ehashfn(0, 0, 0, 0, 0);
701 AC_DEFINE(HAVE_INET_EHASHFN, 1,
702 [__inet_ehashfn is defined])
707 AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
708 LB_LINUX_TRY_COMPILE([
709 #include <linux/err.h>
711 int x = PTR_ERR_OR_ZERO(NULL);
716 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
717 [PTR_ERR_OR_ZERO is defined])
722 AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
723 LB_LINUX_TRY_COMPILE([
724 #include <scsi/libiscsi.h>
726 struct iscsi_session session;
727 session.discovery_sess = 0;
732 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
733 [discovery_sess is defined])
738 AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
739 LB_LINUX_TRY_COMPILE([
740 #include <scsi/iscsi_if.h>
742 int x = ISCSI_PARAM_DISCOVERY_SESS;
747 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
748 [ISCSI_PARAM_DISCOVERY_SESS is defined])
753 AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
754 LB_LINUX_TRY_COMPILE([
755 #include <linux/pci.h>
756 #include <linux/pci_hotplug.h>
758 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
763 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
764 [pcie_link_width is defined])
769 AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
770 LB_LINUX_TRY_COMPILE([
771 #include <linux/pci.h>
772 #include <linux/pci_hotplug.h>
774 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
779 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
780 [pci_bus_speed is defined])
785 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
786 LB_LINUX_TRY_COMPILE([
787 #include <linux/netdevice.h>
789 struct netdev_phys_port_id *x = NULL;
794 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
795 [netdev_phys_port_id is defined])
800 AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
801 LB_LINUX_TRY_COMPILE([
802 #include <linux/if_link.h>
804 struct ifla_vf_info *x;
810 AC_DEFINE(HAVE_LINKSTATE, 1,
811 [linkstate is defined])
816 AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
817 LB_LINUX_TRY_COMPILE([
818 #include <net/busy_poll.h>
820 skb_mark_napi_id(NULL, NULL);
825 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
826 [skb_mark_napi_id is defined])
831 AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
832 LB_LINUX_TRY_COMPILE([
833 #include <linux/netdevice.h>
840 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
841 [napi_hash_add is defined])
846 AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
847 LB_LINUX_TRY_COMPILE([
848 #include <linux/netdevice.h>
850 netif_keep_dst(NULL);
855 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
856 [netif_keep_dst is defined])
861 AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
862 LB_LINUX_TRY_COMPILE([
863 #include <linux/netdevice.h>
865 dev_consume_skb_any(NULL);
870 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
871 [dev_consume_skb_any is defined])
876 AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
877 LB_LINUX_TRY_COMPILE([
878 #include <linux/netdevice.h>
880 netdev_txq_bql_complete_prefetchw(NULL);
881 netdev_txq_bql_enqueue_prefetchw(NULL);
886 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
887 [netdev_txq_bql_complete_prefetchw is defined])
892 AC_MSG_CHECKING([if struct sk_buff has xmit_more])
893 LB_LINUX_TRY_COMPILE([
894 #include <linux/skbuff.h>
902 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
903 [xmit_more is defined])
908 AC_MSG_CHECKING([if struct sk_buff has encapsulation])
909 LB_LINUX_TRY_COMPILE([
910 #include <linux/skbuff.h>
913 skb->encapsulation = 0;
918 AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
919 [encapsulation is defined])
924 AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
925 LB_LINUX_TRY_COMPILE([
926 #include <linux/etherdevice.h>
928 eth_get_headlen(NULL, 0);
933 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
934 [eth_get_headlen is defined])
939 AC_MSG_CHECKING([if struct sk_buff has csum_level])
940 LB_LINUX_TRY_COMPILE([
941 #include <linux/skbuff.h>
949 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
950 [csum_level is defined])
955 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
956 LB_LINUX_TRY_COMPILE([
957 #include <linux/skbuff.h>
959 skb_inner_transport_header(NULL);
964 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
965 [skb_inner_transport_header is defined])
970 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
971 LB_LINUX_TRY_COMPILE([
972 #include <linux/skbuff.h>
974 skb_inner_network_header(NULL);
979 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
980 [skb_inner_network_header is defined])
985 AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
986 LB_LINUX_TRY_COMPILE([
987 #include <linux/if_vlan.h>
989 vlan_dev_get_egress_qos_mask(NULL, 0);
994 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
995 [vlan_dev_get_egress_qos_mask is defined])
1000 AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
1001 LB_LINUX_TRY_COMPILE([
1002 #include <linux/netdevice.h>
1004 netdev_get_prio_tc_map(NULL, 0);
1009 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
1010 [netdev_get_prio_tc_map is defined])
1015 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
1016 LB_LINUX_TRY_COMPILE([
1017 #include <linux/if_vlan.h>
1019 __vlan_find_dev_deep_rcu(NULL, 0, 0);
1024 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
1025 [__vlan_find_dev_deep_rcu is defined])
1030 AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
1031 LB_LINUX_TRY_COMPILE([
1032 #include <linux/netdevice.h>
1034 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
1040 struct net_device_opts ndops;
1042 ndops.ndo_select_queue = select_queue;
1047 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
1048 [ndo_select_queue has accel_priv])
1053 AC_MSG_CHECKING([if include/net/bonding.h exists])
1054 LB_LINUX_TRY_COMPILE([
1055 #include <net/bonding.h>
1060 AC_DEFINE(HAVE_BONDING_H, 1,
1061 [include/net/bonding.h exists])
1066 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
1067 LB_LINUX_TRY_COMPILE([
1068 #include <net/bonding.h>
1070 struct bonding *bond = NULL;
1071 struct list_head *iter = NULL;
1072 struct slave *slave = NULL;
1074 bond_for_each_slave(bond, slave, iter) ;
1079 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
1080 [bond_for_each_slave has 3 parameters])
1086 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
1087 LB_LINUX_TRY_COMPILE([
1088 #include <linux/u64_stats_sync.h>
1090 struct u64_stats_sync sync;
1091 u64_stats_init(&sync);
1096 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
1097 [u64_stats_sync is defined])
1102 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
1103 LB_LINUX_TRY_COMPILE([
1104 #include <linux/u64_stats_sync.h>
1106 struct u64_stats_sync sync;
1107 u64_stats_fetch_begin_irq(&sync);
1112 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
1113 [u64_stats_fetch_begin_irq is defined])
1117 AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
1118 LB_LINUX_TRY_COMPILE([
1119 #include <linux/etherdevice.h>
1121 char dest[6], src[6];
1122 ether_addr_copy(&dest, &src);
1127 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
1128 [ether_addr_copy is defined])
1133 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
1134 LB_LINUX_TRY_COMPILE([
1135 #include <linux/netdevice.h>
1137 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
1143 struct net_device_ops netdev_ops;
1145 netdev_ops.ndo_set_vf_rate = set_vf_rate;
1149 AC_DEFINE(HAVE_SET_VF_RATE, 1,
1150 [ndo_set_vf_rate is defined])
1155 AC_MSG_CHECKING([if netdev_extended has hw_features])
1156 LB_LINUX_TRY_COMPILE([
1157 #include <linux/netdevice.h>
1159 struct net_device *dev = NULL;
1161 netdev_extended(dev)->hw_features = 0;
1166 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
1172 AC_MSG_CHECKING([if net_device_extended has _tx_ext])
1173 LB_LINUX_TRY_COMPILE([
1174 #include <linux/netdevice.h>
1176 struct net_device *dev = NULL;
1178 netdev_extended(dev)->_tx_ext = NULL;
1183 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
1189 AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
1190 LB_LINUX_TRY_COMPILE([
1191 #include <linux/netdevice.h>
1193 int busy_poll(struct napi_struct *napi)
1198 struct net_device *dev = NULL;
1200 netdev_extended(dev)->ndo_busy_poll = busy_poll;
1205 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
1211 AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
1212 LB_LINUX_TRY_COMPILE([
1213 #include <linux/netdevice.h>
1215 struct net_device *dev = NULL;
1217 set_netdev_hw_features(dev, 0);
1222 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
1228 AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
1229 LB_LINUX_TRY_COMPILE([
1230 #include <linux/netdevice.h>
1232 struct net_device *dev = NULL;
1234 netif_set_xps_queue(dev, NULL, 0);
1239 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
1246 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
1247 LB_LINUX_TRY_COMPILE([
1248 #include <linux/netdevice.h>
1250 int set_features(struct net_device *dev, netdev_features_t features)
1255 struct net_device_ops netdev_ops;
1257 netdev_ops.ndo_set_features = set_features;
1261 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1262 [ndo_set_features is defined])
1267 AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
1268 LB_LINUX_TRY_COMPILE([
1269 #include <linux/netdevice.h>
1271 struct net_device_ops x = {
1272 .ndo_setup_tc = NULL,
1278 AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
1279 [ndo_setup_tc is defined])
1284 AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1285 LB_LINUX_TRY_COMPILE([
1286 #include <linux/netdevice.h>
1288 int rx_flow_steer(struct net_device *dev,
1289 const struct sk_buff *skb,
1296 struct net_device_ops netdev_ops;
1298 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1302 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1303 [ndo_rx_flow_steer is defined])
1308 AC_MSG_CHECKING([if struct net_device has priv_flags])
1309 LB_LINUX_TRY_COMPILE([
1310 #include <linux/netdevice.h>
1312 struct net_device *netdev;
1313 netdev->priv_flags = 0;
1318 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1319 [priv_flags is defined])
1324 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1325 LB_LINUX_TRY_COMPILE([
1326 #include <linux/netdevice.h>
1328 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1329 struct rtnl_link_stats64 *storage)
1331 struct rtnl_link_stats64 stats_64;
1335 struct net_device_ops netdev_ops;
1337 netdev_ops.ndo_get_stats64 = get_stats_64;
1342 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1343 [ndo_get_stats64 is defined])
1347 AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1348 LB_LINUX_TRY_COMPILE([
1349 #include <linux/netdevice.h>
1351 struct net_device_ops netdev_ops = {
1352 .ndo_bridge_setlink = NULL,
1353 .ndo_bridge_getlink = NULL,
1359 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1360 [ndo_bridge_set/getlink is defined])
1365 AC_MSG_CHECKING([if rtnetlink.h ndo_dflt_bridge_getlink has 7 params])
1366 LB_LINUX_TRY_COMPILE([
1367 #include <linux/rtnetlink.h>
1369 ndo_dflt_bridge_getlink(NULL, 0, 0, NULL, 0, 0, 0);
1374 AC_DEFINE(HAVE_NDO_DFLT_BRIDGE_GETLINK_7_PARAMS, 1,
1375 [ ndo_dflt_bridge_getlink with 7 params is defined])
1380 AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1381 LB_LINUX_TRY_COMPILE([
1382 #include <linux/netdevice.h>
1385 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1389 struct net_device_ops netdev_ops;
1391 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1392 netdev_ops.ndo_vlan_rx_add_vid (NULL, 1, 1) ;
1397 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1398 [ndo_vlan_rx_add_vid has 3 parameters])
1403 AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1404 LB_LINUX_TRY_COMPILE([
1405 #include <linux/netdevice.h>
1407 int get_phys_port_id(struct net_device *dev,
1408 struct netdev_phys_port_id *ppid)
1413 struct net_device_ops netdev_ops;
1415 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1420 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1426 AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1427 LB_LINUX_TRY_COMPILE([
1428 #include <linux/netdevice.h>
1430 struct net_device_ops_ext netdev_ops_ext = {
1431 .size = sizeof(struct net_device_ops_ext),
1437 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1438 [struct net_device_ops_ext is defined])
1443 AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1444 LB_LINUX_TRY_COMPILE([
1445 #include <linux/netdevice.h>
1447 int get_phys_port_id(struct net_device *dev,
1448 struct netdev_phys_port_id *ppid)
1453 struct net_device_ops_ext netdev_ops_ext;
1455 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1460 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1461 [ndo_get_phys_port_id is defined])
1466 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1467 LB_LINUX_TRY_COMPILE([
1468 #include <linux/netdevice.h>
1470 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1475 struct net_device_ops netdev_ops;
1477 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1482 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1483 [ndo_set_vf_spoofchk is defined in net_device_ops])
1488 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1489 LB_LINUX_TRY_COMPILE([
1490 #include <linux/netdevice.h>
1492 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1497 struct net_device_ops_ext netdev_ops_ext;
1499 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1504 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1505 [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1510 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1511 LB_LINUX_TRY_COMPILE([
1512 #include <linux/netdevice.h>
1514 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1519 struct net_device_ops netdev_ops;
1521 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1526 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1527 [ndo_set_vf_link_state is defined in net_device_ops])
1532 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1533 LB_LINUX_TRY_COMPILE([
1534 #include <linux/netdevice.h>
1536 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1541 struct net_device_ops_ext netdev_ops_ext;
1543 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1548 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1549 [ndo_set_vf_link_state is defined])
1555 AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1556 LB_LINUX_TRY_COMPILE([
1557 #include <linux/netdevice.h>
1559 struct net_device dev;
1561 ret = netif_set_real_num_tx_queues(&dev, 2);
1565 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1566 [netif_set_real_num_tx_queues returns int])
1571 AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1572 LB_LINUX_TRY_COMPILE([
1573 #include <linux/netdevice.h>
1581 AC_DEFINE(HAVE_XPS_MAP, 1,
1582 [struct xps_map is defined])
1587 AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1588 LB_LINUX_TRY_COMPILE([
1589 #include <linux/ethtool.h>
1591 const struct ethtool_ops en_ethtool_ops = {
1598 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1599 [set_phys_id is defined])
1604 AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1605 LB_LINUX_TRY_COMPILE([
1606 #include <linux/ethtool.h>
1608 const struct ethtool_ops en_ethtool_ops = {
1609 .get_channels = NULL,
1610 .set_channels = NULL,
1616 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1617 [get/set_channels is defined])
1622 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1623 LB_LINUX_TRY_COMPILE([
1624 #include <linux/ethtool.h>
1626 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1627 .get_channels = NULL,
1628 .set_channels = NULL,
1634 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1635 [get/set_channels is defined in ethtool_ops_ext])
1640 AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1641 LB_LINUX_TRY_COMPILE([
1642 #include <linux/ethtool.h>
1644 const struct ethtool_ops en_ethtool_ops = {
1645 .get_ts_info = NULL,
1651 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1652 [get_ts_info is defined])
1657 AC_MSG_CHECKING([if linux/timecounter.h exists])
1658 LB_LINUX_TRY_COMPILE([
1659 #include <linux/timecounter.h>
1664 AC_DEFINE(HAVE_TIMECOUNTER_H, 1,
1665 [linux/timecounter.h exists])
1670 # timecounter_adjtime can be in timecounter.h or clocksource.h
1671 AC_MSG_CHECKING([if linux/timecounter.h has timecounter_adjtime])
1672 LB_LINUX_TRY_COMPILE([
1673 #include <linux/timecounter.h>
1675 struct timecounter x;
1677 timecounter_adjtime(&x, y);
1682 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
1683 [timecounter_adjtime is defined])
1688 AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
1689 LB_LINUX_TRY_COMPILE([
1690 #include <linux/clocksource.h>
1692 struct timecounter x;
1694 timecounter_adjtime(&x, y);
1699 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
1700 [timecounter_adjtime is defined])
1705 AC_MSG_CHECKING([if struct ethtool_ops has set_dump])
1706 LB_LINUX_TRY_COMPILE([
1707 #include <linux/ethtool.h>
1709 const struct ethtool_ops en_ethtool_ops = {
1716 AC_DEFINE(HAVE_ETHTOOL_OPS_SET_DUMP, 1,
1717 [set_dump is defined])
1722 AC_MSG_CHECKING([if struct ethtool_ops has get_module_info])
1723 LB_LINUX_TRY_COMPILE([
1724 #include <linux/ethtool.h>
1726 const struct ethtool_ops en_ethtool_ops = {
1727 .get_module_info = NULL,
1733 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_INFO, 1,
1734 [get_module_info is defined])
1739 AC_MSG_CHECKING([if struct ethtool_ops has get_module_eeprom])
1740 LB_LINUX_TRY_COMPILE([
1741 #include <linux/ethtool.h>
1743 const struct ethtool_ops en_ethtool_ops = {
1744 .get_module_eeprom = NULL,
1750 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_EEPROM, 1,
1751 [get_module_eeprom is defined])
1756 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1757 LB_LINUX_TRY_COMPILE([
1758 #include <linux/ethtool.h>
1760 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1761 .get_ts_info = NULL,
1767 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1768 [get_ts_info is defined in ethtool_ops_ext])
1773 AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
1774 LB_LINUX_TRY_COMPILE([
1775 #include <linux/ethtool.h>
1777 unsigned char mac[ETH_ALEN];
1778 struct ethtool_flow_ext h_ext;
1780 memcpy(&mac, h_ext.h_dest, ETH_ALEN);
1785 AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
1786 [ethtool_flow_ext has h_dest])
1791 AC_MSG_CHECKING([if netdevice.h has struct dev_addr_list])
1792 LB_LINUX_TRY_COMPILE([
1793 #include <linux/netdevice.h>
1795 struct dev_addr_list addr;
1799 AC_DEFINE(HAVE_NETDEV_DEV_ADDR, 1,
1800 [dev_addr_list is defined])
1805 AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1806 LB_LINUX_TRY_COMPILE([
1807 #include <linux/pci.h>
1809 struct pci_dev pdev;
1810 pci_vfs_assigned(&pdev);
1814 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1815 [pci_vfs_assigned is defined])
1820 AC_MSG_CHECKING([if vlan_insert_tag_set_proto is defined])
1821 LB_LINUX_TRY_COMPILE([
1822 #include <linux/if_vlan.h>
1824 struct sk_buff *skb;
1825 vlan_insert_tag_set_proto(skb, 0, 0);
1829 AC_DEFINE(HAVE_VLAN_INSERT_TAG_SET_PROTO, 1,
1830 [vlan_insert_tag_set_proto is defined])
1833 AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1834 LB_LINUX_TRY_COMPILE([
1835 #include <linux/if_vlan.h>
1837 struct sk_buff *skb;
1838 __vlan_put_tag(skb, 0, 0);
1842 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1843 [__vlan_put_tag has 3 parameters])
1849 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1850 LB_LINUX_TRY_COMPILE([
1851 #include <linux/if_vlan.h>
1853 struct sk_buff *skb;
1854 __vlan_hwaccel_put_tag(skb, 0, 0);
1859 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1860 [__vlan_hwaccel_put_tag has 3 parameters])
1865 AC_MSG_CHECKING([if struct inet6_ifaddr has if_next])
1866 LB_LINUX_TRY_COMPILE([
1867 #include <net/if_inet6.h>
1869 struct inet6_ifaddr ifp ;
1875 AC_DEFINE(HAVE_INETADDR_IF_NEXT, 1,
1876 [if_next is defined])
1881 AC_MSG_CHECKING([if struct net_device has hw_features])
1882 LB_LINUX_TRY_COMPILE([
1883 #include <linux/netdevice.h>
1885 struct net_device dev;
1886 dev.hw_features = 0;
1891 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1892 [hw_features is defined])
1897 AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1898 LB_LINUX_TRY_COMPILE([
1899 #include <linux/netdevice.h>
1901 struct net_device dev;
1902 dev.hw_enc_features = 0;
1907 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1908 [hw_enc_features is defined])
1913 AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1914 LB_LINUX_TRY_COMPILE([
1915 #include <linux/netdevice.h>
1917 struct net_device dev;
1918 dev.rx_cpu_rmap = NULL;
1923 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1924 [rx_cpu_rmap is defined])
1929 AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1930 LB_LINUX_TRY_COMPILE([
1931 #include <linux/if_vlan.h>
1933 struct sk_buff *skb;
1934 vlan_hwaccel_receive_skb(skb,0,0);
1938 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1939 [vlan_hwaccel_receive_skb is defined])
1944 AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1945 LB_LINUX_TRY_COMPILE([
1946 #include <linux/irq.h>
1947 #include <linux/irqdesc.h>
1949 struct irq_desc desc;
1950 struct irq_data *data = irq_desc_get_irq_data(&desc);
1955 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1956 [irq_desc_get_irq_data is defined])
1962 AC_MSG_CHECKING([if pci_dev has pcie_mpss])
1963 LB_LINUX_TRY_COMPILE([
1964 #include <linux/pci.h>
1966 struct pci_dev *pdev;
1968 pdev->pcie_mpss = 0;
1972 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
1973 [pcie_mpss is defined])
1978 AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
1979 LB_LINUX_TRY_COMPILE([
1980 #include <uapi/linux/if_ether.h>
1985 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
1986 [uapi/linux/if_ether.h exist])
1991 AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
1992 LB_LINUX_TRY_COMPILE([
1993 #include <linux/if_link.h>
1995 struct ifla_vf_info *ivf;
2001 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
2002 [spoofchk is defined])
2007 AC_MSG_CHECKING([if vxlan.h has vxlan_gso_check])
2008 LB_LINUX_TRY_COMPILE([
2009 #include <net/vxlan.h>
2011 vxlan_gso_check(NULL);
2016 AC_DEFINE(HAVE_VXLAN_GSO_CHECK, 1,
2017 [vxlan_gso_check is defined])
2022 AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
2023 LB_LINUX_TRY_COMPILE([
2024 #include <net/dst.h>
2026 struct neighbour *neigh = dst_get_neighbour(NULL);
2031 AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
2037 AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
2038 LB_LINUX_TRY_COMPILE([
2039 #include <linux/netlink.h>
2041 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
2046 AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
2052 AC_MSG_CHECKING([if netlink_dump_start has 5 parameters])
2053 LB_LINUX_TRY_COMPILE([
2054 #include <linux/netlink.h>
2056 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL);
2061 AC_DEFINE(HAVE_NETLINK_DUMP_START_5P, 1,
2067 AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
2068 LB_LINUX_TRY_COMPILE([
2069 #include <net/dcbnl.h>
2071 const struct dcbnl_rtnl_ops en_dcbnl_ops = {
2072 .ieee_getmaxrate = NULL,
2073 .ieee_setmaxrate = NULL,
2079 AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
2080 [ieee_getmaxrate/ieee_setmaxrate is defined])
2086 ac_c_werror_flag=yes
2087 save_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
2088 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
2090 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
2091 LB_LINUX_TRY_COMPILE([
2092 #include <net/bonding.h>
2094 struct bonding *bond = NULL;
2095 struct slave *slave = NULL;
2098 bond_for_each_slave(bond, slave, iter) ;
2103 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
2104 [bond_for_each_slave has int for 3rd parameter])
2108 EXTRA_KCFLAGS="$save_EXTRA_KCFLAGS"
2112 AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
2113 LB_LINUX_TRY_COMPILE([
2114 #include <linux/netdevice.h>
2116 netdev_master_upper_dev_get_rcu(NULL);
2121 AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
2122 [netdev_master_upper_dev_get_rcu is defined])
2127 AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
2128 LB_LINUX_TRY_COMPILE([
2129 #include <linux/if_vlan.h>
2131 __vlan_find_dev_deep(NULL, 0, 0);
2136 AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
2137 [__vlan_find_dev_deep has 3 paramters])
2142 AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
2143 LB_LINUX_TRY_COMPILE([
2144 #include <linux/skbuff.h>
2146 __skb_alloc_page(0, NULL);
2151 AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
2152 [sk_buff has __skb_alloc_page])
2157 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
2158 LB_LINUX_TRY_COMPILE([
2159 #include <linux/if_vlan.h>
2161 __vlan_hwaccel_put_tag(NULL, 0, 0);
2166 AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
2167 [__vlan_hwaccel_put_tag has 3 paramters])
2172 AC_MSG_CHECKING([if linux/mm_types.h has struct page_frag])
2173 LB_LINUX_TRY_COMPILE([
2174 #include <linux/mm_types.h>
2176 struct page_frag frag = {0};
2181 AC_DEFINE(HAVE_MM_TYPES_PAGE_FRAG, 1,
2182 [linux/mm_types.h has struct page_frag])
2187 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep])
2188 LB_LINUX_TRY_COMPILE([
2189 #include <linux/if_vlan.h>
2191 __vlan_find_dev_deep(NULL, 0);
2196 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP, 1,
2197 [__vlan_find_dev_deep is defined])
2202 AC_MSG_CHECKING([if idr .h has idr_Alloc])
2203 LB_LINUX_TRY_COMPILE([
2204 #include <linux/idr.h>
2206 idr_alloc(NULL, NULL, 0, 0, 0);
2210 AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
2211 [idr_Alloc is defined]) ],[
2215 AC_MSG_CHECKING([if completion.h has reinit_completion])
2216 LB_LINUX_TRY_COMPILE([
2217 #include <linux/completion.h>
2219 struct completion c;
2221 reinit_completion(&c);
2225 AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
2226 [reinit_completion is defined])
2231 AC_MSG_CHECKING([if dma-mapping.h has dma_set_mask_and_coherent])
2232 LB_LINUX_TRY_COMPILE([
2233 #include <linux/dma-mapping.h>
2235 dma_set_mask_and_coherent(NULL, 0);
2240 AC_DEFINE(HAVE_DMA_SET_MASK_AND_COHERENT, 1,
2241 [dma_set_mask_and_coherent is defined])
2246 AC_MSG_CHECKING([if in.h has proto_ports_offset])
2247 LB_LINUX_TRY_COMPILE([
2248 #include <linux/in.h>
2250 int x = proto_ports_offset(IPPROTO_TCP);
2254 AC_DEFINE(HAVE_PROTO_PORTS_OFFSET, 1,
2255 [proto_ports_offset is defined])
2260 LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
2261 [kernel/crash_dump.c],
2262 [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
2263 [elfcorehdr_addr is exported by the kernel])],
2266 AC_MSG_CHECKING([if netif_set_real_num_rx_queues is defined])
2267 LB_LINUX_TRY_COMPILE([
2268 #include <linux/netdevice.h>
2270 int rc = netif_set_real_num_rx_queues(NULL, 0);
2275 AC_DEFINE(HAVE_NETIF_SET_REAL_NUM_RX_QUEUES, 1,
2276 [netif_set_real_num_rx_queues is defined])
2281 AC_MSG_CHECKING([if if_vlan.h has is_vlan_dev])
2282 LB_LINUX_TRY_COMPILE([
2283 #include <linux/netdevice.h>
2284 #include <linux/if_vlan.h>
2286 struct net_device dev;
2292 AC_DEFINE(HAVE_IS_VLAN_DEV, 1,
2293 [is_vlan_dev is defined])
2298 AC_MSG_CHECKING([if linux/timecounter.h exists])
2299 LB_LINUX_TRY_COMPILE([
2300 #include <linux/timecounter.h>
2305 AC_DEFINE(HAVE_TIMECOUNTER_H, 1,
2306 [linux/timecounter.h exists])
2311 # timecounter_adjtime can be in timecounter.h or clocksource.h
2312 AC_MSG_CHECKING([if linux/timecounter.h has timecounter_adjtime])
2313 LB_LINUX_TRY_COMPILE([
2314 #include <linux/timecounter.h>
2316 struct timecounter x;
2318 timecounter_adjtime(&x, y);
2323 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
2324 [timecounter_adjtime is defined])
2329 AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
2330 LB_LINUX_TRY_COMPILE([
2331 #include <linux/clocksource.h>
2333 struct timecounter x;
2335 timecounter_adjtime(&x, y);
2340 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
2341 [timecounter_adjtime is defined])
2346 AC_MSG_CHECKING([if cyclecounter_cyc2ns has 4 parameters])
2347 LB_LINUX_TRY_COMPILE([
2348 #include <linux/timecounter.h>
2350 cyclecounter_cyc2ns(NULL, NULL, 0, NULL);
2355 AC_DEFINE(HAVE_CYCLECOUNTER_CYC2NS_4_PARAMS, 1,
2356 [cyclecounter_cyc2ns has 4 parameters])
2361 AC_MSG_CHECKING([if netdevice.h struct net_device_ops has ndo_features_check])
2362 LB_LINUX_TRY_COMPILE([
2363 #include <linux/netdevice.h>
2365 static const struct net_device_ops mlx4_netdev_ops = {
2366 .ndo_features_check = NULL,
2372 AC_DEFINE(HAVE_NETDEV_FEATURES_T, 1,
2373 [netdev_features_t is defined])
2378 AC_MSG_CHECKING([if struct ethtool_ops get_rxnfc gets u32 *rule_locs])
2379 LB_LINUX_TRY_COMPILE([
2380 #include <linux/ethtool.h>
2381 static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *c,
2387 struct ethtool_ops x = {
2388 .get_rxnfc = mlx4_en_get_rxnfc,
2394 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_RXNFC_U32_RULE_LOCS, 1,
2395 [ethtool_ops get_rxnfc gets u32 *rule_locs])
2400 AC_MSG_CHECKING([if ethtool.h enum ethtool_stringset has ETH_SS_RSS_HASH_FUNCS])
2401 LB_LINUX_TRY_COMPILE([
2402 #include <linux/ethtool.h>
2404 enum ethtool_stringset x = ETH_SS_RSS_HASH_FUNCS;
2409 AC_DEFINE(HAVE_ETH_SS_RSS_HASH_FUNCS, 1,
2410 [ETH_SS_RSS_HASH_FUNCS is defined])
2416 # COMPAT_CONFIG_HEADERS
2418 # add -include config.h
2420 AC_DEFUN([COMPAT_CONFIG_HEADERS],[
2421 AC_CONFIG_HEADERS([config.h])
2422 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
2423 AC_SUBST(EXTRA_KCFLAGS)
2426 AC_DEFUN([OFA_PROG_LINUX],
2431 LB_LINUX_CONFIG([MODULES],[],[
2432 AC_MSG_ERROR([module support is required to build mlnx kernel modules.])
2434 LB_LINUX_CONFIG([MODVERSIONS])
2435 LB_LINUX_CONFIG([KALLSYMS],[],[
2436 AC_MSG_ERROR([compat_mlnx requires that CONFIG_KALLSYMS is enabled in your kernel.])
2440 COMPAT_CONFIG_HEADERS