Skip to content

Commit 660e309

Browse files
tlfalcondavem330
authored andcommitted
ibmvnic: Clean actual number of RX or TX pools
Avoid using value stored in the login response buffer when cleaning TX and RX buffer pools since these could be inconsistent depending on the device state. Instead use the field in the driver's private data that tracks the number of active pools. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 906cce0 commit 660e309

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ static void clean_rx_pools(struct ibmvnic_adapter *adapter)
11281128
if (!adapter->rx_pool)
11291129
return;
11301130

1131-
rx_scrqs = be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs);
1131+
rx_scrqs = adapter->num_active_rx_pools;
11321132
rx_entries = adapter->req_rx_add_entries_per_subcrq;
11331133

11341134
/* Free any remaining skbs in the rx buffer pools */
@@ -1177,7 +1177,7 @@ static void clean_tx_pools(struct ibmvnic_adapter *adapter)
11771177
if (!adapter->tx_pool || !adapter->tso_pool)
11781178
return;
11791179

1180-
tx_scrqs = be32_to_cpu(adapter->login_rsp_buf->num_txsubm_subcrqs);
1180+
tx_scrqs = adapter->num_active_tx_pools;
11811181

11821182
/* Free any remaining skbs in the tx buffer pools */
11831183
for (i = 0; i < tx_scrqs; i++) {

0 commit comments

Comments
 (0)