From patchwork Thu Nov 30 07:58:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geetha sowjanya X-Patchwork-Id: 171763 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp220663vqy; Wed, 29 Nov 2023 23:59:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHY+Jq9EtSNKxSl4HAhJgNxMxyGW96afczRsfpqc/BWmyywwkaOc+Hc7u3EOCcYDEzBureY X-Received: by 2002:a17:90b:350d:b0:285:b6b1:a2d6 with SMTP id ls13-20020a17090b350d00b00285b6b1a2d6mr16605315pjb.33.1701331147524; Wed, 29 Nov 2023 23:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701331147; cv=none; d=google.com; s=arc-20160816; b=fQzHFMpSzCUf1FXt8yjU24K8dlQKauXAUrJ9ZPhxmVom8B3/+9g6dxGEIzYqHSN5N/ Gf5pNGa5uOg9MPKREx5bLpK/9Wmr9K4D7kmA5q4Ba5TcAfj8KUI8jw9d96tuLDZp7Jwq KEypBQN2OkWdFvSnH6JS8G3vthJcBCtb+At1VhPDnf0QD1masWi4GprvJ2LNORXclgvQ 0+dQyqd87eGytG9aBRiL6Ltd9R6/KoSJDxWe7V7vrMxov2n+JxACKi4h5NTaetrwfbV3 t/8kkDM+BXXcNbET46P9IRRGqwkvnNNYQpYtICWszcLTEOJPmVbpGDZyGB2y5IkxB+9n qIbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=tLffYGulcEiDS391uyT0+s5E4ygqi5Ia3Ebu69zKUgs=; fh=HY0X0m8t22/vAHj95xREoxWh6Roau2zCUUWQKPKPfT8=; b=GfGRoLCNwc/uiU2xo6DZou696248gIWqg8VqVuxwm4RmyaLFvy/pCe8E63D2tsJ5Wa G08KSNYWm6N5K31Y2rftQiXd2HBBxoVZRIUGnDaL7qA2iuD/1NQiPgpQLbNyRh1K21he uROJnEaqEXKf3xn7wFzS99TUaOUGNiz56uH+a+KNi5gBwdm/fHc+O8K2fdGsAtVSVRLC FjszlyBXpBUYkuG7sYBznHrd4SKEyM7RpPIBXMw5DhTorVBfbNv8ZpauXWB4tChUfiNa T9wGCVEufzxFidoxhvqQ9syx+6nh9GunbFNdnI2PSb6ljlAdQQ0Yhxch4oVuGmdPnS1L bp+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=cxOp0FXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id x12-20020a17090a9dcc00b00283a1123a02si3078089pjv.96.2023.11.29.23.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:59:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=cxOp0FXF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4A462826E6A3; Wed, 29 Nov 2023 23:59:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344794AbjK3H6m (ORCPT + 99 others); Thu, 30 Nov 2023 02:58:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344776AbjK3H6g (ORCPT ); Thu, 30 Nov 2023 02:58:36 -0500 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1BF810DB; Wed, 29 Nov 2023 23:58:42 -0800 (PST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AU7iiqT027731; Wed, 29 Nov 2023 23:58:37 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=tLffYGulcEiDS391uyT0+s5E4ygqi5Ia3Ebu69zKUgs=; b=cxOp0FXFKn6N/qdriN6HpcuDz+3xPXs0Hsne3iMBtNd4SSGJwj8U3U0RY4g+67aUtAoe Hpto+86PKNymML1DQarJfb5XC2OxkcWvxCNxFTM65xGOs3alRCnKJ/ekISSiVgnG8kuD 5rdx0vPRpp1jvE2f6Oj+xXz97slO+wty1AhCV8plQTM8Q4e2GJNYEIXT0rUIr7Sys/nb KysYjL1w+BehuEy45rO9u9mDIn2Jh87Pk1+TbGPfQKeD/ltXjC+4Z0W7mn+gsE12sXDx k2AIXyvJZtZlUMzQ3yykeilafO54gnBcbe6dU6V2NV3fgdVOqeW0gyDN094jBI+Oc9wc 2w== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3upc1v2j04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 23:58:37 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 29 Nov 2023 23:58:35 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 29 Nov 2023 23:58:35 -0800 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 3ADAB3F704B; Wed, 29 Nov 2023 23:58:31 -0800 (PST) From: Geetha sowjanya To: , CC: , , , , , , , , , Subject: [net v3 PATCH 3/5] octeontx2-af: Fix mcs stats register address Date: Thu, 30 Nov 2023 13:28:16 +0530 Message-ID: <20231130075818.18401-4-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231130075818.18401-1-gakula@marvell.com> References: <20231130075818.18401-1-gakula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 45peGFP5N_EqUQGWVLahSNq7H19lU2lH X-Proofpoint-ORIG-GUID: 45peGFP5N_EqUQGWVLahSNq7H19lU2lH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-30_05,2023-11-29_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 23:59:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783975009495864238 X-GMAIL-MSGID: 1783975009495864238 This patch adds the miss mcs stats register for mcs supported platforms. Fixes: 9312150af8da ("octeontx2-af: cn10k: mcs: Support for stats collection") Signed-off-by: Geetha sowjanya Reviewed-by: Wojciech Drewek Reviewed-by: Simon Horman --- .../net/ethernet/marvell/octeontx2/af/mcs.c | 4 +-- .../ethernet/marvell/octeontx2/af/mcs_reg.h | 31 ++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c index d6effbe46208..d4a4e4c837ec 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c @@ -117,7 +117,7 @@ void mcs_get_rx_secy_stats(struct mcs *mcs, struct mcs_secy_stats *stats, int id reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYTAGGEDCTLX(id); stats->pkt_tagged_ctl_cnt = mcs_reg_read(mcs, reg); - reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDORNOTAGX(id); + reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(id); stats->pkt_untaged_cnt = mcs_reg_read(mcs, reg); reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(id); @@ -215,7 +215,7 @@ void mcs_get_sc_stats(struct mcs *mcs, struct mcs_sc_stats *stats, reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCNOTVALIDX(id); stats->pkt_notvalid_cnt = mcs_reg_read(mcs, reg); - reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDOROKX(id); + reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDX(id); stats->pkt_unchecked_cnt = mcs_reg_read(mcs, reg); if (mcs->hw->mcs_blks > 1) { diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h b/drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h index f3ab01fc363c..f4c6de89002c 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h @@ -810,14 +810,37 @@ offset = 0x9d8ull; \ offset; }) +#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDX(a) ({ \ + u64 offset; \ + \ + offset = 0xee80ull; \ + if (mcs->hw->mcs_blks > 1) \ + offset = 0xe818ull; \ + offset += (a) * 0x8ull; \ + offset; }) + +#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(a) ({ \ + u64 offset; \ + \ + offset = 0xa680ull; \ + if (mcs->hw->mcs_blks > 1) \ + offset = 0xd018ull; \ + offset += (a) * 0x8ull; \ + offset; }) + +#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCLATEORDELAYEDX(a) ({ \ + u64 offset; \ + \ + offset = 0xf680ull; \ + if (mcs->hw->mcs_blks > 1) \ + offset = 0xe018ull; \ + offset += (a) * 0x8ull; \ + offset; }) + #define MCSX_CSE_RX_MEM_SLAVE_INOCTETSSCDECRYPTEDX(a) (0xe680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INOCTETSSCVALIDATEX(a) (0xde80ull + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDORNOTAGX(a) (0xa680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYNOTAGX(a) (0xd218 + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(a) (0xd018ull + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDOROKX(a) (0xee80ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(a) (0xb680ull + (a) * 0x8ull) -#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCLATEORDELAYEDX(a) (0xf680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSAINVALIDX(a) (0x12680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSANOTUSINGSAERRORX(a) (0x15680ull + (a) * 0x8ull) #define MCSX_CSE_RX_MEM_SLAVE_INPKTSSANOTVALIDX(a) (0x13680ull + (a) * 0x8ull)