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 7292AA04B7; Tue, 13 Oct 2020 14:37:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D771B1BC0C; Tue, 13 Oct 2020 14:37:05 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DCE021BACE for ; Tue, 13 Oct 2020 14:37:04 +0200 (CEST) IronPort-SDR: AM/oJuzWH90HtIq/dvNwjhZrVSPbZYfTqFW3QAqz89lNHq9okkqZSRnJLRJqXgD86FKd3/SKZ/ UlsfYut44xSA== X-IronPort-AV: E=McAfee;i="6000,8403,9772"; a="250595311" X-IronPort-AV: E=Sophos;i="5.77,370,1596524400"; d="scan'208";a="250595311" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 05:36:55 -0700 IronPort-SDR: cfspD1Y82FTFimORBf0KyqEPP3TbCm9PYYcBySbipb/aLb8aRR+ukTj8Beo+BuN9taevoFePxm EYd3KvANny/w== X-IronPort-AV: E=Sophos;i="5.77,370,1596524400"; d="scan'208";a="530379407" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.214.64]) ([10.213.214.64]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2020 05:36:44 -0700 To: Thomas Monjalon , dev@dpdk.org Cc: arybchenko@solarflare.com, Stephen Hemminger , Shepard Siegel , Ed Czeck , John Miller , Igor Russkikh , Pavel Belous , Hemant Agrawal , Sachin Saxena , Jeff Guo , Haiyue Wang , Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , Igor Chauskin , Gagandeep Singh , Qi Zhang , Xiao Wang , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Wei Hu (Xavier)" , "Min Hu (Connor)" , Yisen Zhuang , Beilei Xing , Jingjing Wu , Qiming Yang , Shijith Thotton , Srisivasubramanian Srinivasan , Zyta Szpak , Liron Himi , Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Long Li , Martin Spinler , Akhil Goyal , Rasesh Mody , Shahed Shaikh , Bruce Richardson , Jerin Jacob , Maciej Czekaj , Maxime Coquelin , Chenbo Xia , Zhihong Wang , Yong Wang , Andrew Rybchenko References: <20200913220711.3768597-1-thomas@monjalon.net> <20201013100634.2482593-1-thomas@monjalon.net> <20201013100634.2482593-2-thomas@monjalon.net> From: Ferruh Yigit Message-ID: <307b1ce6-a06f-6feb-25a2-5f791156b75f@intel.com> Date: Tue, 13 Oct 2020 13:36:39 +0100 MIME-Version: 1.0 In-Reply-To: <20201013100634.2482593-2-thomas@monjalon.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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" 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 <...> > @@ -1497,6 +1497,7 @@ eth_igb_stop(struct rte_eth_dev *dev) > } > > adapter->stopped = true; > + dev->data->dev_started = 0; > } 'igbvf_dev_stop()' may be missed. <...> > @@ -2917,6 +2917,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) > adapter->rss_reta_updated = 0; > > hw->adapter_stopped = true; > + dev->data->dev_started = 0; > } 'ixgbevf_dev_stop()' may be missed. Also many virtual PMDs doesn't call 'dev_stop()' from the 'dev_close()', for many cases they may not needed to, since there is no device to stop. But for the sake of the correct status, should 'dev_started' set to '0' in 'dev_close()' dev_ops, or do you think can we ignore this?