diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-04-21 22:51:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-22 18:28:26 -0400 |
commit | 8ae6df978b986a5ce099e7e7118f127563d2cbbe (patch) | |
tree | 3caffdbc168440397c2d20a0627c0254188b6bbf /drivers/net/qlcnic | |
parent | e802af9cabb011f09b9c19a82faef3dd315f27eb (diff) |
qlcnic: additional driver statistics
Added additional driver statistics to track errors in rcv/tx path.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 4 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ethtool.c | 8 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_init.c | 7 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 4 |
4 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 28c148cbe37b..6c1da71025e1 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -428,6 +428,10 @@ struct qlcnic_adapter_stats { | |||
428 | u64 xmit_on; | 428 | u64 xmit_on; |
429 | u64 xmit_off; | 429 | u64 xmit_off; |
430 | u64 skb_alloc_failure; | 430 | u64 skb_alloc_failure; |
431 | u64 null_skb; | ||
432 | u64 null_rxbuf; | ||
433 | u64 rx_dma_map_error; | ||
434 | u64 tx_dma_map_error; | ||
431 | }; | 435 | }; |
432 | 436 | ||
433 | /* | 437 | /* |
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c index 08d6f105371f..6cdc5ebb7411 100644 --- a/drivers/net/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/qlcnic/qlcnic_ethtool.c | |||
@@ -69,6 +69,14 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = { | |||
69 | QLC_SIZEOF(stats.xmit_off), QLC_OFF(stats.xmit_off)}, | 69 | QLC_SIZEOF(stats.xmit_off), QLC_OFF(stats.xmit_off)}, |
70 | {"skb_alloc_failure", QLC_SIZEOF(stats.skb_alloc_failure), | 70 | {"skb_alloc_failure", QLC_SIZEOF(stats.skb_alloc_failure), |
71 | QLC_OFF(stats.skb_alloc_failure)}, | 71 | QLC_OFF(stats.skb_alloc_failure)}, |
72 | {"null skb", | ||
73 | QLC_SIZEOF(stats.null_skb), QLC_OFF(stats.null_skb)}, | ||
74 | {"null rxbuf", | ||
75 | QLC_SIZEOF(stats.null_rxbuf), QLC_OFF(stats.null_rxbuf)}, | ||
76 | {"rx dma map error", QLC_SIZEOF(stats.rx_dma_map_error), | ||
77 | QLC_OFF(stats.rx_dma_map_error)}, | ||
78 | {"tx dma map error", QLC_SIZEOF(stats.tx_dma_map_error), | ||
79 | QLC_OFF(stats.tx_dma_map_error)}, | ||
72 | 80 | ||
73 | }; | 81 | }; |
74 | 82 | ||
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 01ce74ee99f9..9ef9f58f84dd 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
@@ -1287,6 +1287,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, | |||
1287 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | 1287 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); |
1288 | 1288 | ||
1289 | if (pci_dma_mapping_error(pdev, dma)) { | 1289 | if (pci_dma_mapping_error(pdev, dma)) { |
1290 | adapter->stats.rx_dma_map_error++; | ||
1290 | dev_kfree_skb_any(skb); | 1291 | dev_kfree_skb_any(skb); |
1291 | buffer->skb = NULL; | 1292 | buffer->skb = NULL; |
1292 | return -ENOMEM; | 1293 | return -ENOMEM; |
@@ -1311,8 +1312,10 @@ static struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *adapter, | |||
1311 | PCI_DMA_FROMDEVICE); | 1312 | PCI_DMA_FROMDEVICE); |
1312 | 1313 | ||
1313 | skb = buffer->skb; | 1314 | skb = buffer->skb; |
1314 | if (!skb) | 1315 | if (!skb) { |
1316 | adapter->stats.null_skb++; | ||
1315 | goto no_skb; | 1317 | goto no_skb; |
1318 | } | ||
1316 | 1319 | ||
1317 | if (likely(adapter->rx_csum && cksum == STATUS_CKSUM_OK)) { | 1320 | if (likely(adapter->rx_csum && cksum == STATUS_CKSUM_OK)) { |
1318 | adapter->stats.csummed++; | 1321 | adapter->stats.csummed++; |
@@ -1502,6 +1505,8 @@ qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max) | |||
1502 | 1505 | ||
1503 | if (rxbuf) | 1506 | if (rxbuf) |
1504 | list_add_tail(&rxbuf->list, &sds_ring->free_list[ring]); | 1507 | list_add_tail(&rxbuf->list, &sds_ring->free_list[ring]); |
1508 | else | ||
1509 | adapter->stats.null_rxbuf++; | ||
1505 | 1510 | ||
1506 | skip: | 1511 | skip: |
1507 | for (; desc_cnt > 0; desc_cnt--) { | 1512 | for (; desc_cnt > 0; desc_cnt--) { |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index e4fd5dcdfb4c..5845dc0616b1 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -1589,8 +1589,10 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1589 | 1589 | ||
1590 | pdev = adapter->pdev; | 1590 | pdev = adapter->pdev; |
1591 | 1591 | ||
1592 | if (qlcnic_map_tx_skb(pdev, skb, pbuf)) | 1592 | if (qlcnic_map_tx_skb(pdev, skb, pbuf)) { |
1593 | adapter->stats.tx_dma_map_error++; | ||
1593 | goto drop_packet; | 1594 | goto drop_packet; |
1595 | } | ||
1594 | 1596 | ||
1595 | pbuf->skb = skb; | 1597 | pbuf->skb = skb; |
1596 | pbuf->frag_count = frag_count; | 1598 | pbuf->frag_count = frag_count; |