From patchwork Tue Dec 5 08:04:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geetha sowjanya X-Patchwork-Id: 173782 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3277162vqy; Tue, 5 Dec 2023 00:06:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRUxWjJSegyinz2dQcf5ssAFNNfVr5ndBMsrtfaHL2Wv0VjO7WdbwGxrh0HMTRmmK2I+XE X-Received: by 2002:a05:6a00:3903:b0:6ce:3c1e:743f with SMTP id fh3-20020a056a00390300b006ce3c1e743fmr1037990pfb.41.1701763608062; Tue, 05 Dec 2023 00:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701763608; cv=none; d=google.com; s=arc-20160816; b=dlXo88e5koqYo2PNj3Xwtx/gQbSFDJouqKaYOeYZnK49pXCH9nZoR8Yhqctxsvk74a jxUUnXkeuaVTfgr2VelNY4TcfCLn/LDbRxyd9YjaQ6Uaqh+lgArajxrgz1OKooL3/zWd ZEZUqLDGNX2na4atFND2i33X0gPkYhiBD8i50bJgeiUIwRaQy7KL7lNGFXhQt3yga1R6 RKs/NNVxNXJYrzSh5gHW1/zDIamOGArN1c6NXbTJMD44SLMLr2L0XAFmxQO10GAYFAPm uBdQ5drRPXZuGDlm5C8aHnp9u0ceE/cqkbd1+dK4Z+7P0PRcYQb2UrbAgIDzxwYRvILv cuiA== 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=aWngtRDxPwzlvoiaiZGqPUHzdIBT5rG+oxF0CqsGxLE=; fh=HY0X0m8t22/vAHj95xREoxWh6Roau2zCUUWQKPKPfT8=; b=KTTxvjMySnmbIYyatutkhcaRSTA7h7G2K5LozQ+2unWPO3tKUUo2IaVqRr0K5c3n7Y EzlWFEGiZGqYv8vwKyTAf/aDHYyfF0PeyZMtUElxKSUZZYvKAecJt+KL6Fsoyl1P2b5z wbgsmfe4EBy/NNHpNfzEW0jAdnUp8IhZmNlrfWDjWe3GeeL3r3VEib1Mn9M3zSLAvYdw 0OcUZcdtjMaw3nuBka8dWojTRBexlM3wPyaMu1B9MnL2+zscaeRgCccerMUZHz15iLjw hl3xrTGrvt4xEFoU3oZLireU1I6PSHx8mmlUKwZrFx32xLpgLFF78RZ71KOK2FEBAi9N bcXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=TpbewK1Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u16-20020a056a00125000b006ce08cdaf39si6539042pfi.386.2023.12.05.00.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 00:06:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=TpbewK1Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id A7663807B48E; Tue, 5 Dec 2023 00:05:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235572AbjLEIFX (ORCPT + 99 others); Tue, 5 Dec 2023 03:05:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376355AbjLEIE7 (ORCPT ); Tue, 5 Dec 2023 03:04:59 -0500 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE48719F; Tue, 5 Dec 2023 00:05:04 -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 3B4NxDqJ021827; Tue, 5 Dec 2023 00:04:54 -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=aWngtRDxPwzlvoiaiZGqPUHzdIBT5rG+oxF0CqsGxLE=; b=TpbewK1YrFCAA81Fr1IwuDUjqX/iKS6P6MWrcwciMtS2UVOmpCiri0rYx7Rz0IPmvwAZ 2xGfW6IMFezoqemlegvEwPsEQVNLe2M/YxfJmBr6NyXVDioWGUo2iMEGIyPgckj0vqMK UN+8YyofTM3Nb+3704juQ83kubKklMe73r5Kv/ZmnVhxz4bO6Gzf6dvndNwcUZGFUY2z OJ3rX9WXk7Fvfb6Ip5c+BAbDOJaG7nXPRDl8bZOe+j4Jgkk0WABo4Qs3w0rT2ofFZylk uia2JLUUswlWZkIvRyKSGVr9UIAEqYJGWlGrOIhaEQKrInxCOt20py8s3Uwzfndw9I2A yg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3usrx3h83p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 05 Dec 2023 00:04:53 -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; Tue, 5 Dec 2023 00:04:52 -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; Tue, 5 Dec 2023 00:04:52 -0800 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id BD2E03F70A9; Tue, 5 Dec 2023 00:04:48 -0800 (PST) From: Geetha sowjanya To: , CC: , , , , , , , , , Subject: [net v4 PATCH 3/5] octeontx2-af: Fix mcs stats register address Date: Tue, 5 Dec 2023 13:34:32 +0530 Message-ID: <20231205080434.27604-4-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231205080434.27604-1-gakula@marvell.com> References: <20231205080434.27604-1-gakula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: HA4Ffe0DlSZOAxNc1k_3j8p1m5dVr0Sz X-Proofpoint-ORIG-GUID: HA4Ffe0DlSZOAxNc1k_3j8p1m5dVr0Sz 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-12-05_03,2023-12-04_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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 05 Dec 2023 00:05:49 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784428477082251895 X-GMAIL-MSGID: 1784428477082251895 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 --- .../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 bd87507cf8ea..c1775bd01c2b 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)