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 7A1C2A04DB; Fri, 16 Oct 2020 11:22:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5CB491EBE8; Fri, 16 Oct 2020 11:22:42 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 511711EBE4 for ; Fri, 16 Oct 2020 11:22:39 +0200 (CEST) IronPort-SDR: cnmTS5BwetQ/Mj8RplB2biPyjNVz5gveX3aaKMBo8PgZqXFqiWBdnOHpFeahUJ5xM49mprqIKC fEbDMXqvO5Xg== X-IronPort-AV: E=McAfee;i="6000,8403,9775"; a="230761584" X-IronPort-AV: E=Sophos;i="5.77,382,1596524400"; d="scan'208";a="230761584" 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; 16 Oct 2020 02:22:37 -0700 IronPort-SDR: cQlIn8HdJBCEGgsk+Eml9l+jNBGp1uxN03KrUvzX1GCSB7mW0lW2G8M0TcloAi1bhr/29t7RGV IFX++OVR9o1g== X-IronPort-AV: E=Sophos;i="5.77,382,1596524400"; d="scan'208";a="531648990" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.252.19.66]) ([10.252.19.66]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2020 02:22:35 -0700 To: Andrew Rybchenko , Ray Kinsella , Neil Horman , Thomas Monjalon , Andrew Rybchenko Cc: dev@dpdk.org, Ivan Ilchenko References: <1602682146-4722-1-git-send-email-arybchenko@solarflare.com> <1602768646-13142-1-git-send-email-arybchenko@solarflare.com> <1602768646-13142-2-git-send-email-arybchenko@solarflare.com> From: Ferruh Yigit Message-ID: <39780649-453a-2aa7-0ad3-11b1d2f31885@intel.com> Date: Fri, 16 Oct 2020 10:22:34 +0100 MIME-Version: 1.0 In-Reply-To: <1602768646-13142-2-git-send-email-arybchenko@solarflare.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 01/11] ethdev: change eth dev stop function to return int 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/15/2020 2:30 PM, Andrew Rybchenko wrote: > From: Ivan Ilchenko > > Change rte_eth_dev_stop() return value from void to int > and return negative errno values in case of error conditions. > Also update the usage of the function in ethdev according to > the new return type. > > Signed-off-by: Ivan Ilchenko > Signed-off-by: Andrew Rybchenko > Acked-by: Thomas Monjalon <...> > diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst > index f8686a50db..c8c30937fa 100644 > --- a/doc/guides/rel_notes/release_20_11.rst > +++ b/doc/guides/rel_notes/release_20_11.rst > @@ -355,6 +355,9 @@ API Changes > * vhost: Add a new function ``rte_vhost_crypto_driver_start`` to be called > instead of ``rte_vhost_driver_start`` by crypto applications. > > +* ethdev: changed ``rte_eth_dev_stop`` return value from ``void`` to > + ``int`` to provide a way to report various error conditions. > + > If there will be a new version, there is a ethdev block already in this section can you please move the paragraph up there? > ABI Changes > ----------- > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index d9b82df073..b8cf04ef4d 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -1661,7 +1661,7 @@ rte_eth_dev_start(uint16_t port_id) > struct rte_eth_dev *dev; > struct rte_eth_dev_info dev_info; > int diag; > - int ret; > + int ret, ret_stop; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); > > @@ -1695,7 +1695,13 @@ rte_eth_dev_start(uint16_t port_id) > RTE_ETHDEV_LOG(ERR, > "Error during restoring configuration for device (port %u): %s\n", > port_id, rte_strerror(-ret)); > - rte_eth_dev_stop(port_id); > + ret_stop = rte_eth_dev_stop(port_id); > + if (ret_stop != 0) { > + RTE_ETHDEV_LOG(ERR, > + "Failed to stop device (port %u): %s\n", > + port_id, rte_strerror(-ret_stop)); > + } > + Again, if there will be a new version already, This is the 'rte_eth_dev_start()' function and error log is "Failed to stop device .." :) What do you think about adding a little more detail, like "failed to stop back on error" etc...