From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 6CD1698 for ; Mon, 27 Feb 2017 10:09:06 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id g10so9268467wrg.0 for ; Mon, 27 Feb 2017 01:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9rRIAQtK9ZEjtXaGZh5/PJP/B4SjXANZ9iXz8P/kxLs=; b=kfnKBNjIRQSorxV876VnLm2dVI9dfGMnH0/7M0nISFHIXWLNh94da+ZnhGoOw87jcu QqnYHTwRGf+3qinOSfx9dth5Ce1f/TC7up8TaMHWWvU3Rd2f3I0iy4H4lEHAmLwil3yu 8YYNJebHm2u2SSXxjhN6WtYIp1MTtkbK1v7m6JH1xpmOUhP0FuOZEPPRD8BBr6fRdT6p l6nfws90EYYPNNh5ZEL967ZOBe1JvL8vOr7Rtvn47nxk3OxjcLU9qHvHmX7voYwVWv+X InGTd4e5nsAfkR5D0AXsdw8ZDX6iiaxUuzbUWwA5yQSYSVdv5lmZkvFpOgDw2ss0J1Kx p0TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9rRIAQtK9ZEjtXaGZh5/PJP/B4SjXANZ9iXz8P/kxLs=; b=jLgXTcCmdRdxf6kH8b5Jwt+Kbv7G4ogeKcxGN8K9M3dKbpHQkHDVtdJlirds8b+u84 zUMSbDUfGM8isJGmWYpZHvncqiaSN3ENzAm0JdUte+zaxhFsXMFBBjq0Mo2V/xPX5ra0 FG4EPDtbX8RCzoQauMDSb0Ffswwzf7BDk/eyDaioaJc9Aico4gAyN/owK0YesGSvP75u oIQsPg9VomKViLtnh0s1/zJXL62AJskrOqrkN3H+WWMLBo8FWFsuQNwHBXE8KkolfJ0L xPcN4/WWMcWs3Swl/MNSjljC1u6jfstvB1VcHvF9ptufoMcabnf3C6JXPWiVZByF/9iK 4Slw== X-Gm-Message-State: AMke39lKT1fmPxIFyiX9dkufTi9jSzPnGPtE5i3aqCRKYeOLVaOATHUP2RxPRKs91pCcelO58aVCWZRCJTUl5g== X-Received: by 10.223.132.166 with SMTP id 35mr12811074wrg.122.1488186546060; Mon, 27 Feb 2017 01:09:06 -0800 (PST) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.211.20 with HTTP; Mon, 27 Feb 2017 01:09:05 -0800 (PST) In-Reply-To: <303005d0-f852-f252-7131-8ef6311917a9@nxp.com> References: <1488018496-995-1-git-send-email-jblunck@infradead.org> <1488018496-995-3-git-send-email-jblunck@infradead.org> <303005d0-f852-f252-7131-8ef6311917a9@nxp.com> From: Jan Blunck Date: Mon, 27 Feb 2017 10:09:05 +0100 X-Google-Sender-Auth: Fpps-SvX-fA4u3bnWw3UKAC6bew Message-ID: To: Shreyansh Jain Cc: dev , David Marchand , Ferruh Yigit Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v3 02/10] eal: probe new virtual bus after other bus devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2017 09:09:06 -0000 On Mon, Feb 27, 2017 at 9:59 AM, Shreyansh Jain wrote: > On Saturday 25 February 2017 03:58 PM, Jan Blunck wrote: >> >> Also see commit f4ce209a ("eal: postpone vdev initialization"). >> >> Signed-off-by: Jan Blunck >> --- >> lib/librte_eal/common/eal_common_bus.c | 16 +++++++++++++++- >> 1 file changed, 15 insertions(+), 1 deletion(-) >> >> diff --git a/lib/librte_eal/common/eal_common_bus.c >> b/lib/librte_eal/common/eal_common_bus.c >> index 4638e78..8f9baf8 100644 >> --- a/lib/librte_eal/common/eal_common_bus.c >> +++ b/lib/librte_eal/common/eal_common_bus.c >> @@ -86,9 +86,14 @@ int >> rte_bus_probe(void) >> { >> int ret; >> - struct rte_bus *bus; >> + struct rte_bus *bus, *vbus = NULL; >> >> TAILQ_FOREACH(bus, &rte_bus_list, next) { >> + if (!strcmp(bus->name, "virtual")) { >> + vbus = bus; >> + continue; >> + } >> + >> ret = bus->probe(); >> if (ret) { >> RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", >> @@ -97,6 +102,15 @@ rte_bus_probe(void) >> } >> } >> >> + if (vbus) { >> + ret = vbus->probe(); >> + if (ret) { >> + RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", >> + vbus->name); >> + return ret; >> + } >> + } >> + > > > This has probably changed to do away with priority of RTE_REGISTER_* > macro. > > This is based on an assumption that there is only a single 'virtual' > bus and no driver ever registers another bus with the same name. > > The problem originates from the fact that rte_bus_register is > _not_ checking for duplicate entries while registering. > (Apparently, it would be a problem in case of RTE_* macros as well). > > I think that should be fixed. > > If we are in sync, I will push a patch. > Indeed. The buses should have a unique name.