From nobody Thu Aug 11 14:53:20 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M3VDJ5FyTz4Y7P9; Thu, 11 Aug 2022 14:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M3VDJ3S61z3Tk9; Thu, 11 Aug 2022 14:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660229600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qwAHFazeYGS8ohn0DHdnZenSwnA+mbf4U3RdejOmyd4=; b=xH+R+CilScoIyT8LfKqKc7fbwdXSgAiycrsBgUmQORBsTZ6qyg8EJi+Hj7thRcHvH3FpSm /Z0SRFfcwuSXt83ANh0u53eU9ioFPhD07+tmJa5zArpu60H1/HRrnG6dvoHlWZWZvvbI0R fWOtnvNgeALUTdy/43Ktda+lLxbiIpDtlMltnFbgxGcjSfBmiZ6bm080OC9MvTXgOrIafr 9fjfzMUKwoHvIgF6XwZMxOqwtIuzNUhE+9FzhkTS8SEEN0NLIcOXlBWMG+bXbkXzB0jPv+ Il8mNSWPb7XAmPKR7+RXneUcrnjgAYlUsRjnSHkTTytxk3uBQ7jkWjCQfQHThw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M3VDJ2H8yzw9C; Thu, 11 Aug 2022 14:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27BErKTX032552; Thu, 11 Aug 2022 14:53:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27BErKTO032551; Thu, 11 Aug 2022 14:53:20 GMT (envelope-from git) Date: Thu, 11 Aug 2022 14:53:20 GMT Message-Id: <202208111453.27BErKTO032551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: c7c8b80659f5 - stable/12 - if_dwc: avoid duplicate packet counts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c7c8b80659f5e03a6a1c87a643e18e0ab929e286 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660229600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qwAHFazeYGS8ohn0DHdnZenSwnA+mbf4U3RdejOmyd4=; b=rAFDL8qJF2277afJsdMgDX3QrwCC6/fSratRBmOb++D6sxxVm2ZuIbv3kUGlXkpZjg5VIQ PoNb5ji+SWb6R83tufGLMxX2btJ1Tdic7n0p6AXcBGIfx7k7V5cfdAHGo8fNki68lxHHWG Q9jJpaqZBsekIK5Pjz+YDQRNPXODDYIvPg/J5yVwm5Luzd8S/A85EfA7xwtKW1GumCb0Xb HUTxV8MyjJ9//QdXr22418d/gaVQ0CtU5QbPtbkgo2bym1IvyEHjwHFVxwzeT8Nno5QfKU MdQYMVKHfX2ByIOSyP7bYokOEhF2zetvSpOQ/MmGLNfW+S4d/zFiAGdLhNWMaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660229600; a=rsa-sha256; cv=none; b=oV6HPEmPD2AxWVMuzeIK2TT+dFEDRQABSVT+2yETFvJLUxoBza47HOrVDb1lZcERxHeF1S D5px9AU0hHifhbN0hQD3HLBaBNa4TlbYYutaHlXjlpLuTyPOV8L66e4NrFMwufuvUV3KiC Hx2l/GcDgzUitzniBKPbEbCA/LiaqV17LSA5ut+UmkFnoSqxCPaCZFVy9vCCE/xs8TDs2h qN5rmz2n81+TohL8L0iABVc/Fk2rvqAcaHbdTsdP8YaZm8K3Aypd0r4ZaMGU9lecUa0o4I cK6qCHIElw/LI5OdNoqeZ3iWdos2xMB27DfmlrcuP2fd7ugx6cqWgSt4oM//2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c7c8b80659f5e03a6a1c87a643e18e0ab929e286 commit c7c8b80659f5e03a6a1c87a643e18e0ab929e286 Author: Mitchell Horne AuthorDate: 2022-06-21 13:24:25 +0000 Commit: Mitchell Horne CommitDate: 2022-08-11 14:52:03 +0000 if_dwc: avoid duplicate packet counts We already increment the unicast IPACKETS and OPACKETS counters in the rx/tx paths, respectively. Multicast packets are counted in the generic ethernet code. Therefore, we shouldn't increment these counters in dwc_harvest_stats(). Drop the early return from dwc_rxfinish_one() so that we still count received packets with e.g. a checksum error. PR: 263817 Reported by: Jiahao LI Reviewed by: manu MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35499 (cherry picked from commit 9718759043ec2ef36f12b15963194b866d731b5b) --- sys/dev/dwc/if_dwc.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index 919f8fee1527..934c19f8c419 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -747,14 +747,6 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc, m = map->mbuf; ifp = sc->ifp; rdesc0 = desc ->desc0; - /* Validate descriptor. */ - if (rdesc0 & RDESC0_ES) { - /* - * Errored packet. Statistic counters are updated - * globally, so do nothing - */ - return (NULL); - } if ((rdesc0 & (RDESC0_FS | RDESC0_LS)) != (RDESC0_FS | RDESC0_LS)) { @@ -1268,16 +1260,12 @@ dwc_harvest_stats(struct dwc_softc *sc) sc->stats_harvest_count = 0; ifp = sc->ifp; - if_inc_counter(ifp, IFCOUNTER_IPACKETS, READ4(sc, RXFRAMECOUNT_GB)); - if_inc_counter(ifp, IFCOUNTER_IMCASTS, READ4(sc, RXMULTICASTFRAMES_G)); if_inc_counter(ifp, IFCOUNTER_IERRORS, READ4(sc, RXOVERSIZE_G) + READ4(sc, RXUNDERSIZE_G) + READ4(sc, RXCRCERROR) + READ4(sc, RXALIGNMENTERROR) + READ4(sc, RXRUNTERROR) + READ4(sc, RXJABBERERROR) + READ4(sc, RXLENGTHERROR)); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, READ4(sc, TXFRAMECOUNT_G)); - if_inc_counter(ifp, IFCOUNTER_OMCASTS, READ4(sc, TXMULTICASTFRAMES_G)); if_inc_counter(ifp, IFCOUNTER_OERRORS, READ4(sc, TXOVERSIZE_G) + READ4(sc, TXEXCESSDEF) + READ4(sc, TXCARRIERERR) + READ4(sc, TXUNDERFLOWERROR));