diff mbox series

[v4,4/4] net/mvpp2: check meter packet mode

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

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch success coding style OK

Commit Message

Li Zhang April 13, 2021, 3:50 a.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>
---
 drivers/net/mvpp2/mrvl_mtr.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Liron Himi April 13, 2021, 5:42 a.m. UTC | #1
Acked-by: Liron Himi <lironh@marvell.com>

-----Original Message-----
From: Li Zhang <lizh@nvidia.com> 
Sent: Tuesday, 13 April 2021 06:51
To: dekelp@nvidia.com; orika@nvidia.com; viacheslavo@nvidia.com; matan@nvidia.com; shahafs@nvidia.com; cristian.dumitrescu@intel.com; Liron Himi <lironh@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; ferruh.yigit@intel.com
Cc: dev@dpdk.org; thomas@monjalon.net; rasland@nvidia.com; roniba@nvidia.com
Subject: [EXT] [PATCH v4 4/4] net/mvpp2: check meter packet mode

External Email

----------------------------------------------------------------------
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>
---
 drivers/net/mvpp2/mrvl_mtr.c | 6 ++++++
 1 file changed, 6 insertions(+)

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,
--
2.27.0
diff mbox series

Patch

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,