From nobody Thu Jun 23 18:16:02 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 B0CD18766AA; Thu, 23 Jun 2022 18:16:02 +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 4LTT2p3Qs2z3P7v; Thu, 23 Jun 2022 18:16:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656008162; 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=Teyvb+mm8KpA4LWAUcksOzGg55J6so5q2pTVbMDozIQ=; b=kKssF8ru2khWlSA1d5UNG3h6AVQqWop7sS9okq1e3MnLq8RjrsSlrhJN/fhQ7C+nrMf8Qu ZcYga3bMs0ayTb2ZTr5L3alLRlkyQy/cRx9yqjg+G+IkOT0oz9AayW4aavj9SSCgMhGYiQ KmJ3rZdcUHkQawBSx/1HSAx4MaOibhLrLaQx/SYQPADazeXqz2raNB42xHVmVamsvTT+b3 x8ph3Xul6ATVjQSVrQxTcZ3VcYElKcD3ndT6YMbnXmyK3XP+DUZusZEi31DqaHB5kfNugv 8e4KvXXNQVZBua8XDhfC7fBgTA5gjRBbDR5m0avr1sZ/6NrVX+J9+gBa0w1Pfw== 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 419C91FE44; Thu, 23 Jun 2022 18:16:02 +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 25NIG29r014801; Thu, 23 Jun 2022 18:16:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25NIG2lf014799; Thu, 23 Jun 2022 18:16:02 GMT (envelope-from git) Date: Thu, 23 Jun 2022 18:16:02 GMT Message-Id: <202206231816.25NIG2lf014799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 9718759043ec - main - 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/main X-Git-Reftype: branch X-Git-Commit: 9718759043ec2ef36f12b15963194b866d731b5b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656008162; 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=Teyvb+mm8KpA4LWAUcksOzGg55J6so5q2pTVbMDozIQ=; b=B0bWEDSju1cxrdvFSROl5SbdA6uPtsPDsR2ywJh9VbjVrj9dt5MJb+4pLE6AqvdPC+xQnP 70V44g+fuwkAWKxV3kyWnrXAa3HV4TPcroFJlxNhZQNOdx1jU0/vvbDIxyM9l1swVpq/O3 Dfcn25IlzfaJRfBIUiKgJTMCqV/IINUYWO6TWuDtwmIRRpQNsFknvbne7qGXHwxIcaXCOW psQ0TTvMkpLNMMJUodWXTnuurp/B3fwyUygRCx8g4pzagmcpU52xcSPaHrePc5eIl4pW3i AqcmcNiZ1b96+mQzXL4FatUnQjKBcgTm8AtpaNwTg0CaTQOEZXDmfocdNd8bgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656008162; a=rsa-sha256; cv=none; b=LwqAzTDkcasNMPgVGvfEmCn6K3Dys7DasO8fqDVTOhT5lIEsb0TsEaMtC970PG4aPYe85L uYMjNZQcEBedlom0jxksWxjH6Y0QsWtEiJY4WolQEpQhGq81Qad1kkvCiTuaTgaE3YZiin 7JSxphGoINRoOgTQBoZ8OQEOJbQys3qqAPnCAg9YUs0+aQxUmFHbNDA+P2tAdHZqSTcFA0 DYQbVZTfEz0pMuJlpMytpOERuDXLNB6oaayAGZzOH4wy2qAeMwileYanZMAc+CXLLMgZ39 YwqcjYd2y/PHZ1h7e5oa5B3dBs2WOdmEDQUZ9GChtwoGh2gFRcknT2zRWvbFdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9718759043ec2ef36f12b15963194b866d731b5b commit 9718759043ec2ef36f12b15963194b866d731b5b Author: Mitchell Horne AuthorDate: 2022-06-21 13:24:25 +0000 Commit: Mitchell Horne CommitDate: 2022-06-23 18:15:10 +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 --- 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 1685866ad9ad..5ec115f7081b 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));