diff mbox series

[v5,3/4] net/softnic: check meter packet mode

Message ID 20210413155958.2024584-4-lizh@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series Support PPS(packet per second) on meter | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Li Zhang April 13, 2021, 3:59 p.m. UTC
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: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 drivers/net/softnic/rte_eth_softnic_meter.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

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;
 }