From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Andy Moreton <amoreton@solarflare.com>
Subject: [dpdk-dev] [PATCH 2/5] net/sfc/base: let caller know that queue is already flushed
Date: Sat, 27 May 2017 08:55:31 +0100 [thread overview]
Message-ID: <1495871734-12485-2-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1495871734-12485-1-git-send-email-arybchenko@solarflare.com>
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(-)
diff --git a/drivers/net/sfc/base/ef10_ev.c b/drivers/net/sfc/base/ef10_ev.c
index 3522674..d9389da 100644
--- a/drivers/net/sfc/base/ef10_ev.c
+++ b/drivers/net/sfc/base/ef10_ev.c
@@ -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);
}
diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/net/sfc/base/ef10_rx.c
index 9d6756c..661caa8 100644
--- a/drivers/net/sfc/base/ef10_rx.c
+++ b/drivers/net/sfc/base/ef10_rx.c
@@ -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);
}
diff --git a/drivers/net/sfc/base/ef10_tx.c b/drivers/net/sfc/base/ef10_tx.c
index dfa9e0b..211d265 100644
--- a/drivers/net/sfc/base/ef10_tx.c
+++ b/drivers/net/sfc/base/ef10_tx.c
@@ -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);
}
--
2.9.4
next prev parent reply other threads:[~2017-05-27 7:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-27 7:55 [dpdk-dev] [PATCH 1/5] net/sfc/base: fix incorrect error code usage in common code Andrew Rybchenko
2017-05-27 7:55 ` Andrew Rybchenko [this message]
2017-05-27 7:55 ` [dpdk-dev] [PATCH 3/5] net/sfc: handle already flushed Rx queue gracefully Andrew Rybchenko
2017-05-27 7:55 ` [dpdk-dev] [PATCH 4/5] net/sfc: add Tx queue flush failed flag for sanity Andrew Rybchenko
2017-05-27 7:55 ` [dpdk-dev] [PATCH 5/5] net/sfc: handle already flushed Tx queue gracefully Andrew Rybchenko
2017-05-30 12:08 ` [dpdk-dev] [dpdk-stable] [PATCH 1/5] net/sfc/base: fix incorrect error code usage in common code Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495871734-12485-2-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=amoreton@solarflare.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).