diff mbox series

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

Message ID 20210410072445.1872769-4-lizh@nvidia.com (mailing list archive)
State Superseded
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 10, 2021, 7:24 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/softnic/rte_eth_softnic_meter.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Dumitrescu, Cristian April 12, 2021, 7:24 p.m. UTC | #1
> -----Original Message-----
> From: Li Zhang <lizh@nvidia.com>
> Sent: Saturday, April 10, 2021 8:25 AM
> To: dekelp@nvidia.com; orika@nvidia.com; viacheslavo@nvidia.com;
> matan@nvidia.com; shahafs@nvidia.com; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; lironh@marvell.com; Singh, Jasvinder
> <jasvinder.singh@intel.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; rasland@nvidia.com;
> roniba@nvidia.com
> Subject: [PATCH v3 3/4] 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 <lizh@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  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 2a05a85cdb..046e629f17 100644
> --- a/drivers/net/softnic/rte_eth_softnic_meter.c
> +++ b/drivers/net/softnic/rte_eth_softnic_meter.c
> @@ -107,6 +107,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.21.0

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
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 2a05a85cdb..046e629f17 100644
--- a/drivers/net/softnic/rte_eth_softnic_meter.c
+++ b/drivers/net/softnic/rte_eth_softnic_meter.c
@@ -107,6 +107,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;
 }