aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ibm/ibmvnic.c
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@linux.vnet.ibm.com>2018-02-19 13:30:14 -0600
committerDavid S. Miller <davem@davemloft.net>2018-02-21 14:20:05 -0500
commitd9043c102e73b9abc01f2120d47ba8195823172a (patch)
tree2744c1df736427aa208b7b605762d4c770cbef67 /drivers/net/ethernet/ibm/ibmvnic.c
parentibmvnic: Rename active queue count variables (diff)
downloadlinux-dev-d9043c102e73b9abc01f2120d47ba8195823172a.tar.xz
linux-dev-d9043c102e73b9abc01f2120d47ba8195823172a.zip
ibmvnic: Move active sub-crq count settings
Inpreparation for using the active scrq count to track more active resources, move the setting of the active count to after initialization occurs in initial driver init and during driver reset. Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/ibm/ibmvnic.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index f1166efd8eb7..0c9adeffbe46 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -484,7 +484,6 @@ static void release_rx_pools(struct ibmvnic_adapter *adapter)
kfree(adapter->rx_pool);
adapter->rx_pool = NULL;
- adapter->num_active_rx_scrqs = 0;
}
static int init_rx_pools(struct net_device *netdev)
@@ -509,8 +508,6 @@ static int init_rx_pools(struct net_device *netdev)
return -1;
}
- adapter->num_active_rx_scrqs = 0;
-
for (i = 0; i < rxadd_subcrqs; i++) {
rx_pool = &adapter->rx_pool[i];
@@ -554,8 +551,6 @@ static int init_rx_pools(struct net_device *netdev)
rx_pool->next_free = 0;
}
- adapter->num_active_rx_scrqs = rxadd_subcrqs;
-
return 0;
}
@@ -624,7 +619,6 @@ static void release_tx_pools(struct ibmvnic_adapter *adapter)
kfree(adapter->tx_pool);
adapter->tx_pool = NULL;
- adapter->num_active_tx_scrqs = 0;
}
static int init_tx_pools(struct net_device *netdev)
@@ -641,8 +635,6 @@ static int init_tx_pools(struct net_device *netdev)
if (!adapter->tx_pool)
return -1;
- adapter->num_active_tx_scrqs = 0;
-
for (i = 0; i < tx_subcrqs; i++) {
tx_pool = &adapter->tx_pool[i];
@@ -690,8 +682,6 @@ static int init_tx_pools(struct net_device *netdev)
tx_pool->producer_index = 0;
}
- adapter->num_active_tx_scrqs = tx_subcrqs;
-
return 0;
}
@@ -991,6 +981,10 @@ static int init_resources(struct ibmvnic_adapter *adapter)
return rc;
rc = init_tx_pools(netdev);
+
+ adapter->num_active_tx_scrqs = adapter->req_tx_queues;
+ adapter->num_active_rx_scrqs = adapter->req_rx_queues;
+
return rc;
}
@@ -1692,6 +1686,9 @@ static int do_reset(struct ibmvnic_adapter *adapter,
release_tx_pools(adapter);
init_rx_pools(netdev);
init_tx_pools(netdev);
+
+ adapter->num_active_tx_scrqs = adapter->req_tx_queues;
+ adapter->num_active_rx_scrqs = adapter->req_rx_queues;
} else {
rc = reset_tx_pools(adapter);
if (rc)