From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id E4A88271 for ; Thu, 29 Jun 2017 23:05:01 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 747AA207C7; Thu, 29 Jun 2017 17:05:01 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 29 Jun 2017 17:05:01 -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=d722SHltBIN4Z+F z7aL1ql8ZCD+r+wcba/qp54pVpHw=; b=YzCxk6vHTV8pnLh+By5EdjRg7Odckf7 qOD6wWK4sZCqOW4MC42puRXxqwWzAhYL7SfHZITVMCXFUZ4G3Tcr1/MVWvyb0O0E +eZNHrIpW+SNKYHHyPptSkXceaejCoPirpBHSBvMu6IuKenN0fEvyXK6zQJB/Ul7 PkY5jHWKhroE= 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=d722SHltBIN4Z+Fz7aL1ql8ZCD+r+wcba/qp54pVpHw=; b=Onv0BTVe 7o726itQ+KveO55P89Nmt5wxSa6DNC8sC/TH5RPr1AcL1g3V23RIT1bWb+cniw1h IJOpLJPAX6WSiEsX3iAlRo6MH0JdMxJZoZ1zgPofR9dDPLi6yc7kkQErpNjKv3Km 5L24WiLj9zQ24YmWfAh/MtpfVA61ygaNfxqZnIGiiJU6DSJDgwY3mg4ts2KRIaBn nDY+IDKA76C6f9Rsang7j2mgbXhJITXYOhNH6w/G5gi19o9MiIgmlPLGlm/O6Wej Bew+O31I7m/Gfc39ouT2EbBXS0ery6g9/YGYRSJ3sEnzoVyNJ5ca9eSfD2+Mxlgn JBnM+TFRJ8qOZQ== X-ME-Sender: X-Sasl-enc: VCI90s7i0DkSYiz2dTCvuVoPNmgV/Lji09vtx0rhYGWx 1498770301 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 260C9240B0; Thu, 29 Jun 2017 17:05:01 -0400 (EDT) From: Thomas Monjalon To: Jan Blunck Cc: dev@dpdk.org, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com Date: Thu, 29 Jun 2017 23:05:00 +0200 Message-ID: <2309847.WUWjzkZ3SS@xps> In-Reply-To: <20170629182206.1072-15-jblunck@infradead.org> References: <20170629182206.1072-1-jblunck@infradead.org> <20170629182206.1072-15-jblunck@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v7 14/15] dev: use new hotplug API in attach / detach 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, 29 Jun 2017 21:05:02 -0000 29/06/2017 20:22, Jan Blunck: > Using the new generic API allows attach and detach to be backwards > compatible while decoupling from the concrete bus implementations. > > Signed-off-by: Jan Blunck > --- > int rte_eal_dev_attach(const char *name, const char *devargs) > { > - struct rte_pci_addr addr; > + int ret; > > if (name == NULL || devargs == NULL) { > RTE_LOG(ERR, EAL, "Invalid device or arguments provided\n"); > return -EINVAL; > } > > - if (eal_parse_pci_DomBDF(name, &addr) == 0) { > - if (rte_pci_probe_one(&addr) < 0) > - goto err; > + ret = rte_eal_hotplug_add("PCI", name, devargs); > + if (ret && ret != -EINVAL) > + return ret; > > - } else { > - if (rte_vdev_init(name, devargs)) > - goto err; > - } > + /* > + * If we haven't found a bus device the user meant to "hotplug" a > + * virtual device instead. > + */ > + ret = rte_vdev_init(name, devargs); > + if (ret) > + RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n", > + name); > + return ret; > +} I really don't like this function. It is not really decoupled from the buses (cf "PCI" and rte_vdev_init). However I think it is acceptable if it is explictly deprecated and kept only for the legacy rte_eth_dev_attach() function.