From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] ethdev: fix port ID retrieval on vdev attach Date: Wed, 11 Jul 2018 12:02:32 +0200 Message-ID: <3175221.OSDE0iBHN2@xps> References: <1531302573-16946-1-git-send-email-arybchenko@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Ferruh Yigit , David Marchand To: Andrew Rybchenko , Ivan Malov Return-path: Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by dpdk.org (Postfix) with ESMTP id 6FDEF1B53A for ; Wed, 11 Jul 2018 12:02:36 +0200 (CEST) In-Reply-To: <1531302573-16946-1-git-send-email-arybchenko@solarflare.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 11/07/2018 11:49, Andrew Rybchenko: > From: Ivan Malov > > Attaching a vdev port may result in multiple > ports actually added because a vdev port may > have slave devices to be attached implicitly. > > Ethdev attach API has to fill in the port ID > to be read back by the user and what it does > is take the last assigned ID from the common > list after attach completion. Such an ID may > belong to a slave device and not to the vdev. > > This mistake must be precluded by requesting > the port ID by name of device being attached. No, the real issue is using this function rte_eth_dev_attach. It is broken since day 1. Mixing EAL devargs and ethdev port cannot work by design. If you want to attach a device, you must add it with rte_eal_hotplug_add and wait for the driver to probe the ports (which can be ethdev or other classes). We should take these actions in 18.08: - deprecate rte_eth_dev_attach/rte_eth_dev_detach - deprecate rte_eal_dev_attach/rte_eal_dev_detach I did not take time to send the deprecation notices yet. Feel free to deprecate these functions yourself.