Message ID | 20230412124737.2243527-4-vladimir.oltean@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp308506vqo; Wed, 12 Apr 2023 06:04:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZkAw9DCKtir1+9lNYS4GmgAg7WZu77zFHXoQO87ROliJG41EMTAKrIgZWL4WQp74Zs8MKf X-Received: by 2002:a17:902:ecc6:b0:1a1:b528:9bea with SMTP id a6-20020a170902ecc600b001a1b5289beamr24580777plh.50.1681304680355; Wed, 12 Apr 2023 06:04:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304680; cv=pass; d=google.com; s=arc-20160816; b=YSOX0fNJaCwfgN4uW7J40DfFxIxE4NGZGyBucNVfYQFg4PHN+Xk+OWUeg2OMmzt50n B18DCvI4sc4q/WE1ZkoYJqyQ1Tsa5Beg5y91K2LH14RiEC/lZ+WrR6PZtXHUaZpFLlYF WlM/byqdzDKssC+0svFeEU8xI8GSgXo9uaCd0GCyK8aAGraPem4uzVjxi5icqj1eEvFC tEaYOszxUzgH+MTDgXcpqWvjrYb1hiHKp+JJHMWb5N5Z3VTi/fd1Vs7oDLqq6TpansBI LxNZALY1CeJ6eJH6EK/IoXdETNshW8Qw016pdMmzmOX1z3veLREbgbwcxdJSe/cujHxU aSYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9A3FkgECR+wOrtxS66iwjqK7z4EGPmIhtRTRgbu8FOI=; b=RT7sEb6IqAm6TBO1LwQAkEb6UE/kPE/LgxD1KrN53uBeQ/z1BiWAVmYeVQxHmxQGxO 9u2XVHXNGXlpvDFHZmM6iJwpTPWnbt7+77zla+6J8XX5Olu4FXCAh7Rl7f9ZkAgEZVqN yDDxjK75ObYQgEDaAwsdBS+lVhcWMDt6q4WmyxAL3jkbCpq0sF8os5UtkjIJsOHNOfMK B3U4XSCT3LsCyV8sV4jjD6SJqeBwgWxvXMIQx2DZDLFVqGWeV553D11Jy7J4bAmBWAkV wvzfnwwGAgO9gDqEV1lSbJFBSHznVRsoc/p5Syhcy19xdZMM6v7LKnpcnhhoSb5irjN5 2Yww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="CaKN/sUs"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb12-20020a170902fa4c00b001a515bbe3a5si13120806plb.592.2023.04.12.06.04.27; Wed, 12 Apr 2023 06:04:40 -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=@nxp.com header.s=selector2 header.b="CaKN/sUs"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231567AbjDLMue (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Wed, 12 Apr 2023 08:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231761AbjDLMuC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 12 Apr 2023 08:50:02 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2058.outbound.protection.outlook.com [40.107.22.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D22878A71; Wed, 12 Apr 2023 05:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dzT0l9+xkQucwb8At2BunfW9yy/qT44gFcnvc9c0BO2mavXKUhKijS1V8keOPBtDFv4jt6e3uweYPt8R7w+zXY4ylWU6+ZKbtqdnXmIy0HaFuZD1B8lua7cnAH8lV4JwFLlpHmkJtbFeC8+QTyS/oTuxk/nZIVpG0w9WwCw4dMLqqIRK2Q2GfLrvnetnezoAFAokfMF7I5UBzchzw+tdPrO3DdTlDuVpkWaY5Z19tTMEBxpl0HhdxLKXjr/8aboSOZ+JBW4gPnLBwf82QD1Hrr8FiQD5ZTH35bAyngzfeLf3sLf5ygjGIxeSc9c0TEQiTknQqirMCSVL0Linv1ajtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9A3FkgECR+wOrtxS66iwjqK7z4EGPmIhtRTRgbu8FOI=; b=Iarnrli3YsHpXVAkC/g1j9jI3H351QjJyEtuC0l8gNmyr/447sK+aKy84OX0HTIO6lnDW8Ps2RNmm6gyHjRNh3JGA9VtGAWxSLbrlAfa2v2Uvl2x6A3wpPuL4y/bBOxkDDXnxGnw3EWNF9CtAFJ3VU4uLlaqmRVUeMnLXnkgOqLeQmAkw/rW/6dO43/uVCa6XeYkUjz2qbj5M9oaspzYYE5s/H5rrT9AqtYHXYZdTr7Gw9rqpGOflCiBhJdHDbcRCQPh/4RTNQhQqry0OJNH0U5NUg1uyVROVZOzone3GkrI6jHHNBneASiouKhOSJXi32JCdMKuCst3stgm8OBWCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9A3FkgECR+wOrtxS66iwjqK7z4EGPmIhtRTRgbu8FOI=; b=CaKN/sUswcriWoAGvpTDKiilLEOOvWZ1YxWyN560rURUL7QdaxTsq62N1ixZQmJjpAsb7yBTSHfI7ZxeaztzyWJ2wWBpdZQlBXjzoMfnJlsQDk740QPxn1HEj3nhwal322Hw/vBmEd8fbkIq9+EMEJBF341W+9MhSmkrj0B1PqM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:55 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:55 +0000 From: Vladimir Oltean <vladimir.oltean@nxp.com> To: netdev@vger.kernel.org Cc: Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, UNGLinuxDriver@microchip.com, Colin Foster <colin.foster@in-advantage.com>, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/8] net: mscc: ocelot: debugging print for statistics regions Date: Wed, 12 Apr 2023 15:47:32 +0300 Message-Id: <20230412124737.2243527-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: 19106e46-226d-4f6a-588a-08db3b5422b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hb7WzG5Iy4pCw+AbbV5bg/wwscGTOxjq3fDICDRbhXUXKncIn7shT6Z4I14zMHRjheK4J/XITfjEh/yhjVAP+aqAq7AUAF5kpNiwdRCx2viH3llImnKAQ8If1IDNda1yxs7xPHQdie1JbWlrrWOTs84k5BbTakxiUDZn90jTNcvOMKKLr3JiQGcyCcSKJRZONv8V9LxM7C8ZgFQxv3adcxxXCRrdTTk36Jpk/lQL8qBZJRcfmZ51b4ggpDSszxuyRz0tC1uvy+6KcatBwbO46z6hqif7wtu/GxrEPNoGVPQlboPfwMyQKHFeHcdg78g7twm2pDPrUCSB9kPTLZOxgqODqi4vHhP/9MLiiZKu9gV7pwjY1vJPsHkshGTv7OTdn1fNWyyicLC2KzQp6TH9/4Wcz4y4Ir8f9OrbMKSljPDPWAtCHB+eb0EcEeBA8lDOjIslKFgOIE5ilK9q+UrW8DRhuNeGxIXgoQ1GqTFtDZNLEa/3CDIswyE0wwDTsHZ4seoUlyytSyk+EgQDMMOl1WJnsNj0lZQPSXnMyWlbUR1gyc+g/WNoinyPWQwlfW/oVrP34ojWcdlgRCfypjuXobHlv2TTzzJqzfNizvzsVgFbcx3EXwKpxlkRoPy90+Jr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7kuLUF6uAuCOef+rAVgdEvGBtVqwpN7geWGr9u3Y11qtGjOTdjUDT6nYxuG6c9Y4EeiO83RT4HjiHfOA/SECPZWiX8TLoRNRAHb3CcTAYDterWwxxmhyDgxEyknaglO2CwQJj3k/ti4GKRvhzOy2w4kJdbtulnVOVrR9nx9codm7MUe/viuyODrgNYwPBjfWKJ6E8kqBmPN7yT+fdCxDav6AdIUzaC/MJ1ADmWGVanXuo3ZCMXMXAylmoSLW1j1aYYa0ViTQRTHbrIvIqx0CRrtZJZ9Bp+mQ8tsRjhyZsbo9bZ7QguTyHU49LltaGgtwh0UlJpEA9JXj85/Gpmi7LF6px7huLCC+rop94D3eRb5GIS+8lazmeqAzOCArN9cY1pmWITh7zniwGye/EGm3oKCGZLBMXnkiSOy53aIotTxnvN4SGZW+Xp5k6FrtJz+4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g4tPIjJn3Xbu950HgZiQRNn+kgswNGrfJV2LQUH0dmpTNMHxrOS+7UfYjfyykrJ9bb6c076j19R1DGLU4xfxMw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19106e46-226d-4f6a-588a-08db3b5422b9 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:55.0822 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sh9hWutSYRWV9goJleANIHn0glIzBI4VYaUayBcuO0DMDhHk/CbNJruUVxpfbQsCpzXmRWbGN0frcXbcZmpJOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975736128374954?= X-GMAIL-MSGID: =?utf-8?q?1762975736128374954?= |
Series |
Ocelot/Felix driver cleanup
|
|
Commit Message
Vladimir Oltean
April 12, 2023, 12:47 p.m. UTC
To make it easier to debug future issues with statistics counters not
getting aggregated properly into regions, like what happened in commit
6acc72a43eac ("net: mscc: ocelot: fix stats region batching"), add some
dev_dbg() prints which show the regions that were dynamically
determined.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/ethernet/mscc/ocelot_stats.c | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
On 4/12/2023 5:47 AM, Vladimir Oltean wrote: > To make it easier to debug future issues with statistics counters not > getting aggregated properly into regions, like what happened in commit > 6acc72a43eac ("net: mscc: ocelot: fix stats region batching"), add some > dev_dbg() prints which show the regions that were dynamically > determined. > > Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> > --- > drivers/net/ethernet/mscc/ocelot_stats.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c > index d0e6cd8dbe5c..b50d9d9f8023 100644 > --- a/drivers/net/ethernet/mscc/ocelot_stats.c > +++ b/drivers/net/ethernet/mscc/ocelot_stats.c > @@ -925,6 +925,15 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) > } > > list_for_each_entry(region, &ocelot->stats_regions, node) { > + enum ocelot_target target; > + u32 addr; > + > + ocelot_reg_to_target_addr(ocelot, region->base, &target, > + &addr); > + > + dev_dbg(ocelot->dev, > + "region of %d contiguous counters starting with SYS:STAT:CNT[0x%03x]\n", > + region->count, addr / 4); This will load the target and addr every time even when dev_dbg isn't activated, but thats not a huge cost. Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> > region->buf = devm_kcalloc(ocelot->dev, region->count, > sizeof(*region->buf), GFP_KERNEL); > if (!region->buf)
diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c index d0e6cd8dbe5c..b50d9d9f8023 100644 --- a/drivers/net/ethernet/mscc/ocelot_stats.c +++ b/drivers/net/ethernet/mscc/ocelot_stats.c @@ -925,6 +925,15 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) } list_for_each_entry(region, &ocelot->stats_regions, node) { + enum ocelot_target target; + u32 addr; + + ocelot_reg_to_target_addr(ocelot, region->base, &target, + &addr); + + dev_dbg(ocelot->dev, + "region of %d contiguous counters starting with SYS:STAT:CNT[0x%03x]\n", + region->count, addr / 4); region->buf = devm_kcalloc(ocelot->dev, region->count, sizeof(*region->buf), GFP_KERNEL); if (!region->buf)