Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Dec 2018 07:33:02 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r342450 - stable/11/sys/dev/sfxge/common
Message-ID:  <201812250733.wBP7X2HR052264@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Tue Dec 25 07:33:02 2018
New Revision: 342450
URL: https://svnweb.freebsd.org/changeset/base/342450

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/11/sys/dev/sfxge/common/efx_ev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_ev.c
==============================================================================
--- stable/11/sys/dev/sfxge/common/efx_ev.c	Tue Dec 25 07:32:18 2018	(r342449)
+++ stable/11/sys/dev/sfxge/common/efx_ev.c	Tue Dec 25 07:33:02 2018	(r342450)
@@ -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;
 			}
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812250733.wBP7X2HR052264>