DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jan Blunck <jblunck@infradead.org>
To: Hemant Agrawal <hemant.agrawal@nxp.com>
Cc: Shreyansh Jain <shreyansh.jain@nxp.com>, dev <dev@dpdk.org>,
	 Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH] eal: bus scan and probe never fail
Date: Tue, 19 Sep 2017 20:51:33 +0200	[thread overview]
Message-ID: <CALe+Z03ZDwNSLi42zVXyMa1KQxGzn1Dgpcj4O2inQqB=rw3rvw@mail.gmail.com> (raw)
In-Reply-To: <422ce0c6-7868-b601-2fe9-e361497d7b14@nxp.com>

On Mon, Sep 18, 2017 at 1:36 PM, Hemant Agrawal <hemant.agrawal@nxp.com> wrote:
> Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
>
> On 8/12/2017 3:52 PM, Shreyansh Jain wrote:
>>
>> Bus scan is responsible for finding devices over *all* buses.
>> Some of these buses might not be able to scan but that should
>> not prevent other buses to be scanned.
>>

If scanning the bus fails this is signaling an error. In that case we
might even want to unregister the bus.

>> Same is the case for probing. It is possible that some devices which
>> were scanned didn't have a specific driver. That should not prevent
>> other buses from being probed.

Absolutely correct.

>>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>>
>> ---
>> Until now, this decision was left onto author of bus specific scan and
>> probe function. But, that is incorrect.
>> ---
>>  lib/librte_eal/common/eal_common_bus.c | 12 +++---------
>>  1 file changed, 3 insertions(+), 9 deletions(-)
>>
>> diff --git a/lib/librte_eal/common/eal_common_bus.c
>> b/lib/librte_eal/common/eal_common_bus.c
>> index 08bec2d..58e1084 100644
>> --- a/lib/librte_eal/common/eal_common_bus.c
>> +++ b/lib/librte_eal/common/eal_common_bus.c
>> @@ -73,11 +73,9 @@ rte_bus_scan(void)
>>
>>         TAILQ_FOREACH(bus, &rte_bus_list, next) {
>>                 ret = bus->scan();
>> -               if (ret) {
>> +               if (ret)
>>                         RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n",
>>                                 bus->name);
>> -                       return ret;
>> -               }
>>         }
>>
>>         return 0;
>> @@ -97,20 +95,16 @@ rte_bus_probe(void)
>>                 }
>>
>>                 ret = bus->probe();
>> -               if (ret) {
>> +               if (ret)
>>                         RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n",
>>                                 bus->name);
>> -                       return ret;
>> -               }
>>         }
>>
>>         if (vbus) {
>>                 ret = vbus->probe();
>> -               if (ret) {
>> +               if (ret)
>>                         RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n",
>>                                 vbus->name);
>> -                       return ret;
>> -               }
>>         }
>>
>>         return 0;
>>
>

  reply	other threads:[~2017-09-19 18:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-12 10:22 Shreyansh Jain
2017-09-18 11:36 ` Hemant Agrawal
2017-09-19 18:51   ` Jan Blunck [this message]
2017-10-05 23:21     ` Thomas Monjalon
2017-10-06 13:12       ` Shreyansh Jain
2017-10-06 13:37         ` Thomas Monjalon
2017-10-06 17:34           ` Jan Blunck
2017-10-09 11:10             ` Shreyansh Jain
2017-10-09 18:21               ` Don Provan
2017-10-09 19:34                 ` Thomas Monjalon
2017-10-10  5:00                 ` Shreyansh Jain
2017-10-10 16:00                   ` Aaron Conole
2017-10-11 22:34                     ` Thomas Monjalon
2017-10-12 13:08                       ` Aaron Conole
2017-10-12  5:39                     ` Shreyansh Jain
2017-10-12 13:20                       ` Aaron Conole
2017-10-12 14:23                         ` Shreyansh Jain
2017-10-11  0:03                   ` Don Provan
2017-10-11 22:32                     ` 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='CALe+Z03ZDwNSLi42zVXyMa1KQxGzn1Dgpcj4O2inQqB=rw3rvw@mail.gmail.com' \
    --to=jblunck@infradead.org \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.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).