[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1605208207-1896-6-git-send-email-tlfalcon@linux.ibm.com>
Date: Thu, 12 Nov 2020 13:10:00 -0600
From: Thomas Falcon <tlfalcon@...ux.ibm.com>
To: netdev@...r.kernel.org
Cc: linuxppc-dev@...ts.ozlabs.org, dnbanerg@...ibm.com,
brking@...ux.vnet.ibm.com, pradeep@...ibm.com,
drt@...ux.vnet.ibm.com, sukadev@...ux.vnet.ibm.com,
ljp@...ux.vnet.ibm.com, cforno12@...ux.ibm.com,
tlfalcon@...ux.ibm.com, ricklind@...ux.ibm.com
Subject: [PATCH net-next 05/12] ibmvnic: Fix TX completion error handling
When firmware reports that a transmission was not successful,
the driver is not correctly processing the completion.
It should be freeing the socket buffer and updating the
device queue's inflight frame count and BQL structures.
Do that now.
Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol")
Signed-off-by: Thomas Falcon <tlfalcon@...ux.ibm.com>
---
drivers/net/ethernet/ibm/ibmvnic.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 0f6aba760d65..c9437b2d1aa8 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -3153,10 +3153,12 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter,
/* ensure that we are reading the correct queue entry */
dma_rmb();
for (i = 0; i < next->tx_comp.num_comps; i++) {
+ bool error = false;
+
if (next->tx_comp.rcs[i]) {
dev_err(dev, "tx error %x\n",
next->tx_comp.rcs[i]);
- continue;
+ error = true;
}
index = be32_to_cpu(next->tx_comp.correlators[i]);
if (index & IBMVNIC_TSO_POOL_MASK) {
@@ -3179,7 +3181,10 @@ 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 (error)
+ dev_kfree_skb_irq(txbuff->skb);
+ else
+ dev_consume_skb_irq(txbuff->skb);
txbuff->skb = NULL;
} else {
netdev_warn(adapter->netdev,
--
2.26.2
Powered by blists - more mailing lists