From 0225849177f6da31122bc3e7a4a797f454d40898 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 3 Oct 2019 15:23:38 +0000 Subject: [PATCH] MFS r353051: Add IFLIB_SINGLE_IRQ_RX_ONLY. PR: 239118 Approved by: re (gjb) --- sys/dev/vmware/vmxnet3/if_vmx.c | 2 +- sys/net/iflib.c | 9 ++++++--- sys/net/iflib.h | 5 +++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/vmware/vmxnet3/if_vmx.c b/sys/dev/vmware/vmxnet3/if_vmx.c index fc8c313717b..6c8aaf87387 100644 --- a/sys/dev/vmware/vmxnet3/if_vmx.c +++ b/sys/dev/vmware/vmxnet3/if_vmx.c @@ -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 diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 9950083490a..1e248c00c80 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -6000,6 +6000,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filter, void *filter_arg, int * 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 filter, void *filter_arg, int * 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); diff --git a/sys/net/iflib.h b/sys/net/iflib.h index 2395439a703..b0215dafcd7 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -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 /* -- 2.45.0