Module Name: src
Committed By: msaitoh
Date: Mon May 8 10:00:41 UTC 2017
Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c
Log Message:
Fix a bug that if_obytes and if_omcasts aren't counted. This bug was added
in ixgbe.c rev. 1.27 by me. Reported by Uwe Toenjes.
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/ixgbe/ix_txrx.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.22 src/sys/dev/pci/ixgbe/ix_txrx.c:1.23
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.22 Thu Mar 2 05:35:01 2017
+++ src/sys/dev/pci/ixgbe/ix_txrx.c Mon May 8 10:00:41 2017
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.22 2017/03/02 05:35:01 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.23 2017/05/08 10:00:41 msaitoh Exp $*/
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -333,6 +333,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m
{
struct m_tag *mtag;
struct adapter *adapter = txr->adapter;
+ struct ifnet *ifp = adapter->ifp;
struct ethercom *ec = &adapter->osdep.ec;
u32 olinfo_status = 0, cmd_type_len;
int i, j, error;
@@ -481,6 +482,13 @@ retry:
++txr->total_packets.ev_count;
IXGBE_WRITE_REG(&adapter->hw, txr->tail, i);
+ /*
+ * XXXX NOMPSAFE: ifp->if_data should be percpu.
+ */
+ ifp->if_obytes += m_head->m_pkthdr.len;
+ if (m_head->m_flags & M_MCAST)
+ ifp->if_omcasts++;
+
/* Mark queue as having work */
if (txr->busy == 0)
txr->busy = 1;