Author: arybchik
Date: Wed Dec 26 10:28:03 2018
New Revision: 342521
URL: https://svnweb.freebsd.org/changeset/base/342521

Log:
  MFC r341326
  
  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.
  Differential Revision:  https://reviews.freebsd.org/D18287

Modified:
  stable/10/sys/dev/sfxge/common/efx_ev.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_ev.c     Wed Dec 26 10:27:24 2018        
(r342520)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c     Wed Dec 26 10:28:03 2018        
(r342521)
@@ -501,6 +501,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;
                        }
                }
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to