Commit 152ce47d authored by Nathan Fontenot's avatar Nathan Fontenot Committed by David S. Miller

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: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f185a49a
...@@ -1435,6 +1435,10 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) ...@@ -1435,6 +1435,10 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
struct ibmvnic_adapter *adapter = netdev_priv(netdev); struct ibmvnic_adapter *adapter = netdev_priv(netdev);
int scrq_num = (int)(napi - adapter->napi); int scrq_num = (int)(napi - adapter->napi);
int frames_processed = 0; int frames_processed = 0;
if (adapter->resetting)
return 0;
restart_poll: restart_poll:
while (frames_processed < budget) { while (frames_processed < budget) {
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1493,7 +1497,9 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) ...@@ -1493,7 +1497,9 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
netdev->stats.rx_bytes += length; netdev->stats.rx_bytes += length;
frames_processed++; frames_processed++;
} }
replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]);
if (adapter->state != VNIC_CLOSING)
replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]);
if (frames_processed < budget) { if (frames_processed < budget) {
enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment