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 kernel has ktime_get_ns])
143 LB_LINUX_TRY_COMPILE([
144 #include <linux/ktime.h>
146 unsigned long long ns;
152 AC_DEFINE(HAVE_KTIME_GET_NS, 1,
153 [ktime_get_ns defined])
158 AC_MSG_CHECKING([if svc_xprt_class has xcl_ident])
159 LB_LINUX_TRY_COMPILE([
160 #include <linux/sunrpc/xprt.h>
161 #include <linux/sunrpc/svc_xprt.h>
163 struct svc_xprt_class svc_rdma_class = {
164 .xcl_ident = XPRT_TRANSPORT_RDMA,
169 AC_DEFINE(HAVE_XCL_IDENT, 1,
175 AC_MSG_CHECKING([if struct ifla_vf_info has max_tx_rate])
176 LB_LINUX_TRY_COMPILE([
177 #include <linux/if_link.h>
179 struct ifla_vf_info *ivf;
181 ivf->max_tx_rate = 0;
182 ivf->min_tx_rate = 0;
187 AC_DEFINE(HAVE_TX_RATE_LIMIT, 1,
188 [max_tx_rate is defined])
193 AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh])
194 LB_LINUX_TRY_COMPILE([
195 #include <linux/ethtool.h>
197 const struct ethtool_ops en_ethtool_ops = {
198 .get_rxfh_indir_size = NULL,
206 AC_DEFINE(HAVE_GET_SET_RXFH, 1,
207 [get/set_rxfh is defined])
213 AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable])
214 LB_LINUX_TRY_COMPILE([
215 #include <linux/ethtool.h>
217 const struct ethtool_ops en_ethtool_ops = {
225 AC_DEFINE(HAVE_GET_SET_TUNABLE, 1,
226 [get/set_tunable is defined])
231 AC_MSG_CHECKING([if exist struct ethtool_ops_ext])
232 LB_LINUX_TRY_COMPILE([
233 #include <linux/ethtool.h>
235 const struct ethtool_ops_ext en_ethtool_ops_ext = {
236 .size = sizeof(struct ethtool_ops_ext),
242 AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1,
243 [struct ethtool_ops_ext is defined])
248 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh])
249 LB_LINUX_TRY_COMPILE([
250 #include <linux/ethtool.h>
252 const struct ethtool_ops_ext en_ethtool_ops_ext = {
253 .get_rxfh_indir_size = NULL,
261 AC_DEFINE(HAVE_GET_SET_RXFH_OPS_EXT, 1,
262 [get/set_rxfh is defined])
267 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
268 LB_LINUX_TRY_COMPILE([
269 #include <linux/ethtool.h>
271 const struct ethtool_ops_ext en_ethtool_ops_ext = {
272 .get_rxfh_indir_size = NULL,
273 .get_rxfh_indir = NULL,
274 .set_rxfh_indir = NULL,
280 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
281 [get/set_rxfh_indir is defined])
286 AC_MSG_CHECKING([if struct net_device has dev_port])
287 LB_LINUX_TRY_COMPILE([
288 #include <linux/netdevice.h>
290 struct net_device *dev = NULL;
297 AC_DEFINE(HAVE_NET_DEVICE_DEV_PORT, 1,
298 [dev_port is defined])
303 AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
304 LB_LINUX_TRY_COMPILE([
305 #include <linux/ptp_clock_kernel.h>
307 struct ptp_clock_info *info;
313 AC_DEFINE(HAVE_PTP_CLOCK_INFO_N_PINS, 1,
319 AC_MSG_CHECKING([if pci.h pci_enable_msi_exact])
320 LB_LINUX_TRY_COMPILE([
321 #include <linux/pci.h>
323 int x = pci_enable_msi_exact(NULL, 0);
328 AC_DEFINE(HAVE_PCI_ENABLE_MSI_EXACT, 1,
329 [pci_enable_msi_exact is defined])
334 AC_MSG_CHECKING([if pci.h pci_enable_msix_range])
335 LB_LINUX_TRY_COMPILE([
336 #include <linux/pci.h>
338 int x = pci_enable_msix_range(NULL, 0, 0, 0);
343 AC_DEFINE(HAVE_PCI_ENABLE_MSIX_RANGE, 1,
344 [pci_enable_msix_range is defined])
349 AC_MSG_CHECKING([if struct iscsi_transport has check_protection])
350 LB_LINUX_TRY_COMPILE([
351 #include <scsi/scsi_transport_iscsi.h>
353 static struct iscsi_transport iscsi_iser_transport = {
354 .check_protection = NULL,
360 AC_DEFINE(HAVE_ISCSI_CHECK_PROTECTION, 1,
361 [check_protection is defined])
366 AC_MSG_CHECKING([if netdevice.h has select_queue_fallback_t])
367 LB_LINUX_TRY_COMPILE([
368 #include <linux/netdevice.h>
370 select_queue_fallback_t fallback;
377 AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T, 1,
378 [select_queue_fallback_t is defined])
383 AC_MSG_CHECKING([if skbuff.h has skb_set_hash])
384 LB_LINUX_TRY_COMPILE([
385 #include <linux/netdevice.h>
387 skb_set_hash(NULL, 0, PKT_HASH_TYPE_L3);
392 AC_DEFINE(HAVE_SKB_SET_HASH, 1,
393 [skb_set_hash is defined])
398 AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
399 LB_LINUX_TRY_COMPILE([
400 #include <linux/sockios.h>
402 int x = SIOCGHWTSTAMP;
407 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
408 [SIOCGHWTSTAMP is defined])
413 AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
414 LB_LINUX_TRY_COMPILE([
417 inet_get_local_port_range(NULL, NULL, NULL);
422 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
423 [inet_get_local_port_range has 3 parameters])
428 AC_MSG_CHECKING([if net.h has net_get_random_once])
429 LB_LINUX_TRY_COMPILE([
430 #include <linux/net.h>
432 net_get_random_once(NULL, 0);
437 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
438 [net_get_random_once is defined])
443 AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
444 LB_LINUX_TRY_COMPILE([
445 #include <net/inet_sock.h>
447 __inet_ehashfn(0, 0, 0, 0, 0);
452 AC_DEFINE(HAVE_INET_EHASHFN, 1,
453 [__inet_ehashfn is defined])
458 AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
459 LB_LINUX_TRY_COMPILE([
460 #include <linux/err.h>
462 int x = PTR_ERR_OR_ZERO(NULL);
467 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
468 [PTR_ERR_OR_ZERO is defined])
473 AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
474 LB_LINUX_TRY_COMPILE([
475 #include <scsi/libiscsi.h>
477 struct iscsi_session session;
478 session.discovery_sess = 0;
483 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
484 [discovery_sess is defined])
489 AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
490 LB_LINUX_TRY_COMPILE([
491 #include <scsi/iscsi_if.h>
493 int x = ISCSI_PARAM_DISCOVERY_SESS;
498 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
499 [ISCSI_PARAM_DISCOVERY_SESS is defined])
504 AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
505 LB_LINUX_TRY_COMPILE([
506 #include <linux/pci.h>
508 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
513 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
514 [pcie_link_width is defined])
519 AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
520 LB_LINUX_TRY_COMPILE([
521 #include <linux/pci.h>
523 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
528 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
529 [pci_bus_speed is defined])
534 AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
535 LB_LINUX_TRY_COMPILE([
536 #include <linux/netdevice.h>
538 struct netdev_phys_port_id *x = NULL;
543 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
544 [netdev_phys_port_id is defined])
549 AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
550 LB_LINUX_TRY_COMPILE([
551 #include <linux/if_link.h>
553 struct struct ifla_vf_info x;
559 AC_DEFINE(HAVE_LINKSTATE, 1,
560 [linkstate is defined])
565 AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
566 LB_LINUX_TRY_COMPILE([
567 #include <net/busy_poll.h>
569 skb_mark_napi_id(NULL, NULL);
574 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
575 [skb_mark_napi_id is defined])
580 AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
581 LB_LINUX_TRY_COMPILE([
582 #include <linux/netdevice.h>
589 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
590 [napi_hash_add is defined])
595 AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
596 LB_LINUX_TRY_COMPILE([
597 #include <linux/netdevice.h>
599 netif_keep_dst(NULL);
604 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
605 [netif_keep_dst is defined])
610 AC_MSG_CHECKING([if mm.h has kvfree])
611 LB_LINUX_TRY_COMPILE([
612 #include <linux/mm.h>
619 AC_DEFINE(HAVE_KVFREE, 1,
625 AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
626 LB_LINUX_TRY_COMPILE([
627 #include <linux/netdevice.h>
629 dev_consume_skb_any(NULL);
634 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
635 [dev_consume_skb_any is defined])
640 AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
641 LB_LINUX_TRY_COMPILE([
642 #include <linux/netdevice.h>
644 netdev_txq_bql_complete_prefetchw(NULL);
645 netdev_txq_bql_enqueue_prefetchw(NULL);
650 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
651 [netdev_txq_bql_complete_prefetchw is defined])
656 AC_MSG_CHECKING([if struct sk_buff has xmit_more])
657 LB_LINUX_TRY_COMPILE([
658 #include <linux/skbuff.h>
666 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
667 [xmit_more is defined])
672 AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
673 LB_LINUX_TRY_COMPILE([
674 #include <linux/etherdevice.h>
676 eth_get_headlen(NULL, 0);
681 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
682 [eth_get_headlen is defined])
687 AC_MSG_CHECKING([if struct sk_buff has csum_level])
688 LB_LINUX_TRY_COMPILE([
689 #include <linux/skbuff.h>
697 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
698 [csum_level is defined])
703 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
704 LB_LINUX_TRY_COMPILE([
705 #include <linux/skbuff.h>
707 skb_inner_transport_header(NULL);
712 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
713 [skb_inner_transport_header is defined])
718 AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
719 LB_LINUX_TRY_COMPILE([
720 #include <linux/skbuff.h>
722 skb_inner_network_header(NULL);
727 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
728 [skb_inner_network_header is defined])
733 AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
734 LB_LINUX_TRY_COMPILE([
735 #include <linux/if_vlan.h>
737 vlan_dev_get_egress_qos_mask(NULL, 0);
742 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
743 [vlan_dev_get_egress_qos_mask is defined])
748 AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
749 LB_LINUX_TRY_COMPILE([
750 #include <linux/netdevice.h>
752 netdev_get_prio_tc_map(NULL, 0);
757 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
758 [netdev_get_prio_tc_map is defined])
763 AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
764 LB_LINUX_TRY_COMPILE([
765 #include <linux/if_vlan.h>
767 __vlan_find_dev_deep_rcu(NULL, 0, 0);
772 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
773 [__vlan_find_dev_deep_rcu is defined])
778 AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
779 LB_LINUX_TRY_COMPILE([
780 #include <linux/netdevice.h>
782 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
788 struct net_device_opts ndops;
790 ndoops.ndo_select_queue = select_queue;
795 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
796 [ndo_select_queue has accel_priv])
801 AC_MSG_CHECKING([if drivers/net/bonding/bonding.h exists])
802 LB_LINUX_TRY_COMPILE([
803 #include "../drivers/net/bonding/bonding.h"
808 AC_DEFINE(HAVE_BONDING_H, 1,
809 [drivers/net/bonding/bonding.h exists])
814 AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
815 LB_LINUX_TRY_COMPILE([
816 #include "../drivers/net/bonding/bonding.h"
818 struct bonding *bond = NULL;
819 struct list_head *iter = NULL;
820 struct slave *slave = NULL;
822 bond_for_each_slave(bond, slave, iter) ;
827 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
828 [bond_for_each_slave has 3 parameters])
834 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
835 LB_LINUX_TRY_COMPILE([
836 #include <linux/u64_stats_sync.h>
838 struct u64_stats_sync sync;
839 u64_stats_init(&sync);
844 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
845 [u64_stats_sync is defined])
850 AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
851 LB_LINUX_TRY_COMPILE([
852 #include <linux/u64_stats_sync.h>
854 struct u64_stats_sync sync;
855 u64_stats_fetch_begin_irq(&sync);
860 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
861 [u64_stats_fetch_begin_irq is defined])
865 AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
866 LB_LINUX_TRY_COMPILE([
867 #include <linux/etherdevice.h>
869 char dest[6], src[6];
870 ether_addr_copy(&dest, &src);
875 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
876 [ether_addr_copy is defined])
881 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
882 LB_LINUX_TRY_COMPILE([
883 #include <linux/netdevice.h>
885 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
891 struct net_device_ops netdev_ops;
893 netdev_ops.ndo_set_vf_rate = set_vf_rate;
897 AC_DEFINE(HAVE_SET_VF_RATE, 1,
898 [ndo_set_vf_rate is defined])
903 AC_MSG_CHECKING([if netdev_extended has hw_features])
904 LB_LINUX_TRY_COMPILE([
905 #include <linux/netdevice.h>
907 struct net_device *dev = NULL;
909 netdev_extended(dev)->hw_features = 0;
914 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
920 AC_MSG_CHECKING([if net_device_extended has _tx_ext])
921 LB_LINUX_TRY_COMPILE([
922 #include <linux/netdevice.h>
924 struct net_device *dev = NULL;
926 netdev_extended(dev)->_tx_ext = NULL;
931 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
937 AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
938 LB_LINUX_TRY_COMPILE([
939 #include <linux/netdevice.h>
941 int busy_poll(struct napi_struct *napi)
946 struct net_device *dev = NULL;
948 netdev_extended(dev)->ndo_busy_poll = busy_poll;
953 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
959 AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
960 LB_LINUX_TRY_COMPILE([
961 #include <linux/netdevice.h>
963 struct net_device *dev = NULL;
965 set_netdev_hw_features(dev, 0);
970 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
976 AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
977 LB_LINUX_TRY_COMPILE([
978 #include <linux/netdevice.h>
980 struct net_device *dev = NULL;
982 netif_set_xps_queue(dev, NULL, 0);
987 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
994 AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
995 LB_LINUX_TRY_COMPILE([
996 #include <linux/netdevice.h>
998 int set_features(struct net_device *dev, netdev_features_t features)
1003 struct net_device_ops netdev_ops;
1005 netdev_ops.ndo_set_features = set_features;
1009 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1010 [ndo_set_features is defined])
1015 AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
1016 LB_LINUX_TRY_COMPILE([
1017 #include <linux/netdevice.h>
1019 int setup_tc(struct net_device *dev, , u8 tc)
1024 struct net_device_ops netdev_ops;
1026 netdev_ops.ndo_setup_tc = setup_tc;
1030 AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
1031 [ndo_setup_tc is defined])
1036 AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1037 LB_LINUX_TRY_COMPILE([
1038 #include <linux/netdevice.h>
1040 int rx_flow_steer(struct net_device *dev,
1041 const struct sk_buff *skb,
1048 struct net_device_ops netdev_ops;
1050 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1054 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1055 [ndo_rx_flow_steer is defined])
1060 AC_MSG_CHECKING([if struct net_device has priv_flags])
1061 LB_LINUX_TRY_COMPILE([
1062 #include <linux/netdevice.h>
1064 struct net_device *netdev;
1065 netdev->priv_flags = 0;
1070 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1071 [priv_flags is defined])
1076 AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1077 LB_LINUX_TRY_COMPILE([
1078 #include <linux/netdevice.h>
1080 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1081 struct rtnl_link_stats64 *storage)
1083 struct rtnl_link_stats64 stats_64;
1087 struct net_device_ops netdev_ops;
1089 netdev_ops.ndo_get_stats64 = get_stats_64;
1094 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1095 [ndo_get_stats64 is defined])
1099 AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1100 LB_LINUX_TRY_COMPILE([
1101 #include <linux/netdevice.h>
1103 struct net_device_ops netdev_ops = {
1104 .ndo_bridge_setlink = NULL,
1105 .ndo_bridge_getlink = NULL,
1111 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1112 [ndo_bridge_set/getlink is defined])
1117 AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1118 LB_LINUX_TRY_COMPILE([
1119 #include <linux/netdevice.h>
1121 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1126 struct net_device_ops netdev_ops;
1128 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1133 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1134 [ndo_vlan_rx_add_vid has 3 parameters])
1139 AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1140 LB_LINUX_TRY_COMPILE([
1141 #include <linux/netdevice.h>
1143 int get_phys_port_id(struct net_device *dev,
1144 struct netdev_phys_port_id *ppid)
1149 struct net_device_ops netdev_ops;
1151 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1156 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1162 AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1163 LB_LINUX_TRY_COMPILE([
1164 #include <linux/netdevice.h>
1166 struct net_device_ops_ext netdev_ops_ext;
1167 struct net_device_ops_ext netdev_ops__ext = {
1168 .size = sizeof(struct net_device_ops_ext),
1174 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1175 [struct net_device_ops_ext is defined])
1180 AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1181 LB_LINUX_TRY_COMPILE([
1182 #include <linux/netdevice.h>
1184 int get_phys_port_id(struct net_device *dev,
1185 struct netdev_phys_port_id *ppid)
1190 struct net_device_ops_ext netdev_ops_ext;
1192 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1197 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1198 [ndo_get_phys_port_id is defined])
1203 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1204 LB_LINUX_TRY_COMPILE([
1205 #include <linux/netdevice.h>
1207 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1212 struct net_device_ops netdev_ops;
1214 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1219 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1220 [ndo_set_vf_spoofchk is defined in net_device_ops])
1225 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1226 LB_LINUX_TRY_COMPILE([
1227 #include <linux/netdevice.h>
1229 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1234 struct net_device_ops_ext netdev_ops_ext;
1236 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1241 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1242 [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1247 AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1248 LB_LINUX_TRY_COMPILE([
1249 #include <linux/netdevice.h>
1251 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1256 struct net_device_ops netdev_ops;
1258 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1263 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1264 [ndo_set_vf_link_state is defined in net_device_ops])
1269 AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1270 LB_LINUX_TRY_COMPILE([
1271 #include <linux/netdevice.h>
1273 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1278 struct net_device_ops_ext netdev_ops_ext;
1280 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1285 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1286 [ndo_set_vf_link_state is defined])
1292 AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1293 LB_LINUX_TRY_COMPILE([
1294 #include <linux/netdevice.h>
1296 struct net_device dev;
1298 ret = netif_set_real_num_tx_queues(&dev, 2);
1302 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1303 [netif_set_real_num_tx_queues returns int])
1308 AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1309 LB_LINUX_TRY_COMPILE([
1310 #include <linux/netdevice.h>
1318 AC_DEFINE(HAVE_XPS_MAP, 1,
1319 [struct xps_map is defined])
1324 AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1325 LB_LINUX_TRY_COMPILE([
1326 #include <linux/ethtool.h>
1328 const struct ethtool_ops en_ethtool_ops = {
1335 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1336 [set_phys_id is defined])
1341 AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1342 LB_LINUX_TRY_COMPILE([
1343 #include <linux/ethtool.h>
1345 const struct ethtool_ops en_ethtool_ops = {
1346 .get_channels = NULL,
1347 .set_channels = NULL,
1353 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1354 [get/set_channels is defined])
1359 AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1360 LB_LINUX_TRY_COMPILE([
1361 #include <linux/ethtool.h>
1363 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1364 .get_channels = NULL,
1365 .set_channels = NULL,
1371 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1372 [get/set_channels is defined in ethtool_ops_ext])
1377 AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1378 LB_LINUX_TRY_COMPILE([
1379 #include <linux/ethtool.h>
1381 const struct ethtool_ops en_ethtool_ops = {
1382 .get_ts_info = NULL,
1388 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1389 [get_ts_info is defined])
1394 AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1395 LB_LINUX_TRY_COMPILE([
1396 #include <linux/ethtool.h>
1398 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1399 .get_ts_info = NULL,
1405 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1406 [get_ts_info is defined in ethtool_ops_ext])
1411 AC_MSG_CHECKING([if netdevice.h has struct netdev_hw_addr])
1412 LB_LINUX_TRY_COMPILE([
1413 #include <linux/netdevice.h>
1415 struct netdev_hw_addr addr;
1419 AC_DEFINE(HAVE_NETDEV_HW_ADDR, 1,
1420 [netdev_hw_addr is defined])
1425 AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1426 LB_LINUX_TRY_COMPILE([
1427 #include <linux/pci.h>
1429 struct pci_dev pdev;
1430 pci_vfs_assigned(&pdev);
1434 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1435 [pci_vfs_assigned is defined])
1439 AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1440 LB_LINUX_TRY_COMPILE([
1441 #include <linux/if_vlan.h>
1443 struct sk_buff *skb;
1444 __vlan_put_tag(skb, 0, 0);
1449 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1450 [__vlan_put_tag has 3 parameters])
1455 AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1456 LB_LINUX_TRY_COMPILE([
1457 #include <linux/if_vlan.h>
1459 struct sk_buff *skb;
1460 __vlan_hwaccel_put_tag(skb, 0, 0);
1465 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1466 [__vlan_hwaccel_put_tag has 3 parameters])
1471 AC_MSG_CHECKING([if struct net_device has hw_features])
1472 LB_LINUX_TRY_COMPILE([
1473 #include <linux/netdevice.h>
1475 struct net_device dev;
1476 dev.hw_features = 0;
1481 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1482 [hw_features is defined])
1487 AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1488 LB_LINUX_TRY_COMPILE([
1489 #include <linux/netdevice.h>
1491 struct net_device dev;
1492 dev.hw_enc_features = 0;
1497 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1498 [hw_enc_features is defined])
1503 AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1504 LB_LINUX_TRY_COMPILE([
1505 #include <linux/netdevice.h>
1507 struct net_device dev;
1508 dev.rx_cpu_rmap = NULL;
1513 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1514 [rx_cpu_rmap is defined])
1519 AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1520 LB_LINUX_TRY_COMPILE([
1521 #include <linux/if_vlan.h>
1523 struct sk_buff *skb;
1524 vlan_hwaccel_receive_skb(skb,0,0);
1528 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1529 [vlan_hwaccel_receive_skb is defined])
1534 AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1535 LB_LINUX_TRY_COMPILE([
1536 #include <linux/irqdesc.h>
1538 struct irq_data *data = irq_desc_get_irq_data(NULL);
1542 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1543 [irq_desc_get_irq_data is defined])
1549 AC_MSG_CHECKING([if pci_dev has pcie_mpss])
1550 LB_LINUX_TRY_COMPILE([
1551 #include <linux/pci.h>
1553 struct pci_dev pdev;
1555 pdev->pcie_mpss = 0;
1559 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
1560 [pcie_mpss is defined])
1565 AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
1566 LB_LINUX_TRY_COMPILE([
1567 #include <uapi/linux/if_ether.h>
1572 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
1573 [uapi/linux/if_ether.h exist])
1578 AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
1579 LB_LINUX_TRY_COMPILE([
1580 #include <linux/if_link.h>
1582 struct ifla_vf_info *ivf;
1588 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
1589 [spoofchk is defined])
1596 # COMPAT_CONFIG_HEADERS
1598 # add -include config.h
1600 AC_DEFUN([COMPAT_CONFIG_HEADERS],[
1601 AC_CONFIG_HEADERS([config.h])
1602 EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
1603 AC_SUBST(EXTRA_KCFLAGS)
1606 AC_DEFUN([OFA_PROG_LINUX],
1611 LB_LINUX_CONFIG([MODULES],[],[
1612 AC_MSG_ERROR([module support is required to build mlnx kernel modules.])
1614 LB_LINUX_CONFIG([MODVERSIONS])
1615 LB_LINUX_CONFIG([KALLSYMS],[],[
1616 AC_MSG_ERROR([compat_mlnx requires that CONFIG_KALLSYMS is enabled in your kernel.])
1620 COMPAT_CONFIG_HEADERS