net/mlx5: fix meter profile validation
authorBing Zhao <bingz@nvidia.com>
Thu, 29 Jul 2021 16:04:02 +0000 (19:04 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 29 Jul 2021 20:03:14 +0000 (22:03 +0200)
commit8a0fca1101212c0980b8c007359b843d12854c7e
tree92e9dc819bac5d26523c8c493cef59239c10f41c
parentf17e4b4ffef9ecf2547ad8ee628e94db8f561b2f
net/mlx5: fix meter profile validation

After the support for yellow color and RFC2698 & RFC4115 were added,
the profile validation adjustment was missed. With this fix, the
validation is like below:
  1. Legacy metering only supports RFC2697 without EBS.
  2. ASO metering can support all three profiles.
  3. For backward compatibility, none EBS with RFC2697 profile is
     still supported and the checking is done in the meter
     creation stage.

In the meanwhile, some checking which was done in the parameters
calculation stage is moved in the validation in order to skip the
useless checking.

Fixes: 33a7493c8df8 ("net/mlx5: support meter for trTCM profiles")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/common/mlx5/mlx5_prm.h
drivers/net/mlx5/mlx5_flow_meter.c