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 B17DB45BFE; Mon, 28 Oct 2024 12:02:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E19D40EDD; Mon, 28 Oct 2024 12:01:58 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C4F2B40E41 for ; Mon, 28 Oct 2024 12:01:48 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49SA0mnr010807; Mon, 28 Oct 2024 04:01:47 -0700 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=U oJNxE9BtIc8mhLMy5cmzou/0PpQ067wNMR09Ueuaz4=; b=fCbAEcfzG8gzZlTM9 BPkfrrKELJwknfPm9UuFUGRtBE3Lc0ntTtUHhIjSEo5uLNU8MjvMXF9vP2ti7n3K y6+1YfbCe4KpdURNNmmWx5BvQNO9UKWW1K6SDZqiTCGGgqhjgLl2LI96kwaqu17S a6rdQMj6RIUgi+QwXeuDMIPwh07wcj171QZ8XBC8r6HrL32ouaLrmQx6hoqFb+5U 81OmUeYupNklBnqvDhsAH1epSe7Egjb32IuuQtSGGQKr7c5BAb5R36IFWpr92XN/ nmvMc4As1cbXkVdi4lOryyNFK839PgtsuOIqvj9X4qVmdVn+xqtK+Pc2nZWoVPyq NhqsA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 42j7v2055g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2024 04:01:47 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 28 Oct 2024 04:01:45 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 28 Oct 2024 04:01:45 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 916715C68E6; Mon, 28 Oct 2024 04:01:42 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , Akhil Goyal Subject: [PATCH v6 7/9] raw/cnxk_rvu_lf: support device pffunc get Date: Mon, 28 Oct 2024 16:31:13 +0530 Message-ID: <20241028110115.1070655-8-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241028110115.1070655-1-gakhil@marvell.com> References: <20241024131759.3337333-1-gakhil@marvell.com> <20241028110115.1070655-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: a_5DaDibmr0oi670KR8YLwE7Yf59ic2j X-Proofpoint-ORIG-GUID: a_5DaDibmr0oi670KR8YLwE7Yf59ic2j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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 Added ``rte_pmd_rvu_lf_pf_func_get`` API to get RVU LF device pffunc for the application use. Signed-off-by: Akhil Goyal --- doc/guides/rawdevs/cnxk_rvu_lf.rst | 6 ++++++ drivers/common/cnxk/roc_rvu_lf.c | 2 +- drivers/common/cnxk/roc_rvu_lf.h | 2 ++ drivers/common/cnxk/version.map | 1 + drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c | 15 +++++++++++++++ drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf_driver.h | 12 ++++++++++++ drivers/raw/cnxk_rvu_lf/version.map | 1 + 7 files changed, 38 insertions(+), 1 deletion(-) diff --git a/doc/guides/rawdevs/cnxk_rvu_lf.rst b/doc/guides/rawdevs/cnxk_rvu_lf.rst index e425950d16..0854c88ac9 100644 --- a/doc/guides/rawdevs/cnxk_rvu_lf.rst +++ b/doc/guides/rawdevs/cnxk_rvu_lf.rst @@ -17,6 +17,7 @@ Features The RVU LF device implements following features in the rawdev API: - Get PF FUNC of associated NPA and SSO devices. +- Get PF FUNC for RVU LF device. - Register/unregister interrupt handlers. - Register/unregister mailbox callbacks for the other side to process mailboxes. - Set mailbox message ID range to be used by the driver. @@ -47,6 +48,11 @@ APIs ``rte_pmd_rvu_lf_npa_pf_func_get()`` and ``rte_pmd_rvu_lf_sso_pf_func_get() can be used to get the cnxk NPA PF func and SSO PF func which application can use for NPA/SSO specific configuration. +Get RVU LF PF FUNC +------------------ + +APIs ``rte_pmd_rvu_lf_pf_func_get()`` is added to get the RVU LF device PF FUNC. + Register or remove interrupt handler ------------------------------------ diff --git a/drivers/common/cnxk/roc_rvu_lf.c b/drivers/common/cnxk/roc_rvu_lf.c index 471dfa7a46..862a201135 100644 --- a/drivers/common/cnxk/roc_rvu_lf.c +++ b/drivers/common/cnxk/roc_rvu_lf.c @@ -62,7 +62,7 @@ roc_rvu_lf_dev_fini(struct roc_rvu_lf *roc_rvu_lf) return dev_fini(&rvu->dev, rvu->pci_dev); } -static uint16_t +uint16_t roc_rvu_lf_pf_func_get(struct roc_rvu_lf *roc_rvu_lf) { struct rvu_lf *rvu = roc_rvu_lf_to_rvu_priv(roc_rvu_lf); diff --git a/drivers/common/cnxk/roc_rvu_lf.h b/drivers/common/cnxk/roc_rvu_lf.h index 6b4819666a..8c71876cbc 100644 --- a/drivers/common/cnxk/roc_rvu_lf.h +++ b/drivers/common/cnxk/roc_rvu_lf.h @@ -21,6 +21,8 @@ TAILQ_HEAD(roc_rvu_lf_head, roc_rvu_lf); int __roc_api roc_rvu_lf_dev_init(struct roc_rvu_lf *roc_rvu_lf); int __roc_api roc_rvu_lf_dev_fini(struct roc_rvu_lf *roc_rvu_lf); +uint16_t __roc_api roc_rvu_lf_pf_func_get(struct roc_rvu_lf *roc_rvu_lf); + int __roc_api roc_rvu_lf_msg_process(struct roc_rvu_lf *roc_rvu_lf, uint16_t vf, uint16_t msg_id, void *req_data, uint16_t req_len, diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map index a8cb0755ab..42e9375706 100644 --- a/drivers/common/cnxk/version.map +++ b/drivers/common/cnxk/version.map @@ -559,6 +559,7 @@ INTERNAL { roc_rvu_lf_msg_id_range_check; roc_rvu_lf_msg_id_range_set; roc_rvu_lf_msg_process; + roc_rvu_lf_pf_func_get; local: *; }; diff --git a/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c index 17917532cd..156b9460c1 100644 --- a/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c +++ b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c @@ -115,6 +115,21 @@ rte_pmd_rvu_lf_sso_pf_func_get(void) return roc_sso_pf_func_get(); } +uint16_t +rte_pmd_rvu_lf_pf_func_get(uint8_t dev_id) +{ + struct roc_rvu_lf *roc_rvu_lf; + struct rte_rawdev *rawdev; + + rawdev = rte_rawdev_pmd_get_dev(dev_id); + if (rawdev == NULL) + return 0; + + roc_rvu_lf = (struct roc_rvu_lf *)rawdev->dev_private; + + return roc_rvu_lf_pf_func_get(roc_rvu_lf); +} + static const struct rte_rawdev_ops rvu_lf_rawdev_ops = { .dev_selftest = NULL, }; diff --git a/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf_driver.h b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf_driver.h index 1d0308d6f1..9c4ede2602 100644 --- a/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf_driver.h +++ b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf_driver.h @@ -42,6 +42,18 @@ uint16_t rte_pmd_rvu_lf_npa_pf_func_get(void); __rte_internal uint16_t rte_pmd_rvu_lf_sso_pf_func_get(void); +/** + * Obtain RVU LF device PF func + * + * @param dev_id + * device id of RVU LF device + * + * @return + * Returns RVU LF pf_func on success, 0 in case of invalid pf_func. + */ +__rte_internal +uint16_t rte_pmd_rvu_lf_pf_func_get(uint8_t dev_id); + /** * Signature of callback function called when an interrupt is received on RVU LF device. * diff --git a/drivers/raw/cnxk_rvu_lf/version.map b/drivers/raw/cnxk_rvu_lf/version.map index 7896a8f777..aa974f629e 100644 --- a/drivers/raw/cnxk_rvu_lf/version.map +++ b/drivers/raw/cnxk_rvu_lf/version.map @@ -8,6 +8,7 @@ INTERNAL { rte_pmd_rvu_lf_msg_id_range_set; rte_pmd_rvu_lf_msg_process; rte_pmd_rvu_lf_npa_pf_func_get; + rte_pmd_rvu_lf_pf_func_get; rte_pmd_rvu_lf_sso_pf_func_get; local: *; -- 2.25.1