summaryrefslogtreecommitdiffstats
path: root/include/linux/if_macvlan.h
diff options
context:
space:
mode:
authorKrishna Kumar <krkumar2@in.ibm.com>2010-08-04 06:15:59 +0000
committerDavid S. Miller <davem@davemloft.net>2010-08-16 21:06:25 -0700
commit1565c7c1c4c8e931bdba66abc8aa6f141a406872 (patch)
tree2e2f732e113faa24f4b0e7c804b37bf4283595c3 /include/linux/if_macvlan.h
parentbfb564e7391340638afe4ad67744a8f3858e7566 (diff)
downloadlinux-1565c7c1c4c8e931bdba66abc8aa6f141a406872.tar.gz
linux-1565c7c1c4c8e931bdba66abc8aa6f141a406872.tar.bz2
linux-1565c7c1c4c8e931bdba66abc8aa6f141a406872.zip
macvtap: Implement multiqueue for macvtap driver
Implement multiqueue facility for macvtap driver. The idea is that a macvtap device can be opened multiple times and the fd's can be used to register eg, as backend for vhost. Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_macvlan.h')
-rw-r--r--include/linux/if_macvlan.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 35280b302290..8a2fd66a8b5f 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -40,6 +40,12 @@ struct macvlan_rx_stats {
unsigned long rx_errors;
};
+/*
+ * Maximum times a macvtap device can be opened. This can be used to
+ * configure the number of receive queue, e.g. for multiqueue virtio.
+ */
+#define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16)
+
struct macvlan_dev {
struct net_device *dev;
struct list_head list;
@@ -50,7 +56,8 @@ struct macvlan_dev {
enum macvlan_mode mode;
int (*receive)(struct sk_buff *skb);
int (*forward)(struct net_device *dev, struct sk_buff *skb);
- struct macvtap_queue *tap;
+ struct macvtap_queue *taps[MAX_MACVTAP_QUEUES];
+ int numvtaps;
};
static inline void macvlan_count_rx(const struct macvlan_dev *vlan,