Patchwork [Quantal,04/29] be2net: fix reporting number of actual rx queues

login
register
mail settings
Submitter Jesse Sung
Date Dec. 13, 2012, 6:49 a.m.
Message ID <1355381402-10497-4-git-send-email-jesse.sung@canonical.com>
Download mbox | patch
Permalink /patch/205747/
State New
Headers show

Comments

Jesse Sung - Dec. 13, 2012, 6:49 a.m.
From: Sathya Perla <sathya.perla@emulex.com>

BugLink: https://launchpad.net/bugs/1083088

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7f6400626631454f5b535eb92c09a35390777a52)

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index c70674e..8be7fc7 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1891,6 +1891,12 @@  static int be_rx_cqs_create(struct be_adapter *adapter)
 	 */
 	adapter->num_rx_qs = (num_irqs(adapter) > 1) ?
 				num_irqs(adapter) + 1 : 1;
+	if (adapter->num_rx_qs != MAX_RX_QS) {
+		rtnl_lock();
+		netif_set_real_num_rx_queues(adapter->netdev,
+					     adapter->num_rx_qs);
+		rtnl_unlock();
+	}
 
 	adapter->big_page_size = (1 << get_order(rx_frag_size)) * PAGE_SIZE;
 	for_all_rx_queues(adapter, rxo, i) {
@@ -3741,7 +3747,7 @@  static int __devinit be_probe(struct pci_dev *pdev,
 		goto disable_dev;
 	pci_set_master(pdev);
 
-	netdev = alloc_etherdev_mq(sizeof(struct be_adapter), MAX_TX_QS);
+	netdev = alloc_etherdev_mqs(sizeof(*adapter), MAX_TX_QS, MAX_RX_QS);
 	if (netdev == NULL) {
 		status = -ENOMEM;
 		goto rel_reg;