aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorScott Feldman <scofeldm@cisco.com>2009-09-03 13:02:19 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-03 23:19:18 -0400
commit350991e12ac1ac407850169a0d65f522a7fd029e (patch)
tree68a3553d8de4cc55173dd15e392f42616ca19d8f /drivers
parent56ac88b38e5918d92bdfc97c528068e45ff4581c (diff)
enic: bug fix: included MAC drops in rx_dropped netstat
Bug fix: included MAC drops in rx_dropped netstat. Also track Rx trunctations stat at the MAC Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/enic/enic.h1
-rw-r--r--drivers/net/enic/enic_main.c11
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index cfe94b2e03af..f7c5b334bc79 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -99,6 +99,7 @@ struct enic {
99 ____cacheline_aligned struct vnic_rq rq[1]; 99 ____cacheline_aligned struct vnic_rq rq[1];
100 unsigned int rq_count; 100 unsigned int rq_count;
101 int (*rq_alloc_buf)(struct vnic_rq *rq); 101 int (*rq_alloc_buf)(struct vnic_rq *rq);
102 u64 rq_truncated_pkts;
102 u64 rq_bad_fcs; 103 u64 rq_bad_fcs;
103 struct napi_struct napi; 104 struct napi_struct napi;
104 struct net_lro_mgr lro_mgr; 105 struct net_lro_mgr lro_mgr;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 36cf0fcc66fe..b265b103c210 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -738,8 +738,9 @@ static struct net_device_stats *enic_get_stats(struct net_device *netdev)
738 net_stats->rx_bytes = stats->rx.rx_bytes_ok; 738 net_stats->rx_bytes = stats->rx.rx_bytes_ok;
739 net_stats->rx_errors = stats->rx.rx_errors; 739 net_stats->rx_errors = stats->rx.rx_errors;
740 net_stats->multicast = stats->rx.rx_multicast_frames_ok; 740 net_stats->multicast = stats->rx.rx_multicast_frames_ok;
741 net_stats->rx_over_errors = enic->rq_truncated_pkts;
741 net_stats->rx_crc_errors = enic->rq_bad_fcs; 742 net_stats->rx_crc_errors = enic->rq_bad_fcs;
742 net_stats->rx_dropped = stats->rx.rx_no_bufs; 743 net_stats->rx_dropped = stats->rx.rx_no_bufs + stats->rx.rx_drop;
743 744
744 return net_stats; 745 return net_stats;
745} 746}
@@ -1029,8 +1030,12 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
1029 1030
1030 if (packet_error) { 1031 if (packet_error) {
1031 1032
1032 if (bytes_written > 0 && !fcs_ok) 1033 if (!fcs_ok) {
1033 enic->rq_bad_fcs++; 1034 if (bytes_written > 0)
1035 enic->rq_bad_fcs++;
1036 else if (bytes_written == 0)
1037 enic->rq_truncated_pkts++;
1038 }
1034 1039
1035 dev_kfree_skb_any(skb); 1040 dev_kfree_skb_any(skb);
1036 1041