Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp129985rdh; Wed, 22 Nov 2023 22:01:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHL3HLklnT05tbMCQK268KEcn43f14bK3ZVcnieU4IYAO4+AFrvUnUyzUCXVHM3gUOK6GC X-Received: by 2002:a17:903:2612:b0:1cc:6101:2086 with SMTP id jd18-20020a170903261200b001cc61012086mr4043922plb.11.1700719290268; Wed, 22 Nov 2023 22:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700719290; cv=none; d=google.com; s=arc-20160816; b=FJYVLDyuvAmLtv2id6pqqP2eJzv2MXecwleEKe7yH7QLMuEGdYKE/bUqovqiCHZlrB x/CtSWuypJmqSCNuoGs/+rlIQIkWXJRfeb90oUEJ7LhHst7QuG5PsCd8oJve18ctM2dU FzqLgidrluKVhFpIUtxvdmayJcRKyfAodmgpLWJhYHJOLQT7rtpIksJE3xS8oM0bDBRs K+6jd4UZweracsrQ6z9vN71r1altonM7Ev61nZo3jXTR8aI2S1GIMpOn0JcGb5nok1X5 q/Uud4YnE7TciHfGtLawfMyIeIwYZ2/TRQasPEsxrkfuNv6EzwMNUToYUX8UmyrE1unC 2APw== 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=kM3BU7BmXAvWkQp+dGqrdOyFofGDsnc5M3Efwgf8NdE=; fh=wPv/fmS7iNNmCH0mdUKjkT6XsNx1nMbXFeqwvq2D6q0=; b=ckzvoPep6B8Ne15NauFEG1HKa7Jh6yd0tk7Z/aVZ0jYkxPyqeSdktfEwT3RG2PM3dH dhpQLmXQjM/p2HFChjZVSMl0ft5BJaZZoYHWLOBPUS4SU5zu1K12IFzTav4QlQ+JpfKz GWThFsCRAC9vVlsJ8oMp3a3Jd94Nt4zC6thByZS1mWmJ1Xo33P4eQuBca5XnsXd2/cGY ZB3L22DwfuBBuTrTVI5mRJ26NpMOAG+JQRSd9Bb3wfc93NBDDR1QlexzgohhyVr5juWI GuxtQniRh/z9up95MkJXVHaE1GnoszM4qHAAg+qryMOqf43H2CrZjxInOWeqzRDxHiHV kqaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=I0wtuJku; 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 Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id q9-20020a170902eb8900b001cf6b6831b8si537870plg.58.2023.11.22.22.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 22:01:30 -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=I0wtuJku; 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 363A4807CB74; Wed, 22 Nov 2023 22:01:21 -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 S1344789AbjKWGA6 (ORCPT + 99 others); Thu, 23 Nov 2023 01:00:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344731AbjKWGAq (ORCPT ); Thu, 23 Nov 2023 01:00:46 -0500 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D8151B6; Wed, 22 Nov 2023 22:00:52 -0800 (PST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AN5YmaQ022778; Wed, 22 Nov 2023 22:00:46 -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=kM3BU7BmXAvWkQp+dGqrdOyFofGDsnc5M3Efwgf8NdE=; b=I0wtuJku19iLqhPBQLvFaC1GtlLsgXYjzLQoNCLHjYAe0DxQ0XfzlNN1z2Llu9poU9VW wVbX94K5jJymUF9MDzKP87Bn/z1/BRMTA7fiHSp0pboshcqxdJx7kf3ie6BRVho3ZpDx ALquT8Ae15ck7Up/enFA0FvpjzWc3HreX/nVu4zz0hs87B3PdY7p45dbQo3p8aw5WDBA XSl+dLdPz9d3mCtcLZ0CtRhhT9SxwZuwdALl/USZARMD/e6LdSv25XPWxfSLIWE/IrZ8 uoqlT1zkWDillfqAVrXyg307daHjn9d0Kr8lgbEGAGy7zxf1k0Me4VmeMDyExSHye7Xr NA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uhpxn1xm0-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 22 Nov 2023 22:00:46 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 22 Nov 2023 21:59:57 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 22 Nov 2023 21:59:57 -0800 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 135A73F7088; Wed, 22 Nov 2023 21:59:53 -0800 (PST) From: Geetha sowjanya To: , CC: , , , , , , , Subject: [net PATCH 3/5] octeontx2-af: Fix mcs stats register address Date: Thu, 23 Nov 2023 11:29:39 +0530 Message-ID: <20231123055941.19430-4-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231123055941.19430-1-gakula@marvell.com> References: <20231123055941.19430-1-gakula@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: wT6ECuTrFEa1d7aZZSif7bjQrNFo2Rbi X-Proofpoint-GUID: wT6ECuTrFEa1d7aZZSif7bjQrNFo2Rbi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-23_03,2023-11-22_01,2023-05-22_02 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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, 22 Nov 2023 22:01:21 -0800 (PST) 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 --- .../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) -- 2.25.1