All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fixed get RSS conf
@ 2018-12-21 13:01 Qiming Yang
  2018-12-21 14:25 ` [dpdk-stable] " Ferruh Yigit
  2018-12-24 15:34 ` [PATCH v2] net/i40e: " Qiming Yang
  0 siblings, 2 replies; 6+ messages in thread
From: Qiming Yang @ 2018-12-21 13:01 UTC (permalink / raw)
  To: dev; +Cc: Qiming Yang, stable

I40e do not allow to get rss hena only, need to get rss
key meanwhile.

Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 app/test-pmd/config.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index b9e5dd9..482c4f5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1764,8 +1764,7 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 		return;
 	}
 
-	/* Get RSS hash key if asked to display it */
-	rss_conf.rss_key = (show_rss_key) ? rss_key : NULL;
+	rss_conf.rss_key = rss_key;
 	rss_conf.rss_key_len = hash_key_size;
 	diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);
 	if (diag != 0) {
@@ -1793,6 +1792,8 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
 			printf("%s ", rss_type_table[i].str);
 	}
 	printf("\n");
+
+	/* Get RSS hash key if asked to display it */
 	if (!show_rss_key)
 		return;
 	printf("RSS key:\n");
-- 
2.9.5

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

* Re: [dpdk-stable] [PATCH] app/testpmd: fixed get RSS conf
  2018-12-21 13:01 [PATCH] app/testpmd: fixed get RSS conf Qiming Yang
@ 2018-12-21 14:25 ` Ferruh Yigit
  2018-12-24  7:26   ` Yang, Qiming
  2018-12-24 15:34 ` [PATCH v2] net/i40e: " Qiming Yang
  1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2018-12-21 14:25 UTC (permalink / raw)
  To: Qiming Yang, dev; +Cc: stable

On 12/21/2018 1:01 PM, Qiming Yang wrote:
> I40e do not allow to get rss hena only, need to get rss
> key meanwhile.

i40e_get_rss_key() returns error if 'rss_conf.rss_key' is NULL, this patch is
fixing the error case.

But instead of fixing this in application level, it can be better to fix in
driver level. Because 'rte_eth_dev_rss_hash_conf_get()' API doesn't dictate
'rss_conf.rss_key' to be not NULL, so any other application can cause same problem.

Possible solution can be to have an interim 'key' buffer in
'i40e_dev_rss_hash_conf_get()' and copy it to 'rss_conf.rss_key' if it is not NULL.

> 
> Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> ---
>  app/test-pmd/config.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index b9e5dd9..482c4f5 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1764,8 +1764,7 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
>  		return;
>  	}
>  
> -	/* Get RSS hash key if asked to display it */
> -	rss_conf.rss_key = (show_rss_key) ? rss_key : NULL;
> +	rss_conf.rss_key = rss_key;
>  	rss_conf.rss_key_len = hash_key_size;
>  	diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);
>  	if (diag != 0) {
> @@ -1793,6 +1792,8 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
>  			printf("%s ", rss_type_table[i].str);
>  	}
>  	printf("\n");
> +
> +	/* Get RSS hash key if asked to display it */
>  	if (!show_rss_key)
>  		return;
>  	printf("RSS key:\n");
> 

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

* Re: [dpdk-stable] [PATCH] app/testpmd: fixed get RSS conf
  2018-12-21 14:25 ` [dpdk-stable] " Ferruh Yigit
@ 2018-12-24  7:26   ` Yang, Qiming
  0 siblings, 0 replies; 6+ messages in thread
From: Yang, Qiming @ 2018-12-24  7:26 UTC (permalink / raw)
  To: Yigit, Ferruh, dev; +Cc: stable

Thanks Ferruh, will fix in driver level and then send v2 later.

-----Original Message-----
From: Yigit, Ferruh 
Sent: Friday, December 21, 2018 10:26 PM
To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] app/testpmd: fixed get RSS conf

On 12/21/2018 1:01 PM, Qiming Yang wrote:
> I40e do not allow to get rss hena only, need to get rss key meanwhile.

i40e_get_rss_key() returns error if 'rss_conf.rss_key' is NULL, this patch is fixing the error case.

But instead of fixing this in application level, it can be better to fix in driver level. Because 'rte_eth_dev_rss_hash_conf_get()' API doesn't dictate 'rss_conf.rss_key' to be not NULL, so any other application can cause same problem.

Possible solution can be to have an interim 'key' buffer in 'i40e_dev_rss_hash_conf_get()' and copy it to 'rss_conf.rss_key' if it is not NULL.

> 
> Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and 
> key")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> ---
>  app/test-pmd/config.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 
> b9e5dd9..482c4f5 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1764,8 +1764,7 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
>  		return;
>  	}
>  
> -	/* Get RSS hash key if asked to display it */
> -	rss_conf.rss_key = (show_rss_key) ? rss_key : NULL;
> +	rss_conf.rss_key = rss_key;
>  	rss_conf.rss_key_len = hash_key_size;
>  	diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf);
>  	if (diag != 0) {
> @@ -1793,6 +1792,8 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key)
>  			printf("%s ", rss_type_table[i].str);
>  	}
>  	printf("\n");
> +
> +	/* Get RSS hash key if asked to display it */
>  	if (!show_rss_key)
>  		return;
>  	printf("RSS key:\n");
> 


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

* Re: [PATCH v2] net/i40e: fixed get RSS conf
  2018-12-24 15:34 ` [PATCH v2] net/i40e: " Qiming Yang
