From: Nawal Kishor <nkishor@marvell.com>
To: <dev@dpdk.org>, Sachin Saxena <sachin.saxena@nxp.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Shreyansh Jain <shreyansh.jain@nxp.com>
Cc: <jerinj@marvell.com>, <asekhar@marvell.com>,
Nawal Kishor <nkishor@marvell.com>
Subject: [PATCH] rawdev: fix device ID retrieval function prototype
Date: Wed, 24 Sep 2025 11:26:43 +0530 [thread overview]
Message-ID: <20250924055654.1986682-1-nkishor@marvell.com> (raw)
Fixed rte_rawdev_get_dev_id() function prototype and its usage.
Fixes: c88b3f2558ed ("rawdev: introduce raw device library")
Signed-off-by: Nawal Kishor <nkishor@marvell.com>
---
This patch fixes the return type of rte_rawdev_get_dev_id(). It would be good
to have it merged before the 25.11 release, as it corrects a user-visible API
bug and is a safe change.
app/test/test_rawdev.c | 11 +++++++++--
lib/rawdev/rte_rawdev.c | 2 +-
lib/rawdev/rte_rawdev.h | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c
index d34691dacf..d1d250c9ac 100644
--- a/app/test/test_rawdev.c
+++ b/app/test/test_rawdev.c
@@ -25,11 +25,18 @@ test_rawdev_selftests(void)
static int
test_rawdev_selftest_impl(const char *pmd, const char *opts)
{
- int ret;
+ int dev_id, ret;
printf("\n### Test rawdev infrastructure using skeleton driver\n");
rte_vdev_init(pmd, opts);
- ret = rte_rawdev_selftest(rte_rawdev_get_dev_id(pmd));
+ dev_id = rte_rawdev_get_dev_id(pmd);
+ if (dev_id < 0) {
+ printf("Failed to get dev_id for %s\n", pmd);
+ ret = dev_id;
+ goto exit;
+ }
+ ret = rte_rawdev_selftest(dev_id);
+exit:
rte_vdev_uninit(pmd);
return ret;
}
diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c
index 4da7956d5a..f21d29114c 100644
--- a/lib/rawdev/rte_rawdev.c
+++ b/lib/rawdev/rte_rawdev.c
@@ -39,7 +39,7 @@ rte_rawdev_count(void)
}
RTE_EXPORT_SYMBOL(rte_rawdev_get_dev_id)
-uint16_t
+int
rte_rawdev_get_dev_id(const char *name)
{
uint16_t i;
diff --git a/lib/rawdev/rte_rawdev.h b/lib/rawdev/rte_rawdev.h
index 3fc471526e..ad849e5bea 100644
--- a/lib/rawdev/rte_rawdev.h
+++ b/lib/rawdev/rte_rawdev.h
@@ -44,7 +44,7 @@ rte_rawdev_count(void);
* Returns raw device identifier on success.
* - <0: Failure to find named raw device.
*/
-uint16_t
+int
rte_rawdev_get_dev_id(const char *name);
/**
--
2.48.1
reply other threads:[~2025-09-24 5:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250924055654.1986682-1-nkishor@marvell.com \
--to=nkishor@marvell.com \
--cc=asekhar@marvell.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=jerinj@marvell.com \
--cc=sachin.saxena@nxp.com \
--cc=shreyansh.jain@nxp.com \
/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).