[dpdk-dev,2/2] net/sfc: restart TxQ in case of exception on its event queue

Message ID 1480664481-26427-3-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Dec. 2, 2016, 7:41 a.m. UTC
  From: Ivan Malov <ivan.malov@oktetlabs.ru>

Examples of recoverable exceptions because of Tx error are:
 - Tx descriptor PCI read error
 - invalid Tx option descriptor
 - Tx option descriptor not supported by the firmware variant
 - unexpected Tx option descriptor (e.g. missing FATSO2A before
   FATSO2B, missing FATSO2B after FATSO2A)
 - incomplete packet push (CONT bit set in the latest pushed DMA
   descriptor)

Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc_ev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Patch

diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index 36aede8..af3c7b2 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -339,6 +339,20 @@  sfc_ev_qpoll(struct sfc_evq *evq)
 					rxq_sw_index);
 		}
 
+		if (evq->txq != NULL) {
+			unsigned int txq_sw_index = sfc_txq_sw_index(evq->txq);
+
+			sfc_warn(sa,
+				 "restart TxQ %u because of exception on its EvQ %u",
+				 txq_sw_index, evq->evq_index);
+
+			sfc_tx_qstop(sa, txq_sw_index);
+			rc = sfc_tx_qstart(sa, txq_sw_index);
+			if (rc != 0)
+				sfc_err(sa, "cannot restart TxQ %u",
+					txq_sw_index);
+		}
+
 		if (evq->exception)
 			sfc_panic(sa, "unrecoverable exception on EvQ %u",
 				  evq->evq_index);