net/mlx5: fix RSS flow action hash type selection

On the code after the below commits, the criteria to select the IPV4 or
IPV6 hash functions was the existence of some ETH_RSS_IPV4 RSS types on
the flow rule.

The check is wrong. For example ETH_RSS_NONFRAG_IPV4_TCP will not select
the IPV4 hash which will cause the packet to be spread in a bad way.

Fix it by adding the corresponding types needed for each hash selection.

Fixes: 592f05b29a25 ("net/mlx5: add RSS flow action")
Fixes: fd0b70316bca ("net/mlx5: support inner RSS computation")
Cc: stable@dpdk.org

Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This commit is contained in:
Shahaf Shuler 2018-08-14 14:17:21 +03:00 committed by Ferruh Yigit
parent f9de87187b
commit b8ac090835

View File

@ -1053,6 +1053,8 @@ mlx5_flow_item_ipv4(const struct rte_flow_item *item, struct rte_flow *flow,
mlx5_flow_verbs_hashfields_adjust
(flow, tunnel,
(ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 |
ETH_RSS_NONFRAG_IPV4_TCP |
ETH_RSS_NONFRAG_IPV4_UDP |
ETH_RSS_NONFRAG_IPV4_OTHER),
(IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4));
flow->cur_verbs->attr->priority = MLX5_PRIORITY_MAP_L3;
@ -1188,7 +1190,10 @@ mlx5_flow_item_ipv6(const struct rte_flow_item *item, struct rte_flow *flow,
if (size <= flow_size) {
mlx5_flow_verbs_hashfields_adjust
(flow, tunnel,
(ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_OTHER),
(ETH_RSS_IPV6 | ETH_RSS_FRAG_IPV6 |
ETH_RSS_NONFRAG_IPV6_TCP | ETH_RSS_NONFRAG_IPV6_UDP |
ETH_RSS_NONFRAG_IPV6_OTHER | ETH_RSS_IPV6_EX |
ETH_RSS_IPV6_TCP_EX | ETH_RSS_IPV6_UDP_EX),
(IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6));
flow->cur_verbs->attr->priority = MLX5_PRIORITY_MAP_L3;
mlx5_flow_spec_verbs_add(flow, &ipv6, size);