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 D201842401; Wed, 25 Jan 2023 19:34:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6501542D4C; Wed, 25 Jan 2023 19:34:44 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2084.outbound.protection.outlook.com [40.107.93.84]) by mails.dpdk.org (Postfix) with ESMTP id 19FD542D47 for ; Wed, 25 Jan 2023 19:34:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f439/Dvyofwy8ikkdAvVWci9+2QqEuyGzJ5b+0eARrRWbSQPGzHnBX2lO03ci8A/BOavyufuPTzBcUIelngsvxHBgLTS2oDOzAo8zYfAB/jGLSZGxiKmpQ3S1EYJ/tqTRSi3XHckV5Qity5JQM5c5HAsnFDodVWsj0kerD6LlGhkfAhi2MT8h1uMXnL0zVMtfi/dHsWfejM9aAixHmHEEqp6QP1lWtn17p9wbsWgkQiIIW9NNFtZxjl6XJkB6ZrjARIeCYJcZb+JAZbPB2UNbIyWOKIqEoP4njMGCuwKztybtbgz1hx2qWYduWThABuQf14uOVFU8nJof1wum4lRBw== 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=B1GAsX5rnSFcMlQmpxBj8hKN89hSEBAk3WTaaiAjyBE=; b=WcJS2JVUkEVSMpRY7aaY+vHHYkTD4uYtFqLYhAvBBt8q/AQteqkzCFi9+fADXrgE5OhtoO3nvs58yuKpUPt4QK2UxsS3/I4WbPyrRI9Pj4WYFr9h54lQlSglUYM9380DipwFiKg9I9gc0Bj4jEXJ1IF56+69G2aTrXeTCNyUQ92taiViVYRnpklhQBLk5ltX5WaLLsTGrS6DcNEyUFK8uee3S42RKopkI3uiQb3UtQBITGoHqTh+6UUqZhvo1Y4ZMb8YC3CTPCb10LwHw7Znq1Emzyfv6iL7gkq9kZZn/91L9ueqJwsh5GDdwcraF+79o0F3hJxw4FA0JXBzH4REHA== 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=B1GAsX5rnSFcMlQmpxBj8hKN89hSEBAk3WTaaiAjyBE=; b=ySRfsWwXtR06Xa4JCz0KuOLgUYs+Q+aFjOKmXAe6lYhokHNsHA2DjCb1v4ww+AmFLTFF1O9sIvNBk3qDXYnAb0qM+OevQeKx5vu5fLr29zdU5uiPuoQ+ptOEUOFPVfWZIEFfZuDqiZkvFjGryjVg0Au8O6pchxX/3ZrgySQUVe4= 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 SJ1PR12MB6314.namprd12.prod.outlook.com (2603:10b6:a03:457::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Wed, 25 Jan 2023 18:34:37 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%7]) with mapi id 15.20.6002.033; Wed, 25 Jan 2023 18:34:37 +0000 Message-ID: Date: Wed, 25 Jan 2023 18:34:31 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 2/2] app/testpmd: add disable-flow-flush parameter Content-Language: en-US To: "Singh, Aman Deep" , Chengwen Feng , thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, liudongdong3@huawei.com, yisen.zhuang@huawei.com, yuying.zhang@intel.com References: <20221215014142.15750-1-fengchengwen@huawei.com> <20221215014142.15750-3-fengchengwen@huawei.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0105.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c3::7) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ1PR12MB6314:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c14324e-5438-44da-56c2-08daff02cfe4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yRYKVl1ai0cOWa9X93/i7+Bih1zCLntr0qKLAFKwX4LWLopNDOPObbq4Wi7LiN877shuEXlL1BbAX5WqryFKRQUfgsSbDtgmAY/KgL0g6PltXtNfWCaGEukutaY2tBcVoor2b9t5zCGz5vRinS5OaBLRydA4Y5a2ybktfFiOGfdT0XgoWMC0EdshagkfMD1tyHpRiAqQ+XeM/jtGd2viAgP1G39nbV3gqO11aaru8Uv/s+XjUc9k3BKWE11gz44D9RkeLXcFLthWegd/QzcswAhDnWK8nUFSzMKygTaOCTLhCSv+V7TSK0ws+i8SthcO13TGSmBNTvxgAWapAQkbhmBf4rvJjtf7Dsk3rmyoijxUgVbmbpQB0/hsmMmsCMHajJoYNyIODV+UrJektMZnWQOgUNC0T14j3Zq5Ujffil+d8dQjObaKSxOwXRsFpJ2RG/u1Lk43QA5ZmslBXnFm6BBfpTgplOSS3MTjriDZojwi5bJjiAueW1WfUqZvNtxabAARYNvSeudukUEChduDn47g9kr041QSVQHxqsvzpmsaWtbZTbXkEccLfoyO6dUt3X2gSokODFCFMFa34HSOn8wvHttzZU3TPeks00Z8oHJMgIZ5Nlh4oHVMw1QqupxfGyYMmgb1wUOI6S6dVLHK3u5mJWS+/0WAS3mynzxw2VZH7vqCdePWlalmMwXg+sNRmja1etGTyl+xuWTd2VFWf35U+fk+vWvqK/MsZXmFWRE= 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:(13230025)(4636009)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199018)(83380400001)(66946007)(66556008)(8936002)(6666004)(66476007)(8676002)(4326008)(41300700001)(36756003)(5660300002)(31686004)(31696002)(38100700002)(2906002)(26005)(53546011)(6512007)(6506007)(44832011)(6486002)(110136005)(478600001)(2616005)(186003)(316002)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UDdzQWh5cWdsdUR2Qzljd1dsSHZLMDkxSkwvSWlqYnFidkVmMUFMQ014M25Z?= =?utf-8?B?Qmx2bGZOcVhOQzM3ODNJdEtjQzVMR1kyNzNiUWVjMWk4cmVDbTR5ZTcwRW5U?= =?utf-8?B?elRIcEIwWm5vWUUyQ0o3WkJEY2pKWXl4bkc4RXY2YjJrc2xrN2cwSzg3WThS?= =?utf-8?B?UDJvcnN3RW1Ddk8rbW5RcUF6YVo0VG00MXFDWHNjWTZGTFlXMGNNRExxRXhH?= =?utf-8?B?LzV2WUlQSmJvRmg1NU11Vmlmek03SHJwN1d3a3lNRDdhajZjT05yeE8wd3Z5?= =?utf-8?B?cmJLUDcvODVNU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?utf-8?Q?oYJlXtlnfVc7Jz02XCd+HcyT4?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c14324e-5438-44da-56c2-08daff02cfe4 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 18:34:37.1555 (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: C3wrEq/hM99Xm0fU8Hzm+JzcBszNfFLDD9N0oTM7NoRQ0vvUGE2OZBZn4rN28feo X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6314 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 1/23/2023 3:01 PM, Singh, Aman Deep wrote: > > On 12/15/2022 7:11 AM, Chengwen Feng wrote: >> This patch adds "--disable-flow-flush" parameter, which could used to >> disable port flow flush when stop port. It allows testing keep flow >> rules or shared flow objects across restart. >> >> Signed-off-by: Chengwen Feng >> --- >> app/test-pmd/parameters.c | 4 ++++ >> app/test-pmd/testpmd.c | 7 ++++++- >> app/test-pmd/testpmd.h | 1 + >> doc/guides/testpmd_app_ug/run_app.rst | 5 +++++ >> 4 files changed, 16 insertions(+), 1 deletion(-) >> >> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c >> index d597c209ba..e734ad9a02 100644 >> --- a/app/test-pmd/parameters.c >> +++ b/app/test-pmd/parameters.c >> @@ -175,6 +175,7 @@ usage(char* progname) >> "disable print of designated event or all of them.\n"); >> printf(" --flow-isolate-all: " >> "requests flow API isolated mode on all ports at initialization time.\n"); >> + printf(" --disable-flow-flush: disable port flow flush when stop port.\n"); >> printf(" --tx-offloads=0xXXXXXXXX: hexadecimal bitmask of TX queue offloads\n"); >> printf(" --rx-offloads=0xXXXXXXXX: hexadecimal bitmask of RX queue offloads\n"); >> printf(" --hot-plug: enable hot plug for device.\n"); >> @@ -667,6 +668,7 @@ launch_args_parse(int argc, char** argv) >> { "rxfreet", 1, 0, 0 }, >> { "no-flush-rx", 0, 0, 0 }, >> { "flow-isolate-all", 0, 0, 0 }, >> + { "disable-flow-flush", 0, 0, 0 }, >> { "rxoffs", 1, 0, 0 }, >> { "rxpkts", 1, 0, 0 }, >> { "rxhdrs", 1, 0, 0 }, >> @@ -1330,6 +1332,8 @@ launch_args_parse(int argc, char** argv) >> rmv_interrupt = 0; >> if (!strcmp(lgopts[opt_idx].name, "flow-isolate-all")) >> flow_isolate_all = 1; >> + if (!strcmp(lgopts[opt_idx].name, "disable-flow-flush")) >> + no_flow_flush = 1; >> if (!strcmp(lgopts[opt_idx].name, "tx-offloads")) { >> char *end = NULL; >> n = strtoull(optarg, &end, 16); >> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c >> index 134d79a555..ea78f8982d 100644 >> --- a/app/test-pmd/testpmd.c >> +++ b/app/test-pmd/testpmd.c >> @@ -383,6 +383,11 @@ uint8_t no_flush_rx = 0; /* flush by default */ >> */ >> uint8_t flow_isolate_all; >> >> +/* >> + * Disable port flow flush when stop port. >> + */ >> +uint8_t no_flow_flush = 0; /* do flow flush by default */ >> + >> /* >> * Avoids to check link status when starting/stopping a port. >> */ >> @@ -3246,7 +3251,7 @@ stop_port(portid_t pid) >> } >> } >> >> - if (port->flow_list) >> + if (port->flow_list && !no_flow_flush) >> port_flow_flush(pi); > > In case stop_port() is called through pmd_test_exit(), should the flag > be disabled for flush to happen. > In case of 'pmd_test_exit()', 'close_port()' will be called after port stop which will make port unusable anyway. As long as there is no memory leak in that path, I think no need to for flow flush. @Chengwen, can you please check and confirm there won't be any resource leak in case of 'no_flow_flush' is set and testpmd terminated via 'pmd_test_exit()' call? And rest looks good to me. >> >> ret = eth_dev_stop_mp(pi); >> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h >> index 7d24d25970..ab4733522d 100644 >> --- a/app/test-pmd/testpmd.h >> +++ b/app/test-pmd/testpmd.h >> @@ -476,6 +476,7 @@ extern uint8_t numa_support; /**< set by "--numa" parameter */ >> extern uint16_t port_topology; /**< set by "--port-topology" parameter */ >> extern uint8_t no_flush_rx; /**> extern uint8_t flow_isolate_all; /**< set by "--flow-isolate-all */ >> +extern uint8_t no_flow_flush; /**< set by "--disable-flow-flush" parameter */ >> extern uint8_t mp_alloc_type; >> /**< set by "--mp-anon" or "--mp-alloc" parameter */ >> extern uint32_t eth_link_speed; >> diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst >> index 074f910fc9..3ec3d4f5e6 100644 >> --- a/doc/guides/testpmd_app_ug/run_app.rst >> +++ b/doc/guides/testpmd_app_ug/run_app.rst >> @@ -436,6 +436,11 @@ The command line options are: >> >> Ports that do not support this mode are automatically discarded. >> >> +* ``--disable-flow-flush`` >> + >> + Disable port flow flush when stop port. This allows testing keep flow rules >> + or shared flow objects across restart. >> + >> * ``--tx-offloads=0xXXXXXXXX`` >> >> Set the hexadecimal bitmask of TX queue offloads.