From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 3353DA04B5;
	Wed, 30 Sep 2020 14:18:02 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id DFD241D6C9;
	Wed, 30 Sep 2020 14:18:00 +0200 (CEST)
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100])
 by dpdk.org (Postfix) with ESMTP id 47C711D68D
 for <dev@dpdk.org>; Wed, 30 Sep 2020 14:17:59 +0200 (CEST)
IronPort-SDR: VHzfaOd3r1tYtrYzPX5qh1a183jrrY8xrGsgNzO2LwqCPNygLamWroKJxi47Q6VGH9+HC6NWFV
 um0USc2O0yZQ==
X-IronPort-AV: E=McAfee;i="6000,8403,9759"; a="226576945"
X-IronPort-AV: E=Sophos;i="5.77,322,1596524400"; d="scan'208";a="226576945"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 30 Sep 2020 05:17:57 -0700
IronPort-SDR: eHzb+DJsbX721NCdSWFd99I8qFi6l8W659wEcvlh4+JJ+ZvJ2DQdglczBe2DG2e+BbekhRrcOq
 ZlcDld/6R9DA==
X-IronPort-AV: E=Sophos;i="5.77,322,1596524400"; d="scan'208";a="497286044"
Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.251.186])
 ([10.213.251.186])
 by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 30 Sep 2020 05:17:55 -0700
To: Thomas Monjalon <thomas@monjalon.net>, dev@dpdk.org
Cc: arybchenko@solarflare.com, Wenzhuo Lu <wenzhuo.lu@intel.com>,
 Beilei Xing <beilei.xing@intel.com>,
 Bernard Iremonger <bernard.iremonger@intel.com>
References: <20200913220711.3768597-1-thomas@monjalon.net>
 <20200928231437.414489-1-thomas@monjalon.net>
 <20200928231437.414489-27-thomas@monjalon.net>
From: Ferruh Yigit <ferruh.yigit@intel.com>
Message-ID: <dadfda00-87b0-0787-77cc-16e99907b56e@intel.com>
Date: Wed, 30 Sep 2020 13:17:52 +0100
MIME-Version: 1.0
In-Reply-To: <20200928231437.414489-27-thomas@monjalon.net>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH v3 26/29] app/testpmd: align behaviour of
 multi-port detach
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 9/29/2020 12:14 AM, Thomas Monjalon wrote:
> A port can be closed in multiple situations:
> 	- close command calling close_port() -> rte_eth_dev_close()
> 	- exit calling close_port() -> rte_eth_dev_close()
> 	- hotplug calling close_port() -> rte_eth_dev_close()
> 	- hotplug calling detach_device() -> rte_dev_remove()
> 	- port detach command, detach_device() -> rte_dev_remove()
> 	- device detach command, detach_devargs() -> rte_eal_hotplug_remove()
> 
> The flow rules are flushed before each close.
> It was already done in close_port(), detach_devargs() and
> detach_port_device() which calls detach_device(),
> but not in detach_device(). As a consequence, it was missing for siblings
> of port detach command and unplugged device.
> The check before calling port_flow_flush() is moved inside the function.
> 
> The state of the port to close is checked to be stopped.
> As above, this check was missing in detach_device(),
> impacting the cases of a multi-port device unplugged or detached
> with the port detach command.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>