svn commit: r341326 - head/sys/dev/sfxge/common
Andrew Rybchenko
arybchik at FreeBSD.org
Fri Nov 30 07:11:02 UTC 2018
Author: arybchik
Date: Fri Nov 30 07:10:54 2018
New Revision: 341326
URL: https://svnweb.freebsd.org/changeset/base/341326
Log:
sfxge(4): ensure EvQ poll stops when abort is requested
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.
Submitted by: Mark Spender <mspender at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18287
Modified:
head/sys/dev/sfxge/common/efx_ev.c
Modified: head/sys/dev/sfxge/common/efx_ev.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_ev.c Fri Nov 30 07:10:43 2018 (r341325)
+++ head/sys/dev/sfxge/common/efx_ev.c Fri Nov 30 07:10:54 2018 (r341326)
@@ -509,6 +509,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;
}
}
More information about the svn-src-all
mailing list