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 14192A0032 for ; Wed, 11 May 2022 12:06:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E41C040DDD; Wed, 11 May 2022 12:06:05 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2048.outbound.protection.outlook.com [40.107.102.48]) by mails.dpdk.org (Postfix) with ESMTP id 46B3440DDD; Wed, 11 May 2022 12:06:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EFtxnBDrD5Gf/Q3C13dXqvgcJAgWm4qUNDAjvkQ51zFge6e35t+rlMHwFn0LdWaHg2ySbjArWxgk5qTvVraLMjrBsojqR3EsgBgqtesxLIy9ufjFZ5dl/oeMzaq5czcf6TzxoQsC4H0Gchi0KF/HFQYjrr+q8iJezwpZWQ2gLwDjmnix7gXSTJcpb7GcD4W0gnyKLpf8syXNtzjkSLgQDBmzws7bUEOEAAW7fXnTXlKYr/D3+b3FnSfDBOy6k9ZsFa//QvCR3iYBC57ISrXwgK9LXpTfjKYa67tmaitrd0wYe1RYZnJxW9g2kXjgyyw5L8Iotq3k7qxarUviK0R9zw== 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=jkCXTIk+fvfJwSwgor3Hg7WGfDj0qzlUzdeMnHblBqs=; b=jGvr5FlT3mZJABKEo0TwzohDniBtXr6RKNom4peLhXZRxxSG7bIYD/XtqZzsYF0X8qHIFp04YAsjnWrp8i8ZzIn8zZDmo+JL5jVeTtK0GSZZc/NKFyQPLOgydyb3kQNj0XHQRpWTUN273aJY3bD20aN3HhOLWLLJkbPOsjYGpdMdUCt8T5ko6I6dsVhCAU1kDieDgnBVQAs9gOVOOFoNxIxcAgorGY2aEbI+JbwYsBs0wVnQm9v66unK4RYdlpPudBnQk9AS4E33wcieFSJcuiv/zScyYSivvLd+CZs8cQ6QCZikHJtfwJee+38deCEctWITTTb7XEQqcaC3y0mzgA== 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=jkCXTIk+fvfJwSwgor3Hg7WGfDj0qzlUzdeMnHblBqs=; b=KDmvON2rGR72DDWb0JuRIuKrKnCkJKKNerdHHKp2O7ARjRgifxzy35OS2BBNqEN2ejEI0BSpA3tG1Zxkb2MnDYYuY87X136idlTIUuFuhTIMnV2SR1zPsyr97t9WXby8kxFZpsPlgd9a3r81BH9OcNEz53TzX8duUtkMBGJK8nU= Received: from SA0PR11CA0156.namprd11.prod.outlook.com (2603:10b6:806:1bb::11) by MWHPR02MB2430.namprd02.prod.outlook.com (2603:10b6:300:41::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Wed, 11 May 2022 10:06:02 +0000 Received: from SN1NAM02FT0043.eop-nam02.prod.protection.outlook.com (2603:10b6:806:1bb:cafe::7e) by SA0PR11CA0156.outlook.office365.com (2603:10b6:806:1bb::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23 via Frontend Transport; Wed, 11 May 2022 10:06:01 +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-pvapexch02.xlnx.xilinx.com; Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0043.mail.protection.outlook.com (10.97.5.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5250.13 via Frontend Transport; Wed, 11 May 2022 10:06:00 +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; Wed, 11 May 2022 11:05:59 +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; Wed, 11 May 2022 11:05:59 +0100 Envelope-to: humin29@huawei.com, konstantin.v.ananyev@yandex.ru, dev@dpdk.org, lihuisong@huawei.com, stable@dpdk.org, aman.deep.singh@intel.com, xiaoyun.li@intel.com, yuying.zhang@intel.com, pablo.de.lara.guarch@intel.com, bernard.iremonger@intel.com Received: from [10.71.116.161] (port=21141) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nojEE-0002h6-TE; Wed, 11 May 2022 11:05:59 +0100 Message-ID: <3675ce78-c1a8-6dc9-a5f4-7edb2a00f9e0@xilinx.com> Date: Wed, 11 May 2022 11:05:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v3 3/5] app/testpmd: fix port status of slave device Content-Language: en-US To: "Min Hu (Connor)" , Konstantin Ananyev , CC: Huisong Li , , Aman Singh , Xiaoyun Li , Yuying Zhang , Pablo de Lara , Bernard Iremonger References: <20220324030036.4761-1-humin29@huawei.com> <20220503100217.46203-1-humin29@huawei.com> <20220503100217.46203-4-humin29@huawei.com> <45233ff7-512c-f50a-7b56-8970737d3efe@yandex.ru> <1114e227-69ba-19b2-16d2-48be5399fb04@huawei.com> From: Ferruh Yigit In-Reply-To: <1114e227-69ba-19b2-16d2-48be5399fb04@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82f5f763-de3d-4bad-dd7f-08da3335d9ef X-MS-TrafficTypeDiagnostic: MWHPR02MB2430: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: hThmtaIICJNtCbMpZDWmF2VdATTrnfIc41gmJpXkrNfTy19jpIZnpkhiLkwN4Fg6pJfcDc4lBRSKCBBdow7eqTn6mni9cSnTuzeIt8mPOnBJEzHdX1OOgKyvAu2txAazq1zKlBSEfru3WYGrHupAE4AJpFqy7R6TdtgPOg4yfldnxni0/agsXmdIgUsfDP2SGEqCp1Emak52F7ciMWOUAIoKNOQ+W24xgwS2yZqjE8h4BMyaV7jlXxVQ3cizgO8W1Ba4x9A0Izko4c3A/d8H2d51vlrTQ07xfA5MoIq7QUExI8YhyYZGYuEK8l4ILOt9PznzJo2nyv7jbYEz20v+fDQdDa8a8xb+QtU0jvhaV/PgQi20dwayyiwCEm21AMyENapettCoC1XTEM/ACydJG3RWNYry1zywn+bxdmf6gUesZC3EVVfzksKLGLddAaCIBTCmY1zRBZUappueiZ8ulEQWV3aqUSE2u4chuzMzckKo21Es6ed2jfHYPm6KREi1TmVm6GMLBfSxqH46G+/yb5vCEc3qsD4JqI6L8rVAPJlqT1BzJokH7zt4rfLZGhG4WV+oHW11mQwvVZb660RU3w8g1kX3Ywd2ejOogWSguYnv+Tm9SCfBZnmGbVfUtGSqOgZiHGjqcCHa/ETaqXkqEn/l94dwflJ0TYEAgjohdImXN8Fw4lsGMVUvDF9loQ78lGc+Tqdglq8OsN5XKxXf6pfQTO5NHRdCfBtXSk8RuGs= X-Forefront-Antispam-Report: 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)(46966006)(36840700001)(40470700004)(44832011)(36756003)(31686004)(31696002)(110136005)(5660300002)(54906003)(53546011)(7416002)(7636003)(2906002)(4326008)(8676002)(70206006)(70586007)(9786002)(8936002)(356005)(316002)(40460700003)(82310400005)(36860700001)(508600001)(336012)(26005)(83380400001)(47076005)(426003)(186003)(2616005)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2022 10:06:00.6349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82f5f763-de3d-4bad-dd7f-08da3335d9ef 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-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0043.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2430 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 5/11/2022 3:16 AM, Min Hu (Connor) wrote: <...> >>>>>> @@ -609,8 +658,25 @@ eth_dev_start_mp(uint16_t port_id) >>>>>>   static int >>>>>>   eth_dev_stop_mp(uint16_t port_id) >>>>>>   { >>>>>> -    if (is_proc_primary()) >>>>>> -        return rte_eth_dev_stop(port_id); >>>>>> +    int ret; >>>>>> + >>>>>> +    if (is_proc_primary()) { >>>>>> +        ret = rte_eth_dev_stop(port_id); >>>>>> +        if (ret != 0) >>>>>> +            return ret; >>>>>> + >>>>>> +#ifdef RTE_NET_BOND >>>>> >>>>> Here and in other places - probably no need to pollute the code >>>>> with all these 'ifdef RTE_NET_BOND'. >>>>> I suppose this logic (for checking is bonding API present or not) >>>>> can be hidden inside change_bonding_slave_port_status() itself. >>>>> >>>> I think it does not pollute the code. anyone can tell according to >>>> the flag 'ifdef RTE_NET_BOND'. >>>> if hiddle inside 'change_bonding_slave_port_status', it will be weird. >>>> For example, if the port is not bonding port, It will also invoke >>>> 'change_bonding_slave_port_status'. That is unreasonable. >>>> >>> >>> Hi Konstantin, >>> >>> I also was not happy to have bonding (or any PMD) ifdef in the >>> generic (start()/stop()) functions, but the ifdef blocks updates >>> testpmd (application) level status. So that can't be handled in the >>> PMD and need to be in the application level. >>> Which is enforcing to have same PMD specific code in the testpmd level, >>> if you have any suggestion to prevent this, I am for it. >> >> >> I am not aking to move it to PMD. >> What I am saying that this ifdef logic could be grouped in one place >> (inside change_bonding_slave_port_status()) instead of spreading it >> around multiple places. >> > > Hi, Konstantin, > fixed in v4, thanks. Hi Conor, What do you think to apply same on patch 4/5?