diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-09-27 04:24:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-28 01:09:50 -0400 |
commit | 3171d026291d08c2a4cfe06302ce308b09605c4b (patch) | |
tree | c9ff3f6253a52d63b041b13face40299573990ff /include/linux/netdevice.h | |
parent | 62fe0b40abb3484413800edaef9b087a20059acf (diff) |
net: Add netif_copy_real_num_queues() for use by virtual net drivers
This sets the active numbers of queues on a net device to match another.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b15732e22eee..c2bec990bd17 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1699,6 +1699,18 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev, | |||
1699 | } | 1699 | } |
1700 | #endif | 1700 | #endif |
1701 | 1701 | ||
1702 | static inline int netif_copy_real_num_queues(struct net_device *to_dev, | ||
1703 | const struct net_device *from_dev) | ||
1704 | { | ||
1705 | netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues); | ||
1706 | #ifdef CONFIG_RPS | ||
1707 | return netif_set_real_num_rx_queues(to_dev, | ||
1708 | from_dev->real_num_rx_queues); | ||
1709 | #else | ||
1710 | return 0; | ||
1711 | #endif | ||
1712 | } | ||
1713 | |||
1702 | /* Use this variant when it is known for sure that it | 1714 | /* Use this variant when it is known for sure that it |
1703 | * is executing from hardware interrupt context or with hardware interrupts | 1715 | * is executing from hardware interrupt context or with hardware interrupts |
1704 | * disabled. | 1716 | * disabled. |