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 33116A04FF; Fri, 29 Apr 2022 15:35:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 765744281C; Fri, 29 Apr 2022 15:35:29 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2069.outbound.protection.outlook.com [40.107.95.69]) by mails.dpdk.org (Postfix) with ESMTP id 9EDEF410E3; Fri, 29 Apr 2022 15:35:27 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=i/wPLuMFv5MmQ9wmWSO4cd8aSgYEUpyminChIT6mpIenpFK3YpjWKXV2EyYeCcxRKO/blVQb+e3F9FaBUHOpEJt9yomvS8Y1uwLx4MXxvyuwrVCSm1stxZVBpxAvQ8xenM0UODNXLzXFdjPqQ4Z6wAYjhKqjnvhdvTGDoxAyawnQQDVOsVeyxAZr+/2tnSgvZcIqFEyYNhk/BVZxABmQVfP3mgNUFgdZy44N4PCBNGMvAX5upQ6TL6pQyhh6l7M0FfGpGFftyQe5vj1lyXBBD/lQwGk9iWLeJ+KC5KmnmSHXXLZDeoIAYWebBhaeKHWO5xc8wTCNgbZCFaTqlI0qdw== ARC-Message-Signature: i=2; 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=bO21Iz4fo1wEuQAswMglNYbaYBggGHRoB1KTZ2WpSvA=; b=HvzWD0Adj4MqfEFWiY+nvsSDjUarvpt7+zF4yUg0bK7bMm2FGUZ1ulIyfx1YXdnFplbU9PjSWch+BRigxB1FyOc2QaxswQbVAQSySqs7S9h01t73W5iSS0IZxZB6x7ja57CJVr2P0qbYUGB8eQgRx6g3no7XndwcOTZHussGf73KlcFrvDrqo4/S9DEJLwI5RnaQmS2bMekeA2kqapaNIRC3Cdx4nYjlOiGTOLpA9e0gnuMA5wfsKhmOJqZzyHmU6wj9jjg4jyqE3ikUA68AN1IXJuCmKO5NSw9PZXYoGFdHwHd11AvOfMsjEPFxnJdFVizWD7owcH5YH87GtiY9wg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 20.83.241.18) smtp.rcpttodomain=att.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=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=xilinx.com] dmarc=[1,1,header.from=xilinx.com]) 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=bO21Iz4fo1wEuQAswMglNYbaYBggGHRoB1KTZ2WpSvA=; b=OzRV+LuiUK7jlKy8ODIoHYobLnuEzuJC4xlLFezT9HUce0Xbhi/R91pBcxNnqwcyrohUjF3GrOkEV0Y/tEOOXTN5LP6XTMgaJc9hOVxJDxJGSeR/p5GG2WG9MN5D7G8Ytar66OS8FW0Dr3USTJVNoDEk/An2A3dqS9Z734qUTL4= Received: from SA9PR03CA0014.namprd03.prod.outlook.com (2603:10b6:806:20::19) by CH2PR02MB6855.namprd02.prod.outlook.com (2603:10b6:610:af::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14; Fri, 29 Apr 2022 13:35:25 +0000 Received: from SN1NAM02FT0030.eop-nam02.prod.protection.outlook.com (2603:10b6:806:20:cafe::18) by SA9PR03CA0014.outlook.office365.com (2603:10b6:806:20::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 13:35:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 20.83.241.18) 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 20.83.241.18 as permitted sender) receiver=protection.outlook.com; client-ip=20.83.241.18; helo=mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; Received: from mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (20.83.241.18) by SN1NAM02FT0030.mail.protection.outlook.com (10.97.5.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 13:35:24 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (Postfix) with ESMTPS id 761D441D00; Fri, 29 Apr 2022 13:35:24 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AT5hNIfBW7ch7hlwivopu1xtb7l7ZA0tjjoPCXBYZ8qgd+r7f18gsYI/Jv34a20Jf9mfpu0GaqN/GpuS5sSuzdm0hc4CQpYJ61JEKM6lE5amknXkKtHeoy5wAaDJ1X344Z6TaSFTtMuHsVH0Z7AtmGYGwCWuFnUDHXcrMTad+U9fgVcL/1cDtGHcSyXQeZ0TYbo9Sd1iA4f/a2Ml5BOaXl1xK5XBP7Gz1JU8RkT2BpzvHwTAMcCGx81hm+YHKBzuKjgZumhPkv2mSEBogjkZDZkgfTS3qWb5Eu+hSu9ic/0ae9L6nEQvrrYMkjtNuRG1eWgOdAnNYr+lc+FgnyAGvg== 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=bO21Iz4fo1wEuQAswMglNYbaYBggGHRoB1KTZ2WpSvA=; b=Lbkmt69cYdHJz30VDZd1YGGaqScsBvy12HoInt2zo/GgUjOpJQINi9zUyrnp6rbVKvMO6Ofhs3SU0rmCs5A3N7Noe6uJ6Q02vfBRQ2UuL0oMdDa7yhCZh9gKa+6d4LhayYMSz9/NMJCnHGrloyWKH+p5Rqu58XrBddC4aNLJhR9Zx17K3HkGrtG/K3HxCS1n+9RtMJxpxsstNBNYsbFAYNYCMIzBLPRjLuKBRzJxSQBVmK7p18C0rPt2A30BH0gvpor/VesvcYa7S5xvLcqJ6d5iio2RTtBP+dSmnpbmah/5ql2+hK5ldYTZ92soZkj4KGur3viObB0B3uKDL50OtA== 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 Received: from SN1PR12CA0069.namprd12.prod.outlook.com (2603:10b6:802:20::40) by MN2PR02MB7069.namprd02.prod.outlook.com (2603:10b6:208:20e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 29 Apr 2022 13:35:23 +0000 Received: from SN1NAM02FT0011.eop-nam02.prod.protection.outlook.com (2603:10b6:802:20:cafe::7c) by SN1PR12CA0069.outlook.office365.com (2603:10b6:802:20::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Fri, 29 Apr 2022 13:35:22 +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: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0011.mail.protection.outlook.com (10.97.5.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Fri, 29 Apr 2022 13:35:21 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 29 Apr 2022 14:35:20 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 29 Apr 2022 14:35:20 +0100 Envelope-to: humin29@huawei.com, dev@dpdk.org, lihuisong@huawei.com, stable@dpdk.org, chas3@att.com, arybchenko@solarflare.com, ivan.ilchenko@oktetlabs.ru Received: from [172.21.34.28] (port=63026) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nkQmG-0000IO-5j; Fri, 29 Apr 2022 14:35:20 +0100 Message-ID: <786be041-90eb-bc92-0f80-6031fe6d57d7@xilinx.com> Date: Fri, 29 Apr 2022 14:35:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH V2 2/4] net/bonding: fix non-terminable while loop Content-Language: en-US To: "Min Hu (Connor)" , CC: Huisong Li , , Chas Williams , Andrew Rybchenko , Ivan Ilchenko References: <20211025063922.34066-1-humin29@huawei.com> <20220324030036.4761-1-humin29@huawei.com> <20220324030036.4761-3-humin29@huawei.com> <2e41f4b4-aa52-b219-b597-3e301005e7df@huawei.com> From: Ferruh Yigit In-Reply-To: <2e41f4b4-aa52-b219-b597-3e301005e7df@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: c339f91e-6a61-41ee-cd4b-08da29e51dcd X-MS-TrafficTypeDiagnostic: MN2PR02MB7069:EE_|SN1NAM02FT0030:EE_|CH2PR02MB6855:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: MtqTA12YylP+rfQicGR/wn8V5CeFAHF0RnQxyuVd4jlxyXzCWj9DNydUr2/ql57k9XBPyrbz7quYGuZ2eVs5ddJ8ilTcep8B4fNgMtIkFlBhyO63Z4RPVZr6hS4bzfrIb4DUy5Lcuwxf8dv182NWNES7ANEGNOIbC4DLoVaVRbz8dfJj2rwMIwyv/3IO4FlOXlkkSShouEVOKr89IF1GIqQFPYQEinOnVrtRT3iWSj3ufuS7aIWL9OKZ9i4y6sApQaZu4zqdI4oE7oL3ST5XpMFyPjuUSBqCoo0Q5o+HdfpXlHvdnKLKGGuaq1D5S3x7/3g72zTyXI7WJ9i5oOu4mTjDENIn/l3izg4LHziZklwrHrJ6Mf5tWMdDRy2fa/IrweU2cXRmjEJmlJPYZAZ+l1etzh9+6tDggC2IzjIIXBUY8Id3eQouh3BzsUvHRBA5nkIj4T6ZHn2BNyx5/5WtV2WD2ZhhlelzuDhg5Au97Cg1letGgPxcaqp5JsLe5TY4tMRIA+gjB8Em1E2Ty1DhTtXNO3byw5YZA7Tx+iFDzoYv1MQNaha3sm3DU8D2xWi06UlbABDTjnI9cC9bR5gM1p8iFNvIufT8iZOHmtjnWZYQfJrK6r5ukDukF9S3jxra74LLCUxl3lmUyg/HHLjiPccJUiksqktTmDWd3Xts1quSxwh/9qcPzQJiPQYrz1RkvfFPbrTjsu4kspdkiLDvU6spZCgm2RSJwOblgt4huz0= X-Forefront-Antispam-Report-Untrusted: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(7636003)(316002)(356005)(44832011)(4326008)(8936002)(9786002)(83380400001)(8676002)(70206006)(31696002)(70586007)(508600001)(2906002)(110136005)(40460700003)(5660300002)(54906003)(426003)(336012)(186003)(2616005)(47076005)(26005)(53546011)(36860700001)(82310400005)(36756003)(31686004)(50156003)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB7069 X-MS-Exchange-Transport-CrossTenantHeadersStripped: SN1NAM02FT0030.eop-nam02.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d479d8b4-5fb8-48bd-a5e2-08da29e51be5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hzySPJOl7aW7dnboSmBOAJuTuFCYRPe+tB8oBCfC7XhMjyGSBSxjSPBzynhCV0j74QOdZI5e9yuDTve5RsWRFDGTCCxs9sTGQwNOH4CLqBAdx4Q5/hEn3CVt30VEkWqhReOVioyzUUfu3WsUW5dgrR9cNNeCTdO5/y3QHAgX1Ju08IcUbd2xsjOpLf8S71kzgw6FSBT7V70uUSzqdgvs9/2GXcJB+3O1A3zkowOLgDoDTzpv7GOtmnK/KJzq/SAw4a/jqHZ1/cXokupfa6okmMFLMIFuElaY0NUTtiQ0WSjqAc6QcHY7npnmBEPiPrwq//kaYzsZdXBcOW5op3AtB4JhnKfp30r1MK09+5lvBUirqvq9sSOWC5cMy3aO9xtdgJB0p7ysHlF3uqwttHJ3SMaNjNpZtfSj7Ah7/EB0dyfQldpCUNWpAsyraIZ2H7KVsbMPRb0Gvl3Mz5P/lsoMflFmaDbZ3UFn8g06O1d75aLDwwWiS1ZnSh0MnSo+QwPYryb1QDgJBGBuotw5rg9EM/dvQ6k7ROg3kv3yFudzvJNQ40zL3HC82RfwOiraDlRTrHDeL+7XQNauByY0AAqWcACDYOuqgfB/PTCZMmQ0vY7TLuLGBi0Hr3lo72Zo1k1H8K+RUrSTq1ARCa1TMXQNg8uoiXqgQoHrPlhFWTedrb32qpYxZBQHiTCRhQzEyyUqrTi5SducrnDQK8Lsz9blga/uVjxcEdXdnRMJtFqKwitS6kRKslZBlNqurS96aqzplINUSVrSAZCm0YvcuutmpQ== X-Forefront-Antispam-Report: CIP:20.83.241.18; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(31696002)(26005)(53546011)(2906002)(8936002)(9786002)(508600001)(36756003)(5660300002)(44832011)(82310400005)(70206006)(4326008)(83380400001)(8676002)(40460700003)(81166007)(47076005)(336012)(31686004)(426003)(316002)(186003)(54906003)(36860700001)(2616005)(110136005)(50156003)(36900700001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2022 13:35:24.9372 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c339f91e-6a61-41ee-cd4b-08da29e51dcd X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[20.83.241.18]; Helo=[mailrelay000001.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-SN1NAM02FT0030.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6855 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 4/29/2022 7:52 AM, Min Hu (Connor) wrote: > Hi, Ferruh, > > 在 2022/4/27 2:19, Ferruh Yigit 写道: >> On 3/24/2022 3:00 AM, Min Hu (Connor) wrote: >>> From: Huisong Li >>> >>> All slaves will be stopped and removed when closing a bonded port. >>> But the >>> while loop can not stop if both rte_eth_dev_stop and >>> rte_eth_bond_slave_remove fail to run. >>> >> >> Agree that this is a defect introduced in below commit. Thanks for the >> fix. > thanks. >> >>> Fixes: fb0379bc5db3 ("net/bonding: check stop call status") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Huisong Li >>> Signed-off-by: Min Hu (Connor) >>> --- >>>   drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++- >>>   1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c >>> b/drivers/net/bonding/rte_eth_bond_pmd.c >>> index 469dc71170..00d4deda44 100644 >>> --- a/drivers/net/bonding/rte_eth_bond_pmd.c >>> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c >>> @@ -2149,13 +2149,14 @@ bond_ethdev_close(struct rte_eth_dev *dev) >>>           return 0; >>>       RTE_BOND_LOG(INFO, "Closing bonded device %s", dev->device->name); >>> -    while (internals->slave_count != skipped) { >>> +    while (skipped < internals->slave_count) { >> >> When below fixed with adding 'continue', no need to change the check, >> right? Although new one is also correct. > Agreed. >> >>>           uint16_t port_id = internals->slaves[skipped].port_id; >>>           if (rte_eth_dev_stop(port_id) != 0) { >>>               RTE_BOND_LOG(ERR, "Failed to stop device on port %u", >>>                        port_id); >>>               skipped++; >>> +            continue; >> >> Can't we remove the slave even if 'stop()' failed? If so I think >> better to just log the error and keep continue in that case, what do >> you think? > NO, if slave stop failed, we cannot remove the slave. Got it, thanks for clarification. > just see the function stack: > rte_eth_bond_slave_remove > __eth_bond_slave_remove_lock_free > slave_remove > rte_eth_dev_internal_reset > if (dev->data->dev_started) { >     RTE_ETHDEV_LOG(ERR, "Port %u must be stopped to allow reset\n", >         dev->data->port_id); >     return; > } > >> >>>           } >>>           if (rte_eth_bond_slave_remove(bond_port_id, port_id) != 0) { >> >> .