Source-Changes-HG archive

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

[src/trunk]: src Add support SIOCZIFDATA as ixgbe.c.



details:   https://anonhg.NetBSD.org/src/rev/fa7aa1efcdf2
branches:  trunk
changeset: 459333:fa7aa1efcdf2
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Sep 05 10:01:30 2019 +0000

description:
Add support SIOCZIFDATA as ixgbe.c.

BUGS
     The following event counters are not cleared by SIOCZIFDATA because the
     corresponding registers are read only and not cleared on read:

           Good Packets Received
           Good Octets Received
           Multicast Packets Received
           Good Packets Transmitted
           Good Octets Transmitted

diffstat:

 share/man/man4/ixv.4    |  21 +++++++++++-
 sys/dev/pci/ixgbe/ixv.c |  78 ++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 96 insertions(+), 3 deletions(-)

diffs (145 lines):

diff -r bf9566cb7065 -r fa7aa1efcdf2 share/man/man4/ixv.4
--- a/share/man/man4/ixv.4      Thu Sep 05 09:20:05 2019 +0000
+++ b/share/man/man4/ixv.4      Thu Sep 05 10:01:30 2019 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ixv.4,v 1.4 2019/07/18 03:52:26 msaitoh Exp $
+.\"    $NetBSD: ixv.4,v 1.5 2019/09/05 10:01:30 msaitoh Exp $
 .\"
 .\" Copyright (c) 2018 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 18, 2019
+.Dd September 5, 2019
 .Dt IXV 4
 .Os
 .Sh NAME
@@ -61,3 +61,20 @@
 .Nm
 driver was written by
 .An Intel Corporation Aq Mt freebsdnic%mailbox.intel.com@localhost .
+.Sh BUGS
+The following event counters are not cleared by
+.Dv SIOCZIFDATA
+because the corresponding registers are read only and not cleared on read:
+.Pp
+.Bl -item -offset indent -compact
+.It
+Good Packets Received
+.It
+Good Octets Received
+.It
+Multicast Packets Received
+.It
+Good Packets Transmitted
+.It
+Good Octets Transmitted
+.El
diff -r bf9566cb7065 -r fa7aa1efcdf2 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Thu Sep 05 09:20:05 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Thu Sep 05 10:01:30 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.130 2019/09/04 10:34:04 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.131 2019/09/05 10:01:30 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -131,6 +131,7 @@
 static void    ixv_init_stats(struct adapter *);
 static void    ixv_update_stats(struct adapter *);
 static void    ixv_add_stats_sysctls(struct adapter *);
+static void    ixv_clear_evcnt(struct adapter *);
 
 /* Sysctl handlers */
 static void    ixv_set_sysctl_value(struct adapter *, const char *,
@@ -2630,6 +2631,76 @@
 
 } /* ixv_add_stats_sysctls */
 
+static void
+ixv_clear_evcnt(struct adapter *adapter)
+{
+       struct tx_ring          *txr = adapter->tx_rings;
+       struct rx_ring          *rxr = adapter->rx_rings;
+       struct ixgbevf_hw_stats *stats = &adapter->stats.vf;
+       struct ixgbe_hw *hw = &adapter->hw;
+       int i;
+
+       /* Driver Statistics */
+       adapter->efbig_tx_dma_setup.ev_count = 0;
+       adapter->mbuf_defrag_failed.ev_count = 0;
+       adapter->efbig2_tx_dma_setup.ev_count = 0;
+       adapter->einval_tx_dma_setup.ev_count = 0;
+       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->watchdog_events.ev_count = 0;
+       adapter->tso_err.ev_count = 0;
+       adapter->link_irq.ev_count = 0;
+
+       for (i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
+               adapter->queues[i].irqs.ev_count = 0;
+               adapter->queues[i].handleq.ev_count = 0;
+               adapter->queues[i].req.ev_count = 0;
+               txr->tso_tx.ev_count = 0;
+               txr->no_desc_avail.ev_count = 0;
+               txr->total_packets.ev_count = 0;
+#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;
+
+               rxr->rx_packets.ev_count = 0;
+               rxr->rx_bytes.ev_count = 0;
+               rxr->rx_copies.ev_count = 0;
+               rxr->no_jmbuf.ev_count = 0;
+               rxr->rx_discarded.ev_count = 0;
+       }
+
+       /* MAC stats get their own sub node */
+
+       stats->ipcs.ev_count = 0;
+       stats->l4cs.ev_count = 0;
+       stats->ipcs_bad.ev_count = 0;
+       stats->l4cs_bad.ev_count = 0;
+
+       /* Packet Reception Stats */
+       stats->vfgprc.ev_count = 0;
+       stats->vfgorc.ev_count = 0;
+       stats->vfmprc.ev_count = 0;
+       stats->vfgptc.ev_count = 0;
+       stats->vfgotc.ev_count = 0;
+
+       /* Mailbox Stats */
+       hw->mbx.stats.msgs_tx.ev_count = 0;
+       hw->mbx.stats.msgs_rx.ev_count = 0;
+       hw->mbx.stats.acks.ev_count = 0;
+       hw->mbx.stats.reqs.ev_count = 0;
+       hw->mbx.stats.rsts.ev_count = 0;
+
+} /* ixv_clear_evcnt */
+
 /************************************************************************
  * ixv_set_sysctl_value
  ************************************************************************/
@@ -2863,6 +2934,11 @@
        case SIOCSIFMTU:
                IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)");
                break;
+       case SIOCZIFDATA:
+               IOCTL_DEBUGOUT("ioctl: SIOCZIFDATA (Zero counter)");
+               ixv_update_stats(adapter);
+               ixv_clear_evcnt(adapter);
+               break;
        default:
                IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)", (int)command);
                break;



Home | Main Index | Thread Index | Old Index