DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] net/mlx5: add test for hot upgrade
@ 2023-05-16  5:41 Rongwei Liu
  2023-06-19 12:09 ` Raslan Darawsheh
  2023-06-26 20:22 ` Thomas Monjalon
  0 siblings, 2 replies; 4+ messages in thread
From: Rongwei Liu @ 2023-05-16  5:41 UTC (permalink / raw)
  To: dev, matan, viacheslavo, orika, thomas

This patch adds testpmd app a runtime function to test the hot
upgrade API.

    testpmd> mlx5 set flow_engine <0|1> (flag)
0 stands for active mode while 1 for standby mode.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 doc/guides/nics/mlx5.rst        | 10 ++++++
 drivers/net/mlx5/mlx5_testpmd.c | 63 +++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 7a137d5f6a..1867b2a3c0 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -2057,3 +2057,13 @@ where:
 * ``sw_queue_id``: queue index in range [64536, 65535].
   This range is the highest 1000 numbers.
 * ``hw_queue_id``: queue index given by HW in queue creation.
+
+Set Flow Engine Mode
+^^^^^^^^^^^^^^^^^^^^
+
+Set the flow engine to active(0) or standby(1) mode with specific flags::
+   testpmd> mlx5 set flow_engine <0|1> (flags)
+
+This command works for software steering only.
+Default FDB jump should be disabled if switchdev is enabled.
+The mode will propagate to all the probed ports.
diff --git a/drivers/net/mlx5/mlx5_testpmd.c b/drivers/net/mlx5/mlx5_testpmd.c
index 879ea2826e..cb0cafe1e9 100644
--- a/drivers/net/mlx5/mlx5_testpmd.c
+++ b/drivers/net/mlx5/mlx5_testpmd.c
@@ -561,6 +561,64 @@ cmdline_parse_inst_t mlx5_cmd_unmap_ext_rxq = {
 	}
 };
 
