From patchwork Wed Jun 14 16:18:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13280206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C6FCEB64DB for ; Wed, 14 Jun 2023 16:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bjpfIbchiUnOOxL8VTQeWT6YeHzXnPkdWQ14CpGfmUc=; b=WBy25od2z+D6KN f2Y6gZd4CHwPsyJtlsRgeplULeCvbzC7V5kfbM4tTz5rpl4WgKPFPvj413XlnCVojnqUHvlgueGvf AXgzBxlhG1ee+UwRTS7wDqkgGiQNQyE0FQaC4hHJ6dtrLtGxdPVhjNf/Vt6qhXhYyrWtfdGnYD+fB YVct7DE4Xqj79F7pryEZFHGckSBjl+j7qFHV4J+f/+byjYOnL2Sz1Yu49dHYzCCKguBEiYuOEaMjl uQIqj8XGQRlqSF/FwVcNwZyIE3pgopNwIWnTG1QyIvYoo6EKvhz9Cm3Mm227PrKMpJ3F1xxrDmnmq zM/c4zYMj2cdkxlVoUBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9TNu-00CD58-2Q; Wed, 14 Jun 2023 16:30:14 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9TNr-00CD4G-24 for linux-arm-kernel@lists.infradead.org; Wed, 14 Jun 2023 16:30:12 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 260E763A27; Wed, 14 Jun 2023 16:30:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA3BFC433C8; Wed, 14 Jun 2023 16:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686760209; bh=9llC9DY9BE1LH+xc2pnl/22XEd3kSEENXwtBayoRpmc=; h=From:To:Cc:Subject:Date:From; b=Fnq/3Nj4MccrkPzv3Rq/CX3+iFa7JOQNucgcVaZ391g94TPoDfPbOxu6HRJquclaF nj/Rn8QMm+L+klMX8LFuwwsCcLyMWfPMyWDCJbDaxe5uUDr8Ftm8dksbP4M+LMRVhs pYNLBDGTt24/m+eKyUAuDVDcQXT+wavNLkvybREsquzx/IHQ7nmZSxnTpB7jkluVPG v5LIE6KhNkXhG6ih0rPOUHFykTdBAEFULWkxdzuuQeJEsxRVtdsr6SOHY+pKxuZdtM s3JEAGXFOJ6MvSlznDY6hb8PeFwPBTuRlonB8JNYzWJ2TiL4TzK4lxVQT6mg72eyGU gn4vGFfOPvLCg== From: Jisheng Zhang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH 0/3] net: stmmac: fix & improve driver statistics Date: Thu, 15 Jun 2023 00:18:44 +0800 Message-Id: <20230614161847.4071-1-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230614_093011_744441_038E0A53 X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org patch1 and patch2 fix two issues in net driver statistics: 1. network driver statistics are cleared in .ndo_close() and .ndo_open() cycle 2. some network driver statistics overflow on 32 bit platforms patch3 use pcpu statistics where necessary to remove frequent cacheline ping pongs. Jisheng Zhang (3): net: stmmac: don't clear network statistics in .ndo_open() net: stmmac: fix overflow of some network statistics net: stmmac: use pcpu statistics where necessary drivers/net/ethernet/stmicro/stmmac/common.h | 54 +++-- .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 15 +- .../ethernet/stmicro/stmmac/dwmac100_dma.c | 7 +- .../ethernet/stmicro/stmmac/dwmac4_descs.c | 13 +- .../net/ethernet/stmicro/stmmac/dwmac4_lib.c | 17 +- .../net/ethernet/stmicro/stmmac/dwmac_lib.c | 10 +- .../ethernet/stmicro/stmmac/dwxgmac2_descs.c | 6 +- .../ethernet/stmicro/stmmac/dwxgmac2_dma.c | 9 +- .../net/ethernet/stmicro/stmmac/enh_desc.c | 20 +- drivers/net/ethernet/stmicro/stmmac/hwif.h | 12 +- .../net/ethernet/stmicro/stmmac/norm_desc.c | 15 +- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 100 ++++++--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 190 +++++++++++++----- 13 files changed, 304 insertions(+), 164 deletions(-)