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 D84574246F; Mon, 23 Jan 2023 16:02:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F076400EF; Mon, 23 Jan 2023 16:02:16 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 9D253400D4 for ; Mon, 23 Jan 2023 16:02:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674486134; x=1706022134; h=message-id:date:subject:to:cc:references:from: in-reply-to:mime-version; bh=/wdObZVwaCOUHw8c7j9flGQX8n13CF7JroBCPH/8bbs=; b=g+gxMSIdvZBvLkJ8TAweZXETOgjEk1G+XvUI2Ibr0BkCwSrtT5TEDL1Q RtWx6nc06p3+/TFzgZrOJjaJR3c3flwf7yEet1btIzKgYeMHaFywsDcSY 33ZRX/DnVUXKx1LsBmlNIvaj3S87eL8PJB26H2Ey9qd08FFb6xD8KD7K4 9hJudISWzMRxrNiG4zL9XvJIT278H8Tc5775i9c+6LecNxCF+EesWXkOx eIfBMxImhC6URBszOhMa7f52LHvrh6y8iGO8HTZQOxwvBf+lreH2QqsO6 H4z5Hyafr0beVb7WqJ5KWJTOKCRbVm8U1ZQz8rLFSjLEZZ38fsTwXcp+X w==; X-IronPort-AV: E=McAfee;i="6500,9779,10598"; a="323748757" X-IronPort-AV: E=Sophos;i="5.97,239,1669104000"; d="scan'208,217";a="323748757" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2023 07:02:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10598"; a="661688939" X-IronPort-AV: E=Sophos;i="5.97,239,1669104000"; d="scan'208,217";a="661688939" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 23 Jan 2023 07:02:11 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 23 Jan 2023 07:02:10 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 23 Jan 2023 07:02:10 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.49) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 23 Jan 2023 07:02:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JyTxSpLjk86bcCyWABm7bL4Gp0LE1dwR18h7wNM8GuEAtg8bw5OhTD2wZ1ygBkIGRwfHs9jTxVPeFCJYYySAiTn57/76vT7PdW29VtDfDgB3IG2PDeeM2UNRlMHnqZbC0jJq2CQXjnHnDdtO8XlRm8iF39TAZGVV8gg5XJERr5uDr3IXNPfaFQR+zrWFSTn7Ohkrm2a6Hk30sQ7s50TNDP55abGWJ4zqW42vWImRgQ7k176YzuushCVKW6WTGiswx7+MYlV17Pabm5YE3JRsnXrH//FIYkrkXPl3Pv1QIubqay8Mp/QQ6OSHGUtXYQ3jpSeryF/XJyWT5iTGX61B9g== 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=ez4Aa45mkxSyCtZD0AS9uW+BtxW0KgT9x5LAYr95n7w=; b=M7XQTJEl+tYVbJW/MAFDGx2McTjF2XVqr+X3bOVOzdgZDRWxyr0jismwJZUxaq13Rinirssak6L3YYAmcnMRAV0OmkXEBNhaeE4I8aryU3vfN8VKulNu58+tqcv2NHZm4l4/Q7wcT2k90DE4YfoV84rI8uk1VPRDfnlErGHcaJEUAPTj6GrB3IOvZZXKV8vwZAbmMDx5gTv4htxzoWPiIJ+3DVQXvHa76Ubj0JaPTB2X6ElsfFLboI1Ex4fxxXzLci/E/haBAQ4cb8keAIdMc0XxOIQPcDC05yrAS97S0CSNX7wp0Z+/ZjdsDsl/eBR/DCGH6UOHdjlb1BLGREjAFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by PH7PR11MB5864.namprd11.prod.outlook.com (2603:10b6:510:136::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Mon, 23 Jan 2023 15:02:07 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::610f:2851:ae4e:ebe4]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::610f:2851:ae4e:ebe4%7]) with mapi id 15.20.6002.033; Mon, 23 Jan 2023 15:02:07 +0000 Content-Type: multipart/alternative; boundary="------------Rdfd1ZIZ0GUxkVMhieB0PqXH" Message-ID: Date: Mon, 23 Jan 2023 20:31:56 +0530 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 To: Chengwen Feng , , , CC: , , , References: <20221215014142.15750-1-fengchengwen@huawei.com> <20221215014142.15750-3-fengchengwen@huawei.com> Content-Language: en-US From: "Singh, Aman Deep" In-Reply-To: <20221215014142.15750-3-fengchengwen@huawei.com> X-ClientProxiedBy: PN0PR01CA0039.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:49::9) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB0062:EE_|PH7PR11MB5864:EE_ X-MS-Office365-Filtering-Correlation-Id: 13f15d9c-3b7e-463d-6010-08dafd52cbb5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gzljCiuBkxO/DrecZd/zTceMtTYCErfK5s+++CUA01BC1B/mwE/Rag00hIFqWA0aQvnurdtMECLZIbzpEH413F5u9K+cUkkN320DjUkPRyhECRXJDsXSSrrOH3YU9gXgbY0H68RIpNr4HgahxYvw3k7PvaipsUybW3cEnElIURMk0XT5FA+u4Zsuz7xlhq8J3r1csubrgGngrd+a5lnVs8NbiZwu5322W+iSXbS4vbWg4bVcdu9xieH91bfl8OoZ7MUOCOKxalbWxnh547vf1PWOfIYVIAz9fj74c9h4LOxYKS/Vu17VFQw0gY2CIOF+f7r7uRPreM5UlH8b6PwJULCynXIkCq3t6x7a1/OV7+WhR8Ka/s61WRKWNd88doF+mkN/60Fy9OPJf0+OcD5hk5EgUmOMdCq7LXS1fqGZfIn5JjxtjWyIJJYzROb30Hv2kAbve8syyJih8Po29zdaIXt+/XwmpNmGmpkCu786xEOj9mlcuz5VtkcBVT9g/VvvlTXgGves1k6qtadJkAZWgovVqR4hMMkT22EfO95Y/YKU8Q8LebpP+l6a6KF1ibuZBRXQwQY6yC1IBwaGw49cJTOrFjlBundqDBpfx8/T6WcesBTqfvo2PjUDO4rFoBmTmTBYl07FB9zy4LCKWZONxFFNL8JQ3A44YfHC8aRR2xt4iQfyoGSkGnopp3ALGB5xnuMTAhZMpdflC476G9emX60s8oUNAgy47aGGUZCu/kI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(346002)(136003)(39860400002)(396003)(366004)(451199015)(36756003)(31696002)(41300700001)(86362001)(82960400001)(5660300002)(8936002)(4326008)(2906002)(83380400001)(38100700002)(478600001)(6486002)(31686004)(26005)(8676002)(53546011)(186003)(6512007)(6506007)(33964004)(316002)(2616005)(66946007)(107886003)(6666004)(66556008)(66476007)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dnIzMEgxSFRybHluRHZmV290a1phSlNIUWxHUjBtclg1ckl4Ym5LVlpCdEpQ?= =?utf-8?B?UFFnTCttZ2JMd2dwWWxvMUZqRzRnZWEyRC9wcVVmNExxZTU2K1llaWNaWENh?= =?utf-8?B?c3hJTWZLNUI4WDhSdzRwWW1RajlWRmdLTDYxOFV1ZlRHUThqbnZoVWVPaS9m?= =?utf-8?B?T0hLRTBqcVRYVGYzYzQ5bkFLUXdja2c5UHQ2UkhxWUFhVEoxTXFyQXA5TDdr?= =?utf-8?B?TzVNTzRueFhYclZkd2w2RnFjUTNxVjlmLzZEQ3g1UVBLT3ZpNGE0Mmd3MVpO?= =?utf-8?B?UitsVnVKajNzY2JVRmpkU09zZ2VXSFZPNWgrZC9kRFNtNjNtNHd3dmwrR1g1?= =?utf-8?B?NWp3UzJReGdyMm41MnJuR2hCSzg3NkltMnNZMlpzQTRmNW1lTlVmWWdTMlU4?= =?utf-8?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d9c-3b7e-463d-6010-08dafd52cbb5 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2023 15:02:07.6590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rm9/hy62S1N8ZS3tiUdkAZv9wf8iWW9TtTuXQEQGfD1hd80RN6A2MNj5w5SF2Vgv//nAcM9JBKXpBQHYWgb2iBq1E7ewFbeSfas0GWgS6zo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5864 X-OriginatorOrg: intel.com 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 --------------Rdfd1ZIZ0GUxkVMhieB0PqXH Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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. > > 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. --------------Rdfd1ZIZ0GUxkVMhieB0PqXH Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit


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 <fengchengwen@huawei.com>
---
 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.
 
 		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; /**<set by "--no-flush-rx" parameter */
 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.
--------------Rdfd1ZIZ0GUxkVMhieB0PqXH--