* [dpdk-dev] [PATCH] net/mlx5: fix flow RSS configuration
@ 2018-02-06 9:22 Nelio Laranjeiro
2018-02-06 11:39 ` Shahaf Shuler
0 siblings, 1 reply; 2+ messages in thread
From: Nelio Laranjeiro @ 2018-02-06 9:22 UTC (permalink / raw)
To: dev; +Cc: Adrien Mazarguil, Shahaf Shuler, Yongseok Koh, stable
An RSS configuration without a key is valid according to the
rte_eth_rss_conf API definition.
Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: stable@dpdk.org
Reported-by: Yuanhan Liu <yliu@fridaylinux.org>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
drivers/net/mlx5/mlx5_flow.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index ea90556d0..fd6f96083 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -514,7 +514,8 @@ mlx5_flow_item_validate(const struct rte_flow_item *item,
}
/**
- * Copy the RSS configuration from the user ones.
+ * Copy the RSS configuration from the user ones, of the rss_conf is null,
+ * uses the driver one.
*
* @param priv
* Pointer to private structure.
@@ -531,21 +532,25 @@ priv_flow_convert_rss_conf(struct priv *priv,
struct mlx5_flow_parse *parser,
const struct rte_eth_rss_conf *rss_conf)
{
- const struct rte_eth_rss_conf *rss;
-
+ /*
+ * This function is also called at the beginning of
+ * priv_flow_convert_actions() to initialise the parser with the
+ * device default RSS configuration.
+ */
+ (void)priv;
if (rss_conf) {
if (rss_conf->rss_hf & MLX5_RSS_HF_MASK)
return EINVAL;
- rss = rss_conf;
- } else {
- rss = &priv->rss_conf;
+ if (rss_conf->rss_key_len != 40)
+ return EINVAL;
+ if (rss_conf->rss_key_len && rss_conf->rss_key) {
+ parser->rss_conf.rss_key_len = rss_conf->rss_key_len;
+ memcpy(parser->rss_key, rss_conf->rss_key,
+ rss_conf->rss_key_len);
+ parser->rss_conf.rss_key = parser->rss_key;
+ }
+ parser->rss_conf.rss_hf = rss_conf->rss_hf;
}
- if (rss->rss_key_len > 40)
- return EINVAL;
- parser->rss_conf.rss_key_len = rss->rss_key_len;
- parser->rss_conf.rss_hf = rss->rss_hf;
- memcpy(parser->rss_key, rss->rss_key, rss->rss_key_len);
- parser->rss_conf.rss_key = parser->rss_key;
return 0;
}
--
2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix flow RSS configuration
2018-02-06 9:22 [dpdk-dev] [PATCH] net/mlx5: fix flow RSS configuration Nelio Laranjeiro
@ 2018-02-06 11:39 ` Shahaf Shuler
0 siblings, 0 replies; 2+ messages in thread
From: Shahaf Shuler @ 2018-02-06 11:39 UTC (permalink / raw)
To: Nélio Laranjeiro, dev; +Cc: Adrien Mazarguil, Yongseok Koh, stable
Tuesday, February 6, 2018 11:22 AM, Nelio Laranjeiro:
> An RSS configuration without a key is valid according to the rte_eth_rss_conf
> API definition.
>
> Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
>
> Cc: stable@dpdk.org
> Reported-by: Yuanhan Liu <yliu@fridaylinux.org>
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---
> drivers/net/mlx5/mlx5_flow.c | 29 +++++++++++++++++------------
> 1 file changed, 17 insertions(+), 12 deletions(-)
Applied to next-net-mlx, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-06 11:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-06 9:22 [dpdk-dev] [PATCH] net/mlx5: fix flow RSS configuration Nelio Laranjeiro
2018-02-06 11:39 ` Shahaf Shuler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).