+/* Set flow engine mode with flags command. */
+struct mlx5_cmd_set_flow_engine_mode {
+	cmdline_fixed_string_t mlx5;
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t flow_engine;
+	uint8_t mode;
+	uint32_t flags;
+};
+
+
+static void
+mlx5_cmd_set_flow_engine_mode_parsed(void *parsed_result,
+				     __rte_unused struct cmdline *cl,
+				     __rte_unused void *data)
+{
+	struct mlx5_cmd_set_flow_engine_mode *res = parsed_result;
+	int ret;
+
+	ret = rte_pmd_mlx5_flow_engine_set_mode((enum mlx5_flow_engine_mode)res->mode, res->flags);
+
+	if (ret < 0)
+		fprintf(stderr, "Fail to set flow_engine to %s mode with flags %x, error %s\n",
+			!res->mode ? "active" : "standby", res->flags, strerror(-ret));
+	else
+		TESTPMD_LOG(DEBUG, "Set %d ports flow_engine to %s mode with flags %x\n", ret,
+			    !res->mode ? "active" : "standby", res->flags);
+}
+
+cmdline_parse_token_string_t mlx5_cmd_set_flow_engine_mode_mlx5 =
+	TOKEN_STRING_INITIALIZER(struct mlx5_cmd_set_flow_engine_mode, mlx5,
+				 "mlx5");
+cmdline_parse_token_string_t mlx5_cmd_set_flow_engine_mode_set =
+	TOKEN_STRING_INITIALIZER(struct mlx5_cmd_set_flow_engine_mode, set,
+				 "set");
+cmdline_parse_token_string_t mlx5_cmd_set_flow_engine_mode_flow_engine =
+	TOKEN_STRING_INITIALIZER(struct mlx5_cmd_set_flow_engine_mode, flow_engine,
+				 "flow_engine");
+cmdline_parse_token_num_t mlx5_cmd_set_flow_engine_mode_mode =
+	TOKEN_NUM_INITIALIZER(struct mlx5_cmd_set_flow_engine_mode, mode,
+			      RTE_UINT8);
+cmdline_parse_token_num_t mlx5_cmd_set_flow_engine_mode_flags =
+	TOKEN_NUM_INITIALIZER(struct mlx5_cmd_set_flow_engine_mode, flags,
+			      RTE_UINT32);
+
+cmdline_parse_inst_t mlx5_cmd_set_flow_engine_mode = {
+	.f = &mlx5_cmd_set_flow_engine_mode_parsed,
+	.data = NULL,
+	.help_str = "mlx5 set flow_engine <0|1> (flag)",
+	.tokens = {
+		(void *)&mlx5_cmd_set_flow_engine_mode_mlx5,
+		(void *)&mlx5_cmd_set_flow_engine_mode_set,
+		(void *)&mlx5_cmd_set_flow_engine_mode_flow_engine,
+		(void *)&mlx5_cmd_set_flow_engine_mode_mode,
+		(void *)&mlx5_cmd_set_flow_engine_mode_flags,
+		NULL,
+	}
+};
+
 static struct testpmd_driver_commands mlx5_driver_cmds = {
 	.commands = {
 		{
@@ -588,6 +646,11 @@ static struct testpmd_driver_commands mlx5_driver_cmds = {
 			.help = "mlx5 port (port_id) ext_rxq unmap (sw_queue_id)\n"
 				"    Unmap external Rx queue ethdev index mapping\n\n",
 		},
+		{
+			.ctx = &mlx5_cmd_set_flow_engine_mode,
+			.help = "mlx5 set flow_engine (mode) (flag)\n"
+				"    Set flow_engine to the specific mode with flags.\n\n"
+		},
 		{
 			.ctx = NULL,
 		},
-- 
2.27.0


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

* RE: [PATCH v1] net/mlx5: add test for hot upgrade
  2023-05-16  5:41 [PATCH v1] net/mlx5: add test for hot upgrade Rongwei Liu
@ 2023-06-19 12:09 ` Raslan Darawsheh
  2023-06-26 20:22 ` Thomas Monjalon
  1 sibling, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2023-06-19 12:09 UTC (permalink / raw)
  To: Rongwei Liu, dev, Matan Azrad, Slava Ovsiienko, Ori Kam,
	NBU-Contact-Thomas Monjalon (EXTERNAL)

Hi,

> -----Original Message-----
> From: Rongwei Liu <rongweil@nvidia.com>
> Sent: Tuesday, May 16, 2023 8:42 AM
> To: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>
> Subject: [PATCH v1] net/mlx5: add test for hot upgrade
> 
> This patch adds testpmd app a runtime function to test the hot
> upgrade API.
> 
>     testpmd> mlx5 set flow_engine <0|1> (flag)
> 0 stands for active mode while 1 for standby mode.
> 
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [PATCH v1] net/mlx5: add test for hot upgrade
  2023-05-16  5:41 [PATCH v1] net/mlx5: add test for hot upgrade Rongwei Liu
  2023-06-19 12:09 ` Raslan Darawsheh
@ 2023-06-26 20:22 ` Thomas Monjalon
  2023-09-18 12:17   ` Rongwei Liu
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2023-06-26 20:22 UTC (permalink / raw)
  To: Rongwei Liu, rasland; +Cc: dev, matan, viacheslavo, orika, Maayan Kashani

16/05/2023 07:41, Rongwei Liu:
> This patch adds testpmd app a runtime function to test the hot
> upgrade API.
> 
>     testpmd> mlx5 set flow_engine <0|1> (flag)
> 0 stands for active mode while 1 for standby mode.
> 
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
> --- a/doc/guides/nics/mlx5.rst
> +++ b/doc/guides/nics/mlx5.rst
> @@ -2057,3 +2057,13 @@ where:
>  * ``sw_queue_id``: queue index in range [64536, 65535].
>    This range is the highest 1000 numbers.
>  * ``hw_queue_id``: queue index given by HW in queue creation.
> +
> +Set Flow Engine Mode
> +^^^^^^^^^^^^^^^^^^^^

The title is made as a sub-section of "port map external Rx queue",
which looks wrong.

> +
> +Set the flow engine to active(0) or standby(1) mode with specific flags::
> +   testpmd> mlx5 set flow_engine <0|1> (flags)

It should be said it is for testing live migration.

Also the flags are not described. Should we pass an integer?

> +
> +This command works for software steering only.
> +Default FDB jump should be disabled if switchdev is enabled.
> +The mode will propagate to all the probed ports.

For the reasons above, I prefer not pulling this patch in the main branch.



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

* RE: [PATCH v1] net/mlx5: add test for hot upgrade
  2023-06-26 20:22 ` Thomas Monjalon
@ 2023-09-18 12:17   ` Rongwei Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Rongwei Liu @ 2023-09-18 12:17 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon (EXTERNAL), Raslan Darawsheh
  Cc: dev, Matan Azrad, Slava Ovsiienko, Ori Kam, Maayan Kashani

Hi Thomas:

BR
Rongwei

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, June 27, 2023 04:23
> To: Rongwei Liu <rongweil@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Maayan Kashani
> <mkashani@nvidia.com>
> Subject: Re: [PATCH v1] net/mlx5: add test for hot upgrade
> 
> External email: Use caution opening links or attachments
> 
> 
> 16/05/2023 07:41, Rongwei Liu:
> > This patch adds testpmd app a runtime function to test the hot upgrade
> > API.
> >
> >     testpmd> mlx5 set flow_engine <0|1> (flag)
> > 0 stands for active mode while 1 for standby mode.
> >
> > Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > ---
> > --- a/doc/guides/nics/mlx5.rst
> > +++ b/doc/guides/nics/mlx5.rst
> > @@ -2057,3 +2057,13 @@ where:
> >  * ``sw_queue_id``: queue index in range [64536, 65535].
> >    This range is the highest 1000 numbers.
> >  * ``hw_queue_id``: queue index given by HW in queue creation.
> > +
> > +Set Flow Engine Mode
> > +^^^^^^^^^^^^^^^^^^^^
> 
> The title is made as a sub-section of "port map external Rx queue", which
> looks wrong.
>
Will change the "^^^^" to "~~~~", totally in parallel with " port map external Rx queue "
> > +
> > +Set the flow engine to active(0) or standby(1) mode with specific flags::
> > +   testpmd> mlx5 set flow_engine <0|1> (flags)
> 
> It should be said it is for testing live migration.
> 
Sure.
> Also the flags are not described. Should we pass an integer?
> 
There is information to describe mode, like active(0)/standby(1).
Or we can change to this style:  "mlx5 set flow_engine <active|standby> [<flag>]"
> > +
> > +This command works for software steering only.
> > +Default FDB jump should be disabled if switchdev is enabled.
> > +The mode will propagate to all the probed ports.
> 
> For the reasons above, I prefer not pulling this patch in the main branch.
> 
This command line is a good starting point to play with mlx5 live migration feature.
Keeping it is user-friendly per my view.


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

end of thread, other threads:[~2023-09-18 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16  5:41 [PATCH v1] net/mlx5: add test for hot upgrade Rongwei Liu
2023-06-19 12:09 ` Raslan Darawsheh
2023-06-26 20:22 ` Thomas Monjalon
2023-09-18 12:17   ` Rongwei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).