net/enic: count truncated packets
authorJohn Daley <johndale@cisco.com>
Fri, 3 Jun 2016 00:22:47 +0000 (17:22 -0700)
committerBruce Richardson <bruce.richardson@intel.com>
Wed, 15 Jun 2016 15:13:56 +0000 (17:13 +0200)
commitc44d9f01adf3477a80ac93746ffcb16fcf86a27b
tree578a1593fa8966553f556ed0d7535181d37e183f
parent6cd6d65b7baa9fb87bb18dccb09d6bb1e552c38f
net/enic: count truncated packets

Truncated packets occur on enic if an mbuf is not big enough to
receive it or there aren't enough mbufs if rx scatter is in use.
They show up as error packets but unlike other error packets (like
packets bad FCS) there are no nic drop counts incremented for them.
Truncated packets are calculated by subtracting hardware errors from
software errors. Note: this causes transient inaccuracies in the
ipackets count. Also, the length of truncated packets are counted
in ibytes even though truncated packets are dropped which can make
ibytes be slightly higher than it should be.

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
drivers/net/enic/enic.h
drivers/net/enic/enic_main.c