All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ixgbe: take online CPU number as MQ max limit when  alloc_etherdev_mq()
@ 2016-05-13  5:56 ` Ethan Zhao
  0 siblings, 0 replies; 21+ messages in thread
From: Ethan Zhao @ 2016-05-13  5:56 UTC (permalink / raw)
  To: jeffrey.t.kirsher, jesse.brandeburg, shannon.nelson,
	carolyn.wyborny, donald.c.skidmore, bruce.w.allan, john.ronciak,
	mitch.a.williams, intel-wired-lan, netdev
  Cc: linux-kernel, ethan.kernel, ethan.zhao

Allocating 64 Tx/Rx as default doesn't benefit perfomrnace when less
CPUs were assigned. especially when DCB is enabled, so we should take
num_online_cpus() as top limit, and aslo to make sure every TC has
at least one queue, take the MAX_TRAFFIC_CLASS as bottom limit of queues
number.

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 7df3fe2..1f9769c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9105,6 +9105,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		indices = IXGBE_MAX_RSS_INDICES;
 #endif
 	}
+	/* Don't allocate too more queues than online cpus number */
+	indices = min_t(int, indices, num_online_cpus());
+	/* To make sure TC works, allocate at least 1 queue per TC */
+	indices = max_t(int, indices, MAX_TRAFFIC_CLASS);
 
 	netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), indices);
 	if (!netdev) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-05-17 15:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13  5:56 [PATCH] ixgbe: take online CPU number as MQ max limit when alloc_etherdev_mq() Ethan Zhao
2016-05-13  5:56 ` [Intel-wired-lan] " Ethan Zhao
2016-05-13 12:52 ` Sergei Shtylyov
2016-05-13 12:52   ` [Intel-wired-lan] " Sergei Shtylyov
2016-05-16  5:38   ` ethan zhao
2016-05-16  5:38     ` [Intel-wired-lan] " ethan zhao
2016-05-13 16:46 ` Alexander Duyck
2016-05-13 16:46   ` [Intel-wired-lan] " Alexander Duyck
2016-05-16  2:59   ` ethan zhao
2016-05-16  2:59     ` [Intel-wired-lan] " ethan zhao
2016-05-16 16:09     ` Alexander Duyck
2016-05-16 16:09       ` [Intel-wired-lan] " Alexander Duyck
2016-05-16 17:14       ` John Fastabend
2016-05-16 17:14         ` John Fastabend
2016-05-17  9:00       ` ethan zhao
2016-05-17  9:00         ` [Intel-wired-lan] " ethan zhao
2016-05-17 15:58         ` Alexander Duyck
2016-05-17 15:58           ` [Intel-wired-lan] " Alexander Duyck
2016-05-16 20:58 ` Jeff Kirsher
2016-05-16 20:58   ` [Intel-wired-lan] " Jeff Kirsher
2016-05-16 20:58   ` Jeff Kirsher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.