aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>2010-03-07 19:14:46 -0500
committerDavid S. Miller <davem@davemloft.net>2010-03-08 13:45:29 -0500
commit8bfe8b91b8b877066c8ac788f59a40324eaac6d8 (patch)
treea2347ff6e35f69af10a673e9173630a5e7e7eebd /drivers
parent8bae5698616ac336938684ce7a7370299bd55d01 (diff)
qlcnic: additional driver statistics.
Statistics added for lro/lso bytes, count for tx stop queue and wake queue and skb alloc failure count. Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/qlcnic/qlcnic.h5
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c11
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c1
-rw-r--r--drivers/net/qlcnic/qlcnic_init.c8
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c5
5 files changed, 28 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index b40a851ec7d1..9897b699752f 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -423,6 +423,11 @@ struct qlcnic_adapter_stats {
423 u64 lro_pkts; 423 u64 lro_pkts;
424 u64 rxbytes; 424 u64 rxbytes;
425 u64 txbytes; 425 u64 txbytes;
426 u64 lrobytes;
427 u64 lso_frames;
428 u64 xmit_on;
429 u64 xmit_off;
430 u64 skb_alloc_failure;
426}; 431};
427 432
428/* 433/*
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index ef12792a88be..f83e15fe3e1b 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -59,6 +59,17 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = {
59 QLC_SIZEOF(stats.rxbytes), QLC_OFF(stats.rxbytes)}, 59 QLC_SIZEOF(stats.rxbytes), QLC_OFF(stats.rxbytes)},
60 {"tx_bytes", 60 {"tx_bytes",
61 QLC_SIZEOF(stats.txbytes), QLC_OFF(stats.txbytes)}, 61 QLC_SIZEOF(stats.txbytes), QLC_OFF(stats.txbytes)},
62 {"lrobytes",
63 QLC_SIZEOF(stats.lrobytes), QLC_OFF(stats.lrobytes)},
64 {"lso_frames",
65 QLC_SIZEOF(stats.lso_frames), QLC_OFF(stats.lso_frames)},
66 {"xmit_on",
67 QLC_SIZEOF(stats.xmit_on), QLC_OFF(stats.xmit_on)},
68 {"xmit_off",
69 QLC_SIZEOF(stats.xmit_off), QLC_OFF(stats.xmit_off)},
70 {"skb_alloc_failure", QLC_SIZEOF(stats.skb_alloc_failure),
71 QLC_OFF(stats.skb_alloc_failure)},
72
62}; 73};
63 74
64#define QLCNIC_STATS_LEN ARRAY_SIZE(qlcnic_gstrings_stats) 75#define QLCNIC_STATS_LEN ARRAY_SIZE(qlcnic_gstrings_stats)
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index 99a4d1379d00..e95646bf7d56 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -349,6 +349,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
349 if (nr_desc >= qlcnic_tx_avail(tx_ring)) { 349 if (nr_desc >= qlcnic_tx_avail(tx_ring)) {
350 netif_tx_stop_queue(tx_ring->txq); 350 netif_tx_stop_queue(tx_ring->txq);
351 __netif_tx_unlock_bh(tx_ring->txq); 351 __netif_tx_unlock_bh(tx_ring->txq);
352 adapter->stats.xmit_off++;
352 return -EBUSY; 353 return -EBUSY;
353 } 354 }
354 355
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index ea00ab4d4feb..f0df9717aece 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -1114,8 +1114,10 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
1114 struct pci_dev *pdev = adapter->pdev; 1114 struct pci_dev *pdev = adapter->pdev;
1115 1115
1116 buffer->skb = dev_alloc_skb(rds_ring->skb_size); 1116 buffer->skb = dev_alloc_skb(rds_ring->skb_size);
1117 if (!buffer->skb) 1117 if (!buffer->skb) {
1118 adapter->stats.skb_alloc_failure++;
1118 return -ENOMEM; 1119 return -ENOMEM;
1120 }
1119 1121
1120 skb = buffer->skb; 1122 skb = buffer->skb;
1121 1123
@@ -1289,7 +1291,7 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
1289 netif_receive_skb(skb); 1291 netif_receive_skb(skb);
1290 1292
1291 adapter->stats.lro_pkts++; 1293 adapter->stats.lro_pkts++;
1292 adapter->stats.rxbytes += length; 1294 adapter->stats.lrobytes += length;
1293 1295
1294 return buffer; 1296 return buffer;
1295} 1297}
@@ -1505,6 +1507,8 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter,
1505 adapter->diag_cnt++; 1507 adapter->diag_cnt++;
1506 1508
1507 dev_kfree_skb_any(skb); 1509 dev_kfree_skb_any(skb);
1510 adapter->stats.rx_pkts++;
1511 adapter->stats.rxbytes += length;
1508 1512
1509 return buffer; 1513 return buffer;
1510} 1514}
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 665e8e56b6a8..fc721564e69e 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -118,6 +118,7 @@ qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
118 if (qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH) { 118 if (qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH) {
119 netif_stop_queue(adapter->netdev); 119 netif_stop_queue(adapter->netdev);
120 smp_mb(); 120 smp_mb();
121 adapter->stats.xmit_off++;
121 } 122 }
122} 123}
123 124
@@ -1385,6 +1386,7 @@ qlcnic_tso_check(struct net_device *netdev,
1385 int copied, offset, copy_len, hdr_len = 0, tso = 0, vlan_oob = 0; 1386 int copied, offset, copy_len, hdr_len = 0, tso = 0, vlan_oob = 0;
1386 struct cmd_desc_type0 *hwdesc; 1387 struct cmd_desc_type0 *hwdesc;
1387 struct vlan_ethhdr *vh; 1388 struct vlan_ethhdr *vh;
1389 struct qlcnic_adapter *adapter = netdev_priv(netdev);
1388 1390
1389 if (protocol == cpu_to_be16(ETH_P_8021Q)) { 1391 if (protocol == cpu_to_be16(ETH_P_8021Q)) {
1390 1392
@@ -1494,6 +1496,7 @@ qlcnic_tso_check(struct net_device *netdev,
1494 1496
1495 tx_ring->producer = producer; 1497 tx_ring->producer = producer;
1496 barrier(); 1498 barrier();
1499 adapter->stats.lso_frames++;
1497} 1500}
1498 1501
1499static int 1502static int
@@ -1573,6 +1576,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1573 1576
1574 if (unlikely(no_of_desc + 2 > qlcnic_tx_avail(tx_ring))) { 1577 if (unlikely(no_of_desc + 2 > qlcnic_tx_avail(tx_ring))) {
1575 netif_stop_queue(netdev); 1578 netif_stop_queue(netdev);
1579 adapter->stats.xmit_off++;
1576 return NETDEV_TX_BUSY; 1580 return NETDEV_TX_BUSY;
1577 } 1581 }
1578 1582
@@ -1880,6 +1884,7 @@ static int qlcnic_process_cmd_ring(struct qlcnic_adapter *adapter)
1880 if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH) { 1884 if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH) {
1881 netif_wake_queue(netdev); 1885 netif_wake_queue(netdev);
1882 adapter->tx_timeo_cnt = 0; 1886 adapter->tx_timeo_cnt = 0;
1887 adapter->stats.xmit_on++;
1883 } 1888 }
1884 __netif_tx_unlock(tx_ring->txq); 1889 __netif_tx_unlock(tx_ring->txq);
1885 } 1890 }