From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <dev@dpdk.org>, <thomas@monjalon.net>
Cc: <ferruh.yigit@intel.com>, <shreyansh.jain@nxp.com>,
<akhil.goyal@nxp.com>
Subject: [dpdk-dev] [PATCH 5/8] bus/fslmc: set the dpaa2 device name
Date: Tue, 11 Jul 2017 20:25:56 +0530 [thread overview]
Message-ID: <1499784959-8598-6-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1499784959-8598-1-git-send-email-hemant.agrawal@nxp.com>
rte_eth_dev_allocated expect the device name to be filled.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/bus/fslmc/fslmc_vfio.c | 5 +++--
drivers/bus/fslmc/rte_fslmc.h | 1 +
drivers/net/dpaa2/dpaa2_ethdev.c | 6 +-----
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 725faab..edd9a73 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -551,10 +551,11 @@ int fslmc_vfio_process_group(void)
dev->dev_type = (strcmp(object_type, "dpseci")) ?
DPAA2_MC_DPNI_DEVID : DPAA2_MC_DPSECI_DEVID;
- FSLMC_VFIO_LOG(DEBUG, "DPAA2: Added [%s-%d]",
- object_type, object_id);
+ sprintf(dev->name, "%s.%d", object_type, object_id);
+ dev->device.name = dev->name;
fslmc_bus_add_device(dev);
+ FSLMC_VFIO_LOG(DEBUG, "DPAA2: Added %s", dev->name);
} else {
/* Parse all other objects */
struct rte_dpaa2_object *object;
diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h
index 4b69d38..e60d6eb 100644
--- a/drivers/bus/fslmc/rte_fslmc.h
+++ b/drivers/bus/fslmc/rte_fslmc.h
@@ -78,6 +78,7 @@ struct rte_dpaa2_device {
uint16_t object_id; /**< DPAA2 Object ID */
struct rte_intr_handle intr_handle; /**< Interrupt handle */
struct rte_dpaa2_driver *driver; /**< Associated driver */
+ char name[32]; /**< DPAA2 Object name*/
};
typedef int (*rte_dpaa2_probe_t)(struct rte_dpaa2_driver *dpaa2_drv,
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index acedc7c..9666d9d 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1531,13 +1531,9 @@ rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv,
struct rte_dpaa2_device *dpaa2_dev)
{
struct rte_eth_dev *eth_dev;
- char ethdev_name[RTE_ETH_NAME_MAX_LEN];
-
int diag;
- sprintf(ethdev_name, "dpni-%d", dpaa2_dev->object_id);
-
- eth_dev = rte_eth_dev_allocate(ethdev_name);
+ eth_dev = rte_eth_dev_allocate(dpaa2_dev->device.name);
if (eth_dev == NULL)
return -ENOMEM;
--
2.7.4
next prev parent reply other threads:[~2017-07-11 14:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 14:55 [dpdk-dev] [PATCH 0/8] NXP DPAA2 compilation and runtime fixes Hemant Agrawal
2017-07-11 14:55 ` [dpdk-dev] [PATCH 1/8] crypto/dpaa2_sec: remove GCC 7.1 compilation error Hemant Agrawal
2017-07-11 14:55 ` [dpdk-dev] [PATCH 2/8] net/dpaa2: fix flow control switch case break Hemant Agrawal
2017-07-11 14:55 ` [dpdk-dev] [PATCH 3/8] bus/fslmc: fixes compilation in debug mode Hemant Agrawal
2017-07-11 14:55 ` [dpdk-dev] [PATCH 4/8] event/dpaa2: enable debug mode compilation Hemant Agrawal
2017-07-11 14:55 ` Hemant Agrawal [this message]
2017-07-11 14:55 ` [dpdk-dev] [PATCH 6/8] bus/fslmc: align the object name log to real resource names Hemant Agrawal
2017-07-11 14:55 ` [dpdk-dev] [PATCH 7/8] config: enable virtual IOVA by default for DPAA2 Hemant Agrawal
2017-07-11 14:55 ` [dpdk-dev] [PATCH 8/8] drivers: add newline in RTE LOG usages in dpaa2 Hemant Agrawal
2017-07-14 13:49 ` [dpdk-dev] [PATCH 0/8] NXP DPAA2 compilation and runtime fixes Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1499784959-8598-6-git-send-email-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=akhil.goyal@nxp.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=shreyansh.jain@nxp.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).