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 82907A0543; Thu, 15 Dec 2022 02:48:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D16E842D14; Thu, 15 Dec 2022 02:48:20 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id B0303400D6 for ; Thu, 15 Dec 2022 02:48:18 +0100 (CET) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NXZlK5LJDzqT9H; Thu, 15 Dec 2022 09:43:57 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 15 Dec 2022 09:48:15 +0800 From: Chengwen Feng To: , , CC: , , , , Subject: [PATCH 2/2] app/testpmd: add disable-flow-flush parameter Date: Thu, 15 Dec 2022 01:41:42 +0000 Message-ID: <20221215014142.15750-3-fengchengwen@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221215014142.15750-1-fengchengwen@huawei.com> References: <20221215014142.15750-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 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); 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; /**