All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] net/hns3: support rule keep capability
@ 2022-12-15  1:41 Chengwen Feng
  2022-12-15  1:41 ` [PATCH 1/2] net/hns3: declare " Chengwen Feng
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Chengwen Feng @ 2022-12-15  1:41 UTC (permalink / raw)
  To: thomas, ferruh.yigit, andrew.rybchenko
  Cc: dev, liudongdong3, yisen.zhuang, aman.deep.singh, yuying.zhang

This patch declare the hns3 PMD supports rule keep capability, and also
add "--disable-flow-flush" parameter to test for such capability.

Chengwen Feng (2):
  net/hns3: declare support rule keep capability
  app/testpmd: add disable-flow-flush parameter

 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 +++++
 drivers/net/hns3/hns3_common.c        | 7 ++++---
 5 files changed, 20 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] net/hns3: declare support rule keep capability
  2022-12-15  1:41 [PATCH 0/2] net/hns3: support rule keep capability Chengwen Feng
@ 2022-12-15  1:41 ` Chengwen Feng
  2022-12-15  1:56   ` Dongdong Liu
  2022-12-15  1:41 ` [PATCH 2/2] app/testpmd: add disable-flow-flush parameter Chengwen Feng
  2023-01-31 17:05 ` [PATCH 0/2] net/hns3: support rule keep capability Ferruh Yigit
  2 siblings, 1 reply; 10+ messages in thread
From: Chengwen Feng @ 2022-12-15  1:41 UTC (permalink / raw)
  To: thomas, ferruh.yigit, andrew.rybchenko
  Cc: dev, liudongdong3, yisen.zhuang, aman.deep.singh, yuying.zhang

The driver supports create flow rules when device is stopped, and
re-setup flow rules when restarting, so declare support
RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP.

The driver also supports to create indirect actions when device is
stopped, and keeps the indirect actions when restarting, so declare
support RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP.

Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/net/hns3/hns3_common.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index 7adc6a4972..da0a481f15 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -90,10 +90,11 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	if (hns3_dev_get_support(hw, OUTER_UDP_CKSUM))
 		info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM;
 
+	info->dev_capa = RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP |
+			 RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP;
 	if (hns3_dev_get_support(hw, INDEP_TXRX))
-		info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
-				 RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
-	info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
+		info->dev_capa |= RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
+				  RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
 
 	if (hns3_dev_get_support(hw, PTP))
 		info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] app/testpmd: add disable-flow-flush parameter
  2022-12-15  1:41 [PATCH 0/2] net/hns3: support rule keep capability Chengwen Feng
  2022-12-15  1:41 ` [PATCH 1/2] net/hns3: declare " Chengwen Feng
@ 2022-12-15  1:41 ` Chengwen Feng
  2023-01-23 15:01   ` Singh, Aman Deep
  2023-01-25 18:37   ` Ferruh Yigit
  2023-01-31 17:05 ` [PATCH 0/2] net/hns3: support rule keep capability Ferruh Yigit
  2 siblings, 2 replies; 10+ messages in thread
From: Chengwen Feng @ 2022-12-15  1:41 UTC (permalink / raw)
  To: thomas, ferruh.yigit, andrew.rybchenko
  Cc: dev, liudongdong3, yisen.zhuang, aman.deep.singh, yuying.zhang

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);
 
 		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.
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] net/hns3: declare support rule keep capability
  2022-12-15  1:41 ` [PATCH 1/2] net/hns3: declare " Chengwen Feng
@ 2022-12-15  1:56   ` Dongdong Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Dongdong Liu @ 2022-12-15  1:56 UTC (permalink / raw)
  To: Chengwen Feng, thomas, ferruh.yigit, andrew.rybchenko
  Cc: dev, yisen.zhuang, aman.deep.singh, yuying.zhang


Acked-by: Dongdong Liu <liudongdong3@huawei.com>

Thanks,
Dongdong
On 2022/12/15 9:41, Chengwen Feng wrote:
> The driver supports create flow rules when device is stopped, and
> re-setup flow rules when restarting, so declare support
> RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP.
>
> The driver also supports to create indirect actions when device is
> stopped, and keeps the indirect actions when restarting, so declare
> support RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP.
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
>  drivers/net/hns3/hns3_common.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
> index 7adc6a4972..da0a481f15 100644
> --- a/drivers/net/hns3/hns3_common.c
> +++ b/drivers/net/hns3/hns3_common.c
> @@ -90,10 +90,11 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
>  	if (hns3_dev_get_support(hw, OUTER_UDP_CKSUM))
>  		info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM;
>
> +	info->dev_capa = RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP |
> +			 RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP;
>  	if (hns3_dev_get_support(hw, INDEP_TXRX))
> -		info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
> -				 RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
> -	info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
> +		info->dev_capa |= RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
> +				  RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
>
>  	if (hns3_dev_get_support(hw, PTP))
>  		info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] app/testpmd: add disable-flow-flush parameter
  2022-12-15  1:41 ` [PATCH 2/2] app/testpmd: add disable-flow-flush parameter Chengwen Feng
@ 2023-01-23 15:01   ` Singh, Aman Deep
  2023-01-25 18:34     ` Ferruh Yigit
  2023-01-25 18:37   ` Ferruh Yigit
  1 sibling, 1 reply; 10+ messages in thread
