Skip to content

Commit

Permalink
ibmvnic: Move queue restarting in ibmvnic_tx_complete
Browse files Browse the repository at this point in the history
Restart of the subqueue should occur outside of the loop processing
any tx buffers instead of doing this in the middle of the loop.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nathan Fontenot authored and David S. Miller committed May 3, 2017
1 parent 94ca305 commit 7c3e7de
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1809,19 +1809,8 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
}

if (txbuff->last_frag) {
if (atomic_sub_return(next->tx_comp.num_comps,
&scrq->used) <=
(adapter->req_tx_entries_per_subcrq / 2) &&
netif_subqueue_stopped(adapter->netdev,
txbuff->skb)) {
netif_wake_subqueue(adapter->netdev,
scrq->pool_index);
netdev_dbg(adapter->netdev,
"Started queue %d\n",
scrq->pool_index);
}

dev_kfree_skb_any(txbuff->skb);
txbuff->skb = NULL;
}

adapter->tx_pool[pool].free_map[adapter->tx_pool[pool].
Expand All @@ -1832,6 +1821,15 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
}
/* remove tx_comp scrq*/
next->tx_comp.first = 0;

if (atomic_sub_return(next->tx_comp.num_comps, &scrq->used) <=
(adapter->req_tx_entries_per_subcrq / 2) &&
__netif_subqueue_stopped(adapter->netdev,
scrq->pool_index)) {
netif_wake_subqueue(adapter->netdev, scrq->pool_index);
netdev_info(adapter->netdev, "Started queue %d\n",
scrq->pool_index);
}
}

enable_scrq_irq(adapter, scrq);
Expand Down

0 comments on commit 7c3e7de

Please sign in to comment.