From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7407BA04B7; Tue, 13 Oct 2020 19:59:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3F8811DBF7; Tue, 13 Oct 2020 19:59:30 +0200 (CEST) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by dpdk.org (Postfix) with ESMTP id 2168D1DBF6 for ; Tue, 13 Oct 2020 19:59:28 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id BB329580445; Tue, 13 Oct 2020 13:59:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 13 Oct 2020 13:59:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= yo46vwskfY+waPwJV1ALdu8S5Kcj70TwrAhqORgpZp8=; b=bfkFBrsZKWq/wj3x 6yIM49nkRYOTLNupEGK+nfehboopQicCRu68IsV26vVLU5YeZsp1Ez/b7RPODUDm SwWN61zfIxhOiccE3VDqxTDLTdOX91U/1L3bYg7DK/lvmXnbrFNBAKZb/ecIW155 F31Q8GD2ZhtM+LXvs2SyKcpICMfsA3PxxtJca7Z3RMVasxMTUQZVwAFQnT75B5mk AQdnleWaXOxtXRxQ1iczo/phffQqhkgnR9jGLpu5advSVBUnUnj2lzwRa+2Qsloy 9NSYoHKPpcNwpEaIZ+A7JofxHf1r+Z3qMEOVVD0jD6gNF8gvWgbM2+CsXOJK40uL cMlm4w== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=yo46vwskfY+waPwJV1ALdu8S5Kcj70TwrAhqORgpZ p8=; b=T0rx+bH5qLWaHYyBdPCE7KZur3MEIujYYmYUVbK7pWPghxz2mBcc8E02e BQux6j/pwnW47YJ2TJ/VH516uG0FxHHOSH+b9DIOlV4IUrz7BZUHUbSw0Us1MoLQ 9OvjKjLIP4nS8PQhstZD/ezcRDO0mInsWQ+wm9PFdBwwIaO9NqK8NQ8EZAHkU0Nr 8UNcliPJ0yNqtttWif1JraXBwowT/bBgJRrfisbj/q+ziVwVpEe1ilfZHmye8ikD f+qpgBNj/wEPlxLFDwe77AE0EcFvTO/CGM3IfPiBOomjs+9tAB7uuBrzyiH2flzX do8Nn9yIQxkWMYbC1uXBzDrPxiskg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrheelgdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D93493280066; Tue, 13 Oct 2020 13:59:22 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, Andrew Rybchenko , Steven Webster , Matt Peters , Somalapuram Amaranath , Rasesh Mody , Shahed Shaikh , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , John Daley , Hyong Youb Kim , Qiming Yang , Qi Zhang , Alfredo Cardigliano , Rosen Xu , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Liron Himi , Heinrich Kuhn , Harman Kalra , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K Date: Tue, 13 Oct 2020 19:59:21 +0200 Message-ID: <10144299.NCpPIoQQBk@thomas> In-Reply-To: <66feb9dc-d08c-e01b-40c6-05dca3856c2f@intel.com> References: <20200913220711.3768597-1-thomas@monjalon.net> <4842858.jpJ4lIlKDh@thomas> <66feb9dc-d08c-e01b-40c6-05dca3856c2f@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v5 1/3] ethdev: remove forcing stopped state upon close 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 13/10/2020 19:54, Ferruh Yigit: > On 10/13/2020 1:51 PM, Thomas Monjalon wrote: > > 13/10/2020 14:45, Ferruh Yigit: > >> On 10/13/2020 11:06 AM, Thomas Monjalon wrote: > >>> When closing a port, it is supposed to be already stopped, > >>> and marked as such with "dev_started" state zeroed by the stop API. > >>> > >>> Resetting "dev_started" before calling the driver close operation > >>> was hiding the case of not properly stopped port being closed. > >>> The flag "dev_started" is not changed anymore in "rte_eth_dev_close()". > >>> > >>> In case the "dev_stop" function is called from "dev_close", > >>> bypassing "rte_eth_dev_stop()" API, > >>> the "dev_started" state must be explicitly reset in the PMD > >>> in order to keep the same behaviour. > >>> > >>> Signed-off-by: Thomas Monjalon > >>> Acked-by: Stephen Hemminger > >>> Reviewed-by: Andrew Rybchenko > > [...] > >> Following non-virtual PMDs doesn't call 'dev_stop()' from 'dev_close()', > >> maintainers of the PMDs cc'ed. > >> > >> avp > >> axgbe > >> bnx2x > >> cxgbe > >> dpaa2 > >> enic > >> ice_dcf > >> ionic > >> ipn3ke > >> mlx4 > >> mlx5 > >> mvpp2 > >> nfp > >> octeontx > >> octeontx2 > >> sfc > >> > >> Can you please double check for your driver: > >> > >> 1) Device stopped properly before it has been closed? > >> > >> 2) The device stopped state ('dev->data->dev_started') is correct if device > >> closed without explicitly stopped first. > > > > The application is supposed to call stop before close, > > so I don't know what has to be checked. > > The automatic stop in close is an extra feature per PMD choice. > > > > A device can be hot-removed without stop, that is why I was thinking 'close()' > should stop the device (if it is not already). > > Even current 'rte_eth_dev_close()' API doesn't check if the port stopped or not. > > If application does stop -> close/remove in order, that would work, but for the > case it didn't, PMD ensuring the device stopped before close is safer. Yes that's probably a case which not well tested.