DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: <dev@dpdk.org>
Cc: <declan.doherty@intel.com>, <david.marchand@6wind.com>,
	<thomas.monjalon@6wind.com>, <shreyansh.jain@nxp.com>,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: [dpdk-dev]  [PATCH v2 1/2] eal: postpone vdev initialization
Date: Sun, 4 Dec 2016 02:25:38 +0530	[thread overview]
Message-ID: <1480798539-13360-2-git-send-email-jerin.jacob@caviumnetworks.com> (raw)
In-Reply-To: <1480798539-13360-1-git-send-email-jerin.jacob@caviumnetworks.com>

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 <jerin.jacob@caviumnetworks.com>
---
 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

  reply	other threads:[~2016-12-03 20:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-20  8:00 [dpdk-dev] [PATCH] " Jerin Jacob
2016-11-20 16:05 ` David Marchand
2016-11-21  5:09 ` Shreyansh Jain
2016-11-21 16:56   ` Jerin Jacob
2016-11-21  9:54 ` Ferruh Yigit
2016-11-21 17:02   ` Jerin Jacob
2016-11-21 17:35     ` Ferruh Yigit
2016-11-23  0:07       ` Jerin Jacob
2016-11-23 13:29         ` Thomas Monjalon
2016-12-03 20:55 ` [dpdk-dev] [PATCH v2 0/2] " Jerin Jacob
2016-12-03 20:55   ` Jerin Jacob [this message]
2016-12-03 20:55   ` [dpdk-dev] [PATCH v2 2/2] eal: rename dev init API for consistency Jerin Jacob
2016-12-05 10:12     ` Shreyansh Jain
2016-12-05 10:24       ` Jerin Jacob
2016-12-05 14:03         ` Shreyansh Jain
2016-12-18 14:21   ` [dpdk-dev] [PATCH v3 0/6] libeventdev API and northbound implementation Jerin Jacob
2016-12-18 14:21     ` [dpdk-dev] [PATCH v3 1/6] eventdev: introduce event driven programming model Jerin Jacob
2016-12-18 14:21     ` [dpdk-dev] [PATCH v3 2/6] eventdev: define southbound driver interface Jerin Jacob
2016-12-19 15:50       ` Bruce Richardson
2016-12-18 14:21     ` [dpdk-dev] [PATCH v3 3/6] eventdev: implement the northbound APIs Jerin Jacob
2016-12-18 14:21     ` [dpdk-dev] [PATCH v3 4/6] eventdev: implement PMD registration functions Jerin Jacob
2016-12-18 14:21     ` [dpdk-dev] [PATCH v3 5/6] event/skeleton: add skeleton eventdev driver Jerin Jacob
2016-12-19 11:58       ` Bruce Richardson
2016-12-18 14:21     ` [dpdk-dev] [PATCH v3 6/6] app/test: unit test case for eventdev APIs Jerin Jacob
2016-12-19  5:16     ` [dpdk-dev] [PATCH v3 0/6] libeventdev API and northbound implementation Shreyansh Jain
2016-12-20 11:13     ` Bruce Richardson
2016-12-20 13:09       ` Jerin Jacob
2016-12-20 13:22         ` Bruce Richardson
2017-01-11 15:52           ` Jerin Jacob
2016-12-21 14:39   ` [dpdk-dev] [PATCH v2 0/2] postpone vdev initialization Thomas Monjalon
2016-12-21 14:42 ` [dpdk-dev] [PATCH] eal: " 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=1480798539-13360-2-git-send-email-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=david.marchand@6wind.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=shreyansh.jain@nxp.com \
    --cc=thomas.monjalon@6wind.com \
    /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).