aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-07-02 20:11:00 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-02 20:11:00 -0400
commitaf7efaff2602ec3bb4c5e601204cecabea25744d (patch)
tree644a2f863df8ae7d72d5342a693d80c5366120dc
parentfb0d164cc1e46ddb22e8fac9f9cb94fdaeddd70f (diff)
parent28470572a66e1e676a3b974862ecaf5b4764bc9f (diff)
Merge branch 'qlcnic-next'
Harish Patil says: ==================== qlcnic: Enhance Tx timeout debug data collection. The following set of patches are for enhancing Tx timeout debug collection - Collect a firmware dump on first Tx timeout if netif_msg_tx_err() is set - Log Receive and Status ring info on Tx timeout, in addition to Tx ring info - Log additional Tx ring info if netif_msg_tx_err() is set - Update driver version to 5.3.61 Please apply this series to net-next. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic.h4
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c41
2 files changed, 37 insertions, 8 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index be618b9e874f..16039d1497b8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -39,8 +39,8 @@
39 39
40#define _QLCNIC_LINUX_MAJOR 5 40#define _QLCNIC_LINUX_MAJOR 5
41#define _QLCNIC_LINUX_MINOR 3 41#define _QLCNIC_LINUX_MINOR 3
42#define _QLCNIC_LINUX_SUBVERSION 60 42#define _QLCNIC_LINUX_SUBVERSION 61
43#define QLCNIC_LINUX_VERSIONID "5.3.60" 43#define QLCNIC_LINUX_VERSIONID "5.3.61"
44#define QLCNIC_DRV_IDC_VER 0x01 44#define QLCNIC_DRV_IDC_VER 0x01
45#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ 45#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
46 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION)) 46 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 4fc186713b66..f8de2ae01a5a 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2980,17 +2980,43 @@ static inline void dump_tx_ring_desc(struct qlcnic_host_tx_ring *tx_ring)
2980 } 2980 }
2981} 2981}
2982 2982
2983static void qlcnic_dump_tx_rings(struct qlcnic_adapter *adapter) 2983static void qlcnic_dump_rings(struct qlcnic_adapter *adapter)
2984{ 2984{
2985 struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
2985 struct net_device *netdev = adapter->netdev; 2986 struct net_device *netdev = adapter->netdev;
2987 struct qlcnic_host_rds_ring *rds_ring;
2988 struct qlcnic_host_sds_ring *sds_ring;
2986 struct qlcnic_host_tx_ring *tx_ring; 2989 struct qlcnic_host_tx_ring *tx_ring;
2987 int ring; 2990 int ring;
2988 2991
2989 if (!netdev || !netif_running(netdev)) 2992 if (!netdev || !netif_running(netdev))
2990 return; 2993 return;
2991 2994
2995 for (ring = 0; ring < adapter->max_rds_rings; ring++) {
2996 rds_ring = &recv_ctx->rds_rings[ring];
2997 if (!rds_ring)
2998 continue;
2999 netdev_info(netdev,
3000 "rds_ring=%d crb_rcv_producer=%d producer=%u num_desc=%u\n",
3001 ring, readl(rds_ring->crb_rcv_producer),
3002 rds_ring->producer, rds_ring->num_desc);
3003 }
3004
3005 for (ring = 0; ring < adapter->drv_sds_rings; ring++) {
3006 sds_ring = &(recv_ctx->sds_rings[ring]);
3007 if (!sds_ring)
3008 continue;
3009 netdev_info(netdev,
3010 "sds_ring=%d crb_sts_consumer=%d consumer=%u crb_intr_mask=%d num_desc=%u\n",
3011 ring, readl(sds_ring->crb_sts_consumer),
3012 sds_ring->consumer, readl(sds_ring->crb_intr_mask),
3013 sds_ring->num_desc);
3014 }
3015
2992 for (ring = 0; ring < adapter->drv_tx_rings; ring++) { 3016 for (ring = 0; ring < adapter->drv_tx_rings; ring++) {
2993 tx_ring = &adapter->tx_ring[ring]; 3017 tx_ring = &adapter->tx_ring[ring];
3018 if (!tx_ring)
3019 continue;
2994 netdev_info(netdev, "Tx ring=%d Context Id=0x%x\n", 3020 netdev_info(netdev, "Tx ring=%d Context Id=0x%x\n",
2995 ring, tx_ring->ctx_id); 3021 ring, tx_ring->ctx_id);
2996 netdev_info(netdev, 3022 netdev_info(netdev,
@@ -3013,9 +3039,10 @@ static void qlcnic_dump_tx_rings(struct qlcnic_adapter *adapter)
3013 netdev_info(netdev, "Total desc=%d, Available desc=%d\n", 3039 netdev_info(netdev, "Total desc=%d, Available desc=%d\n",
3014 tx_ring->num_desc, qlcnic_tx_avail(tx_ring)); 3040 tx_ring->num_desc, qlcnic_tx_avail(tx_ring));
3015 3041
3016 if (netif_msg_tx_done(adapter->ahw)) 3042 if (netif_msg_tx_err(adapter->ahw))
3017 dump_tx_ring_desc(tx_ring); 3043 dump_tx_ring_desc(tx_ring);
3018 } 3044 }
3045
3019} 3046}
3020 3047
3021static void qlcnic_tx_timeout(struct net_device *netdev) 3048static void qlcnic_tx_timeout(struct net_device *netdev)
@@ -3025,16 +3052,18 @@ static void qlcnic_tx_timeout(struct net_device *netdev)
3025 if (test_bit(__QLCNIC_RESETTING, &adapter->state)) 3052 if (test_bit(__QLCNIC_RESETTING, &adapter->state))
3026 return; 3053 return;
3027 3054
3028 if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS) { 3055 qlcnic_dump_rings(adapter);
3029 netdev_info(netdev, "Tx timeout, reset the adapter.\n"); 3056
3057 if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS ||
3058 netif_msg_tx_err(adapter->ahw)) {
3059 netdev_err(netdev, "Tx timeout, reset the adapter.\n");
3030 if (qlcnic_82xx_check(adapter)) 3060 if (qlcnic_82xx_check(adapter))
3031 adapter->need_fw_reset = 1; 3061 adapter->need_fw_reset = 1;
3032 else if (qlcnic_83xx_check(adapter)) 3062 else if (qlcnic_83xx_check(adapter))
3033 qlcnic_83xx_idc_request_reset(adapter, 3063 qlcnic_83xx_idc_request_reset(adapter,
3034 QLCNIC_FORCE_FW_DUMP_KEY); 3064 QLCNIC_FORCE_FW_DUMP_KEY);
3035 } else { 3065 } else {
3036 netdev_info(netdev, "Tx timeout, reset adapter context.\n"); 3066 netdev_err(netdev, "Tx timeout, reset adapter context.\n");
3037 qlcnic_dump_tx_rings(adapter);
3038 adapter->ahw->reset_context = 1; 3067 adapter->ahw->reset_context = 1;
3039 } 3068 }
3040} 3069}