Skip to content

Commit

Permalink
ibmvnic: correctly use dev_consume/free_skb_irq
Browse files Browse the repository at this point in the history
commit ca09bf7 upstream.

It is more correct to use dev_kfree_skb_irq when packets are dropped,
and to use dev_consume_skb_irq when packets are consumed.

Fixes: 0d97338 ("ibmvnic: Introduce xmit_more support using batched subCRQ hcalls")
Suggested-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Lijun Pan authored and gregkh committed Apr 21, 2021
1 parent 1ccdf1b commit 5d32809
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3274,9 +3274,6 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,

next = ibmvnic_next_scrq(adapter, scrq);
for (i = 0; i < next->tx_comp.num_comps; i++) {
if (next->tx_comp.rcs[i])
dev_err(dev, "tx error %x\n",
next->tx_comp.rcs[i]);
index = be32_to_cpu(next->tx_comp.correlators[i]);
if (index & IBMVNIC_TSO_POOL_MASK) {
tx_pool = &adapter->tso_pool[pool];
Expand All @@ -3290,7 +3287,13 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
num_entries += txbuff->num_entries;
if (txbuff->skb) {
total_bytes += txbuff->skb->len;
dev_consume_skb_irq(txbuff->skb);
if (next->tx_comp.rcs[i]) {
dev_err(dev, "tx error %x\n",
next->tx_comp.rcs[i]);
dev_kfree_skb_irq(txbuff->skb);
} else {
dev_consume_skb_irq(txbuff->skb);
}
txbuff->skb = NULL;
} else {
netdev_warn(adapter->netdev,
Expand Down

0 comments on commit 5d32809

Please sign in to comment.