net/mlx5: fix RSS flow rule with L4 mismatch
authorLior Margalit <lmargalit@nvidia.com>
Tue, 27 Jul 2021 06:46:19 +0000 (09:46 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 29 Jul 2021 16:01:20 +0000 (18:01 +0200)
commit5e1db76dd8c740629ef0e9569099bf67a3cbbf9d
tree03a71b8ede0702b766d7182ffadbbc8eb7ea9bab
parent7356aec64c48e30585a15659b4ee491d11d4339a
net/mlx5: fix RSS flow rule with L4 mismatch

The RSS hash types defined in the API do not support setting the L4 proto
type (TCP or UDP) without setting the L3 proto. For example, ETH_RSS_TCP
is defined as
(ETH_RSS_NONFRAG_IPV4_TCP | \
 ETH_RSS_NONFRAG_IPV6_TCP | \
 ETH_RSS_IPV6_TCP_EX).

The L3 proto of the RSS hash type may be different than the one defined
in the pattern, for example:
testpmd> flow create .../ ipv4 / tcp / end actions rss types ipv6-tcp-ex
end / end

If the RSS hash type also includes L4 proto type as in the above example,
the selection flags for the RX hash are currently set with SPORT/DPORT
without setting SRC/DST IP. As this combination is not supported, it does
not match any of the pre-created TIRs of the indirect RSS action
and the flow creation fails.

The fix is to prevent setting the selection flags for the RX hash with
SPORT/DPORT without setting SRC/DST IP. It applies non-RSS processing of
the received packets. In case of indirect RSS action, it will match the
MLX5_RSS_HASH_NONE pre-created TIR.

Fixes: b1d63d829378 ("net/mlx5: support RSS on src or dst fields only")
Fixes: 4a78c88e3bae ("net/mlx5: fix Verbs flow tunnel")
Cc: stable@dpdk.org
Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5_flow_dv.c
drivers/net/mlx5/mlx5_flow_verbs.c