Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3036816rwd; Wed, 14 Jun 2023 10:18:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5OP36S1tvC/5Kp1frNvTxHG4uqZ4MGeb09njMFI895Erw+WXJU8pPDhXKLYSWiyygexzJg X-Received: by 2002:a05:6a00:80c:b0:63b:5c82:e209 with SMTP id m12-20020a056a00080c00b0063b5c82e209mr3083373pfk.10.1686763102237; Wed, 14 Jun 2023 10:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686763102; cv=none; d=google.com; s=arc-20160816; b=LrXCzd4FnuG5rbnglJ1HeZMU5/UwbXFKfUoF+YV5vy2T77pUZnkqTvjIZpq93wqeNR 8OznJgdA/VWDD/GonJTbAie/JT0Sw1tA3BAVCAOx26fieznHfJPzziSfSY8leKkvqtFK Fi4NrXRoNjRkjEGoUcH1TKNr8VRHuDR5ytAAPb4rTHUEtprklJmujYefsdruNZxz2btF 1qtTKH33+yB9DdbwvfXc+x5mAiOqWKMzhGuL96aOKqUhFhphymsSAspjTtj7U2L2WH6n v5nHfnKYFvsxhnKUzgpTbYUIoB49LtTrQwykCPofFfT7sj1XSu8duhyyPUeYsuXvAIPO zjtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=fwYvLOvhyNb9MeG5iKgzRLFWStHiNO2IIZf5MNrIZ30=; b=L9evpYW4wGvgN4KeEKykWo1f0l5MjMLWi5XvjUZHKHabM/bX3DAYwEBACdaj0F3K3T SCzsUs8fVBOQR3mgcrKtjsy2XCEccAopnsrtBJy7r84autCcbg+QBhiSfKxh1a3GRNyJ zf36WU2/5jDM2NLp4oXMI9OopehzCUk6lLIOSOMkATd0FMo6jrMfri4RofoWqqz1Y1Iy fyhCgKy0xoRlGxH6Pp4tl+MJjvXVx+7J1gsnKQ6WSIxjkt73uLh4owGWNmxcYq6NvjvA ULOhy8eX5oU0ag2ps4gOm75MI+wFgspWN2AL9BkU8xwmLt8e9koBg2j7MyWEvDdDg8LW JTeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Fnq/3Nj4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x64-20020a626343000000b006630be2db05si271899pfb.182.2023.06.14.10.18.10; Wed, 14 Jun 2023 10:18:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Fnq/3Nj4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233762AbjFNQaQ (ORCPT + 99 others); Wed, 14 Jun 2023 12:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233699AbjFNQaL (ORCPT ); Wed, 14 Jun 2023 12:30:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BCC41FF5 for ; Wed, 14 Jun 2023 09:30:10 -0700 (PDT) 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 221DE61868 for ; 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.40.1