All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net/mlx5: fix flow priority for queue action
@ 2017-10-13 12:09 Nelio Laranjeiro
  2017-10-13 12:09 ` [PATCH 2/2] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-13 12:09 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil

Priority is wrongly configured when the action is queue, using the Ethernet
layer priority instead of the most specific layer found.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2b6380fb9..440bda9a1 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1172,8 +1172,18 @@ priv_flow_convert(struct priv *priv,
 	 * Last step. Complete missing specification to reach the RSS
 	 * configuration.
 	 */
-	if (parser->queues_n > 1)
+	if (parser->queues_n > 1) {
 		priv_flow_convert_finalise(priv, parser);
+	} else if (!parser->drop) {
+		/*
+		 * Action queue have their priority overridden with
+		 * Ethernet priority, this priority needs to be adjusted to
+		 * their most specific layer priority.
+		 */
+		parser->queue[HASH_RXQ_ETH].ibv_attr->priority =
+			attr->priority +
+			hash_rxq_init[parser->layer].flow_priority;
+	}
 exit_free:
 	/* Only verification is expected, all resources should be released. */
 	if (!parser->create) {
-- 
2.11.0

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

* [PATCH 2/2] app/testpmd: fix RSS structure initialisation
  2017-10-13 12:09 [PATCH 1/2] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
@ 2017-10-13 12:09 ` Nelio Laranjeiro
  2017-10-20 19:46   ` [dpdk-stable] " Ferruh Yigit
  2017-10-23  9:44 ` [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-13 12:09 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil, ivan.boule, stable

Struct rss_conf.rss_key_len is not initialised forcing the user to verify
the rss_conf.rss_key pointer to know if the key is present or not.
rss_conf.rss_key_len should have a valid length according to the size of
the rss_key pointed.

Fixes: 560e02ee5237 ("app/testpmd: configure RSS without restart")
Cc: ivan.boule@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 app/test-pmd/cmdline.c      | 2 +-
 drivers/net/mlx5/mlx5_rss.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 120460452..abbe52ad6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1750,7 +1750,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			__attribute__((unused)) void *data)
 {
 	struct cmd_config_rss *res = parsed_result;
-	struct rte_eth_rss_conf rss_conf;
+	struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
 	int diag;
 	uint8_t i;
 
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index ad6d9ab70..dd9ddf2e0 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -72,7 +72,7 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
 	int ret = 0;
 
 	priv_lock(priv);
-	if (rss_conf->rss_key_len) {
+	if (rss_conf->rss_key && rss_conf->rss_key_len) {
 		priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
 						     rss_conf->rss_key_len, 0);
 		if (!priv->rss_conf.rss_key) {
-- 
2.11.0

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

* Re: [dpdk-stable] [PATCH 2/2] app/testpmd: fix RSS structure initialisation
  2017-10-13 12:09 ` [PATCH 2/2] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
@ 2017-10-20 19:46   ` Ferruh Yigit
  0 siblings, 0 replies; 13+ messages in thread
From: Ferruh Yigit @ 2017-10-20 19:46 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev; +Cc: Yongseok Koh, Adrien Mazarguil, ivan.boule, stable

On 10/13/2017 5:09 AM, Nelio Laranjeiro wrote:
> Struct rss_conf.rss_key_len is not initialised forcing the user to verify
> the rss_conf.rss_key pointer to know if the key is present or not.
> rss_conf.rss_key_len should have a valid length according to the size of
> the rss_key pointed.
> 
> Fixes: 560e02ee5237 ("app/testpmd: configure RSS without restart")
> Cc: ivan.boule@6wind.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> Acked-by: Yongseok Koh <yskoh@mellanox.com>
> ---
>  app/test-pmd/cmdline.c      | 2 +-
>  drivers/net/mlx5/mlx5_rss.c | 2 +-

Hi Nelio,

Can you please separate test-pmd and driver patch please?

Thanks,
ferruh

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

* [PATCH 0/3] net/mlx5: bugfixes
  2017-10-13 12:09 [PATCH 1/2] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
  2017-10-13 12:09 ` [PATCH 2/2] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
@ 2017-10-23  9:44 ` Nelio Laranjeiro
  2017-10-23 11:17   ` [PATCH v3 0/3] net/mlx5: bug fixes Nelio Laranjeiro
                     ` (3 more replies)
  2017-10-23  9:44 ` [PATCH 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
                   ` (2 subsequent siblings)
  4 siblings, 4 replies; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23  9:44 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil

Changes in v2:

 * Split last second commit in two, one for testpmd the second one for the PMD
 * Re-work "net/mlx5: fix RSS hash update" to also fix a bug introduced in the
   hash_get() blocking the update.

Nelio Laranjeiro (3):
  net/mlx5: fix flow priority for queue action
  app/testpmd: fix RSS structure initialisation
  net/mlx5: fix RSS hash update

 app/test-pmd/cmdline.c       |  2 +-
 drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++-
 drivers/net/mlx5/mlx5_rss.c  | 25 +++++++++++--------------
 3 files changed, 23 insertions(+), 16 deletions(-)

-- 
2.11.0

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

* [PATCH 1/3] net/mlx5: fix flow priority for queue action
  2017-10-13 12:09 [PATCH 1/2] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
  2017-10-13 12:09 ` [PATCH 2/2] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
  2017-10-23  9:44 ` [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
@ 2017-10-23  9:44 ` Nelio Laranjeiro
  2017-10-23  9:45 ` [PATCH 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
  2017-10-23  9:45 ` [PATCH 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro
  4 siblings, 0 replies; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23  9:44 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil

Priority is wrongly configured when the action is queue, using the Ethernet
layer priority instead of the most specific layer found.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2b6380fb9..440bda9a1 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1172,8 +1172,18 @@ priv_flow_convert(struct priv *priv,
 	 * Last step. Complete missing specification to reach the RSS
 	 * configuration.
 	 */
-	if (parser->queues_n > 1)
+	if (parser->queues_n > 1) {
 		priv_flow_convert_finalise(priv, parser);
+	} else if (!parser->drop) {
+		/*
+		 * Action queue have their priority overridden with
+		 * Ethernet priority, this priority needs to be adjusted to
+		 * their most specific layer priority.
+		 */
+		parser->queue[HASH_RXQ_ETH].ibv_attr->priority =
+			attr->priority +
+			hash_rxq_init[parser->layer].flow_priority;
+	}
 exit_free:
 	/* Only verification is expected, all resources should be released. */
 	if (!parser->create) {
-- 
2.11.0

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

* [PATCH 2/3] app/testpmd: fix RSS structure initialisation
  2017-10-13 12:09 [PATCH 1/2] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
                   ` (2 preceding siblings ...)
  2017-10-23  9:44 ` [PATCH 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
@ 2017-10-23  9:45 ` Nelio Laranjeiro
  2017-10-23  9:45 ` [PATCH 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro
  4 siblings, 0 replies; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23  9:45 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil, ivan.boule, stable

Struct rss_conf.rss_key_len is not initialised forcing the user to verify
the rss_conf.rss_key pointer to know if the key is present or not.
rss_conf.rss_key_len should have a valid length according to the size of
the rss_key pointed.

Fixes: 560e02ee5237 ("app/testpmd: configure RSS without restart")
Cc: ivan.boule@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index bb01e989a..7002ff2c1 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1750,7 +1750,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			__attribute__((unused)) void *data)
 {
 	struct cmd_config_rss *res = parsed_result;
-	struct rte_eth_rss_conf rss_conf;
+	struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
 	int diag;
 	uint8_t i;
 
-- 
2.11.0

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

* [PATCH 3/3] net/mlx5: fix RSS hash update
  2017-10-13 12:09 [PATCH 1/2] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
                   ` (3 preceding siblings ...)
  2017-10-23  9:45 ` [PATCH 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
@ 2017-10-23  9:45 ` Nelio Laranjeiro
  4 siblings, 0 replies; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23  9:45 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil

Few bugs fixes in both configuration get and hash update where inputs are
not handled as expected by the ethdev layer.

RSS structure may not be totally usable, the PMD should try to take as most
information from it has it can when it is an hash update or it should try
to fill as most as possible in the configuration get.
This means that in the RSS configuration structure, the memory space for
the RSS hash key may not be present, but the PMD should consider the hash
field valid and process/set it.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_rss.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index ad6d9ab70..f3de46de0 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -72,14 +72,14 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
 	int ret = 0;
 
 	priv_lock(priv);
-	if (rss_conf->rss_key_len) {
+	if (rss_conf->rss_key && rss_conf->rss_key_len) {
 		priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
 						     rss_conf->rss_key_len, 0);
 		if (!priv->rss_conf.rss_key) {
 			ret = -ENOMEM;
 			goto out;
 		}
-		memcpy(&priv->rss_conf.rss_key, rss_conf->rss_key,
+		memcpy(priv->rss_conf.rss_key, rss_conf->rss_key,
 		       rss_conf->rss_key_len);
 		priv->rss_conf.rss_key_len = rss_conf->rss_key_len;
 	}
@@ -105,22 +105,19 @@ mlx5_rss_hash_conf_get(struct rte_eth_dev *dev,
 		       struct rte_eth_rss_conf *rss_conf)
 {
 	struct priv *priv = dev->data->dev_private;
-	int ret = 0;
 
+	if (!rss_conf)
+		return -EINVAL;
 	priv_lock(priv);
-	if (!rss_conf->rss_key) {
-		ret = -ENOMEM;
-		goto out;
-	}
-	if (rss_conf->rss_key_len < priv->rss_conf.rss_key_len) {
-		ret = -EINVAL;
-		goto out;
+	if (rss_conf->rss_key &&
+	    (rss_conf->rss_key_len >= priv->rss_conf.rss_key_len)) {
+		memcpy(rss_conf->rss_key, priv->rss_conf.rss_key,
+		       priv->rss_conf.rss_key_len);
 	}
-	memcpy(rss_conf->rss_key, priv->rss_conf.rss_key,
-	       priv->rss_conf.rss_key_len);
-out:
+	rss_conf->rss_key_len = priv->rss_conf.rss_key_len;
+	rss_conf->rss_hf = priv->rss_conf.rss_hf;
 	priv_unlock(priv);
-	return ret;
+	return 0;
 }
 
 /**
-- 
2.11.0

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

* [PATCH v3 0/3] net/mlx5: bug fixes
  2017-10-23  9:44 ` [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
@ 2017-10-23 11:17   ` Nelio Laranjeiro
  2017-10-23 21:30     ` Ferruh Yigit
  2017-10-23 11:17   ` [PATCH v3 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23 11:17 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil

Changes in v3:

 * Add missing "fixes" tag in the last commit.

Changes in v2:

 * Split last second commit in two, one for testpmd the second one for the PMD
 * Re-work "net/mlx5: fix RSS hash update" to also fix a bug introduced in the
   hash_get() blocking the update.

Nelio Laranjeiro (3):
  net/mlx5: fix flow priority for queue action
  app/testpmd: fix RSS structure initialisation
  net/mlx5: fix RSS hash update

 app/test-pmd/cmdline.c       |  2 +-
 drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++-
 drivers/net/mlx5/mlx5_rss.c  | 25 +++++++++++--------------
 3 files changed, 23 insertions(+), 16 deletions(-)

-- 
2.11.0

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

* [PATCH v3 1/3] net/mlx5: fix flow priority for queue action
  2017-10-23  9:44 ` [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
  2017-10-23 11:17   ` [PATCH v3 0/3] net/mlx5: bug fixes Nelio Laranjeiro
@ 2017-10-23 11:17   ` Nelio Laranjeiro
  2017-10-23 11:17   ` [PATCH v3 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
  2017-10-23 11:17   ` [PATCH v3 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro
  3 siblings, 0 replies; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23 11:17 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil

Priority is wrongly configured when the action is queue, using the Ethernet
layer priority instead of the most specific layer found.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2b6380fb9..440bda9a1 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1172,8 +1172,18 @@ priv_flow_convert(struct priv *priv,
 	 * Last step. Complete missing specification to reach the RSS
 	 * configuration.
 	 */
-	if (parser->queues_n > 1)
+	if (parser->queues_n > 1) {
 		priv_flow_convert_finalise(priv, parser);
+	} else if (!parser->drop) {
+		/*
+		 * Action queue have their priority overridden with
+		 * Ethernet priority, this priority needs to be adjusted to
+		 * their most specific layer priority.
+		 */
+		parser->queue[HASH_RXQ_ETH].ibv_attr->priority =
+			attr->priority +
+			hash_rxq_init[parser->layer].flow_priority;
+	}
 exit_free:
 	/* Only verification is expected, all resources should be released. */
 	if (!parser->create) {
-- 
2.11.0

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

* [PATCH v3 2/3] app/testpmd: fix RSS structure initialisation
  2017-10-23  9:44 ` [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
  2017-10-23 11:17   ` [PATCH v3 0/3] net/mlx5: bug fixes Nelio Laranjeiro
  2017-10-23 11:17   ` [PATCH v3 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
@ 2017-10-23 11:17   ` Nelio Laranjeiro
  2017-10-23 11:17   ` [PATCH v3 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro
  3 siblings, 0 replies; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23 11:17 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil, ivan.boule, stable

Struct rss_conf.rss_key_len is not initialised forcing the user to verify
the rss_conf.rss_key pointer to know if the key is present or not.
rss_conf.rss_key_len should have a valid length according to the size of
the rss_key pointed.

Fixes: 560e02ee5237 ("app/testpmd: configure RSS without restart")
Cc: ivan.boule@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index bb01e989a..7002ff2c1 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1750,7 +1750,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			__attribute__((unused)) void *data)
 {
 	struct cmd_config_rss *res = parsed_result;
-	struct rte_eth_rss_conf rss_conf;
+	struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
 	int diag;
 	uint8_t i;
 
-- 
2.11.0

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

* [PATCH v3 3/3] net/mlx5: fix RSS hash update
  2017-10-23  9:44 ` [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
                     ` (2 preceding siblings ...)
  2017-10-23 11:17   ` [PATCH v3 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
@ 2017-10-23 11:17   ` Nelio Laranjeiro
  2017-10-23 18:54     ` Yongseok Koh
  3 siblings, 1 reply; 13+ messages in thread
From: Nelio Laranjeiro @ 2017-10-23 11:17 UTC (permalink / raw)
  To: dev; +Cc: Yongseok Koh, Adrien Mazarguil

Few bugs fixes in both configuration get and hash update where inputs are
not handled as expected by the ethdev layer.

RSS structure may not be totally usable, the PMD should try to take as most
information from it has it can when it is an hash update or it should try
to fill as most as possible in the configuration get.
This means that in the RSS configuration structure, the memory space for
the RSS hash key may not be present, but the PMD should consider the hash
field valid and process/set it.

Fixes: 29c1d8bb3e79 ("net/mlx5: handle a single RSS hash key for all protocols")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_rss.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index ad6d9ab70..f3de46de0 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -72,14 +72,14 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
 	int ret = 0;
 
 	priv_lock(priv);
-	if (rss_conf->rss_key_len) {
+	if (rss_conf->rss_key && rss_conf->rss_key_len) {
 		priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
 						     rss_conf->rss_key_len, 0);
 		if (!priv->rss_conf.rss_key) {
 			ret = -ENOMEM;
 			goto out;
 		}
-		memcpy(&priv->rss_conf.rss_key, rss_conf->rss_key,
+		memcpy(priv->rss_conf.rss_key, rss_conf->rss_key,
 		       rss_conf->rss_key_len);
 		priv->rss_conf.rss_key_len = rss_conf->rss_key_len;
 	}
@@ -105,22 +105,19 @@ mlx5_rss_hash_conf_get(struct rte_eth_dev *dev,
 		       struct rte_eth_rss_conf *rss_conf)
 {
 	struct priv *priv = dev->data->dev_private;
-	int ret = 0;
 
+	if (!rss_conf)
+		return -EINVAL;
 	priv_lock(priv);
-	if (!rss_conf->rss_key) {
-		ret = -ENOMEM;
-		goto out;
-	}
-	if (rss_conf->rss_key_len < priv->rss_conf.rss_key_len) {
-		ret = -EINVAL;
-		goto out;
+	if (rss_conf->rss_key &&
+	    (rss_conf->rss_key_len >= priv->rss_conf.rss_key_len)) {
+		memcpy(rss_conf->rss_key, priv->rss_conf.rss_key,
+		       priv->rss_conf.rss_key_len);
 	}
-	memcpy(rss_conf->rss_key, priv->rss_conf.rss_key,
-	       priv->rss_conf.rss_key_len);
-out:
+	rss_conf->rss_key_len = priv->rss_conf.rss_key_len;
+	rss_conf->rss_hf = priv->rss_conf.rss_hf;
 	priv_unlock(priv);
-	return ret;
+	return 0;
 }
 
 /**
-- 
2.11.0

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

* Re: [PATCH v3 3/3] net/mlx5: fix RSS hash update
  2017-10-23 11:17   ` [PATCH v3 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro
@ 2017-10-23 18:54     ` Yongseok Koh
  0 siblings, 0 replies; 13+ messages in thread
From: Yongseok Koh @ 2017-10-23 18:54 UTC (permalink / raw)
  To: Nélio Laranjeiro; +Cc: dev, Adrien Mazarguil


> On Oct 23, 2017, at 4:17 AM, Nelio Laranjeiro <nelio.laranjeiro@6wind.com> wrote:
> 
> Few bugs fixes in both configuration get and hash update where inputs are
> not handled as expected by the ethdev layer.
> 
> RSS structure may not be totally usable, the PMD should try to take as most
> information from it has it can when it is an hash update or it should try
> to fill as most as possible in the configuration get.
> This means that in the RSS configuration structure, the memory space for
> the RSS hash key may not be present, but the PMD should consider the hash
> field valid and process/set it.
> 
> Fixes: 29c1d8bb3e79 ("net/mlx5: handle a single RSS hash key for all protocols")
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks

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

* Re: [PATCH v3 0/3] net/mlx5: bug fixes
  2017-10-23 11:17   ` [PATCH v3 0/3] net/mlx5: bug fixes Nelio Laranjeiro
@ 2017-10-23 21:30     ` Ferruh Yigit
  0 siblings, 0 replies; 13+ messages in thread
From: Ferruh Yigit @ 2017-10-23 21:30 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev; +Cc: Yongseok Koh, Adrien Mazarguil

On 10/23/2017 4:17 AM, Nelio Laranjeiro wrote:
> Changes in v3:
> 
>  * Add missing "fixes" tag in the last commit.
> 
> Changes in v2:
> 
>  * Split last second commit in two, one for testpmd the second one for the PMD
>  * Re-work "net/mlx5: fix RSS hash update" to also fix a bug introduced in the
>    hash_get() blocking the update.
> 
> Nelio Laranjeiro (3):
>   net/mlx5: fix flow priority for queue action
>   app/testpmd: fix RSS structure initialisation
>   net/mlx5: fix RSS hash update

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

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

end of thread, other threads:[~2017-10-23 21:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13 12:09 [PATCH 1/2] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
2017-10-13 12:09 ` [PATCH 2/2] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
2017-10-20 19:46   ` [dpdk-stable] " Ferruh Yigit
2017-10-23  9:44 ` [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
2017-10-23 11:17   ` [PATCH v3 0/3] net/mlx5: bug fixes Nelio Laranjeiro
2017-10-23 21:30     ` Ferruh Yigit
2017-10-23 11:17   ` [PATCH v3 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
2017-10-23 11:17   ` [PATCH v3 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
2017-10-23 11:17   ` [PATCH v3 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro
2017-10-23 18:54     ` Yongseok Koh
2017-10-23  9:44 ` [PATCH 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
2017-10-23  9:45 ` [PATCH 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
2017-10-23  9:45 ` [PATCH 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro

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.