From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 2FA2A2BAA for ; Thu, 13 Jul 2017 08:52:38 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6CB3F20C36; Thu, 13 Jul 2017 02:52:34 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 13 Jul 2017 02:52:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=vEpsLerI3Ig1rzR nEcVZOcbGI5FsK7IxOgOlKiP1D/0=; b=cgU2F5IccHehhC+JyJX6ktvJB6G3k48 7VOS7rDW5XH7G0vXGG9cj9mSoWY1c+/W9UtW0ePvdmabv4oyUHr4hTw07sH1LO4a B/UAHoPn9PSZe6lIFKsNwnviutmrRf7Qo4dzk/vTKEZP8GqkaG+RdLqFpaCuUDrd D08TogbUal7s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=vEpsLerI3Ig1rzRnEcVZOcbGI5FsK7IxOgOlKiP1D/0=; b=GhSTZqLA RAq8bwy6nGFfw7FqMJIEwp2O+iQqrfn3cq7Ixu1sSUhqQetjTd6+rvBci6ptOqXM yoSeXL0Sdq7GoBmQ390BCuc/C3MyMCXOgdNe6WwU68VoZaOd+sVWJVS5+3+5Uvp5 84aWA9WCcGHvvkp0asyUoOk/Yw1vOvJOY1wUFrC5NGNj1lJI/xFLrPTFfofpYael bQvdwXyL+0+Ch+WxoAYpvzRUogWpw0CadwhIuKyxJ5LpUzAdsYUDGby1yXCqaAnp IaECJRNMwfy6htM60GYp5XuMYQdSIsUv90ePQwZl/kjcFuhM2Xh10HQaIYE8C016 Ie5vdU2wL2b34w== X-ME-Sender: X-Sasl-enc: cjEijqwRS0P407uDrd2EJorCjoTrINCQ2J2y3Cm+3+lt 1499928754 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2505C24772; Thu, 13 Jul 2017 02:52:34 -0400 (EDT) From: Thomas Monjalon To: =?ISO-8859-1?Q?Ga=EBtan?= Rivet Cc: dev@dpdk.org Date: Thu, 13 Jul 2017 08:52:33 +0200 Message-ID: <1868638.SUpGZpUFpc@xps> In-Reply-To: <20170712203957.GG11154@bidouze.vm.6wind.com> References: <20170712182812.18404-1-thomas@monjalon.net> <20170712203957.GG11154@bidouze.vm.6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [PATCH] net/failsafe: do not probe device if plugged out 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: Thu, 13 Jul 2017 06:52:38 -0000 12/07/2017 22:39, Ga=EBtan Rivet: > Hi Thomas, >=20 > Nice idea. A few remarks below: >=20 > On Wed, Jul 12, 2017 at 08:28:12PM +0200, Thomas Monjalon wrote: > > FOREACH_SUBDEV(sdev, i, dev) { > > if (sdev->state !=3D DEV_PARSED) > > continue; > > da =3D &sdev->devargs; > > + >=20 > Superfluous line. I don't think so :) It is isolating the "skip" block with its comment. > > + /* skip plugged out devices */ > > + if (! first_init > > + && sdev->cmdline =3D=3D NULL > > + && strcmp(da->bus->name, "vdev") !=3D 0) { >=20 > Use first_init =3D=3D false instead of negation. > && should be at the end of the line instead of the start of the next > one. Yes > Indentation is wrong. No, the coding style is to put 2 tabs for continuation lines. > > + da->bus->scan(); > > + if (bus->find_device(NULL, cmp_dev_name, da->name) =3D=3D NULL) > > + continue; /* device not found */ >=20 > da->bus->find_device instead of bus->find_device. > This function cannot find the device back currently on the PCI bus, > blocking the plugging of VF. >=20 > The PCI bus will scan the VF while no rte_devargs exists to > describe it within the global list. If the device exists, it will > detect it, allocate it and then set its name. > Without any rte_devargs, the name of a PCI device falls back to its > canonical name (DomBDF instead of BDF). The name comparison with > da->name can only succeed if the slave was declared using the DomBDF > format. >=20 > The fix is to do a deep copy of the rte_devargs (the API has been > sent previously with the rte_devargs rework but I have since removed > it) and insert it using rte_eal_devargs_insert(). This is essentially > the solution I used for the rte_eal_hotplug_add() fix[1]. >=20 > The alternative fix is to propose an API for buses to transform device > names into their canonical form on demand... And it would certainly only > be useful for the PCI bus. >=20 > The issue is discussed there: > [1]: http://dpdk.org/ml/archives/dev/2017-July/071155.html OK, I was not aware of this exact issue. So I will wait above fix.