aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netdevice.h3
-rw-r--r--net/core/dev.c11
2 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 2c2ecea28a1b..ab0251d541ab 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2119,6 +2119,9 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2119#endif 2119#endif
2120} 2120}
2121 2121
2122#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2123extern int netif_get_num_default_rss_queues(void);
2124
2122/* Use this variant when it is known for sure that it 2125/* Use this variant when it is known for sure that it
2123 * is executing from hardware interrupt context or with hardware interrupts 2126 * is executing from hardware interrupt context or with hardware interrupts
2124 * disabled. 2127 * disabled.
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)
1793EXPORT_SYMBOL(netif_set_real_num_rx_queues); 1793EXPORT_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 */
1801int netif_get_num_default_rss_queues()
1802{
1803 return min_t(int, DEFAULT_MAX_NUM_RSS_QUEUES, num_online_cpus());
1804}
1805EXPORT_SYMBOL(netif_get_num_default_rss_queues);
1806
1796static inline void __netif_reschedule(struct Qdisc *q) 1807static inline void __netif_reschedule(struct Qdisc *q)
1797{ 1808{
1798 struct softnet_data *sd; 1809 struct softnet_data *sd;