Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 2016 22:46:52 +0000 (UTC)
From:      David C Somayajulu <davidcs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r295830 - head/sys/dev/bxe
Message-ID:  <201602192246.u1JMkqjp066478@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidcs
Date: Fri Feb 19 22:46:52 2016
New Revision: 295830
URL: https://svnweb.freebsd.org/changeset/base/295830

Log:
  Remove dead code. Code Cleanup. Improve clarity in debug messages
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h
  head/sys/dev/bxe/bxe_stats.c
  head/sys/dev/bxe/ecore_init.h

Modified: head/sys/dev/bxe/bxe.c
==============================================================================
--- head/sys/dev/bxe/bxe.c	Fri Feb 19 22:45:09 2016	(r295829)
+++ head/sys/dev/bxe/bxe.c	Fri Feb 19 22:46:52 2016	(r295830)
@@ -124,14 +124,6 @@ static struct bxe_device_type bxe_devs[]
         PCI_ANY_ID, PCI_ANY_ID,
         "QLogic NetXtreme II BCM57712 MF 10GbE"
     },
-#if 0
-    {
-        BRCM_VENDORID,
-        CHIP_NUM_57712_VF,
-        PCI_ANY_ID, PCI_ANY_ID,
-        "QLogic NetXtreme II BCM57712 VF 10GbE"
-    },
-#endif
     {
         BRCM_VENDORID,
         CHIP_NUM_57800,
@@ -144,14 +136,6 @@ static struct bxe_device_type bxe_devs[]
         PCI_ANY_ID, PCI_ANY_ID,
         "QLogic NetXtreme II BCM57800 MF 10GbE"
     },
-#if 0
-    {
-        BRCM_VENDORID,
-        CHIP_NUM_57800_VF,
-        PCI_ANY_ID, PCI_ANY_ID,
-        "QLogic NetXtreme II BCM57800 VF 10GbE"
-    },
-#endif
     {
         BRCM_VENDORID,
         CHIP_NUM_57810,
@@ -164,14 +148,6 @@ static struct bxe_device_type bxe_devs[]
         PCI_ANY_ID, PCI_ANY_ID,
         "QLogic NetXtreme II BCM57810 MF 10GbE"
     },
-#if 0
-    {
-        BRCM_VENDORID,
-        CHIP_NUM_57810_VF,
-        PCI_ANY_ID, PCI_ANY_ID,
-        "QLogic NetXtreme II BCM57810 VF 10GbE"
-    },
-#endif
     {
         BRCM_VENDORID,
         CHIP_NUM_57811,
@@ -184,42 +160,18 @@ static struct bxe_device_type bxe_devs[]
         PCI_ANY_ID, PCI_ANY_ID,
         "QLogic NetXtreme II BCM57811 MF 10GbE"
     },
-#if 0
-    {
-        BRCM_VENDORID,
-        CHIP_NUM_57811_VF,
-        PCI_ANY_ID, PCI_ANY_ID,
-        "QLogic NetXtreme II BCM57811 VF 10GbE"
-    },
-#endif
     {
         BRCM_VENDORID,
         CHIP_NUM_57840_4_10,
         PCI_ANY_ID, PCI_ANY_ID,
         "QLogic NetXtreme II BCM57840 4x10GbE"
     },
-#if 0
-    {
-        BRCM_VENDORID,
-        CHIP_NUM_57840_2_20,
-        PCI_ANY_ID, PCI_ANY_ID,
-        "QLogic NetXtreme II BCM57840 2x20GbE"
-    },
-#endif
     {
         BRCM_VENDORID,
         CHIP_NUM_57840_MF,
         PCI_ANY_ID, PCI_ANY_ID,
         "QLogic NetXtreme II BCM57840 MF 10GbE"
     },
-#if 0
-    {
-        BRCM_VENDORID,
-        CHIP_NUM_57840_VF,
-        PCI_ANY_ID, PCI_ANY_ID,
-        "QLogic NetXtreme II BCM57840 VF 10GbE"
-    },
-#endif
     {
         0, 0, 0, 0, NULL
     }