From: Singh, Aman Deep @ 2023-01-23 15:01 UTC (permalink / raw)
  To: Chengwen Feng, thomas, ferruh.yigit, andrew.rybchenko
  Cc: dev, liudongdong3, yisen.zhuang, yuying.zhang

[-- Attachment #1: Type: text/plain, Size: 4117 bytes --]


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.

[-- Attachment #2: Type: text/html, Size: 4760 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] app/testpmd: add disable-flow-flush parameter
  2023-01-23 15:01   ` Singh, Aman Deep
@ 2023-01-25 18:34     ` Ferruh Yigit
  0 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2023-01-25 18:34 UTC (permalink / raw)
  To: Singh, Aman Deep, Chengwen Feng, thomas, andrew.rybchenko
  Cc: dev, liudongdong3, yisen.zhuang, yuying.zhang

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 <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.
> 

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; /**<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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] app/testpmd: add disable-flow-flush parameter
  2022-12-15  1:41 ` [PATCH 2/2] app/testpmd: add disable-flow-flush parameter Chengwen Feng
  2023-01-23 15:01   ` Singh, Aman Deep
@ 2023-01-25 18:37   ` Ferruh Yigit
  2023-01-26 12:29     ` Ori Kam
  2023-01-31  7:55     ` Singh, Aman Deep
  1 sibling, 2 replies; 10+ messages in thread
From: Ferruh Yigit @ 2023-01-25 18:37 UTC (permalink / raw)
  To: Chengwen Feng, thomas, andrew.rybchenko, Ori Kam, aman.deep.singh
  Cc: dev, liudongdong3, yisen.zhuang, yuying.zhang

On 12/15/2022 1:41 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>

+cc Ori

I am for proceeding with this patch unless there is objection from Aman
& Ori.

> ---
>  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; /**<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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH 2/2] app/testpmd: add disable-flow-flush parameter
  2023-01-25 18:37   ` Ferruh Yigit
@ 2023-01-26 12:29     ` Ori Kam
  2023-01-31  7:55     ` Singh, Aman Deep
  1 sibling, 0 replies; 10+ messages in thread
From: Ori Kam @ 2023-01-26 12:29 UTC (permalink / raw)
  To: Ferruh Yigit, Chengwen Feng,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	andrew.rybchenko, aman.deep.singh
  Cc: dev, liudongdong3, yisen.zhuang, yuying.zhang

Hi,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Wednesday, 25 January 2023 20:38
> 
> On 12/15/2022 1:41 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>
> 
> +cc Ori
> 
> I am for proceeding with this patch unless there is objection from Aman
> & Ori.
> 
> > ---
> >  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; /**<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.

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] app/testpmd: add disable-flow-flush parameter
  2023-01-25 18:37   ` Ferruh Yigit
  2023-01-26 12:29     ` Ori Kam
@ 2023-01-31  7:55     ` Singh, Aman Deep
  1 sibling, 0 replies; 10+ messages in thread
From: Singh, Aman Deep @ 2023-01-31  7:55 UTC (permalink / raw)
  To: Ferruh Yigit, Chengwen Feng, thomas, andrew.rybchenko, Ori Kam
  Cc: dev, liudongdong3, yisen.zhuang, yuying.zhang

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]


On 1/26/2023 12:07 AM, Ferruh Yigit wrote:
> On 12/15/2022 1:41 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>

Acked-by: Aman Singh<aman.deep.singh@intel.com>

<snip>

[-- Attachment #2: Type: text/html, Size: 1046 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] net/hns3: support rule keep capability
  2022-12-15  1:41 [PATCH 0/2] net/hns3: support rule keep capability Chengwen Feng
  2022-12-15  1:41 ` [PATCH 1/2] net/hns3: declare " Chengwen Feng
  2022-12-15  1:41 ` [PATCH 2/2] app/testpmd: add disable-flow-flush parameter Chengwen Feng
@ 2023-01-31 17:05 ` Ferruh Yigit
  2 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2023-01-31 17:05 UTC (permalink / raw)
  To: Chengwen Feng, thomas, andrew.rybchenko
  Cc: dev, liudongdong3, yisen.zhuang, aman.deep.singh, yuying.zhang

On 12/15/2022 1:41 AM, Chengwen Feng wrote:
> This patch declare the hns3 PMD supports rule keep capability, and also
> add "--disable-flow-flush" parameter to test for such capability.
> 
> Chengwen Feng (2):
>   net/hns3: declare support rule keep capability
>   app/testpmd: add disable-flow-flush parameter

Series applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-01-31 17:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15  1:41 [PATCH 0/2] net/hns3: support rule keep capability Chengwen Feng
2022-12-15  1:41 ` [PATCH 1/2] net/hns3: declare " Chengwen Feng
2022-12-15  1:56   ` Dongdong Liu
2022-12-15  1:41 ` [PATCH 2/2] app/testpmd: add disable-flow-flush parameter Chengwen Feng
2023-01-23 15:01   ` Singh, Aman Deep
2023-01-25 18:34     ` Ferruh Yigit
2023-01-25 18:37   ` Ferruh Yigit
2023-01-26 12:29     ` Ori Kam
2023-01-31  7:55     ` Singh, Aman Deep
2023-01-31 17:05 ` [PATCH 0/2] net/hns3: support rule keep capability Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.