net/mlx4: use function to get default RSS fields
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Thu, 23 Nov 2017 17:38:00 +0000 (18:38 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
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 <adrien.mazarguil@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
drivers/net/mlx4/mlx4_flow.c

index 8b87b29..7397dde 100644 (file)
@@ -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)