From patchwork Sat Jun 17 13:09:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13283602 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 A684EEB64D9 for ; Sat, 17 Jun 2023 13:21:44 +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=8t9UF8w07y/T8EEhzmilpLw8y3q8jX1Ig8lVNAsXFdw=; b=IJBt8jyXIuG4mO vcb1ZcAXXAmc77JV0iUI2vN9eoonQ2zT3SABRsmyQY+YDH7CwBwI/+u3nvNCoSQbFBNo3kZZJ/kTH QAZzQ7H7VDNzhV+KrNTgGRzbeCyzpg+Cgl+935KB6eoTMRo82y/BdVdtvwNhfGDsqmY3aUK1nJo1X eCtSdqjjJqV6G6yEHfK9NVcpr/UtOAGiFm2emU5TTwDwsaL/ywCeqxlsNLJHRBCLLIgF9X4YLxp+Q OPhnpIPpLFPni95Yu2Mv6KmZ112KSNe1McD5eCtUtcns/rxvDu0UnZVh68l0uDzdsOboquRFdBalx azbu85rtwO5d6wF5XaOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qAVrk-003ejo-0a; Sat, 17 Jun 2023 13:21:20 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qAVrh-003ejD-0R for linux-arm-kernel@lists.infradead.org; Sat, 17 Jun 2023 13:21:19 +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 E62BA60C2E; Sat, 17 Jun 2023 13:21:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1EB6C433C8; Sat, 17 Jun 2023 13:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687008073; bh=Q+/MaNb9NjJqu/qD/8ir2QEc9bYxenlvnj0Sb209bl4=; h=From:To:Cc:Subject:Date:From; b=WWZmgbFcqSGe4RdMt/6EoAjh2pX4SGmd++uTNfeaTGx706C8fUSYGVoN2z5CJE75Y rOrQ93UEclzD2XhbrIyir1wJGZOw2CgqdvJs01kQWHfc8grm/HH6tVD88VbZxceTwc +Y1zP3J71PdC1fhntjjht14XWdX4zDxbuHb2DCRKjn75kYFm+U+E/AAyxHO6gUy1q5 oSfHSqEhgUXJlxHPsppaC6RVSzs+NYTvZcnkcmDdJy6s5gJPGdcuc9gJVBsWzsnPPx Kid2Ir1eY2g45ubZokrA62W5GONdihNRgq2fBdb+LeG7meuPgqN7R+FMye2pS/4cQq K5QIJtbSubKIw== 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, Simon Horman Subject: [PATCH net-next v2 0/2] net: stmmac: fix & improve driver statistics Date: Sat, 17 Jun 2023 21:09:41 +0800 Message-Id: <20230617130943.2776-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-20230617_062117_234360_1249341D X-CRM114-Status: UNSURE ( 8.30 ) 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 improve the stmmac driver statistics: 1. don't clear network driver statistics in .ndo_close() and .ndo_open() cycle 2. avoid some network driver statistics overflow on 32 bit platforms 3. use pcpu statistics where necessary to remove frequent cacheline ping pongs. Since v1: - rebase on net-next - fold two original patches into one patch - fix issues found by lkp - update commit msg Jisheng Zhang (2): net: stmmac: don't clear network statistics in .ndo_open() net: stmmac: use pcpu 64 bit 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 | 15 +- .../net/ethernet/stmicro/stmmac/dwmac_lib.c | 10 +- .../ethernet/stmicro/stmmac/dwxgmac2_descs.c | 6 +- .../ethernet/stmicro/stmmac/dwxgmac2_dma.c | 13 +- .../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 | 101 +++++++--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 190 +++++++++++++----- 13 files changed, 305 insertions(+), 166 deletions(-)