Commit ca09bf7b authored by Lijun Pan's avatar Lijun Pan Committed by David S. Miller

ibmvnic: correctly use dev_consume/free_skb_irq

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: 0d973388 ("ibmvnic: Introduce xmit_more support using batched subCRQ hcalls")
Suggested-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: default avatarLijun Pan <lijunp213@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 97684f09
...@@ -3204,9 +3204,6 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter, ...@@ -3204,9 +3204,6 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
next = ibmvnic_next_scrq(adapter, scrq); next = ibmvnic_next_scrq(adapter, scrq);
for (i = 0; i < next->tx_comp.num_comps; i++) { 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]); index = be32_to_cpu(next->tx_comp.correlators[i]);
if (index & IBMVNIC_TSO_POOL_MASK) { if (index & IBMVNIC_TSO_POOL_MASK) {
tx_pool = &adapter->tso_pool[pool]; tx_pool = &adapter->tso_pool[pool];
...@@ -3220,7 +3217,13 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter, ...@@ -3220,7 +3217,13 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
num_entries += txbuff->num_entries; num_entries += txbuff->num_entries;
if (txbuff->skb) { if (txbuff->skb) {
total_bytes += txbuff->skb->len; total_bytes += txbuff->skb->len;
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); dev_consume_skb_irq(txbuff->skb);
}
txbuff->skb = NULL; txbuff->skb = NULL;
} else { } else {
netdev_warn(adapter->netdev, netdev_warn(adapter->netdev,
......
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