From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wj0-f182.google.com (mail-wj0-f182.google.com
 [209.85.210.182]) by dpdk.org (Postfix) with ESMTP id E4268F968
 for <dev@dpdk.org>; Wed, 21 Dec 2016 15:42:11 +0100 (CET)
Received: by mail-wj0-f182.google.com with SMTP id tk12so205494604wjb.3
 for <dev@dpdk.org>; Wed, 21 Dec 2016 06:42:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:user-agent:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=+Z2Fx78RY/DNTUGsKGSR32PMn+3sMZ3A4osLYIMhEN4=;
 b=OvRcDm/WkTkWkQ34nnJegZg5EPtKuCpBb7T3Im7DRZYsoPMMgLWv0ui6hjDgFXSjA3
 4qFuELW6AQ21ozJdmTrQeLSi0jbVnRipUKPKaAvvBPsgzGpZGbIUchMMMk99niKW+zJS
 P2bLsNUScFHEUlPVVDn2tw43uC3hyKGupCEAQrrXt0D24xlUDm2OSf+ndTfVzajxW3wk
 Ks2QKF2T+rwS2XARcza7FpOn8g/f+cfsGKrwa/S0VSGTfud2cMVnnh8uPu9qF0/ijpAn
 nJkBiDudkhO5WCeKnaDVHkPkNlwMY/JkD2v6kBzAzECzur25QA7M7SeNVYmbTjab7kv2
 8HGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=+Z2Fx78RY/DNTUGsKGSR32PMn+3sMZ3A4osLYIMhEN4=;
 b=k/aePPv6Llvyrka8SDWivVPAbNiJCpfulTQceeJhQt6K4N+/AFjJ0OWrc/ENkpJR/8
 ZYFIUDxIBlT5Cp0diIBl16vzoRG3yLBSpaOzAblUbPHJSIOHDbSTCqSpbFIxsFqyMAJh
 I5Qi1VDAeSV1RwLQS5YpG4Ys8LSUVXkkkFWh97EEk3nMUMJAtB2grexGaCauLiL8fXef
 X92BAHXrNUrz4TVtkTuGZX6/FEsXjEee8XD8DrrGum8uOagNk7Esuj0hc+4m4eCxOElU
 iA3geiiKU0kUcSuFpl70+I5CqO8lTxNfz2xZZpD76dB8ZFMOb0pwmi8jTdKdvyabl/0T
 X+uw==
X-Gm-Message-State: AIkVDXKiRbm9mhbfrxk7AiSYgWrP6SkTSU1vETgHPUuz0ihJ3qTMY9Kc2m3PRaqd9fFPAMgy
X-Received: by 10.195.12.1 with SMTP id em1mr3699427wjd.134.1482331331640;
 Wed, 21 Dec 2016 06:42:11 -0800 (PST)
Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184])
 by smtp.gmail.com with ESMTPSA id ke6sm30893197wjb.21.2016.12.21.06.42.10
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 21 Dec 2016 06:42:11 -0800 (PST)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Cc: dev@dpdk.org, declan.doherty@intel.com, david.marchand@6wind.com
Date: Wed, 21 Dec 2016 15:42:10 +0100
Message-ID: <2376328.XzMvuznAmr@xps13>
User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <1479628850-27202-1-git-send-email-jerin.jacob@caviumnetworks.com>
References: <1479628850-27202-1-git-send-email-jerin.jacob@caviumnetworks.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH] eal: postpone vdev initialization
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Dec 2016 14:42:12 -0000

2016-11-20 13:30, Jerin Jacob:
> 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>

Applied, thanks