Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev/pci/ixgbe Pull up following revision(s) (requeste...
details: https://anonhg.NetBSD.org/src/rev/3458b8917e46
branches: netbsd-8
changeset: 434733:3458b8917e46
user: martin <martin%NetBSD.org@localhost>
date: Tue Mar 13 14:59:06 2018 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #626):
sys/dev/pci/ixgbe/ixgbe.c: revision 1.134
sys/dev/pci/ixgbe/ixgbe.h: revision 1.35
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.35
sys/dev/pci/ixgbe/ixv.c: revision 1.87
Make some event counters MP safe. Now all of the event counters are
MP safe.
diffstat:
sys/dev/pci/ixgbe/ix_txrx.c | 16 ++++++++--------
sys/dev/pci/ixgbe/ixgbe.c | 43 +++++++++++++++++++++++++++++++++++++++----
sys/dev/pci/ixgbe/ixgbe.h | 20 +++++++++++++++-----
sys/dev/pci/ixgbe/ixv.c | 31 +++++++++++++++++++++++++++++--
4 files changed, 91 insertions(+), 19 deletions(-)
diffs (250 lines):
diff -r 53f8f767f677 -r 3458b8917e46 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c Tue Mar 13 14:54:52 2018 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c Tue Mar 13 14:59:06 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.6 2018/03/06 11:12:40 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.7 2018/03/13 14:59:06 martin Exp $ */
/******************************************************************************
@@ -392,10 +392,10 @@
switch (error) {
case EAGAIN:
- adapter->eagain_tx_dma_setup.ev_count++;
+ txr->q_eagain_tx_dma_setup++;
return EAGAIN;
case ENOMEM:
- adapter->enomem_tx_dma_setup.ev_count++;
+ txr->q_enomem_tx_dma_setup++;
return EAGAIN;
case EFBIG:
/* Try it again? - one try */
@@ -405,23 +405,23 @@
* XXX: m_defrag will choke on
* non-MCLBYTES-sized clusters
*/
- adapter->efbig_tx_dma_setup.ev_count++;
+ txr->q_efbig_tx_dma_setup++;
m = m_defrag(m_head, M_NOWAIT);
if (m == NULL) {
- adapter->mbuf_defrag_failed.ev_count++;
+ txr->q_mbuf_defrag_failed++;
return ENOBUFS;
}
m_head = m;
goto retry;
} else {
- adapter->efbig2_tx_dma_setup.ev_count++;
+ txr->q_efbig2_tx_dma_setup++;
return error;
}
case EINVAL:
- adapter->einval_tx_dma_setup.ev_count++;
+ txr->q_einval_tx_dma_setup++;
return error;
default:
- adapter->other_tx_dma_setup.ev_count++;
+ txr->q_other_tx_dma_setup++;
return error;
}
}
diff -r 53f8f767f677 -r 3458b8917e46 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Tue Mar 13 14:54:52 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Tue Mar 13 14:59:06 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.13 2018/03/08 12:31:25 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.14 2018/03/13 14:59:06 martin Exp $ */
/******************************************************************************
@@ -1980,8 +1980,8 @@
adapter->other_tx_dma_setup.ev_count = 0;
adapter->eagain_tx_dma_setup.ev_count = 0;
adapter->enomem_tx_dma_setup.ev_count = 0;
+ adapter->tso_err.ev_count = 0;
adapter->watchdog_events.ev_count = 0;
- adapter->tso_err.ev_count = 0;
adapter->link_irq.ev_count = 0;
txr = adapter->tx_rings;
@@ -1995,6 +1995,14 @@
#ifndef IXGBE_LEGACY_TX
txr->pcq_drops.ev_count = 0;
#endif
+ txr->q_efbig_tx_dma_setup = 0;
+ txr->q_mbuf_defrag_failed = 0;
+ txr->q_efbig2_tx_dma_setup = 0;
+ txr->q_einval_tx_dma_setup = 0;
+ txr->q_other_tx_dma_setup = 0;
+ txr->q_eagain_tx_dma_setup = 0;
+ txr->q_enomem_tx_dma_setup = 0;
+ txr->q_tso_err = 0;
if (i < __arraycount(stats->mpc)) {
stats->mpc[i].ev_count = 0;
@@ -4190,7 +4198,9 @@
device_t dev = adapter->dev;
struct ix_queue *que = adapter->queues;
u64 queues = 0;
+ u64 v0, v1, v2, v3, v4, v5, v6, v7;
int hung = 0;
+ int i;
KASSERT(mutex_owned(&adapter->core_mtx));
@@ -4202,12 +4212,37 @@
ixgbe_update_link_status(adapter);
ixgbe_update_stats_counters(adapter);
+ /* Update some event counters */
+ v0 = v1 = v2 = v3 = v4 = v5 = v6 = v7 = 0;
+ que = adapter->queues;
+ for (i = 0; i < adapter->num_queues; i++, que++) {
+ struct tx_ring *txr = que->txr;
+
+ v0 += txr->q_efbig_tx_dma_setup;
+ v1 += txr->q_mbuf_defrag_failed;
+ v2 += txr->q_efbig2_tx_dma_setup;
+ v3 += txr->q_einval_tx_dma_setup;
+ v4 += txr->q_other_tx_dma_setup;
+ v5 += txr->q_eagain_tx_dma_setup;
+ v6 += txr->q_enomem_tx_dma_setup;
+ v7 += txr->q_tso_err;
+ }
+ adapter->efbig_tx_dma_setup.ev_count = v0;
+ adapter->mbuf_defrag_failed.ev_count = v1;
+ adapter->efbig2_tx_dma_setup.ev_count = v2;
+ adapter->einval_tx_dma_setup.ev_count = v3;
+ adapter->other_tx_dma_setup.ev_count = v4;
+ adapter->eagain_tx_dma_setup.ev_count = v5;
+ adapter->enomem_tx_dma_setup.ev_count = v6;
+ adapter->tso_err.ev_count = v7;
+
/*
* Check the TX queues status
* - mark hung queues so we don't schedule on them
* - watchdog only if all queues show hung
*/
- for (int i = 0; i < adapter->num_queues; i++, que++) {
+ que = adapter->queues;
+ for (i = 0; i < adapter->num_queues; i++, que++) {
/* Keep track of queues with work for soft irq */
if (que->txr->busy)
queues |= ((u64)1 << que->me);
@@ -4239,7 +4274,7 @@
goto watchdog;
else if (queues != 0) { /* Force an IRQ on queues with work */
que = adapter->queues;
- for (int i = 0; i < adapter->num_queues; i++, que++) {
+ for (i = 0; i < adapter->num_queues; i++, que++) {
mutex_enter(&que->im_mtx);
if (que->im_nest == 0)
ixgbe_rearm_queues(adapter,
diff -r 53f8f767f677 -r 3458b8917e46 sys/dev/pci/ixgbe/ixgbe.h
--- a/sys/dev/pci/ixgbe/ixgbe.h Tue Mar 13 14:54:52 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.h Tue Mar 13 14:59:06 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.24.6.6 2018/03/08 12:31:25 martin Exp $ */
+/* $NetBSD: ixgbe.h,v 1.24.6.7 2018/03/13 14:59:06 martin Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -334,9 +334,10 @@
struct rx_ring *rxr;
struct work wq_cookie;
void *que_si;
- struct evcnt irqs;
- struct evcnt handleq;
- struct evcnt req;
+ /* Per queue event conters */
+ struct evcnt irqs; /* Hardware interrupt */
+ struct evcnt handleq; /* software_interrupt */
+ struct evcnt req; /* deferred */
char namebuf[32];
char evnamebuf[32];
@@ -378,6 +379,15 @@
struct evcnt no_desc_avail;
struct evcnt total_packets;
struct evcnt pcq_drops;
+ /* Per queue conters. The adapter total is in struct adapter */
+ u64 q_efbig_tx_dma_setup;
+ u64 q_mbuf_defrag_failed;
+ u64 q_efbig2_tx_dma_setup;
+ u64 q_einval_tx_dma_setup;
+ u64 q_other_tx_dma_setup;
+ u64 q_eagain_tx_dma_setup;
+ u64 q_enomem_tx_dma_setup;
+ u64 q_tso_err;
};
@@ -558,8 +568,8 @@
void (*stop_locked)(void *);
/* Misc stats maintained by the driver */
+ struct evcnt efbig_tx_dma_setup;
struct evcnt mbuf_defrag_failed;
- struct evcnt efbig_tx_dma_setup;
struct evcnt efbig2_tx_dma_setup;
struct evcnt einval_tx_dma_setup;
struct evcnt other_tx_dma_setup;
diff -r 53f8f767f677 -r 3458b8917e46 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c Tue Mar 13 14:54:52 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c Tue Mar 13 14:59:06 2018 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.56.2.10 2018/03/08 12:31:25 martin Exp $*/
+/*$NetBSD: ixv.c,v 1.56.2.11 2018/03/13 14:59:06 martin Exp $*/
/******************************************************************************
@@ -1201,7 +1201,9 @@
device_t dev = adapter->dev;
struct ix_queue *que = adapter->queues;
u64 queues = 0;
+ u64 v0, v1, v2, v3, v4, v5, v6, v7;
int hung = 0;
+ int i;
KASSERT(mutex_owned(&adapter->core_mtx));
@@ -1210,12 +1212,37 @@
/* Stats Update */
ixv_update_stats(adapter);
+ /* Update some event counters */
+ v0 = v1 = v2 = v3 = v4 = v5 = v6 = v7 = 0;
+ que = adapter->queues;
+ for (i = 0; i < adapter->num_queues; i++, que++) {
+ struct tx_ring *txr = que->txr;
+
+ v0 += txr->q_efbig_tx_dma_setup;
+ v1 += txr->q_mbuf_defrag_failed;
+ v2 += txr->q_efbig2_tx_dma_setup;
+ v3 += txr->q_einval_tx_dma_setup;
+ v4 += txr->q_other_tx_dma_setup;
+ v5 += txr->q_eagain_tx_dma_setup;
+ v6 += txr->q_enomem_tx_dma_setup;
+ v7 += txr->q_tso_err;
+ }
+ adapter->efbig_tx_dma_setup.ev_count = v0;
+ adapter->mbuf_defrag_failed.ev_count = v1;
+ adapter->efbig2_tx_dma_setup.ev_count = v2;
+ adapter->einval_tx_dma_setup.ev_count = v3;
+ adapter->other_tx_dma_setup.ev_count = v4;
+ adapter->eagain_tx_dma_setup.ev_count = v5;
+ adapter->enomem_tx_dma_setup.ev_count = v6;
+ adapter->tso_err.ev_count = v7;
+
/*
* Check the TX queues status
* - mark hung queues so we don't schedule on them
* - watchdog only if all queues show hung
*/
- for (int i = 0; i < adapter->num_queues; i++, que++) {
+ que = adapter->queues;
+ for (i = 0; i < adapter->num_queues; i++, que++) {
/* Keep track of queues with work for soft irq */
if (que->txr->busy)
queues |= ((u64)1 << que->me);
Home |
Main Index |
Thread Index |
Old Index