[dpdk-dev,2/5] net/sfc/base: let caller know that queue is already flushed
Checks
Commit Message
From: Andy Moreton <amoreton@solarflare.com>
Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or
MC reboot. Caller needs to know that the queue is already flushed to
avoid waiting for flush done event.
Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/sfc/base/ef10_ev.c | 7 ++++++-
drivers/net/sfc/base/ef10_rx.c | 18 +++++++++++++++---
drivers/net/sfc/base/ef10_tx.c | 18 +++++++++++++++---
3 files changed, 36 insertions(+), 7 deletions(-)
@@ -431,7 +431,12 @@ efx_mcdi_fini_evq(
return (0);
fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ /*
+ * EALREADY is not an error, but indicates that the MC has rebooted and
+ * that the EVQ has already been destroyed.
+ */
+ if (rc != EALREADY)
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -137,7 +137,7 @@ efx_mcdi_fini_rxq(
efx_mcdi_execute_quiet(enp, &req);
- if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+ if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail1;
}
@@ -145,7 +145,12 @@ efx_mcdi_fini_rxq(
return (0);
fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ /*
+ * EALREADY is not an error, but indicates that the MC has rebooted and
+ * that the RXQ has already been destroyed.
+ */
+ if (rc != EALREADY)
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -802,7 +807,14 @@ ef10_rx_qflush(
return (0);
fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ /*
+ * EALREADY is not an error, but indicates that the MC has rebooted and
+ * that the RXQ has already been destroyed. Callers need to know that
+ * the RXQ flush has completed to avoid waiting until timeout for a
+ * flush done event that will not be delivered.
+ */
+ if (rc != EALREADY)
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -148,7 +148,7 @@ efx_mcdi_fini_txq(
efx_mcdi_execute_quiet(enp, &req);
- if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+ if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail1;
}
@@ -156,7 +156,12 @@ efx_mcdi_fini_txq(
return (0);
fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ /*
+ * EALREADY is not an error, but indicates that the MC has rebooted and
+ * that the TXQ has already been destroyed.
+ */
+ if (rc != EALREADY)
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -675,7 +680,14 @@ ef10_tx_qflush(
return (0);
fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
+ /*
+ * EALREADY is not an error, but indicates that the MC has rebooted and
+ * that the TXQ has already been destroyed. Callers need to know that
+ * the TXQ flush has completed to avoid waiting until timeout for a
+ * flush done event that will not be delivered.
+ */
+ if (rc != EALREADY)
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}