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 Now we can use multiqueue. It's default on...



details:   https://anonhg.NetBSD.org/src/rev/cce7edc086b6
branches:  trunk
changeset: 820988:cce7edc086b6
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Jan 18 10:22:09 2017 +0000

description:
Now we can use multiqueue. It's default on ixg(4). Not yet for ixv(4).

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c       |  17 +++++++++--------
 sys/dev/pci/ixgbe/ixgbe_osdep.h |  12 +++---------
 sys/dev/pci/ixgbe/ixv.c         |  24 ++++++++++++++++--------
 3 files changed, 28 insertions(+), 25 deletions(-)

diffs (137 lines):

diff -r 508e4d7e231e -r cce7edc086b6 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Jan 18 10:18:40 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Jan 18 10:22:09 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.61 2017/01/18 10:18:40 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.62 2017/01/18 10:22:09 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -337,7 +337,7 @@
  * number of cpus with a max of 8. This
  * can be overriden manually here.
  */
-static int ixgbe_num_queues = 1;
+static int ixgbe_num_queues = 0;
 SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0,
     "Number of queues to configure, 0 indicates autoconfigure");
 
@@ -2702,19 +2702,19 @@
                aprint_normal_dev(dev, "for TX/RX, interrupting at %s",
                    intrstr);
                if (error == 0) {
-#ifdef IXGBE_DEBUG
+#if 1 /* def IXGBE_DEBUG */
 #ifdef RSS
                        aprintf_normal(
-                           ", bound RSS bucket %d to CPU %d\n",
+                           ", bound RSS bucket %d to CPU %d",
                            i, cpu_id);
 #else
                        aprint_normal(
-                           ", bound queue %d to cpu %d\n",
+                           ", bound queue %d to cpu %d",
                            i, cpu_id);
 #endif
 #endif /* IXGBE_DEBUG */
-               } else
-                       aprint_normal("\n");
+               }
+               aprint_normal("\n");
 #ifndef IXGBE_LEGACY_TX
                txr->txq_si = softint_establish(SOFTINT_NET,
                    ixgbe_deferred_mq_start, txr);
@@ -2795,7 +2795,8 @@
 
        /* First try MSI/X */
        msgs = pci_msix_count(adapter->osdep.pc, adapter->osdep.tag);
-       if (msgs < IXG_MSIX_NINTR)
+       msgs = MIN(msgs, IXG_MAX_NINTR);
+       if (msgs < 2)
                goto msi;
 
        adapter->msix_mem = (void *)1; /* XXX */
diff -r 508e4d7e231e -r cce7edc086b6 sys/dev/pci/ixgbe/ixgbe_osdep.h
--- a/sys/dev/pci/ixgbe/ixgbe_osdep.h   Wed Jan 18 10:18:40 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_osdep.h   Wed Jan 18 10:22:09 2017 +0000
@@ -31,7 +31,7 @@
 
 ******************************************************************************/
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 294734 2016-01-25 16:18:53Z smh $*/
-/*$NetBSD: ixgbe_osdep.h,v 1.16 2016/12/05 10:05:11 msaitoh Exp $*/
+/*$NetBSD: ixgbe_osdep.h,v 1.17 2017/01/18 10:22:09 msaitoh Exp $*/
 
 #ifndef _IXGBE_OS_H_
 #define _IXGBE_OS_H_
@@ -149,14 +149,8 @@
 
 #define le16_to_cpu 
 
-/*
- * This device driver divides interrupt to TX, RX and link state.
- * Each MSI-X vector indexes are below.
- */
-#define IXG_MSIX_NINTR         2
-#define IXG_MSIX_TXRXINTR_IDX  0
-#define IXG_MSIX_LINKINTR_IDX  1
-#define IXG_MAX_NINTR          IXG_MSIX_NINTR
+/* This device driver's max interrupt numbers. */
+#define IXG_MAX_NINTR          64
 
 #if __FreeBSD_version < 800000
 #if defined(__i386__) || defined(__amd64__)
diff -r 508e4d7e231e -r cce7edc086b6 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Wed Jan 18 10:18:40 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Wed Jan 18 10:22:09 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.31 2017/01/05 05:53:23 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.32 2017/01/18 10:22:09 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1348,7 +1348,7 @@
        tag = adapter->osdep.tag;
 
        if (pci_msix_alloc_exact(pa,
-               &adapter->osdep.intrs, IXG_MSIX_NINTR) != 0)
+               &adapter->osdep.intrs, IXG_MAX_NINTR) != 0)
                return (ENXIO);
 
        kcpuset_create(&affinity, false);
@@ -1457,16 +1457,24 @@
        device_t dev = adapter->dev;
        int want, msgs;
 
-       /*
-       ** Want two vectors: one for a queue,
-       ** plus an additional for mailbox.
-       */
+       /* Must have at least 2 MSIX vectors */
        msgs = pci_msix_count(adapter->osdep.pc, adapter->osdep.tag);
-       if (msgs < IXG_MSIX_NINTR) {
+       if (msgs < 2) {
                aprint_error_dev(dev,"MSIX config error\n");
                return (ENXIO);
        }
-       want = MIN(msgs, IXG_MSIX_NINTR);
+       msgs = MIN(msgs, IXG_MAX_NINTR);
+
+       /*
+       ** Want vectors for the queues,
+       ** plus an additional for mailbox.
+       */
+       want = adapter->num_queues + 1;
+       if (want > msgs) {
+               want = msgs;
+               adapter->num_queues = msgs - 1;
+       } else
+               msgs = want;
 
        adapter->msix_mem = (void *)1; /* XXX */
        aprint_normal_dev(dev,



Home | Main Index | Thread Index | Old Index