From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10076.outbound.protection.outlook.com [40.107.1.76]) by dpdk.org (Postfix) with ESMTP id 287309E4 for ; Tue, 6 Mar 2018 07:21:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tTFvkCSQyOEMZmgt9bgoBFx7YAyMV27xvziZYiJems8=; b=BHDga2PClREEPblhkh8ZOQQP1wx0GIcUNKXRl1W/SwRoN76FiT5MrcosKBpIpoqd7HKmUtEtY2c5qv/hIU9Ih8H84/kRCoDNGfxzHt8MqZV5zSYPNM7p6oeNyJAyOTqVzK0OiFWGOtrcwL362KzkuXofpNG3onbibCow/B50IS0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from mail-wr0-f177.google.com (209.85.128.177) by HE1PR0402MB2778.eurprd04.prod.outlook.com (2603:10a6:3:d4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Tue, 6 Mar 2018 06:20:59 +0000 Received: by mail-wr0-f177.google.com with SMTP id v18so19036972wrv.0 for ; Mon, 05 Mar 2018 22:20:58 -0800 (PST) X-Gm-Message-State: APf1xPCKFlxpaZ3S+6wgwewzTXRKcLot7tRIosdalTYT8KK/lUH5Jm9g JwlzvjYnJs56W5VY7NW/TP4cIhXqa7jH9EH6fKY= X-Google-Smtp-Source: AG47ELsZDO/bhGd3y19R2qTBsiep9b5MsgzjnIjWiMgkoPCXyu21d+tQJiM2LJdbPC/u+wwMM6vkXZSDjJV8etJeESo= X-Received: by 10.223.196.143 with SMTP id m15mr14105904wrf.207.1520317254235; Mon, 05 Mar 2018 22:20:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.135.130 with HTTP; Mon, 5 Mar 2018 22:20:23 -0800 (PST) In-Reply-To: <1520300638-134954-4-git-send-email-rosen.xu@intel.com> References: <1520300638-134954-1-git-send-email-rosen.xu@intel.com> <1520300638-134954-4-git-send-email-rosen.xu@intel.com> From: Shreyansh Jain Date: Tue, 6 Mar 2018 11:50:23 +0530 X-Gmail-Original-Message-ID: Message-ID: To: Rosen Xu Cc: dev@dpdk.org, declan.doherty@intel.com, tianfei.zhang@intel.com Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.128.177] X-ClientProxiedBy: VI1PR0601CA0041.eurprd06.prod.outlook.com (2603:10a6:800:1e::51) To HE1PR0402MB2778.eurprd04.prod.outlook.com (2603:10a6:3:d4::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 80f49cda-e993-4539-6e17-08d5832a6d70 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0402MB2778; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0402MB2778; 3:BO5/cMxNU0DPp56pCLHRe/SDRbLSORzGYAM0TI1aiklcZhrEfzGGyqBj0JgujFiQOhVxzrXT2tIJPkQ/qax/osMU1NQQe6bmNVYnZMMC8tXA9khWZ6bYUgngMHTXOlRP5cCbx+phJqVu/LkUh4Ho1g2gb4RtWpeGZ3/uhvK2GOr6E4LgEv7fBoyV+0SndNK6N7vmhre0PGCuLjSGy2a8JBpr9IcH8SAbq76MHv/CbAO/Khkn4k3aDLhb1lZ5Oiij; 25:ENtXtFX3e1wwSHlCas+2kuGmGn8z+p+maJO6rK3F6cztOWKrZaRNmiwBXJEoi4ApDO1CDtPh38tlcSFJTtuv2xsNF4XAN8GkRDLjLecjJ4FspnmN3NHpSoQMvTfYscE8mT8+KCEvBoSuaPhzUnfkazY9a9svEllQjXbeYSv/Pde0krXkd9T2yCKEM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j6Ol4O16q7GQK8oIy8a+pM2l9uR91SirGrIwG6EoFIJL4nGPA/D7V2kaiqlEhx8ODAoM5U6HRMi4xXBXQGPg1d1YOIzKTr1736xmI4DJF5YfxwuH+0+aT13/6Me8AFq+i51bUCbhUTCjXrBqHwxHLW1ItMtdD4Pk0qR3wMm0w7gARc+bNkurYDCtDx/v+42lYclmC/tnYaughsrPylADDgsF2IIo9ngSxac X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3002001)(3231220)(944501244)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:HE1PR0402MB2778; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0402MB2778; X-Forefront-PRVS: 06036BD506 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(346002)(366004)(376002)(396003)(199004)(189003)(8936002)(9686003)(7736002)(69596002)(107886003)(386003)(478600001)(76176011)(59450400001)(33896004)(53546011)(2906002)(42186006)(305945005)(68736007)(16586007)(316002)(186003)(53936002)(97736004)(6246003)(9896002)(52116002)(81166006)(81156014)(8676002)(93516011)(105586002)(95326003)(23676004)(26005)(106356001)(50466002)(498394004)(5820100001)(66066001)(86362001)(61726006)(59536001)(61266001)(3846002)(47776003)(229853002)(55446002)(4326008)(5660300001)(6862004)(122856001)(2950100002)(6116002)(55456009); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0402MB2778; H:mail-wr0-f177.google.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA0MDJNQjI3Nz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qrQUdomXPU5ERBEFaIzaYs0KPg4YbDpeF9MCpEttdc0dCDtZip29CxSviNAzqZZ0G3zfyCruox9i0PALwPkTtAk3TGEqcCPFyxFtT9+XsO1DwHGDBnQwqRDdpyfqTMIeVEyMeRksPkxHchae6BYxTWxXkYTWinspKZc2ZV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2018 06:20:59.0743 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80f49cda-e993-4539-6e17-08d5832a6d70 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB2778 Subject: Re: [dpdk-dev] [RFC 3/4] lib/librte_eal/common: Add Intel FPGA Bus Second Scan, it should be scanned after PCI Bus 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: Tue, 06 Mar 2018 06:21:01 -0000 On Tue, Mar 6, 2018 at 7:13 AM, Rosen Xu wrote: > Signed-off-by: Rosen Xu > --- > lib/librte_eal/common/eal_common_bus.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c > index 3e022d5..74bfa15 100644 > --- a/lib/librte_eal/common/eal_common_bus.c > +++ b/lib/librte_eal/common/eal_common_bus.c > @@ -70,15 +70,27 @@ struct rte_bus_list rte_bus_list = > rte_bus_scan(void) > { > int ret; > - struct rte_bus *bus = NULL; > + struct rte_bus *bus = NULL, *ifpga_bus = NULL; > > TAILQ_FOREACH(bus, &rte_bus_list, next) { > + if (!strcmp(bus->name, "ifpga")) { > + ifpga_bus = bus; > + continue; > + } > + > ret = bus->scan(); > if (ret) > RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n", > bus->name); > } > > + if (ifpga_bus) { > + ret = ifpga_bus->scan(); > + if (ret) > + RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n", > + ifpga_bus->name); > + } > + You are doing this just so that PCI scans are completed *before* ifpga scans? Well, I understand that this certainly is an issue that we can't yet define a priority ordering of bus scans. But, I think what you are require is a simpler: In the file ifpga_bus.c: +RTE_REGISTER_BUS(IFPGA_BUS_NAME, rte_ifpga_bus.bus); <== this ... ... #define RTE_REGISTER_BUS(nm, bus) \ RTE_INIT_PRIO(businitfn_ ##nm, 110); \ If you define your own version of RTE_REGISTER_BUS with the priority number higher, it would be inserted later in the bus list. rte_register_bus doesn't do any inherent ordering. This would save the changes you are doing in the lib/librte_eal/common/eal_common_bus.c file. But I think there has to be a better provision of defining priority of bus scans - I am sure when new devices come in, there would be possibility of dependencies as in your case. > return 0; > } > > -- > 1.8.3.1 >