diff options
author | glebius <glebius@FreeBSD.org> | 2013-10-09 19:04:40 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-10-09 19:04:40 +0000 |
commit | 75528d8e36fb23734af42c83fe710155dc3e2d5c (patch) | |
tree | a73da61112c51368ee56913bcb5771167291b7ca /sys/net/if_ethersubr.c | |
parent | 57b95400601bfa18b78d342b43a877efa06e81d1 (diff) | |
download | FreeBSD-src-75528d8e36fb23734af42c83fe710155dc3e2d5c.zip FreeBSD-src-75528d8e36fb23734af42c83fe710155dc3e2d5c.tar.gz |
There are some high performance NICs that count statistics in hardware,
and there are ifnets, that do that via counter(9). Provide a flag that
would skip cache line trashing '+=' operation in ether_input().
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Reviewed by: melifaro, adrian
Approved by: re (marius)
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 638b364..d5c5521 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -528,7 +528,8 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m) m->m_flags &= ~M_HASFCS; } - ifp->if_ibytes += m->m_pkthdr.len; + if (!(ifp->if_capenable & IFCAP_HWSTATS)) + ifp->if_ibytes += m->m_pkthdr.len; /* Allow monitor mode to claim this frame, after stats are updated. */ if (ifp->if_flags & IFF_MONITOR) { |