From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01619462A9; Mon, 24 Feb 2025 10:42:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F27840DD5; Mon, 24 Feb 2025 10:41:20 +0100 (CET) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 481F740A72 for ; Mon, 24 Feb 2025 10:41:18 +0100 (CET) Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51O515Gq009516 for ; Mon, 24 Feb 2025 01:41:15 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=M gr6qTctNoRCkAuQ+R4Zwniz3U3lDbQt9BlnjXnG1w0=; b=R7EbzSkvPmHVD5A8I MGbioxiDbDShUH/pSazmv4jKGBXbnxtaij7JEy228sPQumChW3Wn4gi+qND1+l/2 0rktrl1TdINUa++Iqum/7H0RIcrd738+bo12VbEq3W5U1iy1tNjfB0cRUod/cYrw sUX11pJMUXImIqdqjuUuHHRD3VxjVEday5SCuhTl26qwXIoT3Y2fntYhH5pq/F2M fmzYf4O6TBeAmUSprr5lYkMq43Y27LRGCXd2T1mgDt1Nc7qWrAyL7TVWkGN65ajG wxF/xBJNBtpoJHh4ZnowFQRyHSTis0ZuX+Ji1Iwx/34o08IqbNKQo3AHHfTNcfoV X5G4A== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4503qbspv8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Feb 2025 01:41:00 -0800 (PST) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 24 Feb 2025 01:40:54 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 24 Feb 2025 01:40:54 -0800 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id CFAE63F7062; Mon, 24 Feb 2025 01:40:51 -0800 (PST) From: Nithin Dabilpuram To: , Nithin Dabilpuram , "Kiran Kumar K" , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: , Monendra Singh Kushwaha Subject: [PATCH v2 30/33] common/cnxk: add stats reset for inline device Date: Mon, 24 Feb 2025 15:09:12 +0530 Message-ID: <20250224093915.1253215-30-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250224093915.1253215-1-ndabilpuram@marvell.com> References: <20250131080530.3224977-1-ndabilpuram@marvell.com> <20250224093915.1253215-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: AONeVImyiSdy7Z-I09_XGDy5Odpj5zmj X-Proofpoint-ORIG-GUID: AONeVImyiSdy7Z-I09_XGDy5Odpj5zmj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-24_04,2025-02-24_01,2024-11-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Monendra Singh Kushwaha This patch adds support to reset inline device stats. Signed-off-by: Monendra Singh Kushwaha --- drivers/common/cnxk/roc_nix_inl.h | 1 + drivers/common/cnxk/roc_nix_inl_dev.c | 27 +++++++++++++++++++++++++++ drivers/common/cnxk/version.map | 1 + 3 files changed, 29 insertions(+) diff --git a/drivers/common/cnxk/roc_nix_inl.h b/drivers/common/cnxk/roc_nix_inl.h index 2db3a0d0f2..dab4918535 100644 --- a/drivers/common/cnxk/roc_nix_inl.h +++ b/drivers/common/cnxk/roc_nix_inl.h @@ -130,6 +130,7 @@ void __roc_api roc_nix_inl_dev_lock(void); void __roc_api roc_nix_inl_dev_unlock(void); int __roc_api roc_nix_inl_dev_xaq_realloc(uint64_t aura_handle); int __roc_api roc_nix_inl_dev_stats_get(struct roc_nix_stats *stats); +int __roc_api roc_nix_inl_dev_stats_reset(void); int __roc_api roc_nix_inl_dev_cpt_setup(bool use_inl_dev_sso); int __roc_api roc_nix_inl_dev_cpt_release(void); bool __roc_api roc_nix_inl_dev_is_multi_channel(void); diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c index 041ccd9c13..2e753440b7 100644 --- a/drivers/common/cnxk/roc_nix_inl_dev.c +++ b/drivers/common/cnxk/roc_nix_inl_dev.c @@ -1295,6 +1295,33 @@ roc_nix_inl_dev_stats_get(struct roc_nix_stats *stats) return 0; } +int +roc_nix_inl_dev_stats_reset(void) +{ + struct idev_cfg *idev = idev_get_cfg(); + struct nix_inl_dev *inl_dev = NULL; + struct mbox *mbox; + int rc; + + if (idev && idev->nix_inl_dev) + inl_dev = idev->nix_inl_dev; + + if (!inl_dev) + return -EINVAL; + + mbox = mbox_get((&inl_dev->dev)->mbox); + + if (mbox_alloc_msg_nix_stats_rst(mbox) == NULL) { + rc = -ENOMEM; + goto exit; + } + + rc = mbox_process(mbox); +exit: + mbox_put(mbox); + return rc; +} + int roc_nix_inl_dev_init(struct roc_nix_inl_dev *roc_inl_dev) { diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map index 36eb46e3a1..cdbfc1d39a 100644 --- a/drivers/common/cnxk/version.map +++ b/drivers/common/cnxk/version.map @@ -252,6 +252,7 @@ INTERNAL { roc_nix_inl_dev_is_multi_channel; roc_nix_inl_dev_is_probed; roc_nix_inl_dev_stats_get; + roc_nix_inl_dev_stats_reset; roc_nix_inl_dev_lock; roc_nix_inl_dev_rq; roc_nix_inl_dev_rq_get; -- 2.34.1