@ 2018-12-24 12:39   ` Zhang, Qi Z
  2018-12-29  9:33   ` [PATCH v3] net/i40e: fix get RSS conf issue Qiming Yang
  1 sibling, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2018-12-24 12:39 UTC (permalink / raw)
  To: Yang, Qiming, dev; +Cc: Yigit, Ferruh, Yang, Qiming, stable

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> Sent: Monday, December 24, 2018 11:34 PM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] net/i40e: fixed get RSS conf

s/fixed/fix
> 
> rte_eth_dev_rss_hash_conf_get API doesn't force 'rss_conf.rss_key'
> to be not NULL, so rss_key = NULL should be alllowed in i40e driver.

s/alllowed/allowed
> 
> Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel with above typo fix.

Thanks
Qi

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

* [PATCH v2] net/i40e: fixed get RSS conf
  2018-12-21 13:01 [PATCH] app/testpmd: fixed get RSS conf Qiming Yang
  2018-12-21 14:25 ` [dpdk-stable] " Ferruh Yigit
@ 2018-12-24 15:34 ` Qiming Yang
  2018-12-24 12:39   ` Zhang, Qi Z
  2018-12-29  9:33   ` [PATCH v3] net/i40e: fix get RSS conf issue Qiming Yang
  1 sibling, 2 replies; 6+ messages in thread
From: Qiming Yang @ 2018-12-24 15:34 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Qiming Yang, stable

rte_eth_dev_rss_hash_conf_get API doesn't force 'rss_conf.rss_key'
to be not NULL, so rss_key = NULL should be alllowed in i40e
driver.

Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 8dc1a4a..a6b97e1 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -7407,7 +7407,7 @@ i40e_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len)
 	int ret;
 
 	if (!key || !key_len)
-		return -EINVAL;
+		return 0;
 
 	if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) {
 		ret = i40e_aq_get_rss_key(hw, vsi->vsi_id,
@@ -7492,6 +7492,9 @@ i40e_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	uint64_t hena;
 	int ret;
 
+	if (!rss_conf)
+		return -EINVAL;
+
 	ret = i40e_get_rss_key(pf->main_vsi, rss_conf->rss_key,
 			 &rss_conf->rss_key_len);
 	if (ret)
-- 
2.9.5

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

* [PATCH v3] net/i40e: fix get RSS conf issue
  2018-12-24 15:34 ` [PATCH v2] net/i40e: " Qiming Yang
  2018-12-24 12:39   ` Zhang, Qi Z
@ 2018-12-29  9:33   ` Qiming Yang
  1 sibling, 0 replies; 6+ messages in thread
From: Qiming Yang @ 2018-12-29  9:33 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, Qiming Yang, stable

rte_eth_dev_rss_hash_conf_get API doesn't force 'rss_conf.rss_key'
to be not NULL, so rss_key = NULL should be allowed in i40e
driver.

Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
Cc: stable@dpdk.org

Change-Id: I992847995cac44172694ea15ab30c4d1e7e48957
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 8dc1a4a..a6b97e1 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -7407,7 +7407,7 @@ i40e_get_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t *key_len)
 	int ret;
 
 	if (!key || !key_len)
-		return -EINVAL;
+		return 0;
 
 	if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) {
 		ret = i40e_aq_get_rss_key(hw, vsi->vsi_id,
@@ -7492,6 +7492,9 @@ i40e_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	uint64_t hena;
 	int ret;
 
+	if (!rss_conf)
+		return -EINVAL;
+
 	ret = i40e_get_rss_key(pf->main_vsi, rss_conf->rss_key,
 			 &rss_conf->rss_key_len);
 	if (ret)
-- 
2.9.5

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

end of thread, other threads:[~2018-12-29  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 13:01 [PATCH] app/testpmd: fixed get RSS conf Qiming Yang
2018-12-21 14:25 ` [dpdk-stable] " Ferruh Yigit
2018-12-24  7:26   ` Yang, Qiming
2018-12-24 15:34 ` [PATCH v2] net/i40e: " Qiming Yang
2018-12-24 12:39   ` Zhang, Qi Z
2018-12-29  9:33   ` [PATCH v3] net/i40e: fix get RSS conf issue Qiming Yang

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.