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 54425A04B5; Tue, 29 Sep 2020 18:39:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9966E1DA50; Tue, 29 Sep 2020 18:39:38 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B2AD91DA4F for ; Tue, 29 Sep 2020 18:39:36 +0200 (CEST) IronPort-SDR: +5vlVwcD8EL5KZxqwZyYWXZlQa45A6Yic38ZeivWs3whGHWXsYOMlAUhP4R1F4aeimiE0jDKPB 6qmaWFG93stQ== X-IronPort-AV: E=McAfee;i="6000,8403,9759"; a="159568010" X-IronPort-AV: E=Sophos;i="5.77,319,1596524400"; d="scan'208";a="159568010" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2020 09:39:34 -0700 IronPort-SDR: /7SqMamuWXSxW3F6d1zzqcViL0rrqmjk5BqrVusi3+JbaKUu10OgGpySziXSY15fWgZq2Oi0BR zl+aakI51Jlg== X-IronPort-AV: E=Sophos;i="5.77,319,1596524400"; d="scan'208";a="492122190" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.220.198]) ([10.213.220.198]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2020 09:39:33 -0700 To: Thomas Monjalon Cc: dev@dpdk.org, arybchenko@solarflare.com References: <20200913220711.3768597-1-thomas@monjalon.net> <20200928231437.414489-28-thomas@monjalon.net> <7452c24f-b5ad-36b1-7e14-af375f902f75@intel.com> <3009264.rAMxf2BjXc@thomas> From: Ferruh Yigit Message-ID: <8079ff58-f1b9-a202-fc62-34a6f85e7a67@intel.com> Date: Tue, 29 Sep 2020 17:39:32 +0100 MIME-Version: 1.0 In-Reply-To: <3009264.rAMxf2BjXc@thomas> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 27/29] 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 9/29/2020 5:06 PM, Thomas Monjalon wrote: > 29/09/2020 18:01, Ferruh Yigit: >> On 9/29/2020 12:14 AM, Thomas Monjalon wrote: >>> When closing a port, it is supposed to be already stopped, >>> and marked as such with "dev_started" state zeroed. >>> >>> 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()". >>> >>> Signed-off-by: Thomas Monjalon >>> --- >>> lib/librte_ethdev/rte_ethdev.c | 1 - >>> 1 file changed, 1 deletion(-) >>> >>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c >>> index d7668114ca..0b8e8e3e8d 100644 >>> --- a/lib/librte_ethdev/rte_ethdev.c >>> +++ b/lib/librte_ethdev/rte_ethdev.c >>> @@ -1716,7 +1716,6 @@ rte_eth_dev_close(uint16_t port_id) >>> dev = &rte_eth_devices[port_id]; >>> >>> RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_close); >>> - dev->data->dev_started = 0; >>> (*dev->dev_ops->dev_close)(dev); >>> >>> rte_ethdev_trace_close(port_id); >>> >> >> The driver 'remove()' function may be calling the driver 'stop()' dev_ops >> internally, so the device will be stopped properly but the 'dev_started' status >> won't be updated because ethdev API is not called. > > If the driver is managing it internally, it should reset the state as well. > I think many PMD don't update the 'dev_started' right now. >> This API assumes device stopped and updates the state accordingly, it is not >> good but removing it also won't be good for the case device already stopped. >> >> What do you think calling 'rte_eth_dev_stop()' from 'rte_eth_dev_close()'? > > I think it would be confusing. > Better to let the application and the driver manage "stop" > at their best. > OK >> Although not sure how to handle driver 'remove()' case. > > What are you referring to exactly? > This was questioning how to manage 'rte_eth_dev_stop()' call on driver 'remove()' path. Not valid after above comment.