Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Change the Interrupt Moderation flag from ...



details:   https://anonhg.NetBSD.org/src/rev/7684bf2ccc1f
branches:  trunk
changeset: 821589:7684bf2ccc1f
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Feb 10 08:41:13 2017 +0000

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

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  13 +++++--------
 sys/dev/pci/ixgbe/ixv.c   |  16 ++++++++--------
 2 files changed, 13 insertions(+), 16 deletions(-)

diffs (102 lines):

diff -r 8930ae1671e4 -r 7684bf2ccc1f sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 10 06:35:22 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 10 08:41:13 2017 +0000
@@ -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 @@
 ** 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 @@
 
        /* 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_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,
diff -r 8930ae1671e4 -r 7684bf2ccc1f sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Fri Feb 10 06:35:22 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Fri Feb 10 08:41:13 2017 +0000
@@ -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 @@
 ** 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 @@
                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 @@
 
        /* 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_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");
 }
 



Home | Main Index | Thread Index | Old Index