]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: fix RSS hash types adjustment
authorDariusz Sosnowski <dsosnowski@nvidia.com>
Thu, 21 Apr 2022 20:36:56 +0000 (20:36 +0000)
committerRaslan Darawsheh <rasland@nvidia.com>
Tue, 26 Apr 2022 09:51:56 +0000 (11:51 +0200)
When an indirect action was created with an RSS action configured to
hash on both source and destination L3 addresses (or L4 ports), it caused
shared hrxq to be configured to hash only on destination address
(or port).

This patch fixes this behavior by refining RSS types specified in
configuration before calculating hash types used for hrxq. Refining RSS
types removes *_SRC_ONLY and *_DST_ONLY flags if they are both set.

Fixes: 212d17b6a650 ("net/mlx5: fix missing shared RSS hash types")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/mlx5_flow_dv.c

index da2ddd58cd90769bbbebc4c84427a69798d12a19..cb5006bb11092c498d7fd3da175197b233943757 100644 (file)
@@ -14793,8 +14793,8 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
  * MLX5_RSS_HASH_IPV4_DST_ONLY are mutually exclusive so they can share
  * same slot in mlx5_rss_hash_fields.
  *
- * @param[in] rss_types
- *   RSS type.
+ * @param[in] orig_rss_types
+ *   RSS type as provided in shared RSS action.
  * @param[in, out] hash_field
  *   hash_field variable needed to be adjusted.
  *
@@ -14802,9 +14802,11 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
  *   void
  */
 void
-flow_dv_action_rss_l34_hash_adjust(uint64_t rss_types,
+flow_dv_action_rss_l34_hash_adjust(uint64_t orig_rss_types,
                                   uint64_t *hash_field)
 {
+       uint64_t rss_types = rte_eth_rss_hf_refine(orig_rss_types);
+
        switch (*hash_field & ~IBV_RX_HASH_INNER) {
        case MLX5_RSS_HASH_IPV4:
                if (rss_types & MLX5_IPV4_LAYER_TYPES) {