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 281C7A0555; Wed, 25 May 2022 19:44:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF74140143; Wed, 25 May 2022 19:44:22 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2077.outbound.protection.outlook.com [40.107.212.77]) by mails.dpdk.org (Postfix) with ESMTP id 39DE4400EF; Wed, 25 May 2022 19:44:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMUz4UBySYi7n257b7GYwU0S0Dej0yT93S9j1+kquluxBwvKesFriRovu8Iki186DjumJhfq7Kigm7g2/uXNYLlvMeSv5GoovXarlKK4CUiYrL/IFI0Y1CUDSwtWYaG1kWa1pYGg/nuXcNJRUcnIHoSnGBxImX0jARc9uY8HyoeFIvOZx7Hhp/kU5fdiqXMjA1wWHEb1/1dfg1v8/XMk9bH5Ws3Bl+9U7V8Wko8Sn3ofNkoPiI5lJ/Sab09mm25WwgbXrv38agzgRRDdiI+BBTguXhG6cBjONrdRA2ygd2hvpD5YqeAKGmyRrexZCA9jTTbYDHMsSLtWW/OlM0oXtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uXeA7i7rtcQtXeWstvmTQ6aNN6POyC7TiKBtBW2BX6g=; b=blif+/qtdmdnblBvrpyphK/wZQbzegH4tyKgeGac70epfBiU78GqbgxjzEJ7adPdBG0ODZvMsKTsfKbfYqyMjxf7B3qqqIpgigRpdfiw9riBjR2BhHczWZzCfxOWZV+SkvOMPuRx/pPb3kwmWtqh0M9M359O3NU44rekHm4+nSlbo93e7N4KE3Q17aFsJiYDOEFeXRJ25Cy/wfFW7Bp2W9k4QMVxShDSESl8WPGXRWegFkzj18fXRSaePMQgR6E9YQZUwKliXxH6A4gUo4UnpkFYrhY5WqQlKuaVtKwGDt7683UW/1YKAdb0ejbAuYLrJh/IXI6Hz16xPRIYJuSjZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=huawei.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uXeA7i7rtcQtXeWstvmTQ6aNN6POyC7TiKBtBW2BX6g=; b=Rxn2XIa71NzcPDJOsJF8S7tkUDKtG0emL8ojELBxVmarNhTl/CpDokFh7zuYvNxlUGqQCnME9YUeLGr999C/eqM5+egIyG59YUei9QWiSFsJV05UV0mPIoIessh2AHNV3nZpF8cW09rE+tF9xHGW5nyY3cewPw1XOr8MI1r1X30= Received: from DM3PR12CA0124.namprd12.prod.outlook.com (2603:10b6:0:51::20) by BYAPR02MB4871.namprd02.prod.outlook.com (2603:10b6:a03:49::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Wed, 25 May 2022 17:44:18 +0000 Received: from DM3NAM02FT062.eop-nam02.prod.protection.outlook.com (2603:10b6:0:51:cafe::1e) by DM3PR12CA0124.outlook.office365.com (2603:10b6:0:51::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13 via Frontend Transport; Wed, 25 May 2022 17:44:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch01.xlnx.xilinx.com; pr=C Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT062.mail.protection.outlook.com (10.13.5.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5293.13 via Frontend Transport; Wed, 25 May 2022 17:44:16 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 25 May 2022 18:44:15 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Wed, 25 May 2022 18:44:15 +0100 Envelope-to: humin29@huawei.com, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, stable@dpdk.org, ivan.ilchenko@oktetlabs.ru, dev@dpdk.org Received: from [10.71.116.211] (port=55201) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ntv3P-0007Le-5x; Wed, 25 May 2022 18:44:15 +0100 Message-ID: Date: Wed, 25 May 2022 18:44:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 From: Ferruh Yigit Subject: Re: [PATCH v3 5/5] ethdev: fix dev state when stop To: "Min Hu (Connor)" , Thomas Monjalon , Andrew Rybchenko CC: , Ivan Ilchenko , References: <20220324030036.4761-1-humin29@huawei.com> <20220503100217.46203-1-humin29@huawei.com> <20220503100217.46203-6-humin29@huawei.com> Content-Language: en-US In-Reply-To: <20220503100217.46203-6-humin29@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6365ff12-4a6c-46a6-d9a4-08da3e7630ba X-MS-TrafficTypeDiagnostic: BYAPR02MB4871:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2oiSi5tflhHhv7LtrA+5dd1wUX06QF1UmkrU7+62sMl9FaOclDC23C7fcPf8qMHndKpVIBnEkvgBDqmihFrtIH9a4PVZivWbtLwYgtbttvufFXNFGG6rudLdsD/Qrgh8hQLqjs7neu2AUbNRAVtnfuxYlGtBLwMjA+j8V+Zt3EoyP/kE6W0P5BGZBFO+f327GGZpsXpd5bUquEYY6CEdnGtQ4f5Sw+Eh3Atjlt7DFQyz5f5E8aOG7NkIjig7UI2+k2iOLCsXcSHDlGx2SRhW+8PR41e0KqlynFDIoshbgkK2x+f19ANuFvBU+e6xeSWjzRtCuW3WxSNKg0bV4FEGCZ6NkQGmq+dbbWUx7oQrmsH6SKGyDWNHHlnDKqU16vbWWhMp/pmCFxcYIDdgVVxd1oBOh2w0l6BZgLuJ9ZDFOA8qKatZFbSsJ467l3YPNLTwzU6hGRqolNTID6CcDbxdC0UuX1LRhNz/hZKeGo5wIGYWZqAZF6AwsQ24rtX7Hb8Ur22EXL5fpXVCNxXHg7MvzWMWf0Yr0wophTRqNt9sdh6EXnQ32H6bi57tsUkWtcqJBda7Ci9gTfUuqXxV04E1zrdJqaLa+VLTxDsTdipN/WYFLQx7EqjvR2b2vJJxApGLg0GGpqriF1QWYYBFyS4NFgvMDfquw6xDLAgwwcPJaY1WKBJ5OlpXjaIdlgstX0eNlxw1Qe5NaTyArEXT4cgjsYOG9PLGS/aHagsG0wuwjiU= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(83380400001)(9786002)(8936002)(316002)(31686004)(336012)(47076005)(426003)(2616005)(7636003)(2906002)(110136005)(53546011)(54906003)(186003)(82310400005)(36756003)(70586007)(44832011)(31696002)(8676002)(70206006)(4326008)(26005)(36860700001)(40460700003)(356005)(508600001)(5660300002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2022 17:44:16.7211 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6365ff12-4a6c-46a6-d9a4-08da3e7630ba X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT062.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4871 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 On 5/3/2022 11:02 AM, Min Hu (Connor) wrote: > Currently, 'dev_started' is always set to be 0 when dev stop, whether > it succeeded or failed. This is unreasonable and this patch fixed it. > > Fixes: 62024eb82756 ("ethdev: change stop operation callback to return int") > Cc: stable@dpdk.org > > Signed-off-by: Min Hu (Connor) > --- > lib/ethdev/rte_ethdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 29a3d80466..e0011372aa 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -1533,8 +1533,9 @@ rte_eth_dev_stop(uint16_t port_id) > /* point fast-path functions to dummy ones */ > eth_dev_fp_ops_reset(rte_eth_fp_ops + port_id); > > - dev->data->dev_started = 0; > ret = (*dev->dev_ops->dev_stop)(dev); > + if (ret == 0) > + dev->data->dev_started = 0; > rte_ethdev_trace_stop(port_id, ret); > > return ret; Change looks good to me, I checked for possible unexpected side effect but I did not see any. @Andrew, @Thomas, if you also don't see/remember any issue related change, I will push it soon.