Module Name:    src
Committed By:   msaitoh
Date:           Fri Feb 10 08:41:13 UTC 2017

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
 Change the Interrupt Moderation flag from global variable to per device.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.72 src/sys/dev/pci/ixgbe/ixgbe.c:1.73
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.72	Fri Feb 10 06:35:22 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Feb 10 08:41:13 2017
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.72 2017/02/10 06:35:22 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.73 2017/02/10 08:41:13 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -282,7 +282,7 @@ MODULE_DEPEND(ix, ether, 1, 1, 1);
 ** is varied over time based on the
 ** traffic for that interrupt vector
 */
-static int ixgbe_enable_aim = TRUE;
+static bool ixgbe_enable_aim = true;
 #define SYSCTL_INT(_a1, _a2, _a3, _a4, _a5, _a6, _a7)
 SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RWTUN, &ixgbe_enable_aim, 0,
     "Enable adaptive interrupt moderation");
@@ -1708,7 +1708,7 @@ ixgbe_msix_que(void *arg)
 
 	/* Do AIM now? */
 
-	if (adapter->enable_aim == FALSE)
+	if (adapter->enable_aim == false)
 		goto no_calc;
 	/*
 	** Do Adaptive Interrupt Moderation:
@@ -4521,13 +4521,10 @@ ixgbe_add_device_sysctls(struct adapter 
 	    ixgbe_sysctl_flowcntl, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 
-	/* XXX This is an *instance* sysctl controlling a *global* variable.
-	 * XXX It's that way in the FreeBSD driver that this derives from.
-	 */
 	if (sysctl_createv(log, 0, &rnode, &cnode,
-	    CTLFLAG_READWRITE, CTLTYPE_INT,
+	    CTLFLAG_READWRITE, CTLTYPE_BOOL,
 	    "enable_aim", SYSCTL_DESCR("Interrupt Moderation"),
-	    NULL, 0, &ixgbe_enable_aim, 0, CTL_CREATE, CTL_EOL) != 0)
+	    NULL, 0, &adapter->enable_aim, 0, CTL_CREATE, CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 
 	if (sysctl_createv(log, 0, &rnode, &cnode,

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.49 src/sys/dev/pci/ixgbe/ixv.c:1.50
--- src/sys/dev/pci/ixgbe/ixv.c:1.49	Fri Feb 10 06:35:22 2017
+++ src/sys/dev/pci/ixgbe/ixv.c	Fri Feb 10 08:41:13 2017
@@ -31,7 +31,7 @@
 
 ******************************************************************************/
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixv.c,v 1.49 2017/02/10 06:35:22 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.50 2017/02/10 08:41:13 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -197,7 +197,7 @@ TUNABLE_INT("hw.ixv.num_queues", &ixv_nu
 ** is varied over time based on the
 ** traffic for that interrupt vector
 */
-static int ixv_enable_aim = FALSE;
+static bool ixv_enable_aim = false;
 TUNABLE_INT("hw.ixv.enable_aim", &ixv_enable_aim);
 
 /* How many packets rxeof tries to clean at a time */
@@ -425,6 +425,9 @@ ixv_attach(device_t parent, device_t dev
 		bcopy(addr, hw->mac.addr, sizeof(addr));
 	}
 
+	/* hw.ix defaults init */
+	adapter->enable_aim = ixv_enable_aim;
+
 	/* Setup OS specific network interface */
 	ixv_setup_interface(dev, adapter);
 
@@ -943,7 +946,7 @@ ixv_msix_que(void *arg)
 
 	/* Do AIM now? */
 
-	if (ixv_enable_aim == FALSE)
+	if (adapter->enable_aim == false)
 		goto no_calc;
 	/*
 	** Do Adaptive Interrupt Moderation:
@@ -2323,13 +2326,10 @@ ixv_add_device_sysctls(struct adapter *a
 	    ixv_sysctl_debug, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 
-	/* XXX This is an *instance* sysctl controlling a *global* variable.
-	 * XXX It's that way in the FreeBSD driver that this derives from.
-	 */
 	if (sysctl_createv(log, 0, &rnode, &cnode,
-	    CTLFLAG_READWRITE, CTLTYPE_INT,
+	    CTLFLAG_READWRITE, CTLTYPE_BOOL,
 	    "enable_aim", SYSCTL_DESCR("Interrupt Moderation"),
-	    NULL, 0, &ixv_enable_aim, 0, CTL_CREATE, CTL_EOL) != 0)
+	    NULL, 0, &adapter->enable_aim, 0, CTL_CREATE, CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 }
 

Reply via email to