Author: markj
Date: Thu Oct  3 15:23:38 2019
New Revision: 353052
URL: https://svnweb.freebsd.org/changeset/base/353052

Log:
  MFS r353051:
  Add IFLIB_SINGLE_IRQ_RX_ONLY.
  
  PR:           239118
  Approved by:  re (gjb)

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

Modified: releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Thu Oct  3 14:55:07 2019        
(r353051)
+++ releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Thu Oct  3 15:23:38 2019        
(r353052)
@@ -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: releng/12.1/sys/net/iflib.c
==============================================================================
--- releng/12.1/sys/net/iflib.c Thu Oct  3 14:55:07 2019        (r353051)
+++ releng/12.1/sys/net/iflib.c Thu Oct  3 15:23:38 2019        (r353052)
@@ -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: releng/12.1/sys/net/iflib.h
==============================================================================
--- releng/12.1/sys/net/iflib.h Thu Oct  3 14:55:07 2019        (r353051)
+++ releng/12.1/sys/net/iflib.h Thu Oct  3 15:23:38 2019        (r353052)
@@ -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
 
 
 /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to