In few distros (RH6.6 for example) there is already the implementation
for netif_set_real_num_rx_queues function, so check if exists otherwise
use the backport and return 0 for doing nothing.
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
[AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
[elfcorehdr_addr is exported by the kernel])],
[])
+
+ AC_MSG_CHECKING([if netif_set_real_num_rx_queues is defined])
+ MLNX_BG_LB_LINUX_TRY_COMPILE([
+ #include <linux/netdevice.h>
+ ],[
+ int rc = netif_set_real_num_rx_queues(NULL, 0);
+
+ return rc;
+ ],[
+ AC_MSG_RESULT(yes)
+ MLNX_AC_DEFINE(HAVE_NETIF_SET_REAL_NUM_RX_QUEUES, 1,
+ [netif_set_real_num_rx_queues is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
])
#
# COMPAT_CONFIG_HEADERS
* code and making this function to always return success.
*/
/* mask netif_set_real_num_rx_queues as RHEL6.4 backports this */
-#define netif_set_real_num_rx_queues(a, b) compat_netif_set_real_num_rx_queues(a, b)
+#ifndef HAVE_NETIF_SET_REAL_NUM_RX_QUEUES
static inline int netif_set_real_num_rx_queues(struct net_device *dev,
unsigned int rxq)
{
return 0;
}
+#endif
#define net_ns_type_operations LINUX_BACKPORT(net_ns_type_operations)
extern struct kobj_ns_type_operations net_ns_type_operations;