net/mvpp2: check meter packet mode

Currently meter algorithms only supports bytes per second(BPS).
Check packet_mode set to TRUE are rejected.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Liron Himi <lironh@marvell.com>
This commit is contained in:
Li Zhang 2021-04-13 18:59:57 +03:00 committed by Ferruh Yigit
parent 12745a0a33
commit 784b83495b

View File

@ -88,6 +88,12 @@ mrvl_meter_profile_add(struct rte_eth_dev *dev, uint32_t meter_profile_id,
NULL,
"Only srTCM RFC 2697 is supported\n");
if (profile->packet_mode)
return -rte_mtr_error_set(error, EINVAL,
RTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE,
NULL,
"Packet mode is not supported\n");
prof = mrvl_mtr_profile_from_id(priv, meter_profile_id);
if (prof)
return -rte_mtr_error_set(error, EEXIST,