From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 27 Sep 2010 08:24:49 +0000 (+0000)
Subject: net: Add netif_copy_real_num_queues() for use by virtual net drivers
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3171d026291d08c2a4cfe06302ce308b09605c4b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

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>
---

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,
 }
 #endif
 
+static inline int netif_copy_real_num_queues(struct net_device *to_dev,
+					     const struct net_device *from_dev)
+{
+	netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues);
+#ifdef CONFIG_RPS
+	return netif_set_real_num_rx_queues(to_dev,
+					    from_dev->real_num_rx_queues);
+#else
+	return 0;
+#endif
+}
+
 /* Use this variant when it is known for sure that it
  * is executing from hardware interrupt context or with hardware interrupts
  * disabled.