From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0065.outbound.protection.outlook.com [104.47.34.65]) by dpdk.org (Postfix) with ESMTP id 6B1AF2BBE for ; Sun, 20 Nov 2016 09:01:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Wq1fN0dj9SvhcyaVN6cXzIRWLarvQVV66BQKeSc3kik=; b=BDZ96Cuh0Gg6RX4oH8SW1o1gt7AKaVj/VNHFCEdT0Ih/vYSfdr8UkP07OPQXW5ZjzS9xIgmHDivBbesrPYBGaQaR9008S9WlHe/gt1IP7HbC0YKRi3N4SKjDixrcNG5mck1tTek5yV4k5gnNSp9Zhpw1OeJfkREOq4hq1dyBoe4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.net (96.95.216.225) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Sun, 20 Nov 2016 08:01:05 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob Date: Sun, 20 Nov 2016 13:30:50 +0530 Message-ID: <1479628850-27202-1-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [96.95.216.225] X-ClientProxiedBy: SN1PR0701CA0068.namprd07.prod.outlook.com (10.163.126.36) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 2:eCRY6YkC42rU/r9VJ5ZbtFDfxNmtKl5Hme3tiz35rm8XLDnCQ0EliWPgAuBxC9kF2pbBoMQ6p/Y2b+iSMMioR5rij7gIBKLfVc/7cihLdtNmM78e0+66C3EH+n5ttWLX2VT/EMHkCfSOJGqMqD7v/ZcIw2uMEQghIgft0iQOiK4=; 3:bJ+YQFUEomqEsRFkZBMK8cXNr7psIuPH30SJtmPM8UjWhI46nQgILCan3eFwpG+WM48kuAh8qUqVFv9H+ZjN5bROaHQTOHrGlEuFaIycqgQJBYXI1OJcS4anZKxWOVjDXgtBt4VdXrVrNqYNwOll64bHv7TF/6cIa4fMMF3Z7m0= X-MS-Office365-Filtering-Correlation-Id: 8407493a-93f2-41e3-1e6e-08d4111b6158 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 25:BxNlIubrl7KSHRIyy30J6qtHY/kJwQfbreIwY4wUMy/Dn8GZfYEOOGvAGfFc/W7bN3gsJ8h+zEERmmB9mpTFlfzZrCdnlvBawaDw6Z8KZckjZVSibdATjt4x1/0OyyyX8nlbF0aPFWJRXaxgpbl1Myf85MgBNqKaWu64C4SfwZnMkOTEJmsmgsbA+bMu6UudG2x8BLr5gQ+938bGyuSpiQH7u4A7t9Bo9ZAvCmJdRLNdm762vj8vAtyZ3w4lPx25tgZNH4FfOJS0364FAQfM5PIhGbpFloaxulkdyJd8nuOVF5lb1oEeOaeNBGzZAeMw3+b5p9zrEccu8HMmW3NB7eWJAb3HvyVSgYgbn4r+bkfaGCEfrBiT3tH0uVZj3piVQi180ODZb2MBfSdL2u8+gW32cneR/UJhDCeDbMtWntIEigIkAoGo9KsEWccrl6ES7i5BOWcdqwDtVmnl1S+b+41vhn0CbXqmTPnUp/26Wx8NZY4Vjvon/uyc6mf0g/UGeee165NxqZ+vjXqgog5Aywh2wzqeaWF0o3nRFZ2oF40jcqyspS3AuIqA15tuI1t0RIsYI1K0J0rkCo152cu94xfnpcOceW5/RMS+dAi3NL18EF06dWgVhwmQ3iZEouob04UgepnnCgJRa9fAUcfWADF68NImA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lMyE1Yhveq1wR3BnNoXIiAE+41630r4/J+d3MObb+n3jNjUi46dyfefPPdYk+vV7kKDzhJCPrZMVr5w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040307)(6060326)(6045199)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6061324)(6041248); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:+n5H3hkI2Iwnb4JG2lwqDsQmxWdtTTmsQSzF2JourAK09EUTUFVP/thE2/PJSXxY4YxoTdklof34XnLDqOOOGJjxWYUoyKWd8QTB+O3ZriwARwjSParcZHrsMIzVsdtY9kx7DQedZJ0TjKe9jkXMU6Zxvzn2Lxy6NSAwRzwdO8rA2/Nw7yAL3KB0pU4igykaOfe+JW1SefL0RE3wdR8+QTeWmCg6C9RpzJtg/DevdvE4cE4B7Fp0YsQfw7kXRxdFFEGakS2NnrACRVJ8RTQ+2BiwlD/jSVwEs6hH3BdmtuwNs0XXpxtDW/Tii3Nh0Ck8dH5tEvbawiVSBYtviFR9fTUgAGks8JXvNm92gDyERXi/VbiSgPQm21i04c6s3aP4vPWzNMx/+K/exCCap/FxFO8tO9RXfejFmCADtiUNykgJvvz5VIu1/MzjZSGGXRscnz//HE7Za/dd6K/VNXCkFtnSiUo0aRorUFHEsZYfwb8= X-Forefront-PRVS: 0132C558ED X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(6666003)(189998001)(81156014)(5003940100001)(97736004)(8676002)(76506005)(101416001)(105586002)(4001430100002)(42882006)(107886002)(69596002)(66066001)(50466002)(33026002)(3846002)(81166006)(305945005)(77096005)(48376002)(33646002)(106356001)(6116002)(36756003)(42186005)(2351001)(47776003)(7846002)(2906002)(110136003)(50986999)(5660300001)(68736007)(6916009)(38730400001)(92566002)(7736002)(50226002)(4326007)(21086003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:AHD2JTdM+xebeSyf7sWfgwGwx4EnxS4LpqCHh2h?= =?us-ascii?Q?ssvLY6NRFRqReblrVTIeDWQMO8OSdeSL74rWJ5iSWbpNqTAt8yyr8Cdq9fY/?= =?us-ascii?Q?wR1egpylvcy0AO6z+NSJtXvvCEOmQoXXGXXarHKZsQ7vLVolF1bp3VaPz1My?= =?us-ascii?Q?yLAzk8J5MiIHvL36uRNP7kd/iSNogrDCzK2cnN+mRBV3tP9hBeVhHqHnFe25?= =?us-ascii?Q?0TSZfkK3ZtqvOVDUJteSiwJ5bCLJ6kw/VHLlHE6HgxlsixY4DN221UA364h4?= =?us-ascii?Q?cVjewZ4lA6nZdm+ZHUn0op1HLcHHvn4/MsxBuacp1fs5vW57Nz2TeSzAicae?= =?us-ascii?Q?fPo3qfi5KO2zoNxZ2w6RihVGHXCcIJ7g55jqU34WzDqvOzcNqIWMwgjhZVIZ?= =?us-ascii?Q?2EJScdojNouNB3wCYfU28LgBVkld9kcmAkIqtd/8cLRa8mk3NJvwYxTXBcSE?= =?us-ascii?Q?mx/Sig/PDID7d0/wVCQBr0CLi5jvYhYvD6+uIhAz+V3jkx46B4jzCUr5uzo0?= =?us-ascii?Q?HB8Apc872Wl+tjeQw55XErs6KLYKuQ5ym0yT4hU9h3xtzZ7x/8vZtjftzanM?= =?us-ascii?Q?HPBP/XncoZbzuf89LJpZJZMV0lTGY9h6nswKkMVt+vqHY3xaXLZkiOFc7vSK?= =?us-ascii?Q?M+rOQs0Vl5By+HQuSU4v8ALjzLE2CmLKnydMEGnBuW1HURpcFDjft8Be7TtN?= =?us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q3tEnfkfymPZsHLFYkvWKXHWjx8BTLEtnmrwvslDYS1vC9p0G4h7BbEGdMzW7NH07WU3RhBS7JO5rEo8RLfCNXdQ==; 24:BAzwgTJrOh8gIMgAyLfhYsgshjGoTgKbY6RmJ2BQ/65wsVR0R2vnawW8lq2sRB/FrVZXavoDu78k6vI/hclodGHdPOptBWh0DPJuD60iWNE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:kMMZiW5y8zCiTJzHJXoDUCRm4GpTfhMxA9IRujouerVQ68iuafv4O8B4POd6UPepNDpzboKIGJfldDOiC6wnK4R4cu45PE/Kz90+ZuYCc2l6DGspwuxUWlErVknUVelD9bprdqxCWOxGp8KqkkBB6HsTHNazQW+/4jPSRWCCMwl6cDYAo9yvx4L/gXWc35vcny5HhfSs2Zr2gr3cLGqk7Ggp6fqGJJIlUrmX+7F3kxNvjOuTMzZQgiePbvRxpwWAERmBsuOXoqUeh3t2YB6oLfTmCBPB9yGdJyNPsEREwNGjNzE0CmoIlNwv1V+p/5eKPNdEKe172hQFEDZBT3XRyDokX3Pw3dab0c1INcjpdIQ= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2016 08:01:05.2097 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH] eal: postpone vdev initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2016 08:01:12 -0000 Some platform like octeontx may use pci and vdev based combined device to represent a logical dpdk functional device.In such case, postponing the vdev initialization after pci device initialization will provide the better view of the pci device resources in the system in vdev's probe function, and it allows better functional subsystem registration in vdev probe function. As a bonus, This patch fixes a bond device initialization use case. example command to reproduce the issue: ./testpmd -c 0x2 --vdev 'eth_bond0,mode=0, slave=0000:02:00.0,slave=0000:03:00.0' -- --port-topology=chained root cause: In existing case(vdev initialization and then pci initialization), creates three Ethernet ports with following port ids 0 - Bond device 1 - PCI device 0 2 - PCI devive 1 Since testpmd, calls the configure/start on all the ports on start up,it will translate to following illegal setup sequence 1)bond device configure/start 1.1) pci device0 stop/configure/start 1.2) pci device1 stop/configure/start 2)pci device 0 configure(illegal setup case, as device in start state) The fix changes the initialization sequence and allow initialization in following valid setup order 1) pcie device 0 configure/start 2) pcie device 1 configure/start 3) bond device 2 configure/start 3.1) pcie device 0/stop/configure/start 3.2) pcie device 1/stop/configure/start Signed-off-by: Jerin Jacob --- lib/librte_eal/bsdapp/eal/eal.c | 6 +++--- lib/librte_eal/linuxapp/eal/eal.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 35e3117..2206277 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -577,9 +577,6 @@ rte_eal_init(int argc, char **argv) rte_config.master_lcore, thread_id, cpuset, ret == 0 ? "" : "..."); - if (rte_eal_dev_init() < 0) - rte_panic("Cannot init pmd devices\n"); - RTE_LCORE_FOREACH_SLAVE(i) { /* @@ -616,6 +613,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_pci_probe()) rte_panic("Cannot probe PCI\n"); + if (rte_eal_dev_init() < 0) + rte_panic("Cannot init pmd devices\n"); + rte_eal_mcfg_complete(); return fctret; diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 2075282..16dd5b9 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -841,9 +841,6 @@ rte_eal_init(int argc, char **argv) rte_config.master_lcore, (int)thread_id, cpuset, ret == 0 ? "" : "..."); - if (rte_eal_dev_init() < 0) - rte_panic("Cannot init pmd devices\n"); - if (rte_eal_intr_init() < 0) rte_panic("Cannot init interrupt-handling thread\n"); @@ -887,6 +884,9 @@ rte_eal_init(int argc, char **argv) if (rte_eal_pci_probe()) rte_panic("Cannot probe PCI\n"); + if (rte_eal_dev_init() < 0) + rte_panic("Cannot init pmd devices\n"); + rte_eal_mcfg_complete(); return fctret; -- 2.5.5