From: Adrien Mazarguil Date: Thu, 23 Nov 2017 17:38:00 +0000 (+0100) Subject: net/mlx4: use function to get default RSS fields X-Git-Tag: spdx-start~609 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=27563725b1aef003fa375800599e0745b3279761;p=dpdk.git net/mlx4: use function to get default RSS fields Supported RSS hash fields are listed in function mlx4_conv_rss_hf() and duplicated in mlx4_flow_prepare(); the latter are used when RSS is requested without specifying any parameters. This commit standardizes on mlx4_conv_rss_hf(). Signed-off-by: Adrien Mazarguil Acked-by: Neil Horman --- diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 8b87b29890..7397dde26b 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -105,6 +105,9 @@ struct mlx4_drop { /** * Convert DPDK RSS hash fields to their Verbs equivalent. * + * This function returns the supported (default) set when @p rss_hf has + * special value (uint64_t)-1. + * * @param rss_hf * Hash fields in DPDK format (see struct rte_eth_rss_conf). * @@ -154,6 +157,8 @@ mlx4_conv_rss_hf(uint64_t rss_hf) seen |= rss_hf & in[i]; conv |= out[i]; } + if (rss_hf == (uint64_t)-1) + return conv; if (!(rss_hf & ~seen)) return conv; rte_errno = ENOTSUP; @@ -759,10 +764,7 @@ fill: &(struct rte_eth_rss_conf){ .rss_key = mlx4_rss_hash_key_default, .rss_key_len = MLX4_RSS_HASH_KEY_SIZE, - .rss_hf = (ETH_RSS_IPV4 | - ETH_RSS_NONFRAG_IPV4_TCP | - ETH_RSS_IPV6 | - ETH_RSS_NONFRAG_IPV6_TCP), + .rss_hf = -1, }; /* Sanity checks. */ for (i = 0; i < rss->num; ++i)