[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170421193840.11030.74131.stgit@ltcalpine2-lp23.aus.stglabs.ibm.com>
Date: Fri, 21 Apr 2017 15:38:40 -0400
From: Nathan Fontenot <nfont@...ux.vnet.ibm.com>
To: netdev@...r.kernel.org
Cc: brking@...ux.vnet.ibm.com, jallen@...ux.vnet.ibm.com,
muvic@...ux.vnet.ibm.com, tlfalcon@...ux.vnet.ibm.com
Subject: [PATCH net-next 1/7] ibmvnic: Set real number of rx queues
From: Thomas Falcon <tlfalcon@...ux.vnet.ibm.com>
Along with 5 TX queues, 5 RX queues are allocated at the beginning of
device probe. However, only the real number of TX queues is set. Configure
the real number of RX queues as well.
Signed-off-by: Thomas Falcon <tlfalcon@...ux.vnet.ibm.com>
---
drivers/net/ethernet/ibm/ibmvnic.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index e8c72ab..7f4cecb 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -560,6 +560,24 @@ static void release_resources(struct ibmvnic_adapter *adapter)
release_error_buffers(adapter);
}
+static int set_real_num_queues(struct net_device *netdev)
+{
+ struct ibmvnic_adapter *adapter = netdev_priv(netdev);
+ int rc;
+
+ rc = netif_set_real_num_tx_queues(netdev, adapter->req_tx_queues);
+ if (rc) {
+ netdev_err(netdev, "failed to set the number of tx queues\n");
+ return rc;
+ }
+
+ rc = netif_set_real_num_rx_queues(netdev, adapter->req_rx_queues);
+ if (rc)
+ netdev_err(netdev, "failed to set the number of rx queues\n");
+
+ return rc;
+}
+
static int ibmvnic_open(struct net_device *netdev)
{
struct ibmvnic_adapter *adapter = netdev_priv(netdev);
@@ -578,11 +596,9 @@ static int ibmvnic_open(struct net_device *netdev)
if (rc)
return rc;
- rc = netif_set_real_num_tx_queues(netdev, adapter->req_tx_queues);
- if (rc) {
- dev_err(dev, "failed to set the number of tx queues\n");
- return -1;
- }
+ rc = set_real_num_queues(netdev);
+ if (rc)
+ return rc;
rc = init_sub_crq_irqs(adapter);
if (rc) {
Powered by blists - more mailing lists