From: Mark Spender Date: Thu, 7 Feb 2019 16:29:08 +0000 (+0000) Subject: net/sfc/base: ensure EvQ poll stops when abort is requested X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4b4b84caf9b42fd91a0664367b7ef75380f8f228;p=dpdk.git net/sfc/base: ensure EvQ poll stops when abort is requested If an event handler requested an abort, only the inner loop was guaranteed 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 Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/base/efx_ev.c b/drivers/net/sfc/base/efx_ev.c index 1139cc26f9..907c4249fc 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; } }