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 A2791459C6; Wed, 18 Sep 2024 09:56:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC57943276; Wed, 18 Sep 2024 09:51:59 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id EBC4642F01 for ; Wed, 18 Sep 2024 09:51:15 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D03591A13B8; Wed, 18 Sep 2024 09:51:15 +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 9755C1A13B5; Wed, 18 Sep 2024 09:51:15 +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 0BE25183C480; Wed, 18 Sep 2024 15:51:15 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Jun Yang Subject: [v2 40/43] net/dpaa2: add API to get endpoint name Date: Wed, 18 Sep 2024 13:20:53 +0530 Message-Id: <20240918075056.1838654-41-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240918075056.1838654-1-vanshika.shukla@nxp.com> References: <20240913055959.3246917-1-vanshika.shukla@nxp.com> <20240918075056.1838654-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 9f859aef66..4119949c77 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2900,6 +2900,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