@@ -245,10 +197,6 @@ static device_method_t bxe_methods[] = {
     DEVMETHOD(device_attach,    bxe_attach),
     DEVMETHOD(device_detach,    bxe_detach),
     DEVMETHOD(device_shutdown,  bxe_shutdown),
-#if 0
-    DEVMETHOD(device_suspend,   bxe_suspend),
-    DEVMETHOD(device_resume,    bxe_resume),
-#endif
     /* Bus interface (bus_if.h) */
     DEVMETHOD(bus_print_child,  bus_generic_print_child),
     DEVMETHOD(bus_driver_added, bus_generic_driver_added),
@@ -458,12 +406,6 @@ static const struct {
                 8, STATS_FLAGS_FUNC, "tpa_aggregated_frames"},
     { STATS_OFFSET32(total_tpa_bytes_hi),
                 8, STATS_FLAGS_FUNC, "tpa_bytes"},
-#if 0
-    { STATS_OFFSET32(recoverable_error),
-                4, STATS_FLAGS_FUNC, "recoverable_errors" },
-    { STATS_OFFSET32(unrecoverable_error),
-                4, STATS_FLAGS_FUNC, "unrecoverable_errors" },
-#endif
     { STATS_OFFSET32(eee_tx_lpi),
                 4, STATS_FLAGS_PORT, "eee_tx_lpi"},
     { STATS_OFFSET32(rx_calls),
@@ -516,12 +458,6 @@ static const struct {
                 4, STATS_FLAGS_FUNC, "tx_window_violation_std"},
     { STATS_OFFSET32(tx_window_violation_tso),
                 4, STATS_FLAGS_FUNC, "tx_window_violation_tso"},
-#if 0
-    { STATS_OFFSET32(tx_unsupported_tso_request_ipv6),
-                4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_ipv6"},
-    { STATS_OFFSET32(tx_unsupported_tso_request_not_tcp),
-                4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_not_tcp"},
-#endif
     { STATS_OFFSET32(tx_chain_lost_mbuf),
                 4, STATS_FLAGS_FUNC, "tx_chain_lost_mbuf"},
     { STATS_OFFSET32(tx_frames_deferred),
@@ -633,12 +569,6 @@ static const struct {
                 4, "tx_window_violation_std"},
     { Q_STATS_OFFSET32(tx_window_violation_tso),
                 4, "tx_window_violation_tso"},
-#if 0
-    { Q_STATS_OFFSET32(tx_unsupported_tso_request_ipv6),
-                4, "tx_unsupported_tso_request_ipv6"},
-    { Q_STATS_OFFSET32(tx_unsupported_tso_request_not_tcp),
-                4, "tx_unsupported_tso_request_not_tcp"},
-#endif
     { Q_STATS_OFFSET32(tx_chain_lost_mbuf),
                 4, "tx_chain_lost_mbuf"},
     { Q_STATS_OFFSET32(tx_frames_deferred),
@@ -906,12 +836,6 @@ bxe_dma_map_addr(void *arg, bus_dma_segm
     } else {
         dma->paddr = segs->ds_addr;
         dma->nseg  = nseg;
-#if 0
-        BLOGD(dma->sc, DBG_LOAD,
-              "DMA alloc '%s': vaddr=%p paddr=%p nseg=%d size=%lu\n",
-              dma->msg, dma->vaddr, (void *)dma->paddr,
-              dma->nseg, dma->size);
-#endif
     }
 }
 
@@ -996,13 +920,6 @@ bxe_dma_free(struct bxe_softc *sc,
              struct bxe_dma   *dma)
 {
     if (dma->size > 0) {
-#if 0
-        BLOGD(sc, DBG_LOAD,
-              "DMA free '%s': vaddr=%p paddr=%p nseg=%d size=%lu\n",
-              dma->msg, dma->vaddr, (void *)dma->paddr,
-              dma->nseg, dma->size);
-#endif
-
         DBASSERT(sc, (dma->tag != NULL), ("dma tag is NULL"));
 
         bus_dmamap_sync(dma->tag, dma->map,
@@ -1043,69 +960,6 @@ bxe_reg_rd_ind(struct bxe_softc *sc,
     return (val);
 }
 
-#if 0
-void bxe_dp_dmae(struct bxe_softc *sc, struct dmae_command *dmae, int msglvl)
-{
-    uint32_t src_type = dmae->opcode & DMAE_COMMAND_SRC;
-
-    switch (dmae->opcode & DMAE_COMMAND_DST) {
-    case DMAE_CMD_DST_PCI:
-        if (src_type == DMAE_CMD_SRC_PCI)
-            DP(msglvl, "DMAE: opcode 0x%08x\n"
-               "src [%x:%08x], len [%d*4], dst [%x:%08x]\n"
-               "comp_addr [%x:%08x], comp_val 0x%08x\n",
-               dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo,
-               dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo,
-               dmae->comp_addr_hi, dmae->comp_addr_lo,
-               dmae->comp_val);
-        else
-            DP(msglvl, "DMAE: opcode 0x%08x\n"
-               "src [%08x], len [%d*4], dst [%x:%08x]\n"
-               "comp_addr [%x:%08x], comp_val 0x%08x\n",
-               dmae->opcode, dmae->src_addr_lo >> 2,
-               dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo,
-               dmae->comp_addr_hi, dmae->comp_addr_lo,
-               dmae->comp_val);
-        break;
-    case DMAE_CMD_DST_GRC:
-        if (src_type == DMAE_CMD_SRC_PCI)
-            DP(msglvl, "DMAE: opcode 0x%08x\n"
-               "src [%x:%08x], len [%d*4], dst_addr [%08x]\n"
-               "comp_addr [%x:%08x], comp_val 0x%08x\n",
-               dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo,
-               dmae->len, dmae->dst_addr_lo >> 2,
-               dmae->comp_addr_hi, dmae->comp_addr_lo,
-               dmae->comp_val);
-        else
-            DP(msglvl, "DMAE: opcode 0x%08x\n"
-               "src [%08x], len [%d*4], dst [%08x]\n"
-               "comp_addr [%x:%08x], comp_val 0x%08x\n",
-               dmae->opcode, dmae->src_addr_lo >> 2,
-               dmae->len, dmae->dst_addr_lo >> 2,
-               dmae->comp_addr_hi, dmae->comp_addr_lo,
-               dmae->comp_val);
-        break;
-    default:
-        if (src_type == DMAE_CMD_SRC_PCI)
-            DP(msglvl, "DMAE: opcode 0x%08x\n"
-               "src_addr [%x:%08x]  len [%d * 4]  dst_addr [none]\n"
-               "comp_addr [%x:%08x]  comp_val 0x%08x\n",
-               dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo,
-               dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo,
-               dmae->comp_val);
-        else
-            DP(msglvl, "DMAE: opcode 0x%08x\n"
-               "src_addr [%08x]  len [%d * 4]  dst_addr [none]\n"
-               "comp_addr [%x:%08x]  comp_val 0x%08x\n",
-               dmae->opcode, dmae->src_addr_lo >> 2,
-               dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo,
-               dmae->comp_val);
-        break;
-    }
-
-}
-#endif
-
 static int
 bxe_acquire_hw_lock(struct bxe_softc *sc,
                     uint32_t         resource)
@@ -1118,7 +972,8 @@ bxe_acquire_hw_lock(struct bxe_softc *sc
 
     /* validate the resource is within range */
     if (resource > HW_LOCK_MAX_RESOURCE_VALUE) {
-        BLOGE(sc, "resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE\n", resource);
+        BLOGE(sc, "(resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE)"
+            " resource_bit 0x%x\n", resource, resource_bit);
         return (-1);
     }
 
@@ -1132,8 +987,8 @@ bxe_acquire_hw_lock(struct bxe_softc *sc
     /* validate the resource is not already taken */
     lock_status = REG_RD(sc, hw_lock_control_reg);
     if (lock_status & resource_bit) {
-        BLOGE(sc, "resource in use (status 0x%x bit 0x%x)\n",
-              lock_status, resource_bit);
+        BLOGE(sc, "resource (0x%x) in use (status 0x%x bit 0x%x)\n",
+              resource, lock_status, resource_bit);
         return (-1);
     }
 
@@ -1147,7 +1002,8 @@ bxe_acquire_hw_lock(struct bxe_softc *sc
         DELAY(5000);
     }
 
-    BLOGE(sc, "Resource lock timeout!\n");
+    BLOGE(sc, "Resource 0x%x resource_bit 0x%x lock timeout!\n",
+        resource, resource_bit);
     return (-1);
 }
 
@@ -1162,7 +1018,8 @@ bxe_release_hw_lock(struct bxe_softc *sc
 
     /* validate the resource is within range */
     if (resource > HW_LOCK_MAX_RESOURCE_VALUE) {
-        BLOGE(sc, "resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE\n", resource);
+        BLOGE(sc, "(resource 0x%x > HW_LOCK_MAX_RESOURCE_VALUE)"
+            " resource_bit 0x%x\n", resource, resource_bit);
         return (-1);
     }
 
@@ -1176,8 +1033,8 @@ bxe_release_hw_lock(struct bxe_softc *sc
     /* validate the resource is currently taken */
     lock_status = REG_RD(sc, hw_lock_control_reg);
     if (!(lock_status & resource_bit)) {
-        BLOGE(sc, "resource not in use (status 0x%x bit 0x%x)\n",
-              lock_status, resource_bit);
+        BLOGE(sc, "resource (0x%x) not in use (status 0x%x bit 0x%x)\n",
+              resource, lock_status, resource_bit);
         return (-1);
     }
 
@@ -1239,7 +1096,9 @@ bxe_acquire_nvram_lock(struct bxe_softc 
     }
 
     if (!(val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port))) {
-        BLOGE(sc, "Cannot get access to nvram interface\n");
+        BLOGE(sc, "Cannot get access to nvram interface "
+            "port %d val 0x%x (MCPR_NVM_SW_ARB_ARB_ARB1 << port)\n",
+            port, val);
         return (-1);
     }
 
@@ -1273,7 +1132,9 @@ bxe_release_nvram_lock(struct bxe_softc 
     }
 
     if (val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port)) {
-        BLOGE(sc, "Cannot free access to nvram interface\n");
+        BLOGE(sc, "Cannot free access to nvram interface "
+            "port %d val 0x%x (MCPR_NVM_SW_ARB_ARB_ARB1 << port)\n",
+            port, val);
         return (-1);
     }
 
@@ -1356,7 +1217,9 @@ bxe_nvram_read_dword(struct bxe_softc *s
     }
 
     if (rc == -1) {
-        BLOGE(sc, "nvram read timeout expired\n");
+        BLOGE(sc, "nvram read timeout expired "
+            "(offset 0x%x cmd_flags 0x%x val 0x%x)\n",
+            offset, cmd_flags, val);
     }
 
     return (rc);
@@ -1462,7 +1325,9 @@ bxe_nvram_write_dword(struct bxe_softc *
     }
 
     if (rc == -1) {
-        BLOGE(sc, "nvram write timeout expired\n");
+        BLOGE(sc, "nvram write timeout expired "
+            "(offset 0x%x cmd_flags 0x%x val 0x%x)\n",
+            offset, cmd_flags, val);
     }
 
     return (rc);
@@ -1696,7 +1561,8 @@ bxe_issue_dmae_with_comp(struct bxe_soft
         if (!timeout ||
             (sc->recovery_state != BXE_RECOVERY_DONE &&
              sc->recovery_state != BXE_RECOVERY_NIC_LOADING)) {
-            BLOGE(sc, "DMAE timeout!\n");
+            BLOGE(sc, "DMAE timeout! *wb_comp 0x%x recovery_state 0x%x\n",
+                *wb_comp, sc->recovery_state);
             BXE_DMAE_UNLOCK(sc);
             return (DMAE_TIMEOUT);
         }
@@ -1706,7 +1572,8 @@ bxe_issue_dmae_with_comp(struct bxe_soft
     }
 
     if (*wb_comp & DMAE_PCI_ERR_FLAG) {
-        BLOGE(sc, "DMAE PCI error!\n");
+        BLOGE(sc, "DMAE PCI error! *wb_comp 0x%x recovery_state 0x%x\n",
+                *wb_comp, sc->recovery_state);
         BXE_DMAE_UNLOCK(sc);
         return (DMAE_PCI_ERROR);
     }
@@ -1941,12 +1808,6 @@ elink_cb_event_log(struct bxe_softc     
                    ...)
 {
     /* XXX */
-#if 0
-    //va_list ap;
-    va_start(ap, elink_log_id);
-    _XXX_(sc, lm_log_id, ap);
-    va_end(ap);
-#endif
     BLOGI(sc, "ELINK EVENT LOG (%d)\n", elink_log_id);
 }
 
@@ -1959,7 +1820,7 @@ bxe_set_spio(struct bxe_softc *sc,
 
     /* Only 2 SPIOs are configurable */
     if ((spio != MISC_SPIO_SPIO4) && (spio != MISC_SPIO_SPIO5)) {
-        BLOGE(sc, "Invalid SPIO 0x%x\n", spio);
+        BLOGE(sc, "Invalid SPIO 0x%x mode 0x%x\n", spio, mode);
         return (-1);
     }
 
@@ -2013,7 +1874,9 @@ bxe_gpio_read(struct bxe_softc *sc,
     uint32_t gpio_reg;
 
     if (gpio_num > MISC_REGISTERS_GPIO_3) {
-        BLOGE(sc, "Invalid GPIO %d\n", gpio_num);
+        BLOGE(sc, "Invalid GPIO %d port 0x%x gpio_port %d gpio_shift %d"
+            " gpio_mask 0x%x\n", gpio_num, port, gpio_port, gpio_shift,
+            gpio_mask);
         return (-1);
     }
 
@@ -2039,7 +1902,9 @@ bxe_gpio_write(struct bxe_softc *sc,
     uint32_t gpio_reg;
 
     if (gpio_num > MISC_REGISTERS_GPIO_3) {
-        BLOGE(sc, "Invalid GPIO %d\n", gpio_num);
+        BLOGE(sc, "Invalid GPIO %d mode 0x%x port 0x%x gpio_port %d"
+            " gpio_shift %d gpio_mask 0x%x\n",
+            gpio_num, mode, port, gpio_port, gpio_shift, gpio_mask);
         return (-1);
     }
 
@@ -2122,7 +1987,8 @@ bxe_gpio_mult_write(struct bxe_softc *sc
         break;
 
     default:
-        BLOGE(sc, "Invalid GPIO mode assignment %d\n", mode);
+        BLOGE(sc, "Invalid GPIO mode assignment pins 0x%x mode 0x%x"
+            " gpio_reg 0x%x\n", pins, mode, gpio_reg);
         bxe_release_hw_lock(sc, HW_LOCK_RESOURCE_GPIO);
         return (-1);
     }
@@ -2148,7 +2014,9 @@ bxe_gpio_int_write(struct bxe_softc *sc,
     uint32_t gpio_reg;
 
     if (gpio_num > MISC_REGISTERS_GPIO_3) {
-        BLOGE(sc, "Invalid GPIO %d\n", gpio_num);
+        BLOGE(sc, "Invalid GPIO %d mode 0x%x port 0x%x gpio_port %d"
+            " gpio_shift %d gpio_mask 0x%x\n",
+            gpio_num, mode, port, gpio_port, gpio_shift, gpio_mask);
         return (-1);
     }
 
@@ -2567,29 +2435,6 @@ bxe_sp_post(struct bxe_softc *sc,
  * @sc: driver hanlde
  * @p:  pointer to rss configuration
  */
-#if 0
-static void
-bxe_debug_print_ind_table(struct bxe_softc               *sc,
-                          struct ecore_config_rss_params *p)
-{
-    int i;
-
-    BLOGD(sc, DBG_LOAD, "Setting indirection table to:\n");
-    BLOGD(sc, DBG_LOAD, "    0x0000: ");
-    for (i = 0; i < T_ETH_INDIRECTION_TABLE_SIZE; i++) {
-        BLOGD(sc, DBG_LOAD, "0x%02x ", p->ind_table[i]);
-
-        /* Print 4 bytes in a line */
-        if ((i + 1 < T_ETH_INDIRECTION_TABLE_SIZE) &&
-            (((i + 1) & 0x3) == 0)) {
-            BLOGD(sc, DBG_LOAD, "\n");
-            BLOGD(sc, DBG_LOAD, "0x%04x: ", i + 1);
-        }
-    }
-
-    BLOGD(sc, DBG_LOAD, "\n");
-}
-#endif
 
 /*
  * FreeBSD Device probe function.
@@ -2764,13 +2609,6 @@ bxe_tx_avail(struct bxe_softc *sc,
 
     used = SUB_S16(prod, cons);
 
-#if 0
-    KASSERT((used < 0), ("used tx bds < 0"));
-    KASSERT((used > sc->tx_ring_size), ("used tx bds > tx_ring_size"));
-    KASSERT(((sc->tx_ring_size - used) > MAX_TX_AVAIL),
-            ("invalid number of tx bds used"));
-#endif
-
     return (int16_t)(sc->tx_ring_size) - used;
 }
 
@@ -2816,16 +2654,6 @@ bxe_sp_event(struct bxe_softc    *sc,
     BLOGD(sc, DBG_SP, "fp=%d cid=%d got ramrod #%d state is %x type is %d\n",
           fp->index, cid, command, sc->state, rr_cqe->ramrod_cqe.ramrod_type);
 
-#if 0
-    /*
-     * If cid is within VF range, replace the slowpath object with the
-     * one corresponding to this VF
-     */
-    if ((cid >= BXE_FIRST_VF_CID) && (cid < BXE_FIRST_VF_CID + BXE_VF_CIDS)) {
-        bxe_iov_set_queue_sp_obj(sc, cid, &q_obj);
-    }
-#endif
-
     switch (command) {
     case (RAMROD_CMD_ID_ETH_CLIENT_UPDATE):
         BLOGD(sc, DBG_SP, "got UPDATE ramrod. CID %d\n", cid);
@@ -2877,34 +2705,10 @@ bxe_sp_event(struct bxe_softc    *sc,
         return;
     }
 
-#if 0
-    /* SRIOV: reschedule any 'in_progress' operations */
-    bxe_iov_sp_event(sc, cid, TRUE);
-#endif
-
     atomic_add_acq_long(&sc->cq_spq_left, 1);
 
     BLOGD(sc, DBG_SP, "sc->cq_spq_left 0x%lx\n",
           atomic_load_acq_long(&sc->cq_spq_left));
-
-#if 0
-    if ((drv_cmd == ECORE_Q_CMD_UPDATE) && (IS_FCOE_FP(fp)) &&
-        (!!bxe_test_bit(ECORE_AFEX_FCOE_Q_UPDATE_PENDING, &sc->sp_state))) {
-        /*
-         * If Queue update ramrod is completed for last Queue in AFEX VIF set
-         * flow, then ACK MCP at the end. Mark pending ACK to MCP bit to
-         * prevent case that both bits are cleared. At the end of load/unload
-         * driver checks that sp_state is cleared and this order prevents
-         * races.
-         */
-        bxe_set_bit(ECORE_AFEX_PENDING_VIFSET_MCP_ACK, &sc->sp_state);
-        wmb();
-        bxe_clear_bit(ECORE_AFEX_FCOE_Q_UPDATE_PENDING, &sc->sp_state);
-
-        /* schedule the sp task as MCP ack is required */
-        bxe_schedule_sp_task(sc);
-    }
-#endif
 }
 
 /*
@@ -2945,8 +2749,15 @@ bxe_tpa_start(struct bxe_softc          
     tmp_bd = tpa_info->bd;
 
     if (tmp_bd.m == NULL) {
-        BLOGE(sc, "fp[%02d].tpa[%02d] mbuf not allocated!\n",
-              fp->index, queue);
+        uint32_t *tmp;
+
+        tmp = (uint32_t *)cqe;
+
+        BLOGE(sc, "fp[%02d].tpa[%02d] cons[%d] prod[%d]mbuf not allocated!\n",
+              fp->index, queue, cons, prod);
+        BLOGE(sc, "cqe [0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x]\n",
+            *tmp, *(tmp+1), *(tmp+2), *(tmp+3), *(tmp+4), *(tmp+5), *(tmp+6), *(tmp+7)); 
+            
         /* XXX Error handling? */
         return;
     }
@@ -3027,10 +2838,17 @@ bxe_fill_frag_mbuf(struct bxe_softc     
 
     /* make sure the aggregated frame is not too big to handle */
     if (pages > 8 * PAGES_PER_SGE) {
+
+        uint32_t *tmp = (uint32_t *)cqe;
+
         BLOGE(sc, "fp[%02d].sge[0x%04x] has too many pages (%d)! "
                   "pkt_len=%d len_on_bd=%d frag_size=%d\n",
               fp->index, cqe_idx, pages, le16toh(cqe->pkt_len),
               tpa_info->len_on_bd, frag_size);
+
+        BLOGE(sc, "cqe [0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x]\n",
+            *tmp, *(tmp+1), *(tmp+2), *(tmp+3), *(tmp+4), *(tmp+5), *(tmp+6), *(tmp+7)); 
+
         bxe_panic(sc, ("sge page count error\n"));
         return (EINVAL);
     }
@@ -3391,15 +3209,6 @@ bxe_rxeof(struct bxe_softc    *sc,
             uint16_t frag_size, pages;
             uint8_t queue;
 
-#if 0
-            /* sanity check */
-            if (!fp->tpa_enable &&
-                (CQE_TYPE_START(cqe_fp_type) || CQE_TYPE_STOP(cqe_fp_type))) {
-                BLOGE(sc, "START/STOP packet while !tpa_enable type (0x%x)\n",
-                      CQE_TYPE(cqe_fp_type));
-            }
-#endif
-
             if (CQE_TYPE_START(cqe_fp_type)) {
                 bxe_tpa_start(sc, fp, cqe_fp->queue_index,
                               bd_cons, bd_prod, cqe_fp);
@@ -3605,44 +3414,8 @@ bxe_free_tx_pkt(struct bxe_softc    *sc,
     tx_start_bd = &fp->tx_chain[bd_idx].start_bd;
     nbd = le16toh(tx_start_bd->nbd) - 1;
 
-#if 0
-    if ((nbd - 1) > (MAX_MBUF_FRAGS + 2)) {
-        bxe_panic(sc, ("BAD nbd!\n"));
-    }
-#endif
-
     new_cons = (tx_buf->first_bd + nbd);
 
-#if 0
-    struct eth_tx_bd *tx_data_bd;
-
-    /*
-     * The following code doesn't do anything but is left here
-     * for clarity on what the new value of new_cons skipped.
-     */
-
-    /* get the next bd */
-    bd_idx = TX_BD(TX_BD_NEXT(bd_idx));
-
-    /* skip the parse bd */
-    --nbd;
-    bd_idx = TX_BD(TX_BD_NEXT(bd_idx));
-
-    /* skip the TSO split header bd since they have no mapping */
-    if (tx_buf->flags & BXE_TSO_SPLIT_BD) {
-        --nbd;
-        bd_idx = TX_BD(TX_BD_NEXT(bd_idx));
-    }
-
-    /* now free frags */
-    while (nbd > 0) {
-        tx_data_bd = &fp->tx_chain[bd_idx].reg_bd;
-        if (--nbd) {
-            bd_idx = TX_BD(TX_BD_NEXT(bd_idx));
-        }
-    }
-#endif
-
     /* free the mbuf */
     if (__predict_true(tx_buf->m != NULL)) {
         m_freem(tx_buf->m);
@@ -3787,7 +3560,8 @@ bxe_del_all_macs(struct bxe_softc       
 
     rc = mac_obj->delete_all(sc, mac_obj, &vlan_mac_flags, &ramrod_flags);
     if (rc < 0) {
-        BLOGE(sc, "Failed to delete MACs (%d)\n", rc);
+        BLOGE(sc, "Failed to delete MACs (%d) mac_type %d wait_for_comp 0x%x\n",
+            rc, mac_type, wait_for_comp);
     }
 
     return (rc);
@@ -3859,7 +3633,7 @@ bxe_fill_accept_flags(struct bxe_softc *
         break;
 
     default:
-        BLOGE(sc, "Unknown rx_mode (%d)\n", rx_mode);
+        BLOGE(sc, "Unknown rx_mode (0x%x)\n", rx_mode);
         return (-1);
     }
 
@@ -3907,7 +3681,11 @@ bxe_set_q_rx_mode(struct bxe_softc *sc,
 
     rc = ecore_config_rx_mode(sc, &ramrod_param);
     if (rc < 0) {
-        BLOGE(sc, "Set rx_mode %d failed\n", sc->rx_mode);
+        BLOGE(sc, "Set rx_mode %d cli_id 0x%x rx_mode_flags 0x%x "
+            "rx_accept_flags 0x%x tx_accept_flags 0x%x "
+            "ramrod_flags 0x%x rc %d failed\n", sc->rx_mode, cl_id,
+            (uint32_t)rx_mode_flags, (uint32_t)rx_accept_flags,
+            (uint32_t)tx_accept_flags, (uint32_t)ramrod_flags, rc);
         return (rc);
     }
 
@@ -3990,52 +3768,11 @@ bxe_send_unload_req(struct bxe_softc *sc
                     int              unload_mode)
 {
     uint32_t reset_code = 0;
-#if 0
-    int port = SC_PORT(sc);
-    int path = SC_PATH(sc);
-#endif
 
     /* Select the UNLOAD request mode */
     if (unload_mode == UNLOAD_NORMAL) {
         reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
-    }
-#if 0
-    else if (sc->flags & BXE_NO_WOL_FLAG) {
-        reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP;
-    } else if (sc->wol) {
-        uint32_t emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
-        uint8_t *mac_addr = sc->dev->dev_addr;
-        uint32_t val;
-        uint16_t pmc;
-
-        /*
-         * The mac address is written to entries 1-4 to
-         * preserve entry 0 which is used by the PMF
-         */
-        uint8_t entry = (SC_VN(sc) + 1)*8;
-
-        val = (mac_addr[0] << 8) | mac_addr[1];
-        EMAC_WR(sc, EMAC_REG_EMAC_MAC_MATCH + entry, val);
-
-        val = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
-              (mac_addr[4] << 8) | mac_addr[5];
-        EMAC_WR(sc, EMAC_REG_EMAC_MAC_MATCH + entry + 4, val);
-
-        /* Enable the PME and clear the status */
-        pmc = pci_read_config(sc->dev,
-                              (sc->devinfo.pcie_pm_cap_reg +
-                               PCIR_POWER_STATUS),
-                              2);
-        pmc |= PCIM_PSTAT_PMEENABLE | PCIM_PSTAT_PME;
-        pci_write_config(sc->dev,
-                         (sc->devinfo.pcie_pm_cap_reg +
-                          PCIR_POWER_STATUS),
-                         pmc, 4);
-
-        reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_EN;
-    }
-#endif
-    else {
+    } else {
         reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
     }
 
@@ -4210,7 +3947,7 @@ bxe_func_stop(struct bxe_softc *sc)
     rc = ecore_func_state_change(sc, &func_params);
     if (rc) {
         BLOGE(sc, "FUNC_STOP ramrod failed. "
-                  "Running a dry transaction\n");
+                  "Running a dry transaction (%d)\n", rc);
         bxe_set_bit(RAMROD_DRV_CLR_ONLY, &func_params.ramrod_flags);
         return (ecore_func_state_change(sc, &func_params));
     }
@@ -4321,7 +4058,7 @@ bxe_chip_cleanup(struct bxe_softc *sc,
      */
     rc = bxe_func_wait_started(sc);
     if (rc) {
-        BLOGE(sc, "bxe_func_wait_started failed\n");
+        BLOGE(sc, "bxe_func_wait_started failed (%d)\n", rc);
     }
 
     /*
@@ -4339,14 +4076,14 @@ bxe_chip_cleanup(struct bxe_softc *sc,
      * very wrong has happen.
      */
     if (!bxe_wait_sp_comp(sc, ~0x0UL)) {
-        BLOGE(sc, "Common slow path ramrods got stuck!\n");
+        BLOGE(sc, "Common slow path ramrods got stuck!(%d)\n", rc);
     }
 
 unload_error:
 
     rc = bxe_func_stop(sc);
     if (rc) {
-        BLOGE(sc, "Function stop failed!\n");
+        BLOGE(sc, "Function stop failed!(%d)\n", rc);
     }
 
     /* disable HW interrupts */
@@ -4358,7 +4095,7 @@ unload_error:
     /* Reset the chip */
     rc = bxe_reset_hw(sc, reset_code);
     if (rc) {
-        BLOGE(sc, "Hardware reset failed\n");
+        BLOGE(sc, "Hardware reset failed(%d)\n", rc);
     }
 
     /* Report UNLOAD_DONE to MCP */
@@ -4484,7 +4221,8 @@ bxe_nic_unload(struct bxe_softc *sc,
         mb();
 
         BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n");
-        BLOGE(sc, "Can't unload in closed or error state\n");
+        BLOGE(sc, "Can't unload in closed or error state recover_state 0x%x"
+            " state = 0x%x\n", sc->recovery_state, sc->state);
         return (-1);
     }
 
@@ -4691,7 +4429,8 @@ bxe_ioctl_nvram(struct bxe_softc *sc,
         if ((nvdata = (struct bxe_nvram_data *)
                  malloc(len, M_DEVBUF,
                         (M_NOWAIT | M_ZERO))) == NULL) {
-            BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed\n");
+            BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x "
+                " len = 0x%x\n", priv_op, len);
             return (1);
         }
         memcpy(nvdata, &nvdata_base, sizeof(struct bxe_nvram_data));
@@ -5387,11 +5126,6 @@ bxe_set_pbd_lso_e2(struct mbuf *m,
                       ETH_TX_PARSE_BD_E2_LSO_MSS);
 
     /* XXX test for IPv6 with extension header... */
-#if 0
-    struct ip6_hdr *ip6;
-    if (ip6 && ip6->ip6_nxt == 'some ipv6 extension header')
-        *parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR;
-#endif
 }
 
 static void
@@ -5652,17 +5386,6 @@ bxe_tx_encap_continue:
         } else {
             /* used by FW for packet accounting */
             tx_start_bd->vlan_or_ethertype = htole16(fp->tx_pkt_prod);
-#if 0
-            /*
-             * If NPAR-SD is active then FW should do the tagging regardless
-             * of value of priority. Otherwise, if priority indicates this is
-             * a control packet we need to indicate to FW to avoid tagging.
-             */
-            if (!IS_MF_AFEX(sc) && (mbuf priority == PRIO_CONTROL)) {
-                SET_FLAG(tx_start_bd->general_data,
-                         ETH_TX_START_BD_FORCE_VLAN_MODE, 1);
-            }
-#endif
         }
     }
 
@@ -5702,25 +5425,6 @@ bxe_tx_encap_continue:
             hlen = bxe_set_pbd_csum_e2(fp, m0, &pbd_e2_parsing_data);
         }
 
-#if 0
-        /*
-         * Add the MACs to the parsing BD if the module param was
-         * explicitly set, if this is a vf, or in switch independent
-         * mode.
-         */
-        if (sc->flags & BXE_TX_SWITCHING || IS_VF(sc) || IS_MF_SI(sc)) {
-            eh = mtod(m0, struct ether_vlan_header *);
-            bxe_set_fw_mac_addr(&pbd_e2->data.mac_addr.src_hi,
-                                &pbd_e2->data.mac_addr.src_mid,
-                                &pbd_e2->data.mac_addr.src_lo,
-                                eh->evl_shost);
-            bxe_set_fw_mac_addr(&pbd_e2->data.mac_addr.dst_hi,
-                                &pbd_e2->data.mac_addr.dst_mid,
-                                &pbd_e2->data.mac_addr.dst_lo,
-                                eh->evl_dhost);
-        }
-#endif
-
         SET_FLAG(pbd_e2_parsing_data, ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE,
                  mac_type);
     } else {
@@ -6347,13 +6051,6 @@ bxe_free_mem(struct bxe_softc *sc)
 {
     int i;
 
-#if 0
-    if (!CONFIGURE_NIC_MODE(sc)) {
-        /* free searcher T2 table */
-        bxe_dma_free(sc, &sc->t2);
-    }
-#endif
-
     for (i = 0; i < L2_ILT_LINES(sc); i++) {
         bxe_dma_free(sc, &sc->context[i].vcxt_dma);
         sc->context[i].vcxt = NULL;
@@ -6364,9 +6061,6 @@ bxe_free_mem(struct bxe_softc *sc)
 
     bxe_free_ilt_lines_mem(sc);
 
-#if 0
-    bxe_iov_free_mem(sc);
-#endif
 }
 
 static int
@@ -6376,16 +6070,6 @@ bxe_alloc_mem(struct bxe_softc *sc)
     int allocated;
     int i;
 
-#if 0
-    if (!CONFIGURE_NIC_MODE(sc)) {
-        /* allocate searcher T2 table */
-        if (bxe_dma_alloc(sc, SRC_T2_SZ,
-                          &sc->t2, "searcher t2 table") != 0) {
-            return (-1);
-        }
-    }
-#endif
-
     /*
      * Allocate memory for CDU context:
      * This memory is allocated separately and not in the generic ILT
@@ -6440,14 +6124,6 @@ bxe_alloc_mem(struct bxe_softc *sc)
         return (-1);
     }
 
-#if 0
-    if (bxe_iov_alloc_mem(sc)) {
-        BLOGE(sc, "Failed to allocate memory for SRIOV\n");
-        bxe_free_mem(sc);
-        return (-1);
-    }
-#endif
-
     return (0);
 }
 
@@ -8325,27 +8001,9 @@ bxe_attn_int_deasserted3(struct bxe_soft
             if (val & DRV_STATUS_DRV_INFO_REQ)
                 bxe_handle_drv_info_req(sc);
 
-#if 0
-            if (val & DRV_STATUS_VF_DISABLED)
-                bxe_vf_handle_flr_event(sc);
-#endif
-
             if ((sc->port.pmf == 0) && (val & DRV_STATUS_PMF))
                 bxe_pmf_update(sc);
 
-#if 0
-            if (sc->port.pmf &&
-                (val & DRV_STATUS_DCBX_NEGOTIATION_RESULTS) &&
-                (sc->dcbx_enabled > 0))
-                /* start dcbx state machine */
-                bxe_dcbx_set_params(sc, BXE_DCBX_STATE_NEG_RECEIVED);
-#endif
-
-#if 0
-            if (val & DRV_STATUS_AFEX_EVENT_MASK)
-                bxe_handle_afex_cmd(sc, val & DRV_STATUS_AFEX_EVENT_MASK);
-#endif
-
             if (val & DRV_STATUS_EEE_NEGOTIATION_RESULTS)
                 bxe_handle_eee_event(sc);
 
@@ -8746,8 +8404,7 @@ bxe_handle_mcast_eqe(struct bxe_softc *s
         rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_CONT);
         if (rc < 0) {
             BLOGD(sc, DBG_SP,
-                  "ERROR: Failed to send pending mcast commands (%d)\n",
-                  rc);
+                "ERROR: Failed to send pending mcast commands (%d)\n", rc);
         }
     }
 
@@ -8807,16 +8464,6 @@ bxe_handle_rx_mode_eqe(struct bxe_softc 
                                &sc->sp_state)) {
         bxe_set_storm_rx_mode(sc);
     }
-#if 0
-    else if (bxe_test_and_clear_bit(ECORE_FILTER_ISCSI_ETH_START_SCHED,
-                                    &sc->sp_state)) {
-        bxe_set_iscsi_eth_rx_mode(sc, TRUE);
-    }
-    else if (bxe_test_and_clear_bit(ECORE_FILTER_ISCSI_ETH_STOP_SCHED,
-                                    &sc->sp_state)) {
-        bxe_set_iscsi_eth_rx_mode(sc, FALSE);
-    }
-#endif
 }
 
 static void
@@ -8868,27 +8515,12 @@ bxe_eq_int(struct bxe_softc *sc)
 
         elem = &sc->eq[EQ_DESC(sw_cons)];
 
-#if 0
-        int rc;
-        rc = bxe_iov_eq_sp_event(sc, elem);
-        if (!rc) {
-            BLOGE(sc, "bxe_iov_eq_sp_event returned %d\n", rc);
-            goto next_spqe;
-        }
-#endif
-
         /* elem CID originates from FW, actually LE */
         cid = SW_CID(elem->message.data.cfc_del_event.cid);
         opcode = elem->message.opcode;
 
         /* handle eq element */
         switch (opcode) {
-#if 0
-        case EVENT_RING_OPCODE_VF_PF_CHANNEL:
-            BLOGD(sc, DBG_SP, "vf/pf channel element on eq\n");
-            bxe_vf_mbx(sc, &elem->message.data.vf_pf_event);
-            continue;
-#endif
 
         case EVENT_RING_OPCODE_STAT_QUERY:
             BLOGD(sc, DBG_SP, "got statistics completion event %d\n",
@@ -8934,25 +8566,9 @@ bxe_eq_int(struct bxe_softc *sc)
             else {
                 BLOGD(sc, DBG_SP,
                       "AFEX: ramrod completed FUNCTION_UPDATE\n");
-#if 0
-                f_obj->complete_cmd(sc, f_obj, ECORE_F_CMD_AFEX_UPDATE);
-                /*
-                 * We will perform the queues update from the sp_core_task as
-                 * all queue SP operations should run with CORE_LOCK.
-                 */
-                bxe_set_bit(BXE_SP_CORE_AFEX_F_UPDATE, &sc->sp_core_state);
-                taskqueue_enqueue(sc->sp_tq, &sc->sp_tq_task);
-#endif
             }
             goto next_spqe;
 
-#if 0
-        case EVENT_RING_OPCODE_AFEX_VIF_LISTS:
-            f_obj->complete_cmd(sc, f_obj, ECORE_F_CMD_AFEX_VIFLISTS);
-            bxe_after_afex_vif_lists(sc, elem);
-            goto next_spqe;
-#endif
-
         case EVENT_RING_OPCODE_FORWARD_SETUP:
             q_obj = &bxe_fwd_sp_obj(sc, q_obj);
             if (q_obj->complete_cmd(sc, q_obj,
@@ -9079,14 +8695,6 @@ bxe_handle_sp_tq(void *context,
      */
     // XXX bxe_iov_sp_task(sc);
 
-#if 0
-    /* AFEX - poll to check if VIFSET_ACK should be sent to MFW */
-    if (bxe_test_and_clear_bit(ECORE_AFEX_PENDING_VIFSET_MCP_ACK,
-                               &sc->sp_state)) {
-        bxe_link_report(sc);
-        bxe_fw_command(sc, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0);
-    }
-#endif
 }
 
 static void
@@ -9195,13 +8803,6 @@ bxe_intr_legacy(void *xsc)
 
     BLOGD(sc, DBG_INTR, "---> BXE INTx <---\n");

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602192246.u1JMkqjp066478>