Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2018 16:31:17 +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-12@freebsd.org
Subject:   svn commit: r342342 - stable/12/sys/dev/sfxge/common
Message-ID:  <201812211631.wBLGVHUs081739@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Fri Dec 21 16:31:16 2018
New Revision: 342342
URL: https://svnweb.freebsd.org/changeset/base/342342

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

Modified: stable/12/sys/dev/sfxge/common/efx_ev.c
==============================================================================
--- stable/12/sys/dev/sfxge/common/efx_ev.c	Fri Dec 21 16:30:21 2018	(r342341)
+++ stable/12/sys/dev/sfxge/common/efx_ev.c	Fri Dec 21 16:31:16 2018	(r342342)
@@ -503,6 +503,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?201812211631.wBLGVHUs081739>