* [dpdk-dev] [PATCH 1/2] net/sfc: restart RxQ in case of exception on its event queue
2016-12-02 7:41 [dpdk-dev] [PATCH 0/2] Event queue exception handling in Solarflare PMD Andrew Rybchenko
@ 2016-12-02 7:41 ` Andrew Rybchenko
2016-12-02 7:41 ` [dpdk-dev] [PATCH 2/2] net/sfc: restart TxQ " Andrew Rybchenko
2016-12-06 11:42 ` [dpdk-dev] [PATCH 0/2] Event queue exception handling in Solarflare PMD Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2016-12-02 7:41 UTC (permalink / raw)
To: dev
Examples of recoverable exceptions are:
- unexpected Rx event (Rx scatter abort with non-zero size,
too big Rx descriptors batch completed)
- Rx error due to invalid Rx descriptors push
- Rx error due to Rx descriptor read error (e.g. unmapped Rx ring
and denied by IOMMU)
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/sfc.h | 6 ++++++
drivers/net/sfc/sfc_ev.c | 26 ++++++++++++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 29d3a6b..995dfe6 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -187,6 +187,12 @@ sfc_adapter_lock(struct sfc_adapter *sa)
rte_spinlock_lock(&sa->lock);
}
+static inline int
+sfc_adapter_trylock(struct sfc_adapter *sa)
+{
+ return rte_spinlock_trylock(&sa->lock);
+}
+
static inline void
sfc_adapter_unlock(struct sfc_adapter *sa)
{
diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index 96b95cc..36aede8 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -30,6 +30,7 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_alarm.h>
+#include <rte_branch_prediction.h>
#include "efx.h"
@@ -320,6 +321,31 @@ sfc_ev_qpoll(struct sfc_evq *evq)
efx_ev_qpoll(evq->common, &evq->read_ptr, &sfc_ev_callbacks, evq);
+ if (unlikely(evq->exception) && sfc_adapter_trylock(evq->sa)) {
+ struct sfc_adapter *sa = evq->sa;
+ int rc;
+
+ if ((evq->rxq != NULL) && (evq->rxq->state & SFC_RXQ_RUNNING)) {
+ unsigned int rxq_sw_index = sfc_rxq_sw_index(evq->rxq);
+
+ sfc_warn(sa,
+ "restart RxQ %u because of exception on its EvQ %u",
+ rxq_sw_index, evq->evq_index);
+
+ sfc_rx_qstop(sa, rxq_sw_index);
+ rc = sfc_rx_qstart(sa, rxq_sw_index);
+ if (rc != 0)
+ sfc_err(sa, "cannot restart RxQ %u",
+ rxq_sw_index);
+ }
+
+ if (evq->exception)
+ sfc_panic(sa, "unrecoverable exception on EvQ %u",
+ evq->evq_index);
+
+ sfc_adapter_unlock(sa);
+ }
+
/* Poll-mode driver does not re-prime the event queue for interrupts */
}
--
2.5.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/sfc: restart TxQ in case of exception on its event queue
2016-12-02 7:41 [dpdk-dev] [PATCH 0/2] Event queue exception handling in Solarflare PMD Andrew Rybchenko
2016-12-02 7:41 ` [dpdk-dev] [PATCH 1/2] net/sfc: restart RxQ in case of exception on its event queue Andrew Rybchenko
@ 2016-12-02 7:41 ` Andrew Rybchenko
2016-12-06 11:42 ` [dpdk-dev] [PATCH 0/2] Event queue exception handling in Solarflare PMD Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2016-12-02 7:41 UTC (permalink / raw)
To: dev; +Cc: Ivan Malov
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(+)
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);
--
2.5.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] Event queue exception handling in Solarflare PMD
2016-12-02 7:41 [dpdk-dev] [PATCH 0/2] Event queue exception handling in Solarflare PMD Andrew Rybchenko
2016-12-02 7:41 ` [dpdk-dev] [PATCH 1/2] net/sfc: restart RxQ in case of exception on its event queue Andrew Rybchenko
2016-12-02 7:41 ` [dpdk-dev] [PATCH 2/2] net/sfc: restart TxQ " Andrew Rybchenko
@ 2016-12-06 11:42 ` Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2016-12-06 11:42 UTC (permalink / raw)
To: Andrew Rybchenko, dev
On 12/2/2016 7:41 AM, Andrew Rybchenko wrote:
> The patch series adds event queue exception handling.
>
> It is not required when everything goes fine, but has chances to
> recover if something goes wrong in either driver or HW.
>
> The patch series should be applied after
> [PATCH v2 00/55] Solarflare libefx-based PMD
> (Message-ID: 1480436367-20749-1-git-send-email-arybchenko@solarflare.com)
>
>
> Andrew Rybchenko (1):
> net/sfc: restart RxQ in case of exception on its event queue
>
> Ivan Malov (1):
> net/sfc: restart TxQ in case of exception on its event queue
>
> drivers/net/sfc/sfc.h | 6 ++++++
> drivers/net/sfc/sfc_ev.c | 40 ++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 46 insertions(+)
>
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread