From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 21:48:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CC6C918; Tue, 16 Sep 2014 21:48:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D40CBC; Tue, 16 Sep 2014 21:48:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8GLmned007241; Tue, 16 Sep 2014 21:48:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8GLmnYE007240; Tue, 16 Sep 2014 21:48:49 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409162148.s8GLmnYE007240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 16 Sep 2014 21:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271691 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Sep 2014 21:48:49 -0000 Author: melifaro Date: Tue Sep 16 21:48:48 2014 New Revision: 271691 URL: http://svnweb.freebsd.org/changeset/base/271691 Log: * Fix if_omcast handling * Convert if_oerrors to pcpu. Suggested by: glebius MFC after: 2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Sep 16 21:26:24 2014 (r271690) +++ head/sys/net/if_vlan.c Tue Sep 16 21:48:48 2014 (r271691) @@ -104,14 +104,15 @@ struct vlan_mc_entry { struct ifvlan { struct ifvlantrunk *ifv_trunk; struct ifnet *ifv_ifp; - void *ifv_cookie; counter_u64_t ifv_ipackets; counter_u64_t ifv_ibytes; counter_u64_t ifv_opackets; counter_u64_t ifv_obytes; counter_u64_t ifv_omcasts; + counter_u64_t ifv_oerrors; #define TRUNK(ifv) ((ifv)->ifv_trunk) #define PARENT(ifv) ((ifv)->ifv_trunk->parent) + void *ifv_cookie; int ifv_pflags; /* special flags we have set on parent */ struct ifv_linkmib { int ifvm_encaplen; /* encapsulation length */ @@ -959,6 +960,7 @@ vlan_clone_create(struct if_clone *ifc, ifv->ifv_ibytes = counter_u64_alloc(M_WAITOK); ifv->ifv_obytes = counter_u64_alloc(M_WAITOK); ifv->ifv_omcasts = counter_u64_alloc(M_WAITOK); + ifv->ifv_oerrors = counter_u64_alloc(M_WAITOK); ifp->if_softc = ifv; /* @@ -1026,6 +1028,7 @@ vlan_clone_destroy(struct if_clone *ifc, counter_u64_free(ifv->ifv_ibytes); counter_u64_free(ifv->ifv_obytes); counter_u64_free(ifv->ifv_omcasts); + counter_u64_free(ifv->ifv_oerrors); free(ifv, M_VLAN); ifc_free_unit(ifc, unit); @@ -1063,7 +1066,7 @@ vlan_transmit(struct ifnet *ifp, struct */ if (!UP_AND_RUNNING(p)) { m_freem(m); - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); return (ENETDOWN); } @@ -1090,7 +1093,7 @@ vlan_transmit(struct ifnet *ifp, struct if (n > 0) { if_printf(ifp, "cannot pad short frame\n"); - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); m_freem(m); return (0); } @@ -1110,7 +1113,7 @@ vlan_transmit(struct ifnet *ifp, struct m = ether_vlanencap(m, ifv->ifv_vid); if (m == NULL) { if_printf(ifp, "unable to prepend VLAN header\n"); - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); return (0); } } @@ -1122,9 +1125,9 @@ vlan_transmit(struct ifnet *ifp, struct if (error == 0) { counter_u64_add(ifv->ifv_opackets, 1); counter_u64_add(ifv->ifv_obytes, len); - counter_u64_add(ifv->ifv_omcasts, 1); + counter_u64_add(ifv->ifv_omcasts, mcast); } else - ifp->if_oerrors++; + counter_u64_add(ifv->ifv_oerrors, 1); return (error); } @@ -1146,6 +1149,8 @@ vlan_get_counter(struct ifnet *ifp, ifne return (counter_u64_fetch(ifv->ifv_obytes)); case IFCOUNTER_OMCASTS: return (counter_u64_fetch(ifv->ifv_omcasts)); + case IFCOUNTER_OERRORS: + return (counter_u64_fetch(ifv->ifv_oerrors)); default: return (if_get_counter_compat(ifp, cnt)); }