diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2012-06-30 23:18:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-05 06:06:44 -0400 |
commit | 16917b87a23b429226527f393270047069d665e9 (patch) | |
tree | d233f41b31e29688fab779e6885ede9b83f4867b /net/core/dev.c | |
parent | bf5e53e3717ed28be69d0663c65962d1731e7ee4 (diff) |
net-next: Add netif_get_num_default_rss_queues
Most multi-queue networking driver consider the number of online cpus when
configuring RSS queues.
This patch adds a wrapper to the number of cpus, setting an upper limit on the
number of cpus a driver should consider (by default) when allocating resources
for his queues.
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index ed674e212b7a..69f7a1a393d8 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1793,6 +1793,17 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq) | |||
1793 | EXPORT_SYMBOL(netif_set_real_num_rx_queues); | 1793 | EXPORT_SYMBOL(netif_set_real_num_rx_queues); |
1794 | #endif | 1794 | #endif |
1795 | 1795 | ||
1796 | /* netif_get_num_default_rss_queues - default number of RSS queues | ||
1797 | * | ||
1798 | * This routine should set an upper limit on the number of RSS queues | ||
1799 | * used by default by multiqueue devices. | ||
1800 | */ | ||
1801 | int netif_get_num_default_rss_queues() | ||
1802 | { | ||
1803 | return min_t(int, DEFAULT_MAX_NUM_RSS_QUEUES, num_online_cpus()); | ||
1804 | } | ||
1805 | EXPORT_SYMBOL(netif_get_num_default_rss_queues); | ||
1806 | |||
1796 | static inline void __netif_reschedule(struct Qdisc *q) | 1807 | static inline void __netif_reschedule(struct Qdisc *q) |
1797 | { | 1808 | { |
1798 | struct softnet_data *sd; | 1809 | struct softnet_data *sd; |