Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips Remove unmaintained CNMAC_DEBUG debug code.



details:   https://anonhg.NetBSD.org/src/rev/031c56418a48
branches:  trunk
changeset: 973147:031c56418a48
user:      simonb <simonb%NetBSD.org@localhost>
date:      Mon Jun 22 02:26:19 2020 +0000

description:
Remove unmaintained CNMAC_DEBUG debug code.

diffstat:

 sys/arch/mips/cavium/dev/if_cnmac.c      |  166 +------
 sys/arch/mips/cavium/dev/if_cnmacvar.h   |   39 +-
 sys/arch/mips/cavium/dev/octeon_asx.c    |  138 +------
 sys/arch/mips/cavium/dev/octeon_asxvar.h |    7 +-
 sys/arch/mips/cavium/dev/octeon_ciu.c    |   91 +----
 sys/arch/mips/cavium/dev/octeon_fpa.c    |  237 +-----------
 sys/arch/mips/cavium/dev/octeon_fpavar.h |    6 +-
 sys/arch/mips/cavium/dev/octeon_gmx.c    |  487 +-----------------------
 sys/arch/mips/cavium/dev/octeon_gmxvar.h |   36 +-
 sys/arch/mips/cavium/dev/octeon_ipd.c    |  191 +---------
 sys/arch/mips/cavium/dev/octeon_ipdvar.h |   30 +-
 sys/arch/mips/cavium/dev/octeon_pci.c    |   57 +--
 sys/arch/mips/cavium/dev/octeon_pip.c    |  191 +---------
 sys/arch/mips/cavium/dev/octeon_pipvar.h |   21 +-
 sys/arch/mips/cavium/dev/octeon_pko.c    |   79 +---
 sys/arch/mips/cavium/dev/octeon_pkovar.h |    7 +-
 sys/arch/mips/cavium/dev/octeon_pow.c    |  650 +------------------------------
 sys/arch/mips/cavium/dev/octeon_powvar.h |   21 +-
 sys/arch/mips/cavium/octeonvar.h         |   45 +--
 sys/arch/mips/conf/files.octeon          |    5 +-
 20 files changed, 70 insertions(+), 2434 deletions(-)

diffs (truncated from 3356 to 300 lines):

diff -r 450cb8c5431d -r 031c56418a48 sys/arch/mips/cavium/dev/if_cnmac.c
--- a/sys/arch/mips/cavium/dev/if_cnmac.c       Mon Jun 22 01:04:26 2020 +0000
+++ b/sys/arch/mips/cavium/dev/if_cnmac.c       Mon Jun 22 02:26:19 2020 +0000
@@ -1,24 +1,12 @@
-/*     $NetBSD: if_cnmac.c,v 1.22 2020/06/18 13:52:08 simonb Exp $     */
+/*     $NetBSD: if_cnmac.c,v 1.23 2020/06/22 02:26:19 simonb Exp $     */
 
 #include <sys/cdefs.h>
 #if 0
-__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.22 2020/06/18 13:52:08 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.23 2020/06/22 02:26:19 simonb Exp $");
 #endif
 
 #include "opt_octeon.h"
 
-#ifdef CNMAC_DEBUG
-
-#ifndef DIAGNOSTIC
-#define        DIAGNOSTIC
-#endif
-
-#ifndef DEBUG
-#define        DEBUG
-#endif
-
-#endif
-
 /*
  * If no free send buffer is available, free all the sent buffers and bail out.
  */
@@ -83,14 +71,6 @@
 #include <mips/cavium/dev/octeon_smivar.h>
 #include <mips/cavium/dev/if_cnmacvar.h>
 
