Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Feb 2019 18:02:46 +0000 (UTC)
From:      Stephen Hurd <shurd@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: r344471 - stable/12/sys/net
Message-ID:  <201902221802.x1MI2kmu024771@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: shurd
Date: Fri Feb 22 18:02:46 2019
New Revision: 344471
URL: https://svnweb.freebsd.org/changeset/base/344471

Log:
  MFC r344162:
  
  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@gmail.com>
  Reviewed by:	marius, gallatin
  Obtained from:	Haiku (a84bb9, 4947d1)
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D19201

Modified:
  stable/12/sys/net/iflib.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/iflib.c
==============================================================================
--- stable/12/sys/net/iflib.c	Fri Feb 22 15:31:50 2019	(r344470)
+++ stable/12/sys/net/iflib.c	Fri Feb 22 18:02:46 2019	(r344471)
@@ -1466,12 +1466,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);
@@ -1484,14 +1489,17 @@ iflib_fast_intr_rxtx(void *arg)
 	struct grouptask *gtask = info->ifi_task;
 	iflib_rxq_t rxq = (iflib_rxq_t)info->ifi_ctx;
 	if_ctx_t ctx = NULL;;
-	int i, cidx;
+	int i, cidx, 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);
+	}
 
 	MPASS(rxq->ifr_ntxqirq);
 	for (i = 0; i < rxq->ifr_ntxqirq; i++) {
@@ -1526,13 +1534,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);



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