Commit 8bfe8b91 authored by Sucheta Chakraborty's avatar Sucheta Chakraborty Committed by David S. Miller

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: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8bae5698
...@@ -423,6 +423,11 @@ struct qlcnic_adapter_stats { ...@@ -423,6 +423,11 @@ struct qlcnic_adapter_stats {
u64 lro_pkts; u64 lro_pkts;
u64 rxbytes; u64 rxbytes;
u64 txbytes; u64 txbytes;
u64 lrobytes;
u64 lso_frames;
u64 xmit_on;
u64 xmit_off;
u64 skb_alloc_failure;
}; };
/* /*
......
...@@ -59,6 +59,17 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = { ...@@ -59,6 +59,17 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = {
QLC_SIZEOF(stats.rxbytes), QLC_OFF(stats.rxbytes)}, QLC_SIZEOF(stats.rxbytes), QLC_OFF(stats.rxbytes)},
{"tx_bytes", {"tx_bytes",
QLC_SIZEOF(stats.txbytes), QLC_OFF(stats.txbytes)}, QLC_SIZEOF(stats.txbytes), QLC_OFF(stats.txbytes)},
{"lrobytes",
QLC_SIZEOF(stats.lrobytes), QLC_OFF(stats.lrobytes)},
{"lso_frames",
QLC_SIZEOF(stats.lso_frames), QLC_OFF(stats.lso_frames)},
{"xmit_on",
QLC_SIZEOF(stats.xmit_on), QLC_OFF(stats.xmit_on)},
{"xmit_off",
QLC_SIZEOF(stats.xmit_off), QLC_OFF(stats.xmit_off)},
{"skb_alloc_failure", QLC_SIZEOF(stats.skb_alloc_failure),
QLC_OFF(stats.skb_alloc_failure)},
}; };
#define QLCNIC_STATS_LEN ARRAY_SIZE(qlcnic_gstrings_stats) #define QLCNIC_STATS_LEN ARRAY_SIZE(qlcnic_gstrings_stats)
......
...@@ -349,6 +349,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter, ...@@ -349,6 +349,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
if (nr_desc >= qlcnic_tx_avail(tx_ring)) { if (nr_desc >= qlcnic_tx_avail(tx_ring)) {
netif_tx_stop_queue(tx_ring->txq); netif_tx_stop_queue(tx_ring->txq);
__netif_tx_unlock_bh(tx_ring->txq); __netif_tx_unlock_bh(tx_ring->txq);
adapter->stats.xmit_off++;
return -EBUSY; return -EBUSY;
} }
......
...@@ -1114,8 +1114,10 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, ...@@ -1114,8 +1114,10 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
buffer->skb = dev_alloc_skb(rds_ring->skb_size); buffer->skb = dev_alloc_skb(rds_ring->skb_size);
if (!buffer->skb) if (!buffer->skb) {
adapter->stats.skb_alloc_failure++;
return -ENOMEM; return -ENOMEM;
}
skb = buffer->skb; skb = buffer->skb;
...@@ -1289,7 +1291,7 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter, ...@@ -1289,7 +1291,7 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter,
netif_receive_skb(skb); netif_receive_skb(skb);
adapter->stats.lro_pkts++; adapter->stats.lro_pkts++;
adapter->stats.rxbytes += length; adapter->stats.lrobytes += length;
return buffer; return buffer;
} }
...@@ -1505,6 +1507,8 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, ...@@ -1505,6 +1507,8 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter,
adapter->diag_cnt++; adapter->diag_cnt++;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
adapter->stats.rx_pkts++;
adapter->stats.rxbytes += length;
return buffer; return buffer;
} }
......
...@@ -118,6 +118,7 @@ qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter, ...@@ -118,6 +118,7 @@ qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
if (qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH) { if (qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH) {
netif_stop_queue(adapter->netdev); netif_stop_queue(adapter->netdev);
smp_mb(); smp_mb();
adapter->stats.xmit_off++;
} }
} }
...@@ -1385,6 +1386,7 @@ qlcnic_tso_check(struct net_device *netdev, ...@@ -1385,6 +1386,7 @@ qlcnic_tso_check(struct net_device *netdev,
int copied, offset, copy_len, hdr_len = 0, tso = 0, vlan_oob = 0; int copied, offset, copy_len, hdr_len = 0, tso = 0, vlan_oob = 0;
struct cmd_desc_type0 *hwdesc; struct cmd_desc_type0 *hwdesc;
struct vlan_ethhdr *vh; struct vlan_ethhdr *vh;
struct qlcnic_adapter *adapter = netdev_priv(netdev);
if (protocol == cpu_to_be16(ETH_P_8021Q)) { if (protocol == cpu_to_be16(ETH_P_8021Q)) {
...@@ -1494,6 +1496,7 @@ qlcnic_tso_check(struct net_device *netdev, ...@@ -1494,6 +1496,7 @@ qlcnic_tso_check(struct net_device *netdev,
tx_ring->producer = producer; tx_ring->producer = producer;
barrier(); barrier();
adapter->stats.lso_frames++;
} }
static int static int
...@@ -1573,6 +1576,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1573,6 +1576,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
if (unlikely(no_of_desc + 2 > qlcnic_tx_avail(tx_ring))) { if (unlikely(no_of_desc + 2 > qlcnic_tx_avail(tx_ring))) {
netif_stop_queue(netdev); netif_stop_queue(netdev);
adapter->stats.xmit_off++;
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} }
...@@ -1880,6 +1884,7 @@ static int qlcnic_process_cmd_ring(struct qlcnic_adapter *adapter) ...@@ -1880,6 +1884,7 @@ static int qlcnic_process_cmd_ring(struct qlcnic_adapter *adapter)
if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH) { if (qlcnic_tx_avail(tx_ring) > TX_STOP_THRESH) {
netif_wake_queue(netdev); netif_wake_queue(netdev);
adapter->tx_timeo_cnt = 0; adapter->tx_timeo_cnt = 0;
adapter->stats.xmit_on++;
} }
__netif_tx_unlock(tx_ring->txq); __netif_tx_unlock(tx_ring->txq);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment