From: Akhil Goyal <gakhil@marvell.com>
To: Thomas Monjalon <thomas@monjalon.net>,
Nawal Kishor <nkishor@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Sachin Saxena <sachin.saxena@nxp.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Jerin Jacob <jerinj@marvell.com>,
Ashwin Sekhar T K <asekhar@marvell.com>
Subject: RE: [EXTERNAL] Re: [PATCH] rawdev: fix device ID retrieval function prototype
Date: Fri, 17 Oct 2025 11:05:26 +0000 [thread overview]
Message-ID: <CO6PR18MB4484E2A16377DE1CE297E953D8F6A@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <3733472.U7HbjWM52l@thomas>
Hi Thomas,
> 16/10/2025 08:56, Nawal Kishor:
> >
> > >> Fixed rte_rawdev_get_dev_id() function prototype and its usage.
> > >
> > >What? Why?
> >
> > >[...]
> > >> -uint16_t
> > >> +int
> > >> rte_rawdev_get_dev_id(const char *name);
> >
> > >Other functions handle dev_id as uint16_t, so why changing this function?
> >
> > The spec says that rte_rawdev_get_dev_id() returns negative number in case of
> failure.
> > But in the definition it is returning uint16_t which will never be negative, hence
> changed it to int.
> >
> > If this is not acceptable, what fix will you suggest?
>
> You should change to int16_t for all rawdev id parameters.
>
Wont that be an API/ABI break for all the APIs?
We have a similar rte_cryptodev_get_dev_id() and rte_event_dev_get_dev_id() APIs which
return <0 value in case of failure and a positive value for valid ones.
dev_id is defined as unsigned value which is being used everywhere in all APIs of cryptodev, eventdev and rawdev.
The negative value here is just to denote that the API fails to retrieve dev_id and application should take action and not proceed further with that value.
Changing dev_id to a signed value in my opinion is not necessary just because this API may return <0 value on failure.
next prev parent reply other threads:[~2025-10-17 11:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 5:56 Nawal Kishor
2025-10-15 15:05 ` Thomas Monjalon
2025-10-16 6:56 ` Nawal Kishor
2025-10-16 8:08 ` Thomas Monjalon
2025-10-17 11:05 ` Akhil Goyal [this message]
2025-10-17 15:52 ` [EXTERNAL] " 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=CO6PR18MB4484E2A16377DE1CE297E953D8F6A@CO6PR18MB4484.namprd18.prod.outlook.com \
--to=gakhil@marvell.com \
--cc=asekhar@marvell.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=jerinj@marvell.com \
--cc=nkishor@marvell.com \
--cc=sachin.saxena@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).