From nobody Mon Jul 4 16:40:04 2022 X-Original-To: dev-commits-src-branches@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 F3C48189410F; Mon, 4 Jul 2022 16:40:05 +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 4LcBP11wX6z4SHy; Mon, 4 Jul 2022 16:40:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656952805; 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=HMeRs0R2SIqI7Mar7YUfM8Nc+lEFtX4PAY7cbTczyQI=; b=vpwo3zpB3n3gAjaLK1DBjgSTZEHxu7qshiwuaxdGZpUxob6iIF71+uxU7KtM7xu6vtnV4U 5CxQGoyTY/a7grD2ijJMoo6QTpgefr7pHwekfpGgu3e5e+u+zHi736fvBMVetF4Rl4loqF MjCB3CKW60IXzlV4A1ehrkEYJzq38qQ/ae4kembdB0MmwPTvc2W9NdHgg1s0NyJ7q7XPdl Ctt62Ng/9+9biePUrhu9CoRi/dPCWPclNxiNpfYOispbeQ7IjIb69JhACTnmpY+OfBXyhn GLsC4zAwqHF+J/3+m+x1ZQGOHMOqRqBlV/tgM/wsDt9MnMbEyhDeFHafeY50dw== 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 0250E14DA1; Mon, 4 Jul 2022 16:40:05 +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 264Ge4i7043306; Mon, 4 Jul 2022 16:40:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 264Ge4PG043303; Mon, 4 Jul 2022 16:40:04 GMT (envelope-from git) Date: Mon, 4 Jul 2022 16:40:04 GMT Message-Id: <202207041640.264Ge4PG043303@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: 3a72965a25f9 - stable/13 - if_dwc: avoid duplicate packet counts List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 3a72965a25f96e0719fef098c6c78c3d34a6e808 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656952805; 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=HMeRs0R2SIqI7Mar7YUfM8Nc+lEFtX4PAY7cbTczyQI=; b=oOkMV4Kzw5Z+3hM8NONGrbH6gM271L42MIiR9NItpLBSbyelJ518G5aTaLbxILxPUmY1i5 lPiOztOFQqOUwGL4/bAl2Mws/mykY7PVOho1qaoyak6DleGuH8SAK6GtmLYhKV1u2X9QHU 8xm5Xxh39Ckd1fLuqdRjGQwzJgTwrkfomMXq/FWGE0Xv/bIMizwtDsDQR0Si1TvqbUkybE dJgToGOGnoieNRz3djb5cODvcn25gLDhhnCLvavpMMHWkhm02b0JRrhj/6OSoMlrxzHSDZ iN9dS9jQfYlLIEFeJ5rgwaiB6aYCzwWQV2qK28dv0lJyfHpfw28ja/n2c0oeHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656952805; a=rsa-sha256; cv=none; b=CRfKI9RVL26FpXJytFjHsv32YIc6C0aSZLWVimO9zYY8mCAphSWUDQ8viVnEBL8/Ik0Rmc aRmzDJponwslINhSRHXXdPKk/znnSt9Fl2tuOoTYqrFTHnNlamRzc6MQu4LM7R6KqsXTao BXSdsFb8ljucRlgxeiWEin+H9oJP/Flm80qwfU76prlz3zBv9oxhPl6Y6iVnsUpzjcPX9d 89TqNMAuDmHPuNZWQQk5AhiMmVWrvCHSAyAboJaNyEMwGsoJnVJsE0JO01ncFD02+XSl9r 2S34sC7VVyF7CEUFrpUfHqAP0rpteJJ40AFaX4fvfk/W50Plp1/5WIwekmhGTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3a72965a25f96e0719fef098c6c78c3d34a6e808 commit 3a72965a25f96e0719fef098c6c78c3d34a6e808 Author: Mitchell Horne AuthorDate: 2022-06-21 13:24:25 +0000 Commit: Mitchell Horne CommitDate: 2022-07-04 16:34:57 +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 e32ac20f5749..761f4a33ab43 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -824,14 +824,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)) { @@ -1441,16 +1433,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));