From 27bdbbef1a5215b768186be5a59a09c3d0517de0 Mon Sep 17 00:00:00 2001 From: Adrien Mazarguil Date: Mon, 21 May 2018 17:50:09 +0200 Subject: [PATCH] net/mlx4: fix default in RSS converter Below commit documents 0 as a value standing for a default set of RSS hash types, however the mlx4 PMD doesn't interpret it correctly and still uses its own internal special value for that (-1). Also, its function prototype was not updated. Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API") Fixes: 1d173da83ef2 ("net/mlx4: fix default RSS hash fields") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4_flow.c | 6 +++--- drivers/net/mlx4/mlx4_flow.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 202779f7d2..ebc9eeb8bc 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -114,7 +114,7 @@ struct mlx4_drop { * Convert DPDK RSS hash types to their Verbs equivalent. * * This function returns the supported (default) set when @p types has - * special value (uint64_t)-1. + * special value 0. * * @param priv * Pointer to private structure. @@ -160,7 +160,7 @@ mlx4_conv_rss_types(struct priv *priv, uint64_t types) uint64_t conv = 0; unsigned int i; - if (types == (uint64_t)-1) + if (!types) return priv->hw_rss_sup; for (i = 0; i != RTE_DIM(in); ++i) if (types & in[i]) { @@ -1384,7 +1384,7 @@ mlx4_flow_internal(struct priv *priv, struct rte_flow_error *error) struct rte_flow_action_rss action_rss = { .func = RTE_ETH_HASH_FUNCTION_DEFAULT, .level = 0, - .types = -1, + .types = 0, .key_len = MLX4_RSS_HASH_KEY_SIZE, .queue_num = queues, .key = mlx4_rss_hash_key_default, diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h index d1f1611eb8..2e82903bdd 100644 --- a/drivers/net/mlx4/mlx4_flow.h +++ b/drivers/net/mlx4/mlx4_flow.h @@ -48,7 +48,7 @@ struct rte_flow { /* mlx4_flow.c */ -uint64_t mlx4_conv_rss_types(struct priv *priv, uint64_t rss_hf); +uint64_t mlx4_conv_rss_types(struct priv *priv, uint64_t types); uint64_t mlx4_ibv_to_rss_types(uint64_t ibv_rss_types); int mlx4_flow_sync(struct priv *priv, struct rte_flow_error *error); void mlx4_flow_clean(struct priv *priv); -- 2.20.1