-#ifdef CNMAC_DEBUG
-#define        CNMAC_KASSERT(x)        KASSERT(x)
-#define        CNMAC_KDASSERT(x)       KDASSERT(x)
-#else
-#define        CNMAC_KASSERT(x)
-#define        CNMAC_KDASSERT(x)
-#endif
-
 /*
  * Set the PKO to think command buffers are an odd length.  This makes it so we
  * never have to divide a comamnd across two buffers.
@@ -183,46 +163,6 @@
 CFATTACH_DECL_NEW(cnmac, sizeof(struct cnmac_softc),
     cnmac_match, cnmac_attach, NULL, NULL);
 
-#ifdef CNMAC_DEBUG
-
-static const struct octeon_evcnt_entry octeon_evcnt_entries[] = {
-#define        _ENTRY(name, type, parent, descr) \
-       OCTEON_EVCNT_ENTRY(struct cnmac_softc, name, type, parent, descr)
-       _ENTRY(rx,                      MISC, NULL, "rx"),
-       _ENTRY(rxint,                   INTR, NULL, "rx intr"),
-       _ENTRY(rxrs,                    MISC, NULL, "rx dynamic short"),
-       _ENTRY(rxbufpkalloc,            MISC, NULL, "rx buf pkt alloc"),
-       _ENTRY(rxbufpkput,              MISC, NULL, "rx buf pkt put"),
-       _ENTRY(rxbufwqalloc,            MISC, NULL, "rx buf wqe alloc"),
-       _ENTRY(rxbufwqput,              MISC, NULL, "rx buf wqe put"),
-       _ENTRY(rxerrcode,               MISC, NULL, "rx code error"),
-       _ENTRY(rxerrfix,                MISC, NULL, "rx fixup error"),
-       _ENTRY(rxerrjmb,                MISC, NULL, "rx jmb error"),
-       _ENTRY(rxerrlink,               MISC, NULL, "rx link error"),
-       _ENTRY(rxerroff,                MISC, NULL, "rx offload error"),
-       _ENTRY(rxonperrshort,           MISC, NULL, "rx onp fixup short error"),
-       _ENTRY(rxonperrpreamble,        MISC, NULL, "rx onp fixup preamble error"),
-       _ENTRY(rxonperrcrc,             MISC, NULL, "rx onp fixup crc error"),
-       _ENTRY(rxonperraddress,         MISC, NULL, "rx onp fixup address error"),
-       _ENTRY(rxonponp,                MISC, NULL, "rx onp fixup onp packets"),
-       _ENTRY(rxonpok,                 MISC, NULL, "rx onp fixup success packets"),
-       _ENTRY(tx,                      MISC, NULL, "tx"),
-       _ENTRY(txadd,                   MISC, NULL, "tx add"),
-       _ENTRY(txbufcballoc,            MISC, NULL, "tx buf cb alloc"),
-       _ENTRY(txbufcbget,              MISC, NULL, "tx buf cb get"),
-       _ENTRY(txbufgballoc,            MISC, NULL, "tx buf gb alloc"),
-       _ENTRY(txbufgbget,              MISC, NULL, "tx buf gb get"),
-       _ENTRY(txbufgbput,              MISC, NULL, "tx buf gb put"),
-       _ENTRY(txdel,                   MISC, NULL, "tx del"),
-       _ENTRY(txerr,                   MISC, NULL, "tx error"),
-       _ENTRY(txerrcmd,                MISC, NULL, "tx cmd error"),
-       _ENTRY(txerrgbuf,               MISC, NULL, "tx gbuf error"),
-       _ENTRY(txerrlink,               MISC, NULL, "tx link error"),
-       _ENTRY(txerrmkcmd,              MISC, NULL, "tx makecmd error"),
-#undef _ENTRY
-};
-#endif
-
 /* ---- buffer management */
 
 static const struct cnmac_pool_param {
@@ -384,9 +324,6 @@
        sc->sc_rate_recv_fixup_odd_nibble_short_cap.tv_sec = 1;
        sc->sc_rate_recv_fixup_odd_nibble_preamble_cap.tv_sec = 1;
        sc->sc_rate_recv_fixup_odd_nibble_crc_cap.tv_sec = 1;
-#ifdef CNMAC_DEBUG
-       sc->sc_rate_recv_fixup_odd_nibble_addr_cap.tv_sec = 1;
-#endif
        /* XXX */
 
 #if 1
@@ -398,9 +335,6 @@
                    = octpow_intr_establish(OCTEON_POW_GROUP_PIP,
                        IPL_NET, cnmac_recv_intr, NULL, NULL);
 
-       OCTEON_EVCNT_ATTACH_EVCNTS(sc, octeon_evcnt_entries,
-           device_xname(sc->sc_dev));
-
        dict = device_properties(sc->sc_gmx->sc_dev);
 
        clk = prop_dictionary_get(dict, "rgmii-tx");
@@ -598,7 +532,8 @@
 static inline void
 cnmac_send_queue_flush_prefetch(struct cnmac_softc *sc)
 {
-       CNMAC_KASSERT(sc->sc_prefetch == 0);
+
+       KASSERT(sc->sc_prefetch == 0);
        octfau_op_inc_fetch_8(&sc->sc_fau_done, 0);
        sc->sc_prefetch = 1;
 }
@@ -606,13 +541,10 @@
 static inline void
 cnmac_send_queue_flush_fetch(struct cnmac_softc *sc)
 {
-#ifndef         CNMAC_DEBUG
-       if (!sc->sc_prefetch)
-               return;
-#endif
-       CNMAC_KASSERT(sc->sc_prefetch == 1);
+
+       KASSERT(sc->sc_prefetch == 1);
        sc->sc_hard_done_cnt = octfau_op_inc_read_8(&sc->sc_fau_done);
-       CNMAC_KASSERT(sc->sc_hard_done_cnt <= 0);
+       KASSERT(sc->sc_hard_done_cnt <= 0);
        sc->sc_prefetch = 0;
 }
 
@@ -623,8 +555,8 @@
        const int64_t sent_count = sc->sc_hard_done_cnt;
        int i;
 
-       CNMAC_KASSERT(sc->sc_flush == 0);
-       CNMAC_KASSERT(sent_count <= 0);
+       KASSERT(sc->sc_flush == 0);
+       KASSERT(sent_count <= 0);
 
        for (i = 0; i < 0 - sent_count; i++) {
                struct mbuf *m;
@@ -633,7 +565,6 @@
                cnmac_send_queue_del(sc, &m, &gbuf);
 
                octfpa_buf_put(cnmac_fb_sg, gbuf);
-               OCTEON_EVCNT_INC(sc, txbufgbput);
 
                m_freem(m);
 
@@ -650,12 +581,12 @@
        if (sc->sc_flush == 0)
                return;
 
-       CNMAC_KASSERT(sc->sc_flush > 0);
+       KASSERT(sc->sc_flush > 0);
 
        /* XXX XXX XXX */
        octfau_op_inc_read_8(&sc->sc_fau_done);
        sc->sc_soft_req_cnt -= sc->sc_flush;
-       CNMAC_KASSERT(sc->sc_soft_req_cnt >= 0);
+       KASSERT(sc->sc_soft_req_cnt >= 0);
        /* XXX XXX XXX */
 
        sc->sc_flush = 0;
@@ -671,7 +602,6 @@
 
        if (__predict_false(nofree_cnt == GATHER_QUEUE_SIZE - 1)) {
                cnmac_send_queue_flush(sc);
-               OCTEON_EVCNT_INC(sc, txerrgbuf);
                cnmac_send_queue_flush_sync(sc);
                return 1;
        }
@@ -712,8 +642,6 @@
 
        if ((m->m_flags & M_EXT) && m->m_ext.ext_free != NULL)
                sc->sc_ext_callback_cnt++;
-
-       OCTEON_EVCNT_INC(sc, txadd);
 }
 
 static inline void
@@ -722,7 +650,7 @@
        struct _send_queue_entry *sqe;
 
        sqe = SIMPLEQ_FIRST(&sc->sc_sendq);
-       CNMAC_KASSERT(sqe != NULL);
+       KASSERT(sqe != NULL);
        SIMPLEQ_REMOVE_HEAD(&sc->sc_sendq, _sqe_entry);
 
        *rm = (void *)sqe;
@@ -730,10 +658,8 @@
 
        if (((*rm)->m_flags & M_EXT) && (*rm)->m_ext.ext_free != NULL) {
                sc->sc_ext_callback_cnt--;
-               CNMAC_KASSERT(sc->sc_ext_callback_cnt >= 0);
+               KASSERT(sc->sc_ext_callback_cnt >= 0);
        }
-
-       OCTEON_EVCNT_INC(sc, txdel);
 }
 
 static inline int
