diff mbox series

[v6,2/3] app/testpmd: support ethdev rss level config

Message ID 20200821110330.214931-2-kirankumark@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series [v6,1/3] ethdev: add level support for RSS offload types | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kiran Kumar Kokkilagadda Aug. 21, 2020, 11:03 a.m. UTC
From: Kiran Kumar K <kirankumark@marvell.com>

Adding support to set RSS level from ethdev config.
level-inner is default and will set the RSS level to inner layers.
level-outer will set the RSS level to outer layers.
level-inner-outer will set the RSS level to both inner and outer
layers.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
 app/test-pmd/cmdline.c    | 11 ++++++++++-
 app/test-pmd/parameters.c |  6 ++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

Comments

Ajit Khaparde Aug. 29, 2020, 12:48 a.m. UTC | #1
On Fri, Aug 21, 2020 at 4:04 AM <kirankumark@marvell.com> wrote:

> From: Kiran Kumar K <kirankumark@marvell.com>
>
> Adding support to set RSS level from ethdev config.
> level-inner is default and will set the RSS level to inner layers.
> level-outer will set the RSS level to outer layers.
> level-inner-outer will set the RSS level to both inner and outer
> layers.


> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> ---
>  app/test-pmd/cmdline.c    | 11 ++++++++++-
>  app/test-pmd/parameters.c |  6 ++++++
>  2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 0a6ed85f3..4eafee8c8 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -2334,7 +2334,16 @@ cmd_config_rss_parsed(void *parsed_result,
>                 rss_conf.rss_hf = ETH_RSS_GTPU;
>         else if (!strcmp(res->value, "none"))
>                 rss_conf.rss_hf = 0;
> -       else if (!strcmp(res->value, "default"))
> +       else if (!strcmp(res->value, "level-inner")) {
> +               rss_hf &= (~ETH_RSS_LEVEL_MASK);
> +               rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_INNER);
> +       } else if (!strcmp(res->value, "level-outer")) {
> +               rss_hf &= (~ETH_RSS_LEVEL_MASK);
> +               rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_OUTER);
> +       } else if (!strcmp(res->value, "level-inner-outer")) {
> +               rss_hf &= (~ETH_RSS_LEVEL_MASK);
> +               rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_INNER_OUTER);
> +       } else if (!strcmp(res->value, "default"))
>
Thanks for this. But I think
You will have to add these options to cmd_help_long_parsed() under
port config all rss (all|....
level-outer|level-inner|level-inner-outer

Also cmd_config_rss.help_str needs to be extended to show the new options.
level-inner|inner-outer|level-inner-outer



>                 use_default = 1;
>         else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
>                                                 atoi(res->value) < 64)
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 7cb0e3d6e..5f669ff24 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -632,6 +632,8 @@ launch_args_parse(int argc, char** argv)
>                 { "forward-mode",               1, 0, 0 },
>                 { "rss-ip",                     0, 0, 0 },
>                 { "rss-udp",                    0, 0, 0 },
> +               { "rss-outer",                  0, 0, 0 },
> +               { "rss-inner-outer",            0, 0, 0 },
>
You will have to add the new args to usage()
"--rss-ip | --rss-udp | --rss-outer | --rss-inner-outer | "

and add some description for the new options..

printf("  --rss-outer: set RSS hash level to outer");
printf("  --rss-inner-outer: set RSS hash level to default");

>                 { "rxq",                        1, 0, 0 },
>                 { "txq",                        1, 0, 0 },
>                 { "rxd",                        1, 0, 0 },
> @@ -1051,6 +1053,10 @@ launch_args_parse(int argc, char** argv)
>                                 rss_hf = ETH_RSS_IP;
>                         if (!strcmp(lgopts[opt_idx].name, "rss-udp"))
>                                 rss_hf = ETH_RSS_UDP;
> +                       if (!strcmp(lgopts[opt_idx].name, "rss-outer"))
> +                               rss_hf |= ETH_RSS_LEVEL_OUTER;
> +                       if (!strcmp(lgopts[opt_idx].name,
> "rss-inner-outer"))
> +                               rss_hf |= ETH_RSS_LEVEL_INNER_OUTER;
>                         if (!strcmp(lgopts[opt_idx].name, "rxq")) {
>                                 n = atoi(optarg);
>                                 if (n >= 0 && check_nb_rxq((queueid_t)n)
> == 0)
> --
> 2.25.1
>
>
diff mbox series

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0a6ed85f3..4eafee8c8 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2334,7 +2334,16 @@  cmd_config_rss_parsed(void *parsed_result,
 		rss_conf.rss_hf = ETH_RSS_GTPU;
 	else if (!strcmp(res->value, "none"))
 		rss_conf.rss_hf = 0;
-	else if (!strcmp(res->value, "default"))
+	else if (!strcmp(res->value, "level-inner")) {
+		rss_hf &= (~ETH_RSS_LEVEL_MASK);
+		rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_INNER);
+	} else if (!strcmp(res->value, "level-outer")) {
+		rss_hf &= (~ETH_RSS_LEVEL_MASK);
+		rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_OUTER);
+	} else if (!strcmp(res->value, "level-inner-outer")) {
+		rss_hf &= (~ETH_RSS_LEVEL_MASK);
+		rss_conf.rss_hf = (rss_hf | ETH_RSS_LEVEL_INNER_OUTER);
+	} else if (!strcmp(res->value, "default"))
 		use_default = 1;
 	else if (isdigit(res->value[0]) && atoi(res->value) > 0 &&
 						atoi(res->value) < 64)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 7cb0e3d6e..5f669ff24 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -632,6 +632,8 @@  launch_args_parse(int argc, char** argv)
 		{ "forward-mode",               1, 0, 0 },
 		{ "rss-ip",			0, 0, 0 },
 		{ "rss-udp",			0, 0, 0 },
+		{ "rss-outer",			0, 0, 0 },
+		{ "rss-inner-outer",		0, 0, 0 },
 		{ "rxq",			1, 0, 0 },
 		{ "txq",			1, 0, 0 },
 		{ "rxd",			1, 0, 0 },
@@ -1051,6 +1053,10 @@  launch_args_parse(int argc, char** argv)
 				rss_hf = ETH_RSS_IP;
 			if (!strcmp(lgopts[opt_idx].name, "rss-udp"))
 				rss_hf = ETH_RSS_UDP;
+			if (!strcmp(lgopts[opt_idx].name, "rss-outer"))
+				rss_hf |= ETH_RSS_LEVEL_OUTER;
+			if (!strcmp(lgopts[opt_idx].name, "rss-inner-outer"))
+				rss_hf |= ETH_RSS_LEVEL_INNER_OUTER;
 			if (!strcmp(lgopts[opt_idx].name, "rxq")) {
 				n = atoi(optarg);
 				if (n >= 0 && check_nb_rxq((queueid_t)n) == 0)