svn commit: r344162 - head/sys/net

Stephen Hurd shurd at FreeBSD.org
Fri Feb 15 18:51:45 UTC 2019


Author: shurd
Date: Fri Feb 15 18:51:43 2019
New Revision: 344162
URL: https://svnweb.freebsd.org/changeset/base/344162

Log:
  iflib: Improve return values of interrupt handlers.
  
  iflib was returning FILTER_HANDLED, in cases where FILTER_STRAY was more
  correct. This potentially caused issues with shared legacy interrupts.
  
  Driver filters returning FILTER_STRAY are now properly handled.
  
  Submitted by:	Augustin Cavalier <waddlesplash at gmail.com>
  Reviewed by:	marius, gallatin
  Obtained from:	Haiku (a84bb9, 4947d1)
  MFC after:	1 week
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D19201

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Fri Feb 15 18:28:51 2019	(r344161)
+++ head/sys/net/iflib.c	Fri Feb 15 18:51:43 2019	(r344162)
@@ -1468,12 +1468,17 @@ iflib_fast_intr(void *arg)
 {
 	iflib_filter_info_t info = arg;
 	struct grouptask *gtask = info->ifi_task;
+	int result;
+
 	if (!iflib_started)
-		return (FILTER_HANDLED);
+		return (FILTER_STRAY);
 
 	DBG_COUNTER_INC(fast_intrs);
-	if (info->ifi_filter != NULL && info->ifi_filter(info->ifi_filter_arg) == FILTER_HANDLED)
-		return (FILTER_HANDLED);
+	if (info->ifi_filter != NULL) {
+		result = info->ifi_filter(info->ifi_filter_arg);
+		if ((result & FILTER_SCHEDULE_THREAD) == 0)
+			return (result);
+	}
 
 	GROUPTASK_ENQUEUE(gtask);
 	return (FILTER_HANDLED);
@@ -1488,15 +1493,18 @@ iflib_fast_intr_rxtx(void *arg)
 	iflib_rxq_t rxq = (iflib_rxq_t)info->ifi_ctx;
 	iflib_txq_t txq;
 	void *sc;
-	int i, cidx;
+	int i, cidx, result;
 	qidx_t txqid;
 
 	if (!iflib_started)
-		return (FILTER_HANDLED);
+		return (FILTER_STRAY);
 
 	DBG_COUNTER_INC(fast_intrs);
-	if (info->ifi_filter != NULL && info->ifi_filter(info->ifi_filter_arg) == FILTER_HANDLED)
-		return (FILTER_HANDLED);
+	if (info->ifi_filter != NULL) {
+		result = info->ifi_filter(info->ifi_filter_arg);
+		if ((result & FILTER_SCHEDULE_THREAD) == 0)
+			return (result);
+	}
 
 	ctx = rxq->ifr_ctx;
 	sc = ctx->ifc_softc;
@@ -1531,13 +1539,17 @@ iflib_fast_intr_ctx(void *arg)
 {
 	iflib_filter_info_t info = arg;
 	struct grouptask *gtask = info->ifi_task;
+	int result;
 
 	if (!iflib_started)
-		return (FILTER_HANDLED);
+		return (FILTER_STRAY);
 
 	DBG_COUNTER_INC(fast_intrs);
-	if (info->ifi_filter != NULL && info->ifi_filter(info->ifi_filter_arg) == FILTER_HANDLED)
-		return (FILTER_HANDLED);
+	if (info->ifi_filter != NULL) {
+		result = info->ifi_filter(info->ifi_filter_arg);
+		if ((result & FILTER_SCHEDULE_THREAD) == 0)
+			return (result);
+	}
 
 	GROUPTASK_ENQUEUE(gtask);
 	return (FILTER_HANDLED);


More information about the svn-src-all mailing list