From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C51D6A0A0A; Fri, 22 Jan 2021 18:58:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50CDC141090; Fri, 22 Jan 2021 18:58:20 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 39AE814108E; Fri, 22 Jan 2021 18:58:19 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id CA37A5C011B; Fri, 22 Jan 2021 12:58:16 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 22 Jan 2021 12:58:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=pOCg/nHE5FcmZfz6XqVFEQpRiV 3Aoqtachiy4Hf8LAI=; b=PMNomWygs4FQju3WUaJ4fDtfGbQCSc1hqAVwKkWbRq L6584hrPGiBgLQ1qiPJuJWDAlk1YdDcA8I477yqgB7oN+NbhACjRwirMZVANeIaa vFHqiNFeu5hkOhrAUpza/3j9gjeheQmNrrX5IazT3VCSsFKeAZqVccoXZow8LOV1 Vw2GG3TixmxydtGSrU9IFk/1B6zeC2aZa8mFoPvnPOe+REmeEMXDJq7KQKAXeXLa zOHRlvramNV/wYXjFZK1fzAHKcyQ5l1tsn7Ih4ecwuXYCioo7HN7EBc3VRwfLi2k Fs1obHP0iV0OigTe20EG34XET6//bfIdA+IpdUFUr3yg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=pOCg/nHE5FcmZfz6X qVFEQpRiV3Aoqtachiy4Hf8LAI=; b=hiAJ91aOOg85PZ7/5HBUEV+kgSvfNVUEl 2qfG19NcwqUQZFmQ35xmyqqQleaC8OIRB8P9r1soo+pHfmd5/G4R3d1nEYGDIdJD WWp9UJ3gq/I3v02t9W20C3dp9UVpRULpcsiTcUTW/zWUhxfp27J9yBY0tOVfvVoM WxjiZBR+k9hTRyeXXD4J9+/eogbc4YPHp6b0pxtiPmNW1zCJ9yT1AXLJ0jPnqWIe vQjNBlXdrW5j5Y5iHXcUSNf3AmCb52H1wT7HB3PqR1U+zKUhZtjspvMKfc5pk4Rz 2hIBX0vuuqJC9WGu5mBDaneZUSqVZsrTOWiqkUw4Y/okrVDkltQAQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeigdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcu ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrf grthhtvghrnhepvdelvdduhedvudduveeuvdevheegudelgeeigfejheduhedttdegudff jeeihffgnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn rdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 48DF1108005F; Fri, 22 Jan 2021 12:58:15 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org, Anatoly Burakov , Ferruh Yigit , Andrew Rybchenko , Liron Himi , Stephen Hemminger Date: Fri, 22 Jan 2021 18:58:04 +0100 Message-Id: <20210122175804.772207-1-thomas@monjalon.net> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/1] ethdev: fix handling of close failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" If a failure happens when closing a port, it was unnecessarily failing again in the function eth_err(), because of a check against HW removal cause. Indeed there is a big chance the port is released at this point. Given the port is in the middle (or at the end) of a close process, checking the error cause by accessing the port is a non-sense. The error check is replaced by a simple return in the close function. Bugzilla ID: 624 Fixes: 8a5a0aad5d3e ("ethdev: allow close function to return an error") Cc: stable@dpdk.org Reported-by: Anatoly Burakov Signed-off-by: Thomas Monjalon --- lib/librte_ethdev/rte_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index daf5f24f7e..89455a432e 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1820,7 +1820,7 @@ rte_eth_dev_close(uint16_t port_id) rte_ethdev_trace_close(port_id); *lasterr = rte_eth_dev_release_port(dev); - return eth_err(port_id, firsterr); + return firsterr; } int -- 2.30.0