From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100])
 by dpdk.org (Postfix) with ESMTP id DD31BDE5
 for <dev@dpdk.org>; Tue, 17 Jan 2017 11:47:57 +0100 (CET)
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by orsmga105.jf.intel.com with ESMTP; 17 Jan 2017 02:47:56 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.33,244,1477983600"; d="scan'208";a="54184248"
Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.38])
 ([10.237.220.38])
 by fmsmga005.fm.intel.com with ESMTP; 17 Jan 2017 02:47:55 -0800
To: Shreyansh Jain <shreyansh.jain@nxp.com>, david.marchand@6wind.com
References: <1484581107-2025-1-git-send-email-shreyansh.jain@nxp.com>
 <1484647774-28984-1-git-send-email-shreyansh.jain@nxp.com>
 <1484647774-28984-10-git-send-email-shreyansh.jain@nxp.com>
Cc: dev@dpdk.org, thomas.monjalon@6wind.com
From: Ferruh Yigit <ferruh.yigit@intel.com>
Message-ID: <efeef9a6-05b7-6637-aec0-fa3dcbd2d7bb@intel.com>
Date: Tue, 17 Jan 2017 10:47:55 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <1484647774-28984-10-git-send-email-shreyansh.jain@nxp.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH v7 9/9] eal: enable hotplugging of devices on
 bus
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: Tue, 17 Jan 2017 10:47:58 -0000

On 1/17/2017 10:09 AM, Shreyansh Jain wrote:
> Given a bus, attach and detach callbacks allow the implementation to
> handles calls from EAL for attaching or detaching a named device.
> 
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

<...>

> +/**
> + * Search and detach a PCI device from PCI Bus
> + * Implements rte_bus->detach
> + *
> + * @param device_name
> + *	Name of the device to search and detach
> + *
> + * @return
> + *	0 for successful detaching of device
> + *	>0 if device not found on bus
> + *	<0 in case of error in removal.

These are the return values expected by rte_eal_dev_detach(), but
rte_eal_pci_detach() is not following these right now, which is causing
failure on detaching virtual devices.

Fix is not complex, it may be an option to fix this as a separate patch
after this patchset applied.

> + */
> +int
> +rte_eal_pci_detach(const char *device_name);
> +
> +/**

<...>