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 5F598A050D; Tue, 26 Apr 2022 20:19:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C65740E78; Tue, 26 Apr 2022 20:19:38 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2063.outbound.protection.outlook.com [40.107.92.63]) by mails.dpdk.org (Postfix) with ESMTP id 5B447406A2; Tue, 26 Apr 2022 20:19:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c605e4v2rySoZ0z71TSmNAWNVMX0fu+HPguSHmUY3PnvahsotacQlNAoKBUSbcC6ASBZY1I6t+K6clj5IaF0AorqvSTU2ZNfYjIC0My+JOjJCd8n3RIu0Y6YdbewUkYgDortI3MUwEBAoBfG5iRzq19QnI5uO9YHvvrc1M/8qv9xvw/fYODgRT0FeuQGfQD0/1DIz8S4Nvc5wKjV6cX9rSoH0sXRqTIQFqwHegpYaIgr3283sI8jj1LBLCei4Zgv7oSW04wUejUN2cO+6Zd302ioiPeiz19yCUFeSRi7DR/zsqqk+l1OaAfNVQlII0JuRJIsFmj0CnCTPh0yZLnbPw== 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=k4MadqJjofdWmx/74wucYp65c+4FdZgTlt7A2+EKuCA=; b=kv5apb4L0UBw68VzgYpl6o9GBNoGB9pvUfwW4XQgSm1crryIw9cVAN8eZvqk72h2nw3jwd6G1vuCyNHeQVfvFWzm3iNO5HRXOdkbUPNS3EsNpQGCKzGXgnlQj5/+P3W2LgyDAS+qMXhe90Nmrsp1cTAL7Kok52mNkh4pRp3U49PimrSFPh0bHK3/UPYLKz8J8vdxUwRMv+odNTtPvhfDJ1VA01vHOGAxGQgwd01rq8vKhbl66fP3/alwWXRjF05PcSw3FpBRA8An5ggMWfQlWNpdAoOcfUQvJLj/oJb+BLOfwCEClgu1sw/nolxYy3R9KJyr55LQvx6p8rT4hgxItg== 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 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=k4MadqJjofdWmx/74wucYp65c+4FdZgTlt7A2+EKuCA=; b=YUsJ8vtMyfVgw8sKRTHQsSWHKDeB4loJ4NQLDpwmSoprD33G9bCZ1qO5J8VU+RJwOmw6duw6LbBcubgHbpXSfnFiItdij3wJTJIEh6GyH8ZU1LnXFFITydMYQ5X8BmPfrt0VVZDZI/3wLB24D9+GpSlKWaMkfb5bA+DnLHLxLKo= Received: from SN7P222CA0012.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:124::26) by CH2PR02MB6392.namprd02.prod.outlook.com (2603:10b6:610:10::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12; Tue, 26 Apr 2022 18:19:33 +0000 Received: from SN1NAM02FT0006.eop-nam02.prod.protection.outlook.com (2603:10b6:806:124:cafe::4f) by SN7P222CA0012.outlook.office365.com (2603:10b6:806:124::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13 via Frontend Transport; Tue, 26 Apr 2022 18:19:33 +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-SPF: TempError (protection.outlook.com: error in processing during lookup of xilinx.com: DNS Timeout) Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0006.mail.protection.outlook.com (10.97.5.193) 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:31 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) 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; Tue, 26 Apr 2022 19:19:30 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 26 Apr 2022 19:19:30 +0100 Envelope-to: humin29@huawei.com, dev@dpdk.org, lihuisong@huawei.com, stable@dpdk.org, chas3@att.com, radu.nicolau@intel.com Received: from [10.71.119.1] (port=23951) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1njPmV-0000Sq-88; Tue, 26 Apr 2022 19:19:30 +0100 Message-ID: <212e85ef-228a-d31e-e5a1-8b2331c7eef9@xilinx.com> Date: Tue, 26 Apr 2022 19:19:22 +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 1/4] net/bonding: fix non-active slaves aren't stopped Content-Language: en-US To: "Min Hu (Connor)" , CC: Huisong Li , , Chas Williams , Radu Nicolau References: <20211025063922.34066-1-humin29@huawei.com> <20220324030036.4761-1-humin29@huawei.com> <20220324030036.4761-2-humin29@huawei.com> From: Ferruh Yigit In-Reply-To: <20220324030036.4761-2-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: 6f35ade3-c2cd-4743-8070-08da27b14f3b X-MS-TrafficTypeDiagnostic: CH2PR02MB6392: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: 3afQCc9mbOhOeCRrVDf2aVuCY0FNptw4OaB7TafB32CPRka+fDWzqhjhn186GEpF2EVOMsTl57ZAyOSSXk63i6ocERBXHyrIxHRhwMiglfB7+aOFkV6bsy1lb/fcaS+Ra2PCXkGyU/pLQsWmZ7ods2K/ULaeZ9JEkjtx8L+vvoKFBR4poNjDcYnBS6fjvze5fbyKItv2CPI+YhVjTA/tO6QwneZLm66PzUEPuKnukM5eyATvhNYqT6eX7NdyxugppGgFqs6ekd0qpznG0mux4F+mO8LYyLMXglNh8SMhGKHBGzft7UH8CUlX0AzpxVUL5jwBEGklWWhKWi3H5Rf0mprfQyG3yiNZRBSHgg3OV/4dlYLwOOfvKzVilF+HqEsNSyt+x+Glx+R9A/g6849j+KZnyTyP/I6BRL/xe2ho8P0rQqeNoNtcZWoLXzW3oTJk7r5Z109yRREbZnM1TCp0XmlQ59adUPm/6sui6I4H3Q8PpyB8SFRje2ZhUpuoHNdbZoNHuHKLsAYEMOxs6O7dkSH1KwwaivE6TtPMqzQjIIPj2dhqy4968YD3RwT8Yg4sMThvkuO1S9BpRP1nmBKne8TKntfvQSpwFP++Rm4zamRvYWjn6RShHjlDweele3d1LtL1p+61MmC8Wd8EZn1bBNDYodz1rZhJRiCeffN7hrLjuq2qKDoa5y7VnSic7b0XRWWleIraJO4RIOkxxRSTE+oTnndyiWcQoKoEB7UPhI8= 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)(46966006)(40470700004)(36840700001)(70206006)(70586007)(4326008)(63370400001)(8676002)(63350400001)(83380400001)(47076005)(336012)(426003)(186003)(26005)(2906002)(40460700003)(53546011)(6666004)(508600001)(31696002)(9786002)(5660300002)(8936002)(2616005)(44832011)(31686004)(316002)(54906003)(36860700001)(7636003)(36756003)(356005)(110136005)(82310400005)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2022 18:19:31.5684 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f35ade3-c2cd-4743-8070-08da27b14f3b 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: SN1NAM02FT0006.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6392 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 > > When stopping a bonded port, all slaves should be deactivated. But only s/deactivated/stopped/ ? > active slaves are stopped. So fix it and do "deactivae_slave()" for active s/deactivae_slave()/deactivate_slave()/ > slaves. Hi Connor, When a bonding port is closed, is it clear if all slave ports or active slave ports should be stopped? > > Fixes: 0911d4ec0183 ("net/bonding: fix crash when stopping mode 4 port") > Cc: stable@dpdk.org > > Signed-off-by: Huisong Li > Signed-off-by: Min Hu (Connor) > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index b305b6a35b..469dc71170 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -2118,18 +2118,20 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) > internals->link_status_polling_enabled = 0; > for (i = 0; i < internals->slave_count; i++) { > uint16_t slave_id = internals->slaves[i].port_id; > + > + internals->slaves[i].last_link_status = 0; > + ret = rte_eth_dev_stop(slave_id); > + if (ret != 0) { > + RTE_BOND_LOG(ERR, "Failed to stop device on port %u", > + slave_id); > + return ret; Should it return here or try to stop all ports? What about to record the return status, but keep continue to stop all ports. And return error if any of the stop failed? > + } > + > + /* active slaves need to deactivate. */ " active slaves need to be deactivated. " ? > if (find_slave_by_id(internals->active_slaves, > internals->active_slave_count, slave_id) != > - internals->active_slave_count) { > - internals->slaves[i].last_link_status = 0; > - ret = rte_eth_dev_stop(slave_id); > - if (ret != 0) { > - RTE_BOND_LOG(ERR, "Failed to stop device on port %u", > - slave_id); > - return ret; > - } > + internals->active_slave_count) I think original indentation for this line is better. > deactivate_slave(eth_dev, slave_id); > - } > } > > return 0;