[dpdk-dev] [PATCH 03/38] net/sfc/base: ensure EvQ poll stops when abort is requested
Andrew Rybchenko
arybchenko at solarflare.com
Thu Feb 7 17:29:08 CET 2019
From: Mark Spender <mspender at solarflare.com>
If an event handler requested an abort, only the inner loop was
guarenteed to be broken out of - the outer loop could continue
if total == batch.
Fix this by poisoning batch to ensure it is different to total.
Signed-off-by: Mark Spender <mspender at solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
drivers/net/sfc/base/efx_ev.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/sfc/base/efx_ev.c b/drivers/net/sfc/base/efx_ev.c
index 1139cc26f..907c4249f 100644
--- a/drivers/net/sfc/base/efx_ev.c
+++ b/drivers/net/sfc/base/efx_ev.c
@@ -480,6 +480,14 @@ efx_ev_qpoll(
if (should_abort) {
/* Ignore subsequent events */
total = index + 1;
+
+ /*
+ * Poison batch to ensure the outer
+ * loop is broken out of.
+ */
+ EFSYS_ASSERT(batch <= EFX_EV_BATCH);
+ batch += (EFX_EV_BATCH << 1);
+ EFSYS_ASSERT(total != batch);
break;
}
}
--
2.17.1
More information about the dev
mailing list