From 12745a0a33059f8fb4b04fcf1b1c962cf1895e65 Mon Sep 17 00:00:00 2001 From: Li Zhang Date: Tue, 13 Apr 2021 18:59:56 +0300 Subject: [PATCH] net/softnic: 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: Cristian Dumitrescu --- drivers/net/softnic/rte_eth_softnic_meter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c index 31a2a0e6d9..b27b1285e9 100644 --- a/drivers/net/softnic/rte_eth_softnic_meter.c +++ b/drivers/net/softnic/rte_eth_softnic_meter.c @@ -128,6 +128,14 @@ meter_profile_check(struct rte_eth_dev *dev, NULL, "Metering alg not supported"); + /* Not support packet mode, just support byte mode. */ + if (profile->packet_mode) + return -rte_mtr_error_set(error, + EINVAL, + RTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE, + NULL, + "Meter packet mode not supported"); + return 0; } -- 2.20.1