Module Name:    src
Committed By:   thorpej
Date:           Wed Jan 29 04:11:35 UTC 2020

Modified Files:
        src/sys/net: if_arcsubr.c if_ethersubr.c

Log Message:
Adopt <net/if_stats.h>.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/net/if_arcsubr.c
cvs rdiff -u -r1.281 -r1.282 src/sys/net/if_ethersubr.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/net/if_arcsubr.c
diff -u src/sys/net/if_arcsubr.c:1.80 src/sys/net/if_arcsubr.c:1.81
--- src/sys/net/if_arcsubr.c:1.80	Wed May  9 06:35:10 2018
+++ src/sys/net/if_arcsubr.c	Wed Jan 29 04:11:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arcsubr.c,v 1.80 2018/05/09 06:35:10 maxv Exp $	*/
+/*	$NetBSD: if_arcsubr.c,v 1.81 2020/01/29 04:11:35 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Ignatios Souvatzis
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.80 2018/05/09 06:35:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.81 2020/01/29 04:11:35 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -358,7 +358,7 @@ arc_defrag(struct ifnet *ifp, struct mbu
 	if (m->m_len < ARC_HDRNEWLEN) {
 		m = m_pullup(m, ARC_HDRNEWLEN);
 		if (m == NULL) {
-			++ifp->if_ierrors;
+			if_statinc(ifp, if_ierrors);
 			return NULL;
 		}
 	}
@@ -378,7 +378,7 @@ arc_defrag(struct ifnet *ifp, struct mbu
 		if (m->m_len < ARC_HDRNEWLEN) {
 			m = m_pullup(m, ARC_HDRNEWLEN);
 			if (m == NULL) {
-				++ifp->if_ierrors;
+				if_statinc(ifp, if_ierrors);
 				return NULL;
 			}
 		}
@@ -524,11 +524,11 @@ arc_input(struct ifnet *ifp, struct mbuf
 
 	ah = mtod(m, struct arc_header *);
 
-	ifp->if_ibytes += m->m_pkthdr.len;
+	if_statadd(ifp, if_ibytes, m->m_pkthdr.len);
 
 	if (arcbroadcastaddr == ah->arc_dhost) {
 		m->m_flags |= M_BCAST|M_MCAST;
-		ifp->if_imcasts++;
+		if_statinc(ifp, if_imcasts);
 	}
 
 	atype = ah->arc_type;

Index: src/sys/net/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.281 src/sys/net/if_ethersubr.c:1.282
--- src/sys/net/if_ethersubr.c:1.281	Thu Jan 16 13:16:59 2020
+++ src/sys/net/if_ethersubr.c	Wed Jan 29 04:11:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.281 2020/01/16 13:16:59 kardel Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.282 2020/01/29 04:11:35 thorpej Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.281 2020/01/16 13:16:59 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.282 2020/01/29 04:11:35 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -438,7 +438,7 @@ ether_output(struct ifnet * const ifp0, 
 
 #if NCARP > 0
 	if (ifp != ifp0)
-		ifp0->if_obytes += m->m_pkthdr.len + ETHER_HDR_LEN;
+		if_statadd(ifp0, if_obytes, m->m_pkthdr.len + ETHER_HDR_LEN);
 #endif
 
 #ifdef ALTQ
@@ -623,7 +623,7 @@ ether_input(struct ifnet *ifp, struct mb
 		}
 		mutex_exit(&bigpktpps_lock);
 #endif
-		ifp->if_iqdrops++;
+		if_statinc(ifp, if_iqdrops);
 		m_freem(m);
 		return;
 	}
@@ -645,7 +645,7 @@ ether_input(struct ifnet *ifp, struct mb
 			m->m_flags |= M_BCAST;
 		else
 			m->m_flags |= M_MCAST;
-		ifp->if_imcasts++;
+		if_statinc(ifp, if_imcasts);
 	}
 
 	/* If the CRC is still on the packet, trim it off. */
@@ -654,7 +654,7 @@ ether_input(struct ifnet *ifp, struct mb
 		m->m_flags &= ~M_HASFCS;
 	}
 
-	ifp->if_ibytes += m->m_pkthdr.len;
+	if_statadd(ifp, if_ibytes, m->m_pkthdr.len);
 
 #if NCARP > 0
 	if (__predict_false(ifp->if_carp && ifp->if_type != IFT_CARP)) {

Reply via email to