Skip to content

Commit 152ce47

Browse files
nfontdavem330
authored andcommitted
ibmvnic: Check adapter state during ibmvnic_poll
We do not want to process any receive frames if the ibmvnic_poll routine is invoked while a reset is in process. Also, before replenishing the rx pools in the ibmvnic_poll, we want to make sure the adapter is not in the process of closing. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f185a49 commit 152ce47

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,10 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
14351435
struct ibmvnic_adapter *adapter = netdev_priv(netdev);
14361436
int scrq_num = (int)(napi - adapter->napi);
14371437
int frames_processed = 0;
1438+
1439+
if (adapter->resetting)
1440+
return 0;
1441+
14381442
restart_poll:
14391443
while (frames_processed < budget) {
14401444
struct sk_buff *skb;
@@ -1493,7 +1497,9 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
14931497
netdev->stats.rx_bytes += length;
14941498
frames_processed++;
14951499
}
1496-
replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]);
1500+
1501+
if (adapter->state != VNIC_CLOSING)
1502+
replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]);
14971503

14981504
if (frames_processed < budget) {
14991505
enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]);

0 commit comments

Comments
 (0)