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 0F0C445B4C; Tue, 22 Oct 2024 21:17:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 260B9410FA; Tue, 22 Oct 2024 21:15:15 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 7E8BB406B6 for ; Tue, 22 Oct 2024 21:13:14 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6296A1A04F7; Tue, 22 Oct 2024 21:13:14 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 174401A1BD6; Tue, 22 Oct 2024 21:13:14 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 79A74183DC04; Wed, 23 Oct 2024 03:13:13 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Jun Yang Subject: [v4 39/42] net/dpaa2: add API to get endpoint name Date: Wed, 23 Oct 2024 00:42:52 +0530 Message-Id: <20241022191256.516818-40-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241022191256.516818-1-vanshika.shukla@nxp.com> References: <20241014120126.170790-1-vanshika.shukla@nxp.com> <20241022191256.516818-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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: Jun Yang Export API in rte_pmd_dpaa2.h Signed-off-by: Jun Yang --- drivers/net/dpaa2/dpaa2_ethdev.c | 24 ++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 4 ++++ drivers/net/dpaa2/rte_pmd_dpaa2.h | 3 +++ drivers/net/dpaa2/version.map | 1 + 4 files changed, 32 insertions(+) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 7a3937346c..137e116963 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2903,6 +2903,30 @@ rte_pmd_dpaa2_dev_is_dpaa2(uint32_t eth_id) return dev->device->driver == &rte_dpaa2_pmd.driver; } +const char * +rte_pmd_dpaa2_ep_name(uint32_t eth_id) +{ + struct rte_eth_dev *dev; + struct dpaa2_dev_priv *priv; + + if (eth_id >= RTE_MAX_ETHPORTS) + return NULL; + + if (!rte_pmd_dpaa2_dev_is_dpaa2(eth_id)) + return NULL; + + dev = &rte_eth_devices[eth_id]; + if (!dev->data) + return NULL; + + if (!dev->data->dev_private) + return NULL; + + priv = dev->data->dev_private; + + return priv->ep_name; +} + #if defined(RTE_LIBRTE_IEEE1588) int rte_pmd_dpaa2_get_one_step_ts(uint16_t port_id, bool mc_query) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index a2b9fc5678..fd6bad7f74 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -385,6 +385,10 @@ struct dpaa2_dev_priv { uint8_t max_cgs; uint8_t cgid_in_use[MAX_RX_QUEUES]; + enum rte_dpaa2_dev_type ep_dev_type; /**< Endpoint Device Type */ + uint16_t ep_object_id; /**< Endpoint DPAA2 Object ID */ + char ep_name[RTE_DEV_NAME_MAX_LEN]; + struct extract_s extract; uint16_t ss_offset; diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2.h b/drivers/net/dpaa2/rte_pmd_dpaa2.h index fc52a9218e..f93af1c65f 100644 --- a/drivers/net/dpaa2/rte_pmd_dpaa2.h +++ b/drivers/net/dpaa2/rte_pmd_dpaa2.h @@ -130,6 +130,9 @@ rte_pmd_dpaa2_get_tlu_hash(uint8_t *key, int size); __rte_experimental int rte_pmd_dpaa2_dev_is_dpaa2(uint32_t eth_id); +__rte_experimental +const char * +rte_pmd_dpaa2_ep_name(uint32_t eth_id); #if defined(RTE_LIBRTE_IEEE1588) __rte_experimental diff --git a/drivers/net/dpaa2/version.map b/drivers/net/dpaa2/version.map index 233c6e6b2c..35815f7777 100644 --- a/drivers/net/dpaa2/version.map +++ b/drivers/net/dpaa2/version.map @@ -18,6 +18,7 @@ EXPERIMENTAL { rte_pmd_dpaa2_get_tlu_hash; # added in 24.11 rte_pmd_dpaa2_dev_is_dpaa2; + rte_pmd_dpaa2_ep_name; rte_pmd_dpaa2_set_one_step_ts; rte_pmd_dpaa2_get_one_step_ts; rte_pmd_dpaa2_mux_dump_counter; -- 2.25.1