bnx2x: Add additional debug information
authorYuval Mintz <yuvalmin@broadcom.com>
Wed, 23 Jan 2013 03:21:46 +0000 (03:21 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2013 18:58:28 +0000 (13:58 -0500)
Add/Revise several debug prints in the bnx2x driver - on regular flows
as well as error flows.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c

index e8f2700b3c378ce3b45b51ccaa6480a7b2749393..58f491ef5d82481617f5b67d73cee51aa516781d 100644 (file)
@@ -3486,9 +3486,10 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        DP(NETIF_MSG_TX_QUEUED,
-          "queue[%d]: SKB: summed %x  protocol %x protocol(%x,%x) gso type %x  xmit_type %x\n",
+          "queue[%d]: SKB: summed %x  protocol %x protocol(%x,%x) gso type %x  xmit_type %x len %d\n",
           txq_index, skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr,
-          ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type);
+          ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type,
+          skb->len);
 
        eth = (struct ethhdr *)skb->data;
 
@@ -4078,6 +4079,8 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index)
        } else /* if rx_ring_size specified - use it */
                rx_ring_size = bp->rx_ring_size;
 
+       DP(BNX2X_MSG_SP, "calculated rx_ring_size %d\n", rx_ring_size);
+
        /* Common */
        sb = &bnx2x_fp(bp, index, status_blk);
 
index f949540497f93d2ee4aec399979455ddb4682951..9a674b14b403dc605bfb10c448ea8a175a2614ae 100644 (file)
@@ -1731,6 +1731,10 @@ static int bnx2x_set_ringparam(struct net_device *dev,
 {
        struct bnx2x *bp = netdev_priv(dev);
 
+       DP(BNX2X_MSG_ETHTOOL,
+          "set ring params command parameters: rx_pending = %d, tx_pending = %d\n",
+          ering->rx_pending, ering->tx_pending);
+
        if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
                DP(BNX2X_MSG_ETHTOOL,
                   "Handling parity error recovery. Try again later\n");
index e496f190032a7d81e029e9311d32c4ba54e236b9..c9effad3c36225039246c446a20b7957c99996e4 100644 (file)
@@ -1027,6 +1027,17 @@ void bnx2x_panic_dump(struct bnx2x *bp, bool disable_int)
        }
 
 #ifdef BNX2X_STOP_ON_ERROR
+
+       /* event queue */
+       for (i = 0; i < NUM_EQ_DESC; i++) {
+               u32 *data = (u32 *)&bp->eq_ring[i].message.data;
+
+               BNX2X_ERR("event queue [%d]: header: opcode %d, error %d\n",
+                         i, bp->eq_ring[i].message.opcode,
+                         bp->eq_ring[i].message.error);
+               BNX2X_ERR("data: %x %x %x\n", data[0], data[1], data[2]);
+       }
+
        /* Rings */
        /* Rx */
        for_each_valid_rx_queue(bp, i) {
@@ -7395,8 +7406,10 @@ static int bnx2x_init_hw_func(struct bnx2x *bp)
        /* FLR cleanup - hmmm */
        if (!CHIP_IS_E1x(bp)) {
                rc = bnx2x_pf_flr_clnup(bp);
-               if (rc)
+               if (rc) {
+                       bnx2x_fw_dump(bp);
                        return rc;
+               }
        }
 
        /* set MSI reconfigure capability */
@@ -9782,6 +9795,8 @@ static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
        if (bnx2x_prev_is_path_marked(bp))
                return bnx2x_prev_mcp_done(bp);
 
+       BNX2X_DEV_INFO("Path is unmarked\n");
+
        /* If function has FLR capabilities, and existing FW version matches
         * the one required, then FLR will be sufficient to clean any residue
         * left by previous driver
@@ -9917,7 +9932,8 @@ static void bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
        if (!CHIP_IS_E1x(bp)) {
                u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
                if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
-                       BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing");
+                       DP(BNX2X_MSG_SP,
+                          "'was error' bit was found to be set in pglueb upon startup. Clearing\n");
                        REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR,
                               1 << BP_FUNC(bp));
                }
@@ -12488,6 +12504,7 @@ static int bnx2x_init_one(struct pci_dev *pdev,
                dev_err(&pdev->dev, "Cannot set interrupts\n");
                goto init_one_exit;
        }
+       BNX2X_DEV_INFO("set interrupts successfully\n");
 
        /* register the net device */
        rc = register_netdev(dev);
index 4a28601908bc13ce162f57812b24e8f9b087e374..7d6d601a84203a39f4b2849b3bf6322c4078c65a 100644 (file)
@@ -4241,11 +4241,16 @@ int bnx2x_queue_state_change(struct bnx2x *bp,
        unsigned long *pending = &o->pending;
 
        /* Check that the requested transition is legal */
-       if (o->check_transition(bp, o, params))
+       rc = o->check_transition(bp, o, params);
+       if (rc) {
+               BNX2X_ERR("check transition returned an error. rc %d\n", rc);
                return -EINVAL;
+       }
 
        /* Set "pending" bit */
+       DP(BNX2X_MSG_SP, "pending bit was=%lx\n", o->pending);
        pending_bit = o->set_pending(o, params);
+       DP(BNX2X_MSG_SP, "pending bit now=%lx\n", o->pending);
 
        /* Don't send a command if only driver cleanup was requested */
        if (test_bit(RAMROD_DRV_CLR_ONLY, &params->ramrod_flags))
@@ -5029,8 +5034,11 @@ static int bnx2x_queue_chk_transition(struct bnx2x *bp,
         * Don't allow a next state transition if we are in the middle of
         * the previous one.
         */
-       if (o->pending)
+       if (o->pending) {
+               BNX2X_ERR("Blocking transition since pending was %lx\n",
+                         o->pending);
                return -EBUSY;
+       }
 
        switch (state) {
        case BNX2X_Q_STATE_RESET: