net/mlx5: fix flow priority for queue action
PATCH 1/2 net/mlx5: fix flow priority for queue action
Priority is wrongly configured when the action is queue, using the Ethernet layer priority instead of the most specific layer found.
--- drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow.c +11 -1
@@ -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) {
Signature · 1 line
2.11.0
PATCH 2/2 app/testpmd: fix RSS structure initialisation
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.
--- app/test-pmd/cmdline.c | 2 +- drivers/net/mlx5/mlx5_rss.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline.c +1 -1
@@ -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;
drivers/net/mlx5/mlx5_rss.c +1 -1
@@ -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) {
Signature · 1 line
2.11.0
Re: [dpdk-stable] [PATCH 2/2] app/testpmd: fix RSS structure initialisation
Quoted 9 lines · Nelio Laranjeiro
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_keypointed.Fixes 560e02ee5237 ("app/testpmd: configure RSS without restart")
Quoted 5 lines
Signed-off-by Nelio Laranjeiro <[email protected]>Acked-by Yongseok Koh <[email protected]>--- 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
cover net/mlx5: bugfixes
In reply to Nelio LaranjeiroChanges 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(-)
Signature · 1 line
2.11.0
PATCH 1/3 net/mlx5: fix flow priority for queue action
Priority is wrongly configured when the action is queue, using the Ethernet layer priority instead of the most specific layer found.
--- drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow.c +11 -1
@@ -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) {
Signature · 1 line
2.11.0
PATCH 2/3 app/testpmd: fix RSS structure initialisation
In reply to Nelio LaranjeiroStruct 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.
--- app/test-pmd/cmdline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
@@ -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;
Signature · 1 line
2.11.0
PATCH 3/3 net/mlx5: fix RSS hash update
In reply to Nelio LaranjeiroFew 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.
--- drivers/net/mlx5/mlx5_rss.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/net/mlx5/mlx5_rss.c +11 -14
@@ -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 ; }/**
Signature · 1 line
2.11.0
v3 cover net/mlx5: bug fixes
In reply to Nelio LaranjeiroChanges 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(-)
Signature · 1 line
2.11.0
PATCH v3 1/3 net/mlx5: fix flow priority for queue action
Priority is wrongly configured when the action is queue, using the Ethernet layer priority instead of the most specific layer found.
--- drivers/net/mlx5/mlx5_flow.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow.c +11 -1
@@ -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) {
Signature · 1 line
2.11.0
PATCH v3 2/3 app/testpmd: fix RSS structure initialisation
In reply to Nelio LaranjeiroStruct 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.
--- app/test-pmd/cmdline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
@@ -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;
Signature · 1 line
2.11.0
PATCH v3 3/3 net/mlx5: fix RSS hash update
In reply to Nelio LaranjeiroFew 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.
--- drivers/net/mlx5/mlx5_rss.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/net/mlx5/mlx5_rss.c +11 -14
@@ -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 ; }/**
Signature · 1 line
2.11.0
Re: [PATCH v3 3/3] net/mlx5: fix RSS hash update
Quoted 13 lines · Nelio Laranjeiro
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.
Quoted 4 lines
Fixes 29c1d8bb3e79 ("net/mlx5: handle a single RSS hash key for all protocols")Signed-off-by Nelio Laranjeiro <[email protected]>---
Thanks
Re: [PATCH v3 0/3] net/mlx5: bug fixes
In reply to Nelio LaranjeiroQuoted 6 lines · Nelio Laranjeiro
Changes in v3:
* Add missing "fixes" tag in the last commit.
Changes in v2:
Quoted 8 lines
* 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 thehash_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.