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 3B7ACA050D; Tue, 26 Apr 2022 20:19:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32FFC42816; Tue, 26 Apr 2022 20:19:59 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2049.outbound.protection.outlook.com [40.107.236.49]) by mails.dpdk.org (Postfix) with ESMTP id 0E3024280F; Tue, 26 Apr 2022 20:19:57 +0200 (CEST) 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=R74lA3sh3bBRW73bP+irBM2v8VqdGzIPZdnmosKgvlo=; b=YxFzya0Nw27WX+AbwvdlqkTTgK1pNEjqoDldiXuZ97gDAVCjbG5DLTJERPjhQprqMpKq4OA7eBQhwZVcYn6FNSOUr72soo7IgSWuRpsfRS30d0RbclAgQAx2qaKyWrNWt7rT1Q4rdDsoP7kuoe4K//0PlohKTByCnegi1XM9ez0= Received: from DS7PR03CA0134.namprd03.prod.outlook.com (2603:10b6:5:3b4::19) by BYAPR02MB6437.namprd02.prod.outlook.com (2603:10b6:a03:120::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Tue, 26 Apr 2022 18:19:51 +0000 Received: from DM3NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::6f) by DS7PR03CA0134.outlook.office365.com (2603:10b6:5:3b4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15 via Frontend Transport; Tue, 26 Apr 2022 18:19:50 +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=mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; Received: from mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (20.83.241.18) by DM3NAM02FT021.mail.protection.outlook.com (10.13.4.249) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14 via Frontend Transport; Tue, 26 Apr 2022 18:19:50 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net (Postfix) with ESMTPS id 20F2B3F030; Tue, 26 Apr 2022 18:19:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vc3h0dTLQfyWnlacG6j0oy1R9cplGCIPq88y0Q2LEoeKBO/kWFq7g2Pjdlc4KlY9sYrD9R6VcGMxGsqyIYAO2jTcpbZ8xRY2HrLWYJkMm1aDTT3Ta35ULrSjUY4BFXle93zVqUp0Rrb3XAYOFgABzvYXvLl4xCcwjNtEqaG3uDsvZI5uEtlJOjQd0k9lGZRRwz0UnMZe45+viS44Ena/gL7PPSmeFeNh/oprMxRZkREJ6hLsUHjUmwpukhC0DC7C+D5Z8mRCdu6LTsIk6viQfJcWQhPjxpMen2bWt7wXmIVLVyi6+KiE9qb5pslPK0aER/cKx01EQyjksRTp+KamIg== 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=R74lA3sh3bBRW73bP+irBM2v8VqdGzIPZdnmosKgvlo=; b=CeaezooKB7NMgowkINILfORlvTLtLfD29Tj2avMXB0k1vecHJuYq84gWSb22Zypa/QgBW5ratuiGTyqszvJ9rhxJyDUGp3XfQZw8lwEQQTUCu2sKQKk4rWlGGZJkiJBWw8ZCgDd0ByO+/VgROBwf0OTgrWYR+QavOv4D+uRWth0qyHyVZVxtucp6g05ZCEOFyVr8vh36JFg3WOOH3OjOdgyi9JAPEZVD4/xZUzH9MVpPCW7Tbq4KfywaPl0x0+vYOhe+ltozZ60i4s3HmcauBoeGMd+ScxdWhUgG9nefjF1eoPDcGezxOFaGnZb8qQ2cncMdokww2DvU8bHXQ2K1Pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 149.199.80.198) smtp.rcpttodomain=huawei.com smtp.mailfrom=xilinx.com; dmarc=temperror action=none header.from=xilinx.com; dkim=none (message not signed); arc=none Received: from DM6PR10CA0018.namprd10.prod.outlook.com (2603:10b6:5:60::31) by SJ0PR02MB8547.namprd02.prod.outlook.com (2603:10b6:a03:3fd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Tue, 26 Apr 2022 18:19:47 +0000 Received: from DM3NAM02FT027.eop-nam02.prod.protection.outlook.com (2603:10b6:5:60:cafe::cd) by DM6PR10CA0018.outlook.office365.com (2603:10b6:5:60::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14 via Frontend Transport; Tue, 26 Apr 2022 18:19:47 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=xilinx.com; Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT027.mail.protection.outlook.com (10.13.5.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5186.14 via Frontend Transport; Tue, 26 Apr 2022 18:19:46 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) 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; Tue, 26 Apr 2022 19:19:44 +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; Tue, 26 Apr 2022 19:19:44 +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 [10.71.119.1] (port=62534) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1njPmq-0002hn-Sy; Tue, 26 Apr 2022 19:19:44 +0100 Message-ID: Date: Tue, 26 Apr 2022 19:19:44 +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> From: Ferruh Yigit In-Reply-To: <20220324030036.4761-3-humin29@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 88fee908-6877-4d0c-af34-08da27b15a81 X-MS-TrafficTypeDiagnostic: SJ0PR02MB8547:EE_|DM3NAM02FT021:EE_|BYAPR02MB6437: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: G05hXcZR630VmZp7rcaxx3YghCRPKTB6XxtZIC7Pym8X3DoUleXAyKH2ij8KTd8/8gyw6KHR5EytXKWuOyJEEHxK7vkSS212/AXR07reySWqHRe9740EhNiQhoLgx5unxMy6kQNXp5FEu4D+1soNLXNyFh3KKtQ8f4OHUycOrM3PpsIhh58pN0OG91CabgkHVVqUQAQEpkTJUWonFiSYPi27uVOv5yPC6iaWdHrWk+dn4lkfHAj8B1xs2eyJNZLX2rIyJWs0HL77sDDXse8VO0RS+lllKQR39KZ11iqITxtYSb1QH2TG7lsIyJ62WhNwQ2vaOy4VqYvs55If1VAfzxMmshRmOUzXAt7HxIKJcFfovDb4FJ6/rbNXRRvr+6loIo0mzO1ZBDLYKzg006YPvNVjsRxlzzqZ0K/MgLdQcs8KoUOwrZxoo4WjOoHFNXN0FG8CdUOAfkKUldM0kBuq5L50AcCphSBomKXDhlpqWPVTsbXzf6iysaaEodpUt2A8z+rYiZztVoEoYpKyObp0MFzM3SyJCZqVWomLrgMTO4S13qW/hsH2E4oG7TTnjr3tne8mz1Br0DrhG+KeXQ/d4wJReEUW1CK198rTmSR1jqJ5ZRMV1DAqNnPk5AjRMV7f/VQlO3lFyQfRcJr71dKLz1RVjt9mi70zPerMbjKxmvaGfq+07ctxvtBxg/bSXf0a9xYlukCnt0bhpyp8TzkgKUWtNKHvYqv1gZgy7V4rW4g= 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)(46966006)(36840700001)(426003)(5660300002)(63350400001)(356005)(31696002)(8936002)(9786002)(47076005)(7636003)(8676002)(40460700003)(110136005)(54906003)(508600001)(44832011)(36860700001)(186003)(336012)(2906002)(70206006)(4326008)(70586007)(63370400001)(316002)(82310400005)(31686004)(53546011)(2616005)(36756003)(26005)(83380400001)(50156003)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB8547 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DM3NAM02FT021.eop-nam02.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c362a321-ca50-4b81-b36a-08da27b157d1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y3yvUXyWKYgI0pxYKVumBRTPh56lY2XHG7dqF2W6WYLsmEDklNp6JBtlGzHW9aBTOa35FTpAB4AIAoX4uUxxpZt+XjQWtLeSlUssYdniSbAx84wiJavxjdnFVeKrl9RqluuBFUvrlAGfm7RFif6CAxBu6cK2N0z0XUD0Rr5+xtXUQPTsgDeMuvPRTO4hPqjMri+ZqCB0Nn8XsxYItGIrEyRs4HhEKrWDgcGKh2UsSQa0JXml4m6jQ86J1ivoTFsSZUDWvWk80R6+URnwTrdqUn/hHHkLYhoaJP6kGDcZ7lmLK3jKpbYZrwlQQUTMrxBru6cGCFAq8tN3M4YqTlzCAB+Z0h/2ex+2YeoJVpj5IZS7DgWvr66kZAt2iC8Bm6PHf+0jIZP+uorzYDJ3orY2zCNZPVyADY3L2MclITYe+R1vl8cRGNQakS8fEq9kCBXN2KUnHszdb+MmQie94QEjhotagq7uF+ZqIMkEeQYpQycuFtYdx5DIzEvIerYuOdPM4yGomso5ffbcFT3prfWgeV7vz6rXEUOxouED7hdZoyC6txDH+cDEIA0gKsMezGOYfUYpnX9w0GjvczHl9OtcvegmOui9pK+XB6i05W7hn3tKP+IWzqCNq0b9KSiBn7KmvpWqAsPWYwgdheGuBLvIrASlGdIA/vdJPX6cltS2j62QdMdsmGL12zwYHyetk9XGJAGkG1FmjvM9J3oB+9zFVPUbJ36w0RtfkPtz4Olz8GHs7qtCBfqLRt3ZpVDV8Fwl+TYpQIuOAqR9SHe+x7GGWw== X-Forefront-Antispam-Report: CIP:20.83.241.18; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(5660300002)(426003)(8936002)(83380400001)(36756003)(26005)(4326008)(9786002)(31696002)(336012)(53546011)(2906002)(44832011)(36860700001)(186003)(31686004)(47076005)(508600001)(8676002)(2616005)(316002)(70206006)(81166007)(40460700003)(82310400005)(54906003)(110136005)(50156003)(36900700001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2022 18:19:50.5770 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88fee908-6877-4d0c-af34-08da27b15a81 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=[mailrelay000000.14r1f435wfvunndds3vy4cdalc.xx.internal.cloudapp.net] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-DM3NAM02FT021.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB6437 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 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. > 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. > 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? > } > > if (rte_eth_bond_slave_remove(bond_port_id, port_id) != 0) {