[v2,3/5] app/testpmd: fix RSS type display

Message ID 20210922095742.229262-4-maxime.coquelin@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series Virtio PMD RSS support & RSS fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Maxime Coquelin Sept. 22, 2021, 9:57 a.m. UTC
  This patch fixes the display of the RSS hash types
configured in the port, which displayed "all" even
if only a single type was configured

Fixes: 3c90743dd3b9 ("app/testpmd: support more types for flow RSS")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-pmd/config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Li, Xiaoyun Sept. 22, 2021, 12:01 p.m. UTC | #1
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Wednesday, September 22, 2021 17:58
> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>;
> amorenoz@redhat.com; david.marchand@redhat.com;
> andrew.rybchenko@oktetlabs.ru; Yigit, Ferruh <ferruh.yigit@intel.com>;
> michaelba@nvidia.com; viacheslavo@nvidia.com; Li, Xiaoyun
> <xiaoyun.li@intel.com>
> Cc: stable@dpdk.org; nelio.laranjeiro@6wind.com; yvugenfi@redhat.com;
> ybendito@redhat.com; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [PATCH v2 3/5] app/testpmd: fix RSS type display
> 
> This patch fixes the display of the RSS hash types configured in the port, which
> displayed "all" even if only a single type was configured
> 
> Fixes: 3c90743dd3b9 ("app/testpmd: support more types for flow RSS")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  app/test-pmd/config.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> 611965769c..9a4a0c232b 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -2833,7 +2833,9 @@ port_rss_hash_conf_show(portid_t port_id, int
> show_rss_key)
>  	}
>  	printf("RSS functions:\n ");
>  	for (i = 0; rss_type_table[i].str; i++) {
> -		if (rss_hf & rss_type_table[i].rss_type)
> +		if (rss_type_table[i].rss_type == 0)
> +			continue;
> +		if ((rss_hf & rss_type_table[i].rss_type) ==
> +rss_type_table[i].rss_type)
>  			printf("%s ", rss_type_table[i].str);
>  	}
>  	printf("\n");
> --
> 2.31.1

Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
  
Chenbo Xia Sept. 23, 2021, 7:59 a.m. UTC | #2
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Wednesday, September 22, 2021 5:58 PM
> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>; amorenoz@redhat.com;
> david.marchand@redhat.com; andrew.rybchenko@oktetlabs.ru; Yigit, Ferruh
> <ferruh.yigit@intel.com>; michaelba@nvidia.com; viacheslavo@nvidia.com; Li,
> Xiaoyun <xiaoyun.li@intel.com>
> Cc: stable@dpdk.org; nelio.laranjeiro@6wind.com; yvugenfi@redhat.com;
> ybendito@redhat.com; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [PATCH v2 3/5] app/testpmd: fix RSS type display
> 
> This patch fixes the display of the RSS hash types
> configured in the port, which displayed "all" even
> if only a single type was configured
> 
> Fixes: 3c90743dd3b9 ("app/testpmd: support more types for flow RSS")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  app/test-pmd/config.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 611965769c..9a4a0c232b 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -2833,7 +2833,9 @@ port_rss_hash_conf_show(portid_t port_id, int
> show_rss_key)
>  	}
>  	printf("RSS functions:\n ");
>  	for (i = 0; rss_type_table[i].str; i++) {
> -		if (rss_hf & rss_type_table[i].rss_type)
> +		if (rss_type_table[i].rss_type == 0)
> +			continue;
> +		if ((rss_hf & rss_type_table[i].rss_type) ==
> rss_type_table[i].rss_type)
>  			printf("%s ", rss_type_table[i].str);
>  	}
>  	printf("\n");
> --
> 2.31.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 611965769c..9a4a0c232b 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2833,7 +2833,9 @@  port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 	}
 	printf("RSS functions:\n ");
 	for (i = 0; rss_type_table[i].str; i++) {
-		if (rss_hf & rss_type_table[i].rss_type)
+		if (rss_type_table[i].rss_type == 0)
+			continue;
+		if ((rss_hf & rss_type_table[i].rss_type) == rss_type_table[i].rss_type)
 			printf("%s ", rss_type_table[i].str);
 	}
 	printf("\n");