@@ -748,11 +674,9 @@
                start_buffer = addr & ~(2048 - 1);
 
                octfpa_buf_put_paddr(cnmac_fb_pkt, start_buffer);
-               OCTEON_EVCNT_INC(sc, rxbufpkput);
        }
 
        octfpa_buf_put(cnmac_fb_wqe, work);
-       OCTEON_EVCNT_INC(sc, rxbufwqput);
 
        return 0;
 }
@@ -761,17 +685,11 @@
 cnmac_buf_ext_free_m(struct mbuf *m, void *buf, size_t size, void *arg)
 {
        uint64_t *work = (void *)arg;
-#ifdef CNMAC_DEBUG
-       struct cnmac_softc *sc = (void *)(uintptr_t)work[0];
-#endif
        int s = splnet();
 
-       OCTEON_EVCNT_INC(sc, rxrs);
+       octfpa_buf_put(cnmac_fb_wqe, work);
 
-       octfpa_buf_put(cnmac_fb_wqe, work);
-       OCTEON_EVCNT_INC(sc, rxbufwqput);
-
-       CNMAC_KASSERT(m != NULL);
+       KASSERT(m != NULL);
 
        pool_cache_put(mb_cache, m);
 
@@ -782,18 +700,13 @@
 cnmac_buf_ext_free_ext(struct mbuf *m, void *buf, size_t size, void *arg)
 {
        uint64_t *work = (void *)arg;
-#ifdef CNMAC_DEBUG
-       struct cnmac_softc *sc = (void *)(uintptr_t)work[0];
-#endif
        int s = splnet();
 
        octfpa_buf_put(cnmac_fb_wqe, work);
-       OCTEON_EVCNT_INC(sc, rxbufwqput);
 
        octfpa_buf_put(cnmac_fb_pkt, buf);
-       OCTEON_EVCNT_INC(sc, rxbufpkput);
 
-       CNMAC_KASSERT(m != NULL);
+       KASSERT(m != NULL);
 
        pool_cache_put(mb_cache, m);
 
@@ -886,7 +799,7 @@
                        continue;
 
 #if 0
-               CNMAC_KASSERT(((uint32_t)m->m_data & (PAGE_SIZE - 1))
+               KASSERT(((uint32_t)m->m_data & (PAGE_SIZE - 1))
                   == (kvtophys((vaddr_t)m->m_data) & (PAGE_SIZE - 1)));
 #endif
 
@@ -917,7 +830,7 @@
                }
        }
 
-       CNMAC_KASSERT(m == NULL);
+       KASSERT(m == NULL);
 
        *rsegs = segs;
 
@@ -984,12 +897,12 @@
 #endif
        cmdptr += sc->sc_cmdptr.cmdptr_idx;
 
-       CNMAC_KASSERT(cmdptr != NULL);
+       KASSERT(cmdptr != NULL);
 
        *cmdptr++ = pko_cmd_w0;
        *cmdptr++ = pko_cmd_w1;
 
-       CNMAC_KASSERT(sc->sc_cmdptr.cmdptr_idx + 2 <= FPA_COMMAND_BUFFER_POOL_NWORDS - 1);
+       KASSERT(sc->sc_cmdptr.cmdptr_idx + 2 <= FPA_COMMAND_BUFFER_POOL_NWORDS - 1);
 
        if (sc->sc_cmdptr.cmdptr_idx + 2 == FPA_COMMAND_BUFFER_POOL_NWORDS - 1) {
                paddr_t buf;
@@ -1002,7 +915,6 @@
                        result = 1;
                        goto done;
                }



Home | Main Index | Thread Index | Old Index