From: Li Zhang Date: Tue, 13 Apr 2021 15:59:57 +0000 (+0300) Subject: net/mvpp2: check meter packet mode X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=784b83495bc5c40c5aa91d1e4d3966ec22e59e38;p=dpdk.git 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 Acked-by: Matan Azrad Acked-by: Liron Himi --- diff --git a/drivers/net/mvpp2/mrvl_mtr.c b/drivers/net/mvpp2/mrvl_mtr.c index 2fa5cb43ad..c07ac95ddc 100644 --- a/drivers/net/mvpp2/mrvl_mtr.c +++ b/drivers/net/mvpp2/mrvl_mtr.c @@ -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,