From: Thomas Monjalon <thomas@monjalon.net>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, grive@u256.net, david.marchand@redhat.com,
wenzhuo.lu@intel.com, beilei.xing@intel.com,
bernard.iremonger@intel.com, ferruh.yigit@intel.com,
akhil.goyal@nxp.com
Subject: Re: [dpdk-dev] [PATCH v2 (v20.11) 2/2] eal: improve device probing API
Date: Thu, 06 Aug 2020 13:43:36 +0200 [thread overview]
Message-ID: <18395771.BYCcGiSWyI@thomas> (raw)
In-Reply-To: <f0c585c7-bbee-fd01-ab58-54cfa0944d40@redhat.com>
06/08/2020 12:29, Maxime Coquelin:
> On 8/6/20 1:33 AM, Thomas Monjalon wrote:
> > 25/06/2020 10:04, Maxime Coquelin:
> >> This patch makes rte_dev_probe() to return the
> >> rte_device pointer on success and NULL on error
> >> instead of returning 0 on success and negative
> >> value on error.
> >>
> >> The goal is to avoid that the calling application
> >> iterates the devices list afterwards to retrieve
> >> the pointer. Retrieving the pointer is required
> >> for calling rte_dev_remove() later.
> >>
> >> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> ---
> >> --- a/lib/librte_eal/include/rte_dev.h
> >> +++ b/lib/librte_eal/include/rte_dev.h
> >> @@ -148,9 +148,9 @@ int rte_eal_hotplug_add(const char *busname, const char *devname,
> >> * @param devargs
> >> * Device arguments including bus, class and driver properties.
> >> * @return
> >> - * 0 on success, negative on error.
> >> + * Generic device pointer on success, NULL on error.
> >> */
> >> -int rte_dev_probe(const char *devargs);
> >> +struct rte_device *rte_dev_probe(const char *devargs);
> >
> > Sorry for not catching it earlier, I think this change is against
> > the idea of having a generic devargs syntax.
> > One string could identify multiple devices.
>
> That sounds fragile to me. What if one of the multiple devices fails to
> probe? Do the other ones are going to be removed?
No, what is correctly probed should not be rolled back in my opinion.
> > And a successful probe does not mean there is a new rte_device
> > (can be an update, allowing more ports on the same device).
>
> This should be done by a separate API in my opinion, ports may be seen
> as a sub-function of the device.
>
> But anyway, I am fine with dropping it. It is not blocking vDPA probing,
> just making it more cumbersome.
Apps should not iterate on devices.
vDPA should have an event mechanism like in ethdev:
a callback with RTE_ETH_EVENT_NEW is called for each new port probed.
prev parent reply other threads:[~2020-08-06 11:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 8:04 [dpdk-dev] [PATCH v2 0/2] rte_dev_probe() API change Maxime Coquelin
2020-06-25 8:04 ` [dpdk-dev] [PATCH v2 1/2] doc: announce " Maxime Coquelin
2020-07-31 7:20 ` Maxime Coquelin
2020-07-31 9:26 ` Bruce Richardson
2020-07-31 9:44 ` Gaëtan Rivet
2020-07-31 9:47 ` Maxime Coquelin
2020-08-04 8:12 ` David Marchand
2020-08-04 8:53 ` Jerin Jacob
2020-06-25 8:04 ` [dpdk-dev] [PATCH v2 (v20.11) 2/2] eal: improve device probing API Maxime Coquelin
2020-06-29 9:57 ` Gaëtan Rivet
2020-08-05 23:33 ` Thomas Monjalon
2020-08-06 10:29 ` Maxime Coquelin
2020-08-06 11:43 ` Thomas Monjalon [this message]
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=18395771.BYCcGiSWyI@thomas \
--to=thomas@monjalon.net \
--cc=akhil.goyal@nxp.com \
--cc=beilei.xing@intel.com \
--cc=bernard.iremonger@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=grive@u256.net \
--cc=maxime.coquelin@redhat.com \
--cc=wenzhuo.lu@intel.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).