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 svc_xprt_class has xcl_ident])
223 LB_LINUX_TRY_COMPILE([
224 #include <linux/sunrpc/xprt.h>
225 #include <linux/sunrpc/svc_xprt.h>
227 struct svc_xprt_class svc_rdma_class = {
228 .xcl_ident = XPRT_TRANSPORT_RDMA,
233 AC_DEFINE(HAVE_XCL_IDENT, 1,
239 AC_MSG_CHECKING([if struct ifla_vf_info has max_tx_rate])
240 LB_LINUX_TRY_COMPILE([
241 #include <linux/if_link.h>
243 struct ifla_vf_info *ivf;
245 ivf->max_tx_rate = 0;
246 ivf->min_tx_rate = 0;
251 AC_DEFINE(HAVE_TX_RATE_LIMIT, 1,
252 [max_tx_rate is defined])
257 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh])
258 LB_LINUX_TRY_COMPILE([
259 #include <linux/ethtool.h>
261 const struct ethtool_ops en_ethtool_ops = {
262 .get_rxfh_key_size = NULL,
270 AC_DEFINE(HAVE_GET_SET_RXFH, 1,
271 [get/set_rxfh is defined])
276 AC_MSG_CHECKING([if struct ethtool_ops has get_rxfh_indir_size])
277 LB_LINUX_TRY_COMPILE([
278 #include <linux/ethtool.h>
280 const struct ethtool_ops en_ethtool_ops = {
281 .get_rxfh_indir_size = NULL,
287 AC_DEFINE(HAVE_RXFH_INDIR_SIZE, 1,
288 [get_rxfh_indir_size is defined])
293 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_rxfh_indir_size])
294 LB_LINUX_TRY_COMPILE([
295 #include <linux/ethtool.h>
297 const struct ethtool_ops_ext en_ethtool_ops_ext = {
298 .get_rxfh_indir_size = NULL,
304 AC_DEFINE(HAVE_RXFH_INDIR_SIZE_EXT, 1,
305 [get_rxfh_indir_size is defined in ethtool_ops_ext])
310 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh_indir])
311 LB_LINUX_TRY_COMPILE([
312 #include <linux/ethtool.h>
314 int mlx4_en_get_rxfh_indir(struct net_device *d, u32 *r)
319 struct ethtool_ops en_ethtool_ops;
320 en_ethtool_ops.get_rxfh_indir = mlx4_en_get_rxfh_indir;
325 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
326 [get/set_rxfh_indir is defined])
331 AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable])
332 LB_LINUX_TRY_COMPILE([
333 #include <linux/ethtool.h>
335 const struct ethtool_ops en_ethtool_ops = {
343 AC_DEFINE(HAVE_GET_SET_TUNABLE, 1,
344 [get/set_tunable is defined])
349 AC_MSG_CHECKING([if exist struct ethtool_ops_ext])
350 LB_LINUX_TRY_COMPILE([
351 #include <linux/ethtool.h>
353 const struct ethtool_ops_ext en_ethtool_ops_ext = {
354 .size = sizeof(struct ethtool_ops_ext),
360 AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1,
361 [struct ethtool_ops_ext is defined])
366 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
367 LB_LINUX_TRY_COMPILE([
368 #include <linux/ethtool.h>
370 const struct ethtool_ops_ext en_ethtool_ops_ext = {
371 .get_rxfh_indir = NULL,
372 .set_rxfh_indir = NULL,
378 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR_EXT, 1,
379 [get/set_rxfh_indir is defined])
384 AC_MSG_CHECKING([if struct net_device has dev_port])
385 LB_LINUX_TRY_COMPILE([
386 #include <linux/netdevice.h>
388 struct net_device *dev = NULL;
395 AC_DEFINE(HAVE_NET_DEVICE_DEV_PORT, 1,
396 [dev_port is defined])
401 AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
402 LB_LINUX_TRY_COMPILE([
403 #include <linux/ptp_clock_kernel.h>
405 struct ptp_clock_info *info;
411 AC_DEFINE(HAVE_PTP_CLOCK_INFO_N_PINS, 1,
417 AC_MSG_CHECKING([if pci.h pci_enable_msi_exact])
418 LB_LINUX_TRY_COMPILE([
419 #include <linux/pci.h>
421 int x = pci_enable_msi_exact(NULL, 0);
426 AC_DEFINE(HAVE_PCI_ENABLE_MSI_EXACT, 1,
427 [pci_enable_msi_exact is defined])
432 AC_MSG_CHECKING([if pci.h pci_enable_msix_range])
433 LB_LINUX_TRY_COMPILE([
434 #include <linux/pci.h>
436 int x = pci_enable_msix_range(NULL, 0, 0, 0);
441 AC_DEFINE(HAVE_PCI_ENABLE_MSIX_RANGE, 1,
442 [pci_enable_msix_range is defined])
447 AC_MSG_CHECKING([if pci.h pci_msix_vec_count])
448 LB_LINUX_TRY_COMPILE([
449 #include <linux/pci.h>
451 int x = pci_msix_vec_count(NULL);
456 AC_DEFINE(HAVE_PCI_MSIX_VEC_COUNT, 1,
457 [pci_msix_vec_count is defined])
462 AC_MSG_CHECKING([if pci_dev has msix_cap])
463 LB_LINUX_TRY_COMPILE([
464 #include <linux/pci.h>
472 AC_DEFINE(HAVE_PCI_MSIX_CAP, 1,
473 [msix_cap is defined])
478 AC_MSG_CHECKING([if mm_struct has pinned_vm])
479 LB_LINUX_TRY_COMPILE([
480 #include <linux/mm_types.h>
488 AC_DEFINE(HAVE_PINNED_VM, 1,
489 [pinned_vm is defined])
494 AC_MSG_CHECKING([if kernel has idr_alloc])
495 LB_LINUX_TRY_COMPILE([
496 #include <linux/idr.h>
499 x = idr_alloc(NULL, NULL, 0, 0, 0);
504 AC_DEFINE(HAVE_IDR_ALLOC, 1,
505 [idr_alloc is defined])
510 AC_MSG_CHECKING([if kernel has percpu variables])
511 LB_LINUX_TRY_COMPILE([
512 #include <linux/percpu.h>
514 static DEFINE_PER_CPU(unsigned int, x);
520 AC_DEFINE(HAVE_PERCPU_VARS, 1,
521 [percpu variables are defined])
526 AC_MSG_CHECKING([if struct iscsi_transport has attr_is_visible])
527 LB_LINUX_TRY_COMPILE([
528 #include <scsi/scsi_transport_iscsi.h>
530 static struct iscsi_transport iscsi_iser_transport = {
531 .attr_is_visible = NULL,
537 AC_DEFINE(HAVE_ISCSI_ATTR_IS_VISIBLE, 1,
538 [attr_is_visible is defined])
543 AC_MSG_CHECKING([if struct iscsi_transport has get_ep_param])
544 LB_LINUX_TRY_COMPILE([
545 #include <scsi/scsi_transport_iscsi.h>
547 static struct iscsi_transport iscsi_iser_transport = {
548 .get_ep_param = NULL,
554 AC_DEFINE(HAVE_ISCSI_GET_EP_PARAM, 1,
555 [get_ep_param is defined])
560 AC_MSG_CHECKING([if struct iscsi_transport has check_protection])
561 LB_LINUX_TRY_COMPILE([
562 #include <scsi/scsi_transport_iscsi.h>
564 static struct iscsi_transport iscsi_iser_transport = {
565 .check_protection = NULL,
571 AC_DEFINE(HAVE_ISCSI_CHECK_PROTECTION, 1,
572 [check_protection is defined])
577 AC_MSG_CHECKING([if iscsi_proto.h has struct iscsi_scsi_req])
578 LB_LINUX_TRY_COMPILE([
579 #include <scsi/iscsi_proto.h>
581 struct iscsi_scsi_req req = {
588 AC_DEFINE(HAVE_ISCSI_SCSI_REQ, 1,
589 [struct iscsi_scsi_req is defined])
594 AC_MSG_CHECKING([if struct request_queue has request_fn_active])
595 LB_LINUX_TRY_COMPILE([
596 #include <linux/blkdev.h>
598 struct request_queue rq = {
599 .request_fn_active = 0,
605 AC_DEFINE(HAVE_REQUEST_QUEUE_REQUEST_FN_ACTIVE, 1,
606 [struct request_queue has request_fn_active])
611 AC_MSG_CHECKING([if netdevice.h has select_queue_fallback_t])
612 LB_LINUX_TRY_COMPILE([
613 #include <linux/netdevice.h>
615 select_queue_fallback_t fallback;
622 AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T, 1,
623 [select_queue_fallback_t is defined])
628 AC_MSG_CHECKING([if netdevice.h has skb_set_hash])
629 LB_LINUX_TRY_COMPILE([
630 #include <linux/netdevice.h>
632 skb_set_hash(NULL, 0, PKT_HASH_TYPE_L3);
637 AC_DEFINE(HAVE_SKB_SET_HASH, 1,
638 [skb_set_hash is defined])
643 AC_MSG_CHECKING([if netdevice.h has alloc_netdev with 4 params])
644 LB_LINUX_TRY_COMPILE([
645 #include <linux/netdevice.h>
647 struct net_device *dev;
649 dev = alloc_netdev(0, NULL, 0, NULL);
654 AC_DEFINE(HAVE_ALLOC_NETDEV_4P, 1,
655 [alloc_netdev has 4 parameters])
660 AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
661 LB_LINUX_TRY_COMPILE([
662 #include <linux/sockios.h>
664 int x = SIOCGHWTSTAMP;
669 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
670 [SIOCGHWTSTAMP is defined])
675 AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
676 LB_LINUX_TRY_COMPILE([
679 inet_get_local_port_range(NULL, NULL, NULL);
684 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
685 [inet_get_local_port_range has 3 parameters])
690 AC_MSG_CHECKING([if net.h has net_get_random_once])
691 LB_LINUX_TRY_COMPILE([
692 #include <linux/net.h>
694 net_get_random_once(NULL, 0);
699 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
700 [net_get_random_once is defined])
705 AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
706 LB_LINUX_TRY_COMPILE([
707 #include <net/inet_sock.h>
709 __inet_ehashfn(0, 0, 0, 0, 0);
714 AC_DEFINE(HAVE_INET_EHASHFN, 1,
715 [__inet_ehashfn is defined])
720 AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
721 LB_LINUX_TRY_COMPILE([
722 #include <linux/err.h>
724 int x = PTR_ERR_OR_ZERO(NULL);
729 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
730 [PTR_ERR_OR_ZERO is defined])
735 AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
736 LB_LINUX_TRY_COMPILE([
737 #include <scsi/libiscsi.h>
739 struct iscsi_session session;
740 session.discovery_sess = 0;
745 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
746 [discovery_sess is defined])
751 AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
752 LB_LINUX_TRY_COMPILE([
753 #include <scsi/iscsi_if.h>
755 int x = ISCSI_PARAM_DISCOVERY_SESS;
760 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
761 [ISCSI_PARAM_DISCOVERY_SESS is defined])
766 AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
767 LB_LINUX_TRY_COMPILE([
768 #include <linux/pci.h>
769 #include <linux/pci_hotplug.h>
771 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
776 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
777 [pcie_link_width is defined])
782 AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
783 LB_LINUX_TRY_COMPILE([
784 #include <linux/pci.h>
785 #include <linux/pci_hotplug.h>
787 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
792 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
793 [pci_bus_speed is defined])
798 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
799 LB_LINUX_TRY_COMPILE([
800 #include <linux/netdevice.h>
802 struct netdev_phys_port_id *x = NULL;
807 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
808 [netdev_phys_port_id is defined])
813 AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
814 LB_LINUX_TRY_COMPILE([
815 #include <linux/if_link.h>
817 struct ifla_vf_info *x;
823 AC_DEFINE(HAVE_LINKSTATE, 1,
824 [linkstate is defined])
829 AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
830 LB_LINUX_TRY_COMPILE([
831 #include <net/busy_poll.h>
833 skb_mark_napi_id(NULL, NULL);
838 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
839 [skb_mark_napi_id is defined])
844 AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
845 LB_LINUX_TRY_COMPILE([
846 #include <linux/netdevice.h>
853 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
854 [napi_hash_add is defined])
859 AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
860 LB_LINUX_TRY_COMPILE([
861 #include <linux/netdevice.h>
863 netif_keep_dst(NULL);
868 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
869 [netif_keep_dst is defined])
874 AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
875 LB_LINUX_TRY_COMPILE([
876 #include <linux/netdevice.h>
878 dev_consume_skb_any(NULL);
883 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
884 [dev_consume_skb_any is defined])
889 AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
890 LB_LINUX_TRY_COMPILE([
891 #include <linux/netdevice.h>
893 netdev_txq_bql_complete_prefetchw(NULL);
894 netdev_txq_bql_enqueue_prefetchw(NULL);
899 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
900 [netdev_txq_bql_complete_prefetchw is defined])
905 AC_MSG_CHECKING([if struct sk_buff has xmit_more])
906 LB_LINUX_TRY_COMPILE([
907 #include <linux/skbuff.h>
915 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
916 [xmit_more is defined])
921 AC_MSG_CHECKING([if struct sk_buff has encapsulation])
922 LB_LINUX_TRY_COMPILE([
923 #include <linux/skbuff.h>
926 skb->encapsulation = 0;
931 AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
932 [encapsulation is defined])
937 AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
938 LB_LINUX_TRY_COMPILE([
939 #include <linux/etherdevice.h>
941 eth_get_headlen(NULL, 0);
946 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
947 [eth_get_headlen is defined])
952 AC_MSG_CHECKING([if struct sk_buff has csum_level])
953 LB_LINUX_TRY_COMPILE([
954 #include <linux/skbuff.h>
962 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
963 [csum_level is defined])
968 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
969 LB_LINUX_TRY_COMPILE([
970 #include <linux/skbuff.h>
972 skb_inner_transport_header(NULL);
977 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
978 [skb_inner_transport_header is defined])
983 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
984 LB_LINUX_TRY_COMPILE([
985 #include <linux/skbuff.h>
987 skb_inner_network_header(NULL);
992 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
993 [skb_inner_network_header is defined])
998 AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
999 LB_LINUX_TRY_COMPILE([
1000 #include <linux/if_vlan.h>
1002 vlan_dev_get_egress_qos_mask(NULL, 0);
1007 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
1008 [vlan_dev_get_egress_qos_mask is defined])
1013 AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
1014 LB_LINUX_TRY_COMPILE([
1015 #include <linux/netdevice.h>
1017 netdev_get_prio_tc_map(NULL, 0);
1022 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
1023 [netdev_get_prio_tc_map is defined])
1028 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
1029 LB_LINUX_TRY_COMPILE([
1030 #include <linux/if_vlan.h>
1032 __vlan_find_dev_deep_rcu(NULL, 0, 0);
1037 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
1038 [__vlan_find_dev_deep_rcu is defined])
1043 AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
1044 LB_LINUX_TRY_COMPILE([
1045 #include <linux/netdevice.h>
1047 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
1053 struct net_device_opts ndops;
1055 ndops.ndo_select_queue = select_queue;
1060 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
1061 [ndo_select_queue has accel_priv])
1066 AC_MSG_CHECKING([if include/net/bonding.h exists])
1067 LB_LINUX_TRY_COMPILE([
1068 #include <net/bonding.h>
1073 AC_DEFINE(HAVE_BONDING_H, 1,
1074 [include/net/bonding.h exists])
1079 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
1080 LB_LINUX_TRY_COMPILE([
1081 #include <net/bonding.h>
1083 struct bonding *bond = NULL;
1084 struct list_head *iter = NULL;
1085 struct slave *slave = NULL;
1087 bond_for_each_slave(bond, slave, iter) ;
1092 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
1093 [bond_for_each_slave has 3 parameters])
1099 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
1100 LB_LINUX_TRY_COMPILE([
1101 #include <linux/u64_stats_sync.h>
1103 struct u64_stats_sync sync;
1104 u64_stats_init(&sync);
1109 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
1110 [u64_stats_sync is defined])
1115 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
1116 LB_LINUX_TRY_COMPILE([
1117 #include <linux/u64_stats_sync.h>
1119 struct u64_stats_sync sync;
1120 u64_stats_fetch_begin_irq(&sync);
1125 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
1126 [u64_stats_fetch_begin_irq is defined])
1130 AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
1131 LB_LINUX_TRY_COMPILE([
1132 #include <linux/etherdevice.h>
1134 char dest[6], src[6];
1135 ether_addr_copy(&dest, &src);
1140 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
1141 [ether_addr_copy is defined])
1146 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
1147 LB_LINUX_TRY_COMPILE([
1148 #include <linux/netdevice.h>
1150 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
1156 struct net_device_ops netdev_ops;
1158 netdev_ops.ndo_set_vf_rate = set_vf_rate;
1162 AC_DEFINE(HAVE_SET_VF_RATE, 1,
1163 [ndo_set_vf_rate is defined])
1168 AC_MSG_CHECKING([if netdev_extended has hw_features])
1169 LB_LINUX_TRY_COMPILE([
1170 #include <linux/netdevice.h>
1172 struct net_device *dev = NULL;
1174 netdev_extended(dev)->hw_features = 0;
1179 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
1185 AC_MSG_CHECKING([if net_device_extended has _tx_ext])
1186 LB_LINUX_TRY_COMPILE([
1187 #include <linux/netdevice.h>
1189 struct net_device *dev = NULL;
1191 netdev_extended(dev)->_tx_ext = NULL;
1196 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
1202 AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
1203 LB_LINUX_TRY_COMPILE([
1204 #include <linux/netdevice.h>
1206 int busy_poll(struct napi_struct *napi)
1211 struct net_device *dev = NULL;
1213 netdev_extended(dev)->ndo_busy_poll = busy_poll;
1218 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
1224 AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
1225 LB_LINUX_TRY_COMPILE([
1226 #include <linux/netdevice.h>
1228 struct net_device *dev = NULL;
1230 set_netdev_hw_features(dev, 0);
1235 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
1241 AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
1242 LB_LINUX_TRY_COMPILE([
1243 #include <linux/netdevice.h>
1245 struct net_device *dev = NULL;
1247 netif_set_xps_queue(dev, NULL, 0);
1252 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
1259 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
1260 LB_LINUX_TRY_COMPILE([
1261 #include <linux/netdevice.h>
1263 int set_features(struct net_device *dev, netdev_features_t features)
1268 struct net_device_ops netdev_ops;
1270 netdev_ops.ndo_set_features = set_features;
1274 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1275 [ndo_set_features is defined])
1280 AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1281 LB_LINUX_TRY_COMPILE([
1282 #include <linux/netdevice.h>
1284 int rx_flow_steer(struct net_device *dev,
1285 const struct sk_buff *skb,
1292 struct net_device_ops netdev_ops;
1294 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1298 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1299 [ndo_rx_flow_steer is defined])
1304 AC_MSG_CHECKING([if struct net_device has priv_flags])
1305 LB_LINUX_TRY_COMPILE([
1306 #include <linux/netdevice.h>
1308 struct net_device *netdev;
1309 netdev->priv_flags = 0;
1314 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1315 [priv_flags is defined])
1320 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1321 LB_LINUX_TRY_COMPILE([
1322 #include <linux/netdevice.h>
1324 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1325 struct rtnl_link_stats64 *storage)
1327 struct rtnl_link_stats64 stats_64;
1331 struct net_device_ops netdev_ops;
1333 netdev_ops.ndo_get_stats64 = get_stats_64;
1338 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1339 [ndo_get_stats64 is defined])
1343 AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1344 LB_LINUX_TRY_COMPILE([
1345 #include <linux/netdevice.h>
1347 struct net_device_ops netdev_ops = {
1348 .ndo_bridge_setlink = NULL,
1349 .ndo_bridge_getlink = NULL,
1355 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1356 [ndo_bridge_set/getlink is defined])
1361 AC_MSG_CHECKING([if rtnetlink.h ndo_dflt_bridge_getlink has 7 params])
1362 LB_LINUX_TRY_COMPILE([
1363 #include <linux/rtnetlink.h>
1365 ndo_dflt_bridge_getlink(NULL, 0, 0, NULL, 0, 0, 0);
1370 AC_DEFINE(HAVE_NDO_DFLT_BRIDGE_GETLINK_7_PARAMS, 1,
1371 [ ndo_dflt_bridge_getlink with 7 params is defined])
1376 AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1377 LB_LINUX_TRY_COMPILE([
1378 #include <linux/netdevice.h>
1381 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1385 struct net_device_ops netdev_ops;
1387 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1388 netdev_ops.ndo_vlan_rx_add_vid (NULL, 1, 1) ;
1393 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1394 [ndo_vlan_rx_add_vid has 3 parameters])
1399 AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1400 LB_LINUX_TRY_COMPILE([
1401 #include <linux/netdevice.h>
1403 int get_phys_port_id(struct net_device *dev,
1404 struct netdev_phys_port_id *ppid)
1409 struct net_device_ops netdev_ops;
1411 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1416 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1422 AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1423 LB_LINUX_TRY_COMPILE([
1424 #include <linux/netdevice.h>
1426 struct net_device_ops_ext netdev_ops_ext = {
1427 .size = sizeof(struct net_device_ops_ext),
1433 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1434 [struct net_device_ops_ext is defined])
1439 AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1440 LB_LINUX_TRY_COMPILE([
1441 #include <linux/netdevice.h>
1443 int get_phys_port_id(struct net_device *dev,
1444 struct netdev_phys_port_id *ppid)
1449 struct net_device_ops_ext netdev_ops_ext;
1451 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1456 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1457 [ndo_get_phys_port_id is defined])
1462 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1463 LB_LINUX_TRY_COMPILE([
1464 #include <linux/netdevice.h>
1466 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1471 struct net_device_ops netdev_ops;
1473 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1478 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1479 [ndo_set_vf_spoofchk is defined in net_device_ops])
1484 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1485 LB_LINUX_TRY_COMPILE([
1486 #include <linux/netdevice.h>
1488 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1493 struct net_device_ops_ext netdev_ops_ext;
1495 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1500 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1501 [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1506 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1507 LB_LINUX_TRY_COMPILE([
1508 #include <linux/netdevice.h>
1510 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1515 struct net_device_ops netdev_ops;
1517 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1522 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1523 [ndo_set_vf_link_state is defined in net_device_ops])
1528 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1529 LB_LINUX_TRY_COMPILE([
1530 #include <linux/netdevice.h>
1532 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1537 struct net_device_ops_ext netdev_ops_ext;
1539 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1544 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1545 [ndo_set_vf_link_state is defined])
1551 AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1552 LB_LINUX_TRY_COMPILE([
1553 #include <linux/netdevice.h>
1555 struct net_device dev;
1557 ret = netif_set_real_num_tx_queues(&dev, 2);
1561 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1562 [netif_set_real_num_tx_queues returns int])
1567 AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1568 LB_LINUX_TRY_COMPILE([
1569 #include <linux/netdevice.h>
1577 AC_DEFINE(HAVE_XPS_MAP, 1,
1578 [struct xps_map is defined])
1583 AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1584 LB_LINUX_TRY_COMPILE([
1585 #include <linux/ethtool.h>
1587 const struct ethtool_ops en_ethtool_ops = {
1594 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1595 [set_phys_id is defined])
1600 AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1601 LB_LINUX_TRY_COMPILE([
1602 #include <linux/ethtool.h>
1604 const struct ethtool_ops en_ethtool_ops = {
1605 .get_channels = NULL,
1606 .set_channels = NULL,
1612 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1613 [get/set_channels is defined])
1618 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1619 LB_LINUX_TRY_COMPILE([
1620 #include <linux/ethtool.h>
1622 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1623 .get_channels = NULL,
1624 .set_channels = NULL,
1630 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1631 [get/set_channels is defined in ethtool_ops_ext])
1636 AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1637 LB_LINUX_TRY_COMPILE([
1638 #include <linux/ethtool.h>
1640 const struct ethtool_ops en_ethtool_ops = {
1641 .get_ts_info = NULL,
1647 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1648 [get_ts_info is defined])
1653 AC_MSG_CHECKING([if struct ethtool_ops has set_dump])
1654 LB_LINUX_TRY_COMPILE([
1655 #include <linux/ethtool.h>
1657 const struct ethtool_ops en_ethtool_ops = {
1664 AC_DEFINE(HAVE_ETHTOOL_OPS_SET_DUMP, 1,
1665 [set_dump is defined])
1670 AC_MSG_CHECKING([if struct ethtool_ops has get_module_info])
1671 LB_LINUX_TRY_COMPILE([
1672 #include <linux/ethtool.h>
1674 const struct ethtool_ops en_ethtool_ops = {
1675 .get_module_info = NULL,
1681 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_INFO, 1,
1682 [get_module_info is defined])
1687 AC_MSG_CHECKING([if struct ethtool_ops has get_module_eeprom])
1688 LB_LINUX_TRY_COMPILE([
1689 #include <linux/ethtool.h>
1691 const struct ethtool_ops en_ethtool_ops = {
1692 .get_module_eeprom = NULL,
1698 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_EEPROM, 1,
1699 [get_module_eeprom is defined])
1704 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1705 LB_LINUX_TRY_COMPILE([
1706 #include <linux/ethtool.h>
1708 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1709 .get_ts_info = NULL,
1715 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1716 [get_ts_info is defined in ethtool_ops_ext])
1721 AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
1722 LB_LINUX_TRY_COMPILE([
1723 #include <linux/ethtool.h>
1725 unsigned char mac[ETH_ALEN];
1726 struct ethtool_flow_ext h_ext;
1728 memcpy(&mac, h_ext.h_dest, ETH_ALEN);
1733 AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
1734 [ethtool_flow_ext has h_dest])
1739 AC_MSG_CHECKING([if netdevice.h has struct dev_addr_list])
1740 LB_LINUX_TRY_COMPILE([
1741 #include <linux/netdevice.h>
1743 struct dev_addr_list addr;
1747 AC_DEFINE(HAVE_NETDEV_DEV_ADDR, 1,
1748 [dev_addr_list is defined])
1753 AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1754 LB_LINUX_TRY_COMPILE([
1755 #include <linux/pci.h>
1757 struct pci_dev pdev;
1758 pci_vfs_assigned(&pdev);
1762 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1763 [pci_vfs_assigned is defined])
1768 AC_MSG_CHECKING([if vlan_insert_tag_set_proto is defined])
1769 LB_LINUX_TRY_COMPILE([
1770 #include <linux/if_vlan.h>
1772 struct sk_buff *skb;
1773 vlan_insert_tag_set_proto(skb, 0, 0);
1777 AC_DEFINE(HAVE_VLAN_INSERT_TAG_SET_PROTO, 1,
1778 [vlan_insert_tag_set_proto is defined])
1781 AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1782 LB_LINUX_TRY_COMPILE([
1783 #include <linux/if_vlan.h>
1785 struct sk_buff *skb;
1786 __vlan_put_tag(skb, 0, 0);
1790 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1791 [__vlan_put_tag has 3 parameters])
1797 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1798 LB_LINUX_TRY_COMPILE([
1799 #include <linux/if_vlan.h>
1801 struct sk_buff *skb;
1802 __vlan_hwaccel_put_tag(skb, 0, 0);
1807 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1808 [__vlan_hwaccel_put_tag has 3 parameters])
1813 AC_MSG_CHECKING([if struct inet6_ifaddr has if_next])
1814 LB_LINUX_TRY_COMPILE([
1815 #include <net/if_inet6.h>
1817 struct inet6_ifaddr ifp ;
1823 AC_DEFINE(HAVE_INETADDR_IF_NEXT, 1,
1824 [if_next is defined])
1829 AC_MSG_CHECKING([if struct net_device has hw_features])
1830 LB_LINUX_TRY_COMPILE([
1831 #include <linux/netdevice.h>
1833 struct net_device dev;
1834 dev.hw_features = 0;
1839 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1840 [hw_features is defined])
1845 AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1846 LB_LINUX_TRY_COMPILE([
1847 #include <linux/netdevice.h>
1849 struct net_device dev;
1850 dev.hw_enc_features = 0;
1855 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1856 [hw_enc_features is defined])
1861 AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1862 LB_LINUX_TRY_COMPILE([
1863 #include <linux/netdevice.h>
1865 struct net_device dev;
1866 dev.rx_cpu_rmap = NULL;
1871 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1872 [rx_cpu_rmap is defined])
1877 AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1878 LB_LINUX_TRY_COMPILE([
1879 #include <linux/if_vlan.h>
1881 struct sk_buff *skb;
1882 vlan_hwaccel_receive_skb(skb,0,0);
1886 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1887 [vlan_hwaccel_receive_skb is defined])
1892 AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1893 LB_LINUX_TRY_COMPILE([
1894 #include <linux/irq.h>
1895 #include <linux/irqdesc.h>
1897 struct irq_desc desc;
1898 struct irq_data *data = irq_desc_get_irq_data(&desc);
1903 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1904 [irq_desc_get_irq_data is defined])
1910 AC_MSG_CHECKING([if pci_dev has pcie_mpss])
1911 LB_LINUX_TRY_COMPILE([
1912 #include <linux/pci.h>
1914 struct pci_dev *pdev;
1916 pdev->pcie_mpss = 0;
1920 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
1921 [pcie_mpss is defined])
1926 AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
1927 LB_LINUX_TRY_COMPILE([
1928 #include <uapi/linux/if_ether.h>
1933 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
1934 [uapi/linux/if_ether.h exist])
1939 AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
1940 LB_LINUX_TRY_COMPILE([
1941 #include <linux/if_link.h>
1943 struct ifla_vf_info *ivf;
1949 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
1950 [spoofchk is defined])
1955 AC_MSG_CHECKING([if vxlan.h has vxlan_gso_check])
1956 LB_LINUX_TRY_COMPILE([
1957 #include <net/vxlan.h>
1959 vxlan_gso_check(NULL);
1964 AC_DEFINE(HAVE_VXLAN_GSO_CHECK, 1,
1965 [vxlan_gso_check is defined])
1970 AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
1971 LB_LINUX_TRY_COMPILE([
1972 #include <net/dst.h>
1974 struct neighbour *neigh = dst_get_neighbour(NULL);
1979 AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
1985 AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
1986 LB_LINUX_TRY_COMPILE([
1987 #include <linux/netlink.h>
1989 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
1994 AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
2000 AC_MSG_CHECKING([if netlink_dump_start has 5 parameters])
2001 LB_LINUX_TRY_COMPILE([
2002 #include <linux/netlink.h>
2004 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL);
2009 AC_DEFINE(HAVE_NETLINK_DUMP_START_5P, 1,
2015 AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
2016 LB_LINUX_TRY_COMPILE([
2017 #include <net/dcbnl.h>
2019 const struct dcbnl_rtnl_ops en_dcbnl_ops = {
2020 .ieee_getmaxrate = NULL,
2021 .ieee_setmaxrate = NULL,
2027 AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
2028 [ieee_getmaxrate/ieee_setmaxrate is defined])
2034 ac_c_werror_flag=yes
2035 save_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
2036 EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
2038 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
2039 LB_LINUX_TRY_COMPILE([
2040 #include <net/bonding.h>
2042 struct bonding *bond = NULL;
2043 struct slave *slave = NULL;
2046 bond_for_each_slave(bond, slave, iter) ;
2051 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
2052 [bond_for_each_slave has int for 3rd parameter])
2056 EXTRA_KCFLAGS="$save_EXTRA_KCFLAGS"
2060 AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
2061 LB_LINUX_TRY_COMPILE([
2062 #include <linux/netdevice.h>
2064 netdev_master_upper_dev_get_rcu(NULL);
2069 AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
2070 [netdev_master_upper_dev_get_rcu is defined])
2075 AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
2076 LB_LINUX_TRY_COMPILE([
2077 #include <linux/if_vlan.h>
2079 __vlan_find_dev_deep(NULL, 0, 0);
2084 AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
2085 [__vlan_find_dev_deep has 3 paramters])
2090 AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
2091 LB_LINUX_TRY_COMPILE([
2092 #include <linux/skbuff.h>
2094 __skb_alloc_page(0, NULL);
2099 AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
2100 [sk_buff has __skb_alloc_page])
2105 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
2106 LB_LINUX_TRY_COMPILE([
2107 #include <linux/if_vlan.h>
2109 __vlan_hwaccel_put_tag(NULL, 0, 0);
2114 AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
2115 [__vlan_hwaccel_put_tag has 3 paramters])
2120 AC_MSG_CHECKING([if linux/mm_types.h has struct page_frag])
2121 LB_LINUX_TRY_COMPILE([
2122 #include <linux/mm_types.h>
2124 struct page_frag frag = {0};
2129 AC_DEFINE(HAVE_MM_TYPES_PAGE_FRAG, 1,
2130 [linux/mm_types.h has struct page_frag])
2135 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep])
2136 LB_LINUX_TRY_COMPILE([
2137 #include <linux/if_vlan.h>
2139 __vlan_find_dev_deep(NULL, 0);
2144 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP, 1,
2145 [__vlan_find_dev_deep is defined])
2150 AC_MSG_CHECKING([if idr .h has idr_Alloc])
2151 LB_LINUX_TRY_COMPILE([
2152 #include <linux/idr.h>
2154 idr_alloc(NULL, NULL, 0, 0, 0);
2158 AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
2159 [idr_Alloc is defined]) ],[
2163 AC_MSG_CHECKING([if completion.h has reinit_completion])
2164 LB_LINUX_TRY_COMPILE([
2165 #include <linux/completion.h>
2167 struct completion c;
2169 reinit_completion(&c);
2173 AC_DEFINE(HAVE_REINIT_COMPLETION, 1,
2174 [reinit_completion is defined])
2179 AC_MSG_CHECKING([if dma-mapping.h has dma_set_mask_and_coherent])
2180 LB_LINUX_TRY_COMPILE([
2181 #include <linux/dma-mapping.h>
2183 dma_set_mask_and_coherent(NULL, 0);
2188 AC_DEFINE(HAVE_DMA_SET_MASK_AND_COHERENT, 1,
2189 [dma_set_mask_and_coherent is defined])
2194 AC_MSG_CHECKING([if in.h has proto_ports_offset])
2195 LB_LINUX_TRY_COMPILE([
2196 #include <linux/in.h>
2198 int x = proto_ports_offset(IPPROTO_TCP);
2202 AC_DEFINE(HAVE_PROTO_PORTS_OFFSET, 1,
2203 [proto_ports_offset is defined])
2208 LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
2209 [kernel/crash_dump.c],
2210 [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
2211 [elfcorehdr_addr is exported by the kernel])],
2214 AC_MSG_CHECKING([if netif_set_real_num_rx_queues is defined])
2215 LB_LINUX_TRY_COMPILE([
2216 #include <linux/netdevice.h>
2218 int rc = netif_set_real_num_rx_queues(NULL, 0);
2223 AC_DEFINE(HAVE_NETIF_SET_REAL_NUM_RX_QUEUES, 1,
2224 [netif_set_real_num_rx_queues is defined])
2229 AC_MSG_CHECKING([if if_vlan.h has is_vlan_dev])
2230 LB_LINUX_TRY_COMPILE([
2231 #include <linux/netdevice.h>
2232 #include <linux/if_vlan.h>
2234 struct net_device dev;
2240 AC_DEFINE(HAVE_IS_VLAN_DEV, 1,
2241 [is_vlan_dev is defined])
2246 AC_MSG_CHECKING([if linux/timecounter.h exists])
2247 LB_LINUX_TRY_COMPILE([
2248 #include <linux/timecounter.h>
2253 AC_DEFINE(HAVE_TIMECOUNTER_H, 1,
2254 [linux/timecounter.h exists])
2259 # timecounter_adjtime can be in timecounter.h or clocksource.h
2260 AC_MSG_CHECKING([if linux/clocksource.h has timecounter_adjtime])
2261 LB_LINUX_TRY_COMPILE([
2262 #include <linux/clocksource.h>
2264 struct timecounter x;
2266 timecounter_adjtime(&x, y);
2271 AC_DEFINE(HAVE_TIMECOUNTER_ADJTIME, 1,
2272 [timecounter_adjtime is defined])
2277 AC_MSG_CHECKING([if cyclecounter_cyc2ns has 4 parameters])
2278 LB_LINUX_TRY_COMPILE([
2279 #include <linux/timecounter.h>
2281 cyclecounter_cyc2ns(NULL, NULL, 0, NULL);
2286 AC_DEFINE(HAVE_CYCLECOUNTER_CYC2NS_4_PARAMS, 1,
2287 [cyclecounter_cyc2ns has 4 parameters])
2292 AC_MSG_CHECKING([if netdevice.h struct net_device_ops has ndo_features_check])
2293 LB_LINUX_TRY_COMPILE([
2294 #include <linux/netdevice.h>
2296 static const struct net_device_ops mlx4_netdev_ops = {
2297 .ndo_features_check = NULL,
2303 AC_DEFINE(HAVE_NETDEV_FEATURES_T, 1,
2304 [netdev_features_t is defined])
2309 AC_MSG_CHECKING([if struct ethtool_ops get_rxnfc gets u32 *rule_locs])
2310 LB_LINUX_TRY_COMPILE([
2311 #include <linux/ethtool.h>
2312 static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *c,
2318 struct ethtool_ops x = {
2319 .get_rxnfc = mlx4_en_get_rxnfc,
2325 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_RXNFC_U32_RULE_LOCS, 1,
2326 [ethtool_ops get_rxnfc gets u32 *rule_locs])
2331 AC_MSG_CHECKING([if ethtool.h enum ethtool_stringset has ETH_SS_RSS_HASH_FUNCS])
2332 LB_LINUX_TRY_COMPILE([
2333 #include <linux/ethtool.h>
2335 enum ethtool_stringset x = ETH_SS_RSS_HASH_FUNCS;
2340 AC_DEFINE(HAVE_ETH_SS_RSS_HASH_FUNCS, 1,
2341 [ETH_SS_RSS_HASH_FUNCS is defined])
2346 AC_MSG_CHECKING([if include/linux/irq_poll.h exists])
2347 LB_LINUX_TRY_COMPILE([
2348 #include <linux/irq_poll.h>
2353 AC_DEFINE(HAVE_IRQ_POLL_H, 1,
2354 [include/linux/irq_poll.h exists])
2359 AC_MSG_CHECKING([if linux/dma-mapping.h has struct dma_attrs])
2360 LB_LINUX_TRY_COMPILE([
2361 #include <linux/dma-mapping.h>
2363 struct dma_attrs *attrs;
2366 ret = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);
2371 AC_DEFINE(HAVE_STRUCT_DMA_ATTRS, 1,
2372 [struct dma_attrs is defined])
2377 AC_MSG_CHECKING([if pci.h has pcie_get_minimum_link])
2378 LB_LINUX_TRY_COMPILE([
2379 #include <linux/pci.h>
2382 ret = pcie_get_minimum_link(NULL, NULL, NULL);
2387 AC_DEFINE(HAVE_PCIE_GET_MINIMUM_LINK, 1,
2388 [pcie_get_minimum_link is defined])
2393 AC_MSG_CHECKING([if netdevice.h has netdev_for_each_all_upper_dev_rcu])
2394 LB_LINUX_TRY_COMPILE([
2395 #include <linux/netdevice.h>
2397 struct net_device *dev;
2398 struct net_device *upper;
2399 struct list_head *list;
2401 netdev_for_each_all_upper_dev_rcu(dev, upper, list);
2405 AC_DEFINE(HAVE_NETDEV_FOR_EACH_ALL_UPPER_DEV_RCU, 1,
2406 [netdev_master_upper_dev_get_rcu is defined])
2411 AC_MSG_CHECKING([if netdevice.h has netdev_has_upper_dev])
2412 LB_LINUX_TRY_COMPILE([
2413 #include <linux/netdevice.h>
2415 struct net_device *dev;
2416 struct net_device *upper;
2417 netdev_has_upper_dev(dev, upper);
2422 AC_DEFINE(HAVE_NETDEV_HAS_UPPER_DEV, 1,
2423 [netdev_has_upper_dev is defined])
2428 AC_MSG_CHECKING([if ethtool.h has __ethtool_get_link_ksettings])
2429 LB_LINUX_TRY_COMPILE([
2430 #include <linux/ethtool.h>
2432 __ethtool_get_link_ksettings(NULL, NULL);
2437 AC_DEFINE(HAVE___ETHTOOL_GET_LINK_KSETTINGS, 1,
2438 [__ethtool_get_link_ksettings is defined])
2443 AC_MSG_CHECKING([if addrconf.h has addrconf_ifid_eui48])
2444 LB_LINUX_TRY_COMPILE([
2445 #include <net/addrconf.h>
2447 int x = addrconf_ifid_eui48(NULL, NULL);
2452 AC_DEFINE(HAVE_ADDRCONF_IFID_EUI48, 1,
2453 [addrconf_ifid_eui48 is defined])
2458 AC_MSG_CHECKING([if mm.h get_user_pages has 6 params])
2459 LB_LINUX_TRY_COMPILE([
2460 #include <linux/mm.h>
2462 get_user_pages(0, 0, 0, 0, NULL, NULL);
2467 AC_DEFINE(HAVE_GET_USER_PAGES_6_PARAMS, 1,
2468 [get_user_pages has 6 params])
2473 AC_MSG_CHECKING([if mm.h get_user_pages_remote])
2474 LB_LINUX_TRY_COMPILE([
2475 #include <linux/mm.h>
2477 get_user_pages_remote(NULL, NULL, 0, 0, 0, 0, NULL, NULL);
2482 AC_DEFINE(HAVE_GET_USER_PAGES_REMOTE, 1,
2483 [get_user_pages_remote exist])
2488 AC_MSG_CHECKING([if ip_fib.h fib_lookup has 4 params])
2489 LB_LINUX_TRY_COMPILE([
2490 #include <linux/bug.h>
2491 #include <net/ip_fib.h>
2493 fib_lookup(NULL, NULL, NULL, 0);
2498 AC_DEFINE(HAVE_FIB_LOOKUP_4_PARAMS, 1,
2499 [fib_lookup has 4 params])
2504 AC_MSG_CHECKING([if include/net/devlink.h exists])
2505 LB_LINUX_TRY_COMPILE([
2506 #include <net/devlink.h>
2511 AC_DEFINE(HAVE_NET_DEVLINK_H, 1,
2512 [include/net/devlink.h exists])
2517 AC_MSG_CHECKING([if io_mapping_map_wc has 3 params])
2518 LB_LINUX_TRY_COMPILE([
2519 #include <linux/io-mapping.h>
2521 io_mapping_map_wc(NULL, 0, 0);
2526 AC_DEFINE(HAVE_IO_MAPPING_MAP_WC_3_PARAMS, 1,
2527 [io_mapping_map_wc has 3 params])
2532 AC_MSG_CHECKING([if include/net/dcbnl.h struct dcbnl_rtnl_ops has *ieee_getqcn])
2533 LB_LINUX_TRY_COMPILE([
2534 #include <linux/netdevice.h>
2535 #include <net/dcbnl.h>
2537 struct dcbnl_rtnl_ops x = {
2538 .ieee_getqcn = NULL,
2544 AC_DEFINE(HAVE_IEEE_GETQCN, 1,
2545 [ieee_getqcn is defined])
2550 AC_MSG_CHECKING([if dcbnl.h has struct ieee_qcn])
2551 LB_LINUX_TRY_COMPILE([
2552 #include <linux/netdevice.h>
2553 #include <net/dcbnl.h>
2560 AC_DEFINE(HAVE_STRUCT_IEEE_QCN, 1,
2561 [ieee_qcn is defined])
2566 AC_MSG_CHECKING([if netdevice.h has napi_consume_skb])
2567 LB_LINUX_TRY_COMPILE([
2568 #include <linux/skbuff.h>
2570 napi_consume_skb(NULL, 0);
2575 AC_DEFINE(HAVE_NAPI_CONSUME_SKB, 1,
2576 [napi_consume_skb is defined])
2581 AC_MSG_CHECKING([if include/linux/bpf.h exists])
2582 LB_LINUX_TRY_COMPILE([
2583 #include <linux/bpf.h>
2588 AC_DEFINE(HAVE_LINUX_BPF_H, 1,
2589 [include/linux/bpf.h exists])
2594 AC_MSG_CHECKING([if mm_types.h struct page has _count])
2595 LB_LINUX_TRY_COMPILE([
2596 #include <linux/mm.h>
2597 #include <linux/mm_types.h>
2600 p._count.counter = 0;
2605 AC_DEFINE(HAVE_MM_PAGE__COUNT, 1,
2606 [struct page has _count])
2611 AC_MSG_CHECKING([if include/linux/page_ref.h exists])
2612 LB_LINUX_TRY_COMPILE([
2613 #include <linux/page_ref.h>
2618 AC_DEFINE(HAVE_LINUX_PAGE_REF_H, 1,
2619 [include/linux/page_ref.h exists])
2624 AC_MSG_CHECKING([if linux/ethtool.h has ETHTOOL_xLINKSETTINGS API])
2625 LB_LINUX_TRY_COMPILE([
2626 #include <linux/ethtool.h>
2628 enum ethtool_link_mode_bit_indices x = ETHTOOL_LINK_MODE_TP_BIT;
2633 AC_DEFINE(HAVE_ETHTOOL_xLINKSETTINGS, 1,
2634 [ETHTOOL_xLINKSETTINGS API is defined])
2639 AC_MSG_CHECKING([if linux/printk.h exists])
2640 LB_LINUX_TRY_COMPILE([
2641 #include <linux/printk.h>
2646 AC_DEFINE(HAVE_LINUX_PRINTK_H, 1,
2647 [linux/printk.h is defined])
2652 AC_MSG_CHECKING([if printk.h has struct va_format])
2653 LB_LINUX_TRY_COMPILE([
2654 #include <linux/printk.h>
2661 AC_DEFINE(HAVE_VA_FORMAT, 1,
2662 [va_format is defined])
2667 AC_MSG_CHECKING([if irq.h irq_data has member affinity])
2668 LB_LINUX_TRY_COMPILE([
2669 #include <linux/irq.h>
2670 #include <linux/cpumask.h>
2673 struct irq_data y = {
2680 AC_DEFINE(HAVE_IRQ_DATA_AFFINITY, 1,
2681 [irq_data member affinity is defined])
2686 AC_MSG_CHECKING([if irq.h irq_data_get_affinity_mask])
2687 LB_LINUX_TRY_COMPILE([
2688 #include <linux/irq.h>
2690 irq_data_get_affinity_mask(NULL);
2695 AC_DEFINE(HAVE_IRQ_DATA_GET_AFFINITY_MASK, 1,
2696 [irq_data_get_affinity_mask exist])
2701 AC_MSG_CHECKING([if netdevice.h has netif_tx_napi_add])
2702 LB_LINUX_TRY_COMPILE([
2703 #include <linux/netdevice.h>
2705 netif_tx_napi_add(NULL, NULL, NULL, 0);
2710 AC_DEFINE(HAVE_NETIF_TX_NAPI_ADD, 1,
2711 [netif_tx_napi_add is defined])
2716 AC_MSG_CHECKING([if ndo_setup_tc takes 4 parameters])
2717 LB_LINUX_TRY_COMPILE([
2718 #include <linux/netdevice.h>
2720 int mlx4_en_setup_tc(struct net_device *dev, u32 handle,
2721 __be16 protocol, struct tc_to_netdev *tc)
2726 struct net_device_ops x = {
2727 .ndo_setup_tc = mlx4_en_setup_tc,
2733 AC_DEFINE(HAVE_NDO_SETUP_TC_4_PARAMS, 1,
2734 [ndo_setup_tc takes 4 parameters])
2739 AC_MSG_CHECKING([if etherdevice.h has alloc_etherdev_mqs, alloc_etherdev_mqs, num_tc])
2740 LB_LINUX_TRY_COMPILE([
2741 #include <linux/etherdevice.h>
2742 #include <linux/netdevice.h>
2744 struct net_device x = {
2748 alloc_etherdev_mqs(0, 0, 0);
2753 AC_DEFINE(HAVE_NEW_TX_RING_SCHEME, 1,
2754 [alloc_etherdev_mqs, alloc_etherdev_mqs, num_tc is defined])
2759 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_tx_maxrate])
2760 LB_LINUX_TRY_COMPILE([
2761 #include <linux/netdevice.h>
2763 struct net_device_ops x = {
2764 .ndo_set_tx_maxrate = NULL,
2770 AC_DEFINE(HAVE_NDO_SET_TX_MAXRATE, 1,
2771 [ndo_set_tx_maxrate is defined])
2776 AC_MSG_CHECKING([if struct net_device has gso_partial_features])
2777 LB_LINUX_TRY_COMPILE([
2778 #include <linux/netdevice.h>
2780 struct net_device *dev = NULL;
2782 dev->gso_partial_features = 0;
2787 AC_DEFINE(HAVE_NET_DEVICE_GSO_PARTIAL_FEATURES, 1,
2788 [gso_partial_features is defined])
2793 AC_MSG_CHECKING([if vxlan have ndo_add_vxlan_port])
2794 LB_LINUX_TRY_COMPILE([
2795 #include <linux/netdevice.h>
2797 #if IS_ENABLED(CONFIG_VXLAN)
2798 void add_vxlan_port(struct net_device *dev, sa_family_t sa_family, __be16 port)
2804 struct net_device_ops netdev_ops;
2805 netdev_ops.ndo_add_vxlan_port = add_vxlan_port;
2810 AC_DEFINE(HAVE_VXLAN_DYNAMIC_PORT, 1,
2811 [ndo_add_vxlan_port is defined])
2816 AC_MSG_CHECKING([if vxlan has vxlan_get_rx_port])
2817 LB_LINUX_TRY_COMPILE([
2818 #if IS_ENABLED(CONFIG_VXLAN)
2819 #include <net/vxlan.h>
2822 vxlan_get_rx_port(NULL);
2827 AC_DEFINE(HAVE_VXLAN_ENABLED, 1,
2828 [vxlan_get_rx_port is defined])
2833 AC_MSG_CHECKING([if vxlan have ndo_udp_tunnel_add])
2834 LB_LINUX_TRY_COMPILE([
2835 #include <linux/netdevice.h>
2837 #if IS_ENABLED(CONFIG_VXLAN)
2838 void udp_tunnel_add(struct net_device *dev, sa_family_t sa_family, __be16 port)
2844 struct net_device_ops netdev_ops;
2845 netdev_ops.ndo_udp_tunnel_add = udp_tunnel_add;
2850 AC_DEFINE(HAVE_NDO_UDP_TUNNEL_ADD, 1,
2851 [ndo_udp_tunnel_add is defined])
2856 AC_MSG_CHECKING([if vxlan has udp_tunnel_get_rx_info])
2857 LB_LINUX_TRY_COMPILE([
2858 #include <net/udp_tunnel.h>
2860 udp_tunnel_get_rx_info(NULL);
2865 AC_DEFINE(HAVE_UDP_TUNNEL_GET_RX_INFO, 1,
2866 [udp_tunnel_get_rx_info is defined])
2871 AC_MSG_CHECKING([if netdevice.h has struct netdev_bonding_info])
2872 LB_LINUX_TRY_COMPILE([
2873 #include <linux/netdevice.h>
2875 struct netdev_bonding_info x;
2876 x.master.num_slaves = 0;
2881 AC_DEFINE(HAVE_NETDEV_BONDING_INFO, 1,
2882 [netdev_bonding_info is defined])
2887 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_item_id])
2888 LB_LINUX_TRY_COMPILE([
2889 #include <linux/netdevice.h>
2891 struct netdev_phys_item_id x;
2897 AC_DEFINE(HAVE_NETDEV_PHYS_ITEM_ID, 1,
2898 [netdev_phys_item_id is defined])
2903 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_mac])
2904 LB_LINUX_TRY_COMPILE([
2905 #include <linux/netdevice.h>
2907 int set_vf_mac(struct net_device *dev, int queue, u8 *mac)
2912 struct net_device_ops netdev_ops;
2913 netdev_ops.ndo_set_vf_mac = set_vf_mac;
2918 AC_DEFINE(HAVE_NDO_SET_VF_MAC, 1,
2919 [ndo_set_vf_mac is defined])
2924 AC_MSG_CHECKING([if getnumtcs returns int])
2925 LB_LINUX_TRY_COMPILE([
2926 #include <linux/netdevice.h>
2927 #include <net/dcbnl.h>
2929 static int mlx4_en_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
2936 struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = {
2937 .getnumtcs = mlx4_en_dcbnl_getnumtcs,
2943 AC_DEFINE(NDO_GETNUMTCS_RETURNS_INT, 1,
2944 [if getnumtcs returns int])
2949 AC_MSG_CHECKING([if getapp returns int])
2950 LB_LINUX_TRY_COMPILE([
2951 #include <linux/netdevice.h>
2952 #include <net/dcbnl.h>
2954 static int mlx4_en_dcbnl_getapp(struct net_device *netdev, u8 idtype,
2960 struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = {
2961 .getapp = mlx4_en_dcbnl_getapp,
2967 AC_DEFINE(NDO_GETAPP_RETURNS_INT, 1,
2968 [if getapp returns int])
2973 AC_MSG_CHECKING([if setapp returns int])
2974 LB_LINUX_TRY_COMPILE([
2975 #include <linux/netdevice.h>
2976 #include <net/dcbnl.h>
2978 static int mlx4_en_dcbnl_setapp(struct net_device *netdev, u8 idtype,
2985 struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = {
2986 .setapp = mlx4_en_dcbnl_setapp,
2992 AC_DEFINE(NDO_SETAPP_RETURNS_INT, 1,
2993 [if setapp returns int])
2998 AC_MSG_CHECKING([if linux/inetdevice.h inet_confirm_addr has 5 parameters])
2999 LB_LINUX_TRY_COMPILE([
3000 #include <linux/inetdevice.h>
3002 inet_confirm_addr(NULL, NULL, 0, 0, 0);
3007 AC_DEFINE(HAVE_INET_CONFIRM_ADDR_5_PARAMS, 1,
3008 [inet_confirm_addr has 5 parameters])
3013 AC_MSG_CHECKING([if netdevice.h has netdev_rss_key_fill])
3014 LB_LINUX_TRY_COMPILE([
3015 #include <linux/netdevice.h>
3017 netdev_rss_key_fill(NULL, 0);
3022 AC_DEFINE(HAVE_NETDEV_RSS_KEY_FILL, 1,
3023 [netdev_rss_key_fill is defined])
3028 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_vf_stats])
3029 LB_LINUX_TRY_COMPILE([
3030 #include <linux/netdevice.h>
3032 int get_vf_stats(struct net_device *dev, int vf, struct ifla_vf_stats *vf_stats)
3037 struct net_device_ops netdev_ops;
3038 netdev_ops.ndo_get_vf_stats = get_vf_stats;
3043 AC_DEFINE(HAVE_NDO_GET_VF_STATS, 1,
3044 [ndo_get_vf_stats is defined])
3049 AC_MSG_CHECKING([if struct net_device_ops has ndo_set_vf_guid])
3050 LB_LINUX_TRY_COMPILE([
3051 #include <linux/netdevice.h>
3053 int set_vf_guid(struct net_device *dev, int vf, u64 guid, int guid_type)
3058 struct net_device_ops netdev_ops;
3059 netdev_ops.ndo_set_vf_guid = set_vf_guid;
3064 AC_DEFINE(HAVE_NDO_SET_VF_GUID, 1,
3065 [ndo_set_vf_guid is defined])
3070 AC_MSG_CHECKING([if netdevice.h has netif_trans_update])
3071 LB_LINUX_TRY_COMPILE([
3072 #include <linux/netdevice.h>
3074 netif_trans_update(NULL);
3079 AC_DEFINE(HAVE_NETIF_TRANS_UPDATE, 1,
3080 [netif_trans_update is defined])
3085 AC_MSG_CHECKING([if netdevice.h alloc_netdev_mqs has 6 params])
3086 LB_LINUX_TRY_COMPILE([
3087 #include <linux/netdevice.h>
3089 alloc_netdev_mqs(0, NULL, NET_NAME_UNKNOWN, NULL, 0, 0);
3094 AC_DEFINE(HAVE_ALLOC_NETDEV_MQS_6_PARAMS, 1,
3095 [alloc_netdev_mqs has 6 params])
3100 AC_MSG_CHECKING([if filter.h has XDP])
3101 LB_LINUX_TRY_COMPILE([
3102 #include <linux/filter.h>
3104 enum xdp_action action = XDP_ABORTED;
3109 AC_DEFINE(HAVE_FILTER_XDP, 1,
3115 AC_MSG_CHECKING([if firmware.h has request_firmware_direct])
3116 LB_LINUX_TRY_COMPILE([
3117 #include <linux/firmware.h>
3119 (void)request_firmware_direct(NULL, NULL, NULL);
3124 AC_DEFINE(HAVE_REQUEST_FIRMWARE_DIRECT, 1,
3125 [firmware.h has request_firmware_direct])
3130 AC_MSG_CHECKING([if pci.h has pci_set_vpd_size])
3131 LB_LINUX_TRY_COMPILE([
3132 #include <linux/pci.h>
3134 (void)pci_set_vpd_size(NULL, 0);
3139 AC_DEFINE(HAVE_PCI_SET_VPD_SIZE, 1,
3140 [pci.h has pci_set_vpd_size])
3145 AC_MSG_CHECKING([if ethtooL_drvinfo has erom_version])
3146 LB_LINUX_TRY_COMPILE([
3147 #include <linux/ethtool.h>
3149 struct ethtool_drvinfo e;
3151 return (e.erom_version);
3154 AC_DEFINE(HAVE_ETHTOOL_DRVINFO_EROM_VERSION, 1,
3155 [ethtool_drvinfo has erom_version])
3160 AC_MSG_CHECKING([if string_helpers.h string_get_size has 5 params])
3161 LB_LINUX_TRY_COMPILE([
3162 #include <linux/sched.h>
3163 #include <linux/bug.h>
3164 #include <linux/kernel.h>
3165 #include <linux/math64.h>
3166 #include <linux/export.h>
3167 #include <linux/ctype.h>
3168 #include <linux/errno.h>
3169 #include <linux/string.h>
3170 #include <linux/string_helpers.h>
3172 (void)string_get_size(0, 0, 0, NULL, 0);
3177 AC_DEFINE(HAVE_STRING_GET_SIZE_5_PARAMS, 1,
3178 [string_get_size has 5 params])
3183 AC_MSG_CHECKING([if debugfs.h debugfs_create_bool has bool pointer])
3184 LB_LINUX_TRY_COMPILE([
3185 #include <linux/debugfs.h>
3187 (void)debugfs_create_bool(NULL, 0, NULL, (bool *)0);
3192 AC_DEFINE(HAVE_DEBUGFS_CREATE_BOOL_USES_BOOL_PTR, 1,
3193 [debugfs_create_bool has bool pointer])
3198 AC_MSG_CHECKING([if pat_enabled is a function on X86])
3199 LB_LINUX_TRY_COMPILE([
3200 #if defined(CONFIG_X86)
3201 #include <asm/pat.h>
3206 #if defined(CONFIG_X86)
3214 AC_DEFINE(HAVE_PAT_ENABLED_FUNCTION_X86, 1,
3215 [pat_enabled is a function])
3220 AC_MSG_CHECKING([if include/net/switchdev.h exists])
3221 LB_LINUX_TRY_COMPILE([
3222 #include <net/switchdev.h>
3227 AC_DEFINE(HAVE_NET_SWITCHDEV_H, 1,
3228 [include/net/switchdev.h exists])
3233 AC_MSG_CHECKING([if net_device_ops has ndo_udp_tunnel_add])
3234 LB_LINUX_TRY_COMPILE([
3235 #include <linux/netdevice.h>
3237 void add_udp_tunnel(struct net_device *dev, struct udp_tunnel_info *ti)
3242 struct net_device_ops netdev_ops;
3243 netdev_ops.ndo_udp_tunnel_add = add_udp_tunnel;
3248 AC_DEFINE(HAVE_NDO_UDP_TUNNEL_ADD, 1,
3249 [ndo_udp_tunnel_add is defined])
3254 AC_MSG_CHECKING([if net/pkt_cls.h has hardware flower offload support])
3255 LB_LINUX_TRY_COMPILE([
3256 #include <net/pkt_cls.h>
3258 struct tc_cls_flower_offload offload = {0};
3263 AC_DEFINE(HAVE_HW_FLOWER_OFFLOAD_SUPPORT, 1,
3264 [firmware.h has hardware flower offload support])
3269 AC_MSG_CHECKING([if linux/netdev_features.h has tc offload feature])
3270 LB_LINUX_TRY_COMPILE([
3271 #include <linux/netdevice.h>
3273 netdev_features_t hw_features = NETIF_F_HW_TC;
3278 AC_DEFINE(HAVE_TC_OFFLOAD, 1,
3279 [tc offload is supported])
3284 AC_MSG_CHECKING([if struct skbuff.h has skb_flow_dissect_flow_keys])
3285 LB_LINUX_TRY_COMPILE([
3286 #include <linux/skbuff.h>
3288 skb_flow_dissect_flow_keys(NULL, NULL, 0);
3293 AC_DEFINE(HAVE_SKB_FLOW_DISSECT_FLOW_KEYS, 1,
3294 [skb_flow_dissect_flow_keys is defined])
3299 AC_MSG_CHECKING([if workqueue.h has __cancel_delayed_work])
3300 LB_LINUX_TRY_COMPILE([
3301 #include <linux/workqueue.h>
3303 __cancel_delayed_work(NULL);
3308 AC_DEFINE(HAVE___CANCEL_DELAYED_WORK, 1,
3309 [__cancel_delayed_work is defined])
3314 AC_MSG_CHECKING([if struct ethtool_ops has get/set_priv_flags])
3315 LB_LINUX_TRY_COMPILE([
3316 #include <linux/ethtool.h>
3318 const struct ethtool_ops en_ethtool_ops = {
3319 .get_priv_flags = NULL,
3320 .set_priv_flags = NULL,
3326 AC_DEFINE(HAVE_GET_SET_PRIV_FLAGS, 1,
3327 [get/set_priv_flags is defined])
3332 AC_MSG_CHECKING([if netdevice.h has netdev_get_num_tc])
3333 LB_LINUX_TRY_COMPILE([
3334 #include <linux/netdevice.h>
3336 netdev_get_num_tc(NULL);
3341 AC_DEFINE(HAVE_NETDEV_GET_NUM_TC, 1,
3342 [netdev_get_num_tc is defined])
3347 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_trust])
3348 LB_LINUX_TRY_COMPILE([
3349 #include <linux/netdevice.h>
3351 int set_vf_trust(struct net_device *dev, int vf, bool setting)
3356 struct net_device_ops netdev_ops;
3358 netdev_ops.ndo_set_vf_trust = set_vf_trust;
3363 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_TRUST, 1,
3364 [ndo_set_vf_trust is defined in net_device_ops])
3369 AC_MSG_CHECKING([if netdev_features.h has NETIF_F_HW_VLAN_STAG_RX])
3370 LB_LINUX_TRY_COMPILE([
3371 #include <linux/netdev_features.h>
3373 netdev_features_t stag = NETIF_F_HW_VLAN_STAG_RX;
3378 AC_DEFINE(HAVE_NETIF_F_HW_VLAN_STAG_RX, 1,
3379 [NETIF_F_HW_VLAN_STAG_RX is defined in netdev_features.h])
3384 AC_MSG_CHECKING([if struct netdevice.h has NETIF_F_RXHASH])
3385 LB_LINUX_TRY_COMPILE([
3386 #include <linux/netdevice.h>
3388 int x = NETIF_F_RXHASH;
3393 AC_DEFINE(HAVE_NETIF_F_RXHASH, 1,
3394 [NETIF_F_RXHASH is defined in netdevice.h])
3399 AC_MSG_CHECKING([if skbuff.h skb_shared_info has UNION tx_flags])
3400 LB_LINUX_TRY_COMPILE([
3401 #include <linux/skbuff.h>
3403 struct skb_shared_info x;
3404 x.tx_flags.flags = 0;
3409 AC_DEFINE(HAVE_SKB_SHARED_INFO_UNION_TX_FLAGS, 1,