From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0058.outbound.protection.outlook.com [104.47.38.58]) by dpdk.org (Postfix) with ESMTP id A744D58C8 for ; Sat, 3 Dec 2016 21:55:56 +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=jWhHvcl1uBx4QnwEjf+yG5A1SSGfQLRn5Lo0Q0qxvcSGnANXPE4TyMok88YEEIZDOte21RjXeyilAlfahSH4fFopEAQywtGparCtjcezKSqsPpffwubhi9mcqgrOF1KaF8f+Bz4NAJlhg7dz07GkvC9as2xgxKJUhyUWvCO5I9M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.net (50.254.132.37) by BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.693.12; Sat, 3 Dec 2016 20:55:53 +0000 From: Jerin Jacob To: CC: , , , , Jerin Jacob Date: Sun, 4 Dec 2016 02:25:38 +0530 Message-ID: <1480798539-13360-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1480798539-13360-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1479628850-27202-1-git-send-email-jerin.jacob@caviumnetworks.com> <1480798539-13360-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.254.132.37] X-ClientProxiedBy: SN2PR10CA0035.namprd10.prod.outlook.com (10.160.12.173) To BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 2:yESyxCFA9kBWrdbg//VaGT1KIobvxkAJlsKynfITKys27h3CeNhSGtwNTdlRs2m7O7wH/WfjgyK3AajEVBjtV1Y1FD+0abnecaNSahpfOMsq884b+YhTRDunxBG5O5pRw71Nrnn71kJjrw82cxYaiYhD5gheJczkl1Wkh2e9kh0=; 3:gt3ohFPTRN660XlF3bSuP9h39Eaz4F7vhl5GofaxJpPLonoB8XYdIZxux2G/i/qTM6hvyjlDJ0JK3oPSGmky0ZE8284orbr3J2TN11aGhcldcKskWsxIpir2I9Z/3ye9SkTd9b7nHyuk4yin0Q3DhhahGz8NjrIG53tc0h2Vh8A=; 25:Za+5sA0ZTDbOdE8+u9hBpZ3WQuXe8RAjy5qvcnG0hbNmpjbTvn3C8Srgpl8M9PGqkps+pkXAheP99Jxny9dghdu914GefQGo0ug4UkwSKxL7xt/Y2Jli16MmpRqr26zBuKkYFKJ97ivXIUjr6gYl82Up7sDRhZoG+4U6oG/gbgZqAaKlLyr9SBT4fHB7zcdVdVfAiLqAPJ3Po0gVlztROy7ZYolwLLL+684G5hhQaeAe5RUIOJqkuwwKSjbsj1kuGdkfEzYbDO+Lc74lGH+g4Thrv4NXuWpKvj7JS2oacliagsNrY7u8MqFkpeuRbG9BbdUvcYVHtgsh8KYJgAbkLPO5So0mm8GFQBoxXR/T9cT4YEvOd/FZrGfdjO7PeRU31LhesZ9BRRoqtXz6hAGiRFaxVPFeADaZmdS4+Nr+1vIKnnwhIO0ONziP/Luz7PKDmzye9KUjmDODtAKjA1exwQ== X-MS-Office365-Filtering-Correlation-Id: 1d519680-3f25-4cbb-3dba-08d41bbec5a7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 31:GturKldb4BviJbt3sVLulzK/M354svAwnI38/ATGtv+LdbVUPY3t4A59UF8j8Fm6UyXfI6vPP6eus6rD+hnvBUybOTbqRv2DBkCZO4qj9i8Ne+KEp0P+v+YCE+LuKtUbNKHooTjCxzf6wECCKPemPzcZu3WHFjdUc2COnxfoUm/1b6HZMldDEAXwykqhLMciPMW+xIBR/jumfENiH07GGOehrCwTRLQ8CcbjdnNi8WIO04fXNPacZkLFMzOxL9VEXk6+6zDx/oUCM97XJ348Oq5oRyKr5ZAqZpIV8sKbtU8=; 20:AHJGE+K4weUDPOzGtnC3/hcLKs61RSVELz0Slw1c/2c6wB18Tyv5IcLb13PDUjAYXwC444Bq4s2/Q9BdSymw566t7liI8MwoMr0n/kv/zndxCnFT/gufYWge2Xe2wW4Yr6oQ2PcEE2IXBSvvAXU+ILJK6aDb6u+p8Lk+Owpj9MWkzwu8MYt5ZFP65W7473RNiv5guoboaPlnkzaoPKpjPUbcFzATThskLjjxx7pQsAON0+TojAK/QqG+L+Tj5fP5WPexIO9GMUKh0veD7SBkp8Mnf0Vn51w8LkcB/2QVAywHqceQ5VbQAHrpGIqulb1jULp7Fp/muryLh++fFaATExfKRoebIUq4myl+tGenwucZ06ZhVeogCFShPWYESMOnaNsxbnQ7y5chJAf+Xuplh9yQnYre0JEGmnI19HfH5fOV1UtaQqHlcmPxg3JVVXf7epr6+OKGCU0p62+PX7Rt4hwa4WC3qaVYDEjWI6CjaJtfxkdvk8UK/Y3kFxAXdGPymma5t+Odxkz4nU3LykZ/T4sAJc40Wke1tqDhpU88eOD/u2g6YqLtnhfIeihSBIRr28BaeZXcwIiOx3GXC5cgT/CPcShTFkHf5lZGSVNh3eE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:BN3PR0701MB1717; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 4:QiiaV2UU3Um7Aytgt0Y2y1YKxV4HrAUmpo5IAbuGUYqCyqvlsyR0iUQ/+8joKdSb45fXW7lDQYLQxNUInNqA9qt+w3NL9tVl5Jv+tn+Wjbgmq9QpZbCVqH5vKu0q2CROC/bVpP3ZIfm71h09sEC/gX7Iop+DXggH3Y7YKilj1MCypm+Vcgz1eAHJvvi2l8YugOMmKOkuuQizE2cw1M4M/XmP8hQww/4bCXYLUqM7Ava5o7Grlf41vBMe0zFV7Am94G6PPkzXUSBGVVqo2eDaJd+hM0gX8FaIVo/2R1N2n+xsRLSJhTX4zjTd/wKFFkCS9aktVnzm6BElRpddBbOLTOwPdrtLLBnfPj1LSJUizQEaJo8jCXArw3fetxKeWKSqHN1tHyPwlUU1Ojl4+ziKNIIpP3ozsf4VkUTe04+R9piZlAMfKl8WGek1s2zpc34sbfTWbKnpQbeAVoKSO8PEgfP0GiN/ZVYyVed0e0jK5SjB0h1uiF+5LKr3DC/VZOjKxRs1deGILluwjepmrp/Xqzue1XGgU9ZkZeCeKzcUxUJw+V1Yj6qTTYsk7G39Xhc/oYvKSHXPEW9aH47m62n+4w== X-Forefront-PRVS: 0145758B1D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(97736004)(81166006)(8676002)(2950100002)(5660300001)(38730400001)(733004)(7846002)(4326007)(39450400002)(110136003)(33026002)(21086003)(6506006)(36756003)(33646002)(2906002)(8666005)(42882006)(81156014)(305945005)(69596002)(101416001)(5003940100001)(66066001)(50226002)(47776003)(2351001)(7736002)(6512006)(6486002)(4001430100002)(92566002)(6916009)(50986999)(39410400001)(76506005)(106356001)(189998001)(3846002)(105586002)(48376002)(68736007)(42186005)(6116002)(107886002)(76176999)(50466002)(6666003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1717; 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; BN3PR0701MB1717; 23:xeqsBfPGhGDm+2a7TW3Ko0Wzxu5C+qQEs7MwFrh?= =?us-ascii?Q?8fpQc6L52BIu07omqIGZ4gKbS751sS15HXUWvowQct90SlWP3CidrzF45r0E?= =?us-ascii?Q?qhwRgKVYMI75Y9b7SMYgnXMohmH85XtcMMV0KtxPYfV42AyYLqHf/W+fNG3z?= =?us-ascii?Q?IbYVUHaLEYVwNW7/H2oJeIu8SgC4f2kezU2sA5fOMSv3cTDV1euRUkEEcC4y?= =?us-ascii?Q?KVxlW6yEuHaR2OMzccoodotYYSwDxmleO+Chb5baiaKlXC9PgUW4g5r9cUi8?= =?us-ascii?Q?9q9Vzt0M2JuU5SB9mFnrEgd3x/gfdmSSPsBP1dq3o0XJ548PS7JE0z7K4YwF?= =?us-ascii?Q?MAGTCgt/d5xDc2GlqI92CqH2R07ldDzW6hBF4g/R5e5uZTKlYie9PO5ES2Gc?= =?us-ascii?Q?z7KOtYRW6rNNljNq53StFFOzYJHl98wkK8pEL1ASVZpJP2Hy7CHXqZydeUoJ?= =?us-ascii?Q?c7pJOn12rM3qqV1dsCss9qubKEEHj5w7GV0qeKrCprYHZ4hawnaPHl/Exiy5?= =?us-ascii?Q?zeK51g/DRHj9d+uOYO3jAhEkmYcGITLMiyLvepESJBP16pAvYqYtOF6mEezW?= =?us-ascii?Q?ejpTo9u2Tb+xeQy/rI4xPrjBdP5liy3Coft8a9oAGZV8YI48FCjoZPl7TvdV?= =?us-ascii?Q?Tj+4T62vOlFlzqpCjF46Sr6nQHCcZAZFQQQh51ooiL28WRF7y6xA/uLrSzLT?= =?us-ascii?Q?Pud0HtW8JKCUmx1S4eFs0oQUvOROO5Twwqmc81P75OwhIwfTpQdhY51rxcMa?= =?us-ascii?Q?+LkGNhFiBX/viWmn7RBAb9gkDBrZlJPUFeaUQ59wcoOLUuaZWYqdELLjiX7Y?= =?us-ascii?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Kx/f/87kJrQnp9GZFkmx3uI=; 5:FJVWrBwwpH3fBHvB1BsWsHUrscX6pZ3qUWppZZrYoUGIF8ifgfgrn7cFpY4hXKZDGSU7ne1MQCpCODscaAIsTG11Gx3jWuZfPi0enqbgPWcRSzaLYG+bKK8IvF/5r4k5KXBYFBeLZ3dgV82F9VzHh7BOklbbbducD9S/2e7mank=; 24:VZRrOEYP0XiKxGELwpTa1EFos9MR+Zj4ZjiRWANJvGW4kY47ccjrON+lLP19o+4BGUC5SCjl/gBKPdF0zaGfjsjuuDrlug/AClVgejmbPRU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 7:ISj5xSpcqqEiJkVTEg0wLIIYF0MeCztwgXDXoobQ5X2srcc2tlu+Jkk0T8WY6sfyyNgtZPuH6eXbGOoM8BM4bSHekyZvBa+4y92HYub4tUv0mVqDO9Ms2uLKR//IYkiM75jDpjkW/kgnuJu/gSRdNtwWICLmUp09Iyk7nuroi3pETCnLabzVT+aJxvMxw98jpQDlgB+8wWYhx7idJWFiVepUkzMAJqxAXoMPRdEqCWAcHXRh+CXlR2SydB34jWbssr3qroGHAQ1xOPIpdxuGGB7QSCJ/iI2gGwuudU11QhQbfZkTEZ3hcZHmuKqTNrBiQ+Iip1Dajp6JTvy9iPLMfYIzh+hRExSTWs4RIJdQ6Gg= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2016 20:55:53.2664 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Subject: [dpdk-dev] [PATCH v2 1/2] eal: postpone vdev initialization 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: Sat, 03 Dec 2016 20:55:57 -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