From owner-svn-src-head@freebsd.org Mon Sep 30 15:59:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15A9D12B693; Mon, 30 Sep 2019 15:59:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hnC06hDFz46cp; Mon, 30 Sep 2019 15:59:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9A474FE0; Mon, 30 Sep 2019 15:59:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8UFx8GD017833; Mon, 30 Sep 2019 15:59:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8UFx8Ff017830; Mon, 30 Sep 2019 15:59:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909301559.x8UFx8Ff017830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 30 Sep 2019 15:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352906 - in head/sys: dev/vmware/vmxnet3 net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 352906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 15:59:09 -0000 Author: markj Date: Mon Sep 30 15:59:07 2019 New Revision: 352906 URL: https://svnweb.freebsd.org/changeset/base/352906 Log: Add IFLIB_SINGLE_IRQ_RX_ONLY. As of r347221 the iflib legacy interrupt mode setup assumes that drivers perform both receive and transmit processing from the interrupt handler. This assumption is invalid in the vmxnet3 driver, so introduce the IFLIB_SINGLE_IRQ_RX_ONLY flag to make iflib avoid tx processing in the interrupt handler. PR: 239118 Reported and tested by: Juraj Lutter Obtained from: marius Reviewed by: gallatin MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21831 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Sep 30 15:08:45 2019 (r352905) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Sep 30 15:59:07 2019 (r352906) @@ -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: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Sep 30 15:08:45 2019 (r352905) +++ head/sys/net/iflib.c Mon Sep 30 15:59:07 2019 (r352906) @@ -6059,6 +6059,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte gtask_fn_t *fn; void *q; int err, tqrid; + bool rx_only; q = &ctx->ifc_rxqs[0]; info = &rxq[0].ifr_filter_info; @@ -6066,17 +6067,19 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte tqg = qgroup_if_io_tqg; tqrid = *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; dev = ctx->ifc_dev; /* 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); res = irq->ii_res; Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Mon Sep 30 15:08:45 2019 (r352905) +++ head/sys/net/iflib.h Mon Sep 30 15:59:07 2019 (r352906) @@ -366,6 +366,11 @@ typedef enum { * Driver will pass the media */ #define IFLIB_DRIVER_MEDIA 0x20000 +/* + * 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 /* * field accessors