Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2019 14:55:07 +0000 (UTC)
From:      Mark Johnston <markj@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: r353051 - in stable/12/sys: dev/vmware/vmxnet3 net
Message-ID:  <201910031455.x93Et7T4058065@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Thu Oct  3 14:55:07 2019
New Revision: 353051
URL: https://svnweb.freebsd.org/changeset/base/353051

Log:
  MFC r352906:
  Add IFLIB_SINGLE_IRQ_RX_ONLY.
  
  PR:	239118

Modified:
  stable/12/sys/dev/vmware/vmxnet3/if_vmx.c
  stable/12/sys/net/iflib.c
  stable/12/sys/net/iflib.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c	Thu Oct  3 14:54:26 2019	(r353050)
+++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c	Thu Oct  3 14:55:07 2019	(r353051)
@@ -287,7 +287,7 @@ static struct if_shared_ctx vmxnet3_sctx_init = {
 	.isc_vendor_info = vmxnet3_vendor_info_array,
 	.isc_driver_version = "2",
 	.isc_driver = &vmxnet3_iflib_driver,
-	.isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ,
+	.isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ | IFLIB_SINGLE_IRQ_RX_ONLY,
 
 	/*
 	 * Number of receive queues per receive queue set, with associated

Modified: stable/12/sys/net/iflib.c
==============================================================================
--- stable/12/sys/net/iflib.c	Thu Oct  3 14:54:26 2019	(r353050)
+++ stable/12/sys/net/iflib.c	Thu Oct  3 14:55:07 2019	(r353051)
@@ -6000,6 +6000,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte
 	int tqrid;
 	void *q;
 	int err;
+	bool rx_only;
 
 	q = &ctx->ifc_rxqs[0];
 	info = &rxq[0].ifr_filter_info;
@@ -6007,16 +6008,18 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte
 	tqg = qgroup_if_io_tqg;
 	tqrid = irq->ii_rid = *rid;
 	fn = _task_fn_rx;
+	rx_only = (ctx->ifc_sctx->isc_flags & IFLIB_SINGLE_IRQ_RX_ONLY) != 0;
 
 	ctx->ifc_flags |= IFC_LEGACY;
 	info->ifi_filter = filter;
 	info->ifi_filter_arg = filter_arg;
 	info->ifi_task = gtask;
-	info->ifi_ctx = q;
+	info->ifi_ctx = rx_only ? ctx : q;
 
 	/* We allocate a single interrupt resource */
-	if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_rxtx,
-	    NULL, info, name)) != 0)
+	err = _iflib_irq_alloc(ctx, irq, tqrid, rx_only ? iflib_fast_intr_ctx :
+	    iflib_fast_intr_rxtx, NULL, info, name);
+	if (err != 0)
 		return (err);
 	GROUPTASK_INIT(gtask, 0, fn, q);
 	taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name);

Modified: stable/12/sys/net/iflib.h
==============================================================================
--- stable/12/sys/net/iflib.h	Thu Oct  3 14:54:26 2019	(r353050)
+++ stable/12/sys/net/iflib.h	Thu Oct  3 14:55:07 2019	(r353051)
@@ -361,6 +361,11 @@ typedef enum {
  * Interface needs admin task to ignore interface up/down status
  */
 #define IFLIB_ADMIN_ALWAYS_RUN	0x10000
+/*
+ * When using a single hardware interrupt for the interface, only process RX
+ * interrupts instead of doing combined RX/TX processing.
+ */
+#define	IFLIB_SINGLE_IRQ_RX_ONLY	0x40000
 
 
 /*



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