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 78F14423AC; Wed, 11 Jan 2023 13:52:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 687A940E25; Wed, 11 Jan 2023 13:52:38 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2041.outbound.protection.outlook.com [40.107.237.41]) by mails.dpdk.org (Postfix) with ESMTP id 8E85140A7D for ; Wed, 11 Jan 2023 13:52:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aLMgFlW3Ym3QkMiXflRkSfaB7zTfoBCinMQjqu3qQcHg1zqLlzBqXxn0sdumGrMkgRFTcUVPK9/XwSyn96GUBNaPBNcqLg/QMU5/5QGRVGM8MmaUKikiYs2NnnJeBEPRhHPZYcsANX8S/QJk4HkjtX+yfDwXJdUphBPZU1C1xgJAwXRksyZT/4uXle26kveurCJbngeBEjhSx7YdfGY5mWjqIf8VNBFYghi8fGOJayvEueiEn5ZQUYQvATfiguFW3hQUTj6HmMYCt9N/CRXj2Np8BmW8r5SjIB0nVqOVWlNmHKJ9a4v0D1vz9YhkAvj9GNp/2bVPFk0ep1cEgZSLSg== 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=I4/GceFZdZuGLfnigRaZsMsDRFSattU9t4VHUWqwC6I=; b=fizrcueUd+h83VSk6tkh72NDwge0g1XRIH/QEhSnmceY4zSBx1RJZ9VdYFzNs6PAoOOAK1biXpOS218P/RCG9iQo/tg0YPLRA1WLfZMl5j18NNPq3pvxDPJnlJEZljFqClYiyC5RIJAyy/R+oth8ptNqk9o2N3EyHeF/p6nZ8oHUIaswGdOjYx2rZD0StqujvLRbW3mFx3/PAgJytDpH92oALQTaYCOoJcdFUO85vufF5gn9c+k/AzOF3YQAl2jGrE50qyr4sxp6j9uPnA/HmWmmvlWxuWlr3LJms1E2h02BwJ9wr2ChFNNWpVsPC7lsykXpFYTv9xFKg5JnjxjCig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I4/GceFZdZuGLfnigRaZsMsDRFSattU9t4VHUWqwC6I=; b=sNok8gOJIccgnKD/h36el4H8MfqajbF0ziGQEQH3pOErwpm8k08FFFnLn12AdU9Oz2pXdPfDe1O5KLm5+gsX83GjgFxX8eNaphK8VomtP7d9V5mTQVIlzAhOhEspK9maGI5pGVt1/O0tszc3KSAv5vrjilh+mU96/57uMdZDBfo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CH0PR12MB5332.namprd12.prod.outlook.com (2603:10b6:610:d7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 12:52:36 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%9]) with mapi id 15.20.5986.018; Wed, 11 Jan 2023 12:52:36 +0000 Message-ID: Date: Wed, 11 Jan 2023 12:52:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: Huisong Li , dev@dpdk.org, andrew.rybchenko@oktetlabs.ru Cc: thomas@monjalon.net, liudongdong3@huawei.com, huangdaode@huawei.com, fengchengwen@huawei.com, Aman Singh References: <20220825024425.10534-1-lihuisong@huawei.com> <20221206092649.8287-1-lihuisong@huawei.com> <20221206092649.8287-6-lihuisong@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH V4 5/5] app/testpmd: stop forwarding in new or destroy event In-Reply-To: <20221206092649.8287-6-lihuisong@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0186.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CH0PR12MB5332:EE_ X-MS-Office365-Filtering-Correlation-Id: 456dba0d-f950-45bf-0078-08daf3d2b6b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9Y+w1XM17KTz1BogelVAgTzYPvpLUr3va6N+FQbvleRfKF4Lgq0TVNBbzvAziBRpKs4YY1RxsmoUS+O0HHx2UXovjFmkV04AnUGgbVpii+VzdGACLumdkevGTFuk+b377VLLuRyb6LLxXk4g8QXt2facbzf++iYraUxVZc7DaF5/uKaS7oEcV8BsFR4/ZbcSxuwCSeq+Sk8T69vWHJk8joQ6olToXBX+BvOeKpaQqQtqnSGPxKmjReumOzmfLKboVNPzKOg4b7HTSNSfX5xayKP+pJVz2Opi0E2zpItn6Qi3ot/ZBfETKQlQKwBqrLyf0lAn1lT4ORfjnAj/5AgoBT36L+Gp6UTNKbgL0uFJNHyL6b7d5LyeWKBaEOa+ea4ImLvuHffAODyWKArGS2Kd+omLm7fRawc1xLgRN5phP9O/2rOJeBDVZ91fE3o9seGifiMzcFVvpKR4U7P5m/+TxPFG555Dq88KuOyD8ljulGkqHSEgsJWDdry2voujq6nEoZlAE9V4lD8DlFoQ1erbxtWV3wPDTRA8n9NiegfbJ6SmWepi/PJu/gl4yiuHw7fV3eGt17DRDIDWi4N0CK87JJV0/YmmgRqZTkas3SLCHpBjpszF7t+xWMOGtN/LaeCjDW3wtPXWkDdPNO0wFKA/rZVU5jRMReIx6piRvbxq1SDLAdH87jFOezYQ7whFV8uOFdNbDASMYANcd+pZ+Qy9PKte27KZaVufRbeZH5NJnk8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(39860400002)(136003)(366004)(376002)(451199015)(6506007)(38100700002)(6666004)(53546011)(31686004)(2906002)(44832011)(478600001)(2616005)(6486002)(186003)(6512007)(26005)(316002)(5660300002)(31696002)(83380400001)(8936002)(36756003)(86362001)(66476007)(4326008)(8676002)(41300700001)(66556008)(66946007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a1kycHpVTmdXV3VBK3dQeXk2Zm14UU42TEhPeHA0eTU0Z2xtRnlwdW0zZTl0?= =?utf-8?B?VWdtMkIrT3AwRFBOZmEweEh3OXlhbDlXa2VDUUcwNGtkNEpCelVlM0cwVHYr?= =?utf-8?B?ZGJGK3phenNyT3FqeUJMNnJaZW80ckV2dTd4VjI1MmdoVktOMXNOL0xwZjY1?= =?utf-8?B?SFNJMnlyZEtzQ1ZmcXo3d2VCRC8weVdNQWgvcFViRGExUVdZYUxOVHVqMS83?= =?utf-8?B?RWdHZDQyS0dDM3ZQSkRyWElLM0J4ZVFpbFJVOThlbXpUdzhVVjQ2VHl0dF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094eHB2YUVvdU4wUkppYVMwcnpoN3I2VklkbzZt?= =?utf-8?Q?/YXzzOcCHuybmm6QqL0q825B0?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 456dba0d-f950-45bf-0078-08daf3d2b6b4 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 12:52:36.2309 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: os12XOHl8elDpZXZH1qcJnlhzt8pi3VhwcEHjAEs7Tt/pzrrS9iZppBGIZwRM06N X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5332 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 12/6/2022 9:26 AM, Huisong Li wrote: > When testpmd receives the new or destroy event, the port related > information will be updated. Testpmd must stop packet forwarding > before updating the information to avoid some serious problems. > > Signed-off-by: Huisong Li > --- > app/test-pmd/testpmd.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 2e6329c853..746f07652a 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -3806,6 +3806,8 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, > > switch (type) { > case RTE_ETH_EVENT_NEW: > + if (test_done == 0) > + stop_packet_forwarding(); testpmd is test application, why not prevent user to issue attach / detach commands when packet forwarding is going on, and force user to stop forwarding explicitly instead of doing this implicitly and silently? Similar to previous comments, as we make things more complex for specific use cases it will be very difficult to update testpmd without hitting unexpected side effects everywhere, at least this is my concern. > if (setup_on_probe_event) > setup_attached_port(port_id); > break; > @@ -3816,6 +3818,8 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, > "Could not set up deferred device removal\n"); > break; > case RTE_ETH_EVENT_DESTROY: > + if (test_done == 0) > + stop_packet_forwarding(); > ports[port_id].port_status = RTE_PORT_CLOSED; > printf("Port %u is closed\n", port_id); > if (rte_eal_alarm_set(100000, remove_invalid_ports_callback,