1 #ifndef LINUX_3_9_COMPAT_H
2 #define LINUX_3_9_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
8 #include <linux/netdevice.h>
9 #include <linux/skbuff.h>
11 #define __netdev_pick_tx LINUX_BACKPORT(__netdev_pick_tx)
12 u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb);
15 #define MAX_XPS_CPUS NR_CPUS
17 #define MAX_XPS_CPUS 64
19 #define mlx4_en_hashrnd 0xd631614b
20 #define MAX_XPS_BUFFER_SIZE (DIV_ROUND_UP(MAX_XPS_CPUS, 32) * 9)
22 #ifndef HAVE_NETIF_SET_XPS_QUEUE
24 struct mlx4_en_netq_attribute {
25 struct attribute attr;
26 ssize_t (*show)(struct netdev_queue *queue,
27 struct mlx4_en_netq_attribute *attr, char *buf);
28 ssize_t (*store)(struct netdev_queue *queue,
29 struct mlx4_en_netq_attribute *attr, const char *buf,
33 #define to_netq_attr(_attr) container_of(_attr, \
34 struct mlx4_en_netq_attribute, attr)
36 #define netif_set_xps_queue LINUX_BACKPORT(netif_set_xps_queue)
37 int netif_set_xps_queue(struct net_device *dev, struct cpumask *msk, u16 idx);
39 #endif /* HAVE_NETIF_SET_XPS_QUEUE */
40 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) */
42 #endif /* LINUX_3_9_COMPAT_H */