diff mbox series

[2/2] net/mvpp2: check meter packet mode

Message ID 20210401061618.1478961-3-lizh@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series Check meter packet mode in PMD | expand

Checks

Context Check Description
ci/github-robot fail github build: failed
ci/Intel-compilation fail Compilation issues
ci/travis-robot fail travis build: failed
ci/checkpatch success coding style OK

Commit Message

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

Comments

Dumitrescu, Cristian April 7, 2021, 8:13 p.m. UTC | #1
> -----Original Message-----
> From: Li Zhang <lizh@nvidia.com>
> Sent: Thursday, April 1, 2021 7:16 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
> Cc: dev@dpdk.org; thomas@monjalon.net; rasland@nvidia.com;
> roniba@nvidia.com
> Subject: [PATCH 2/2] 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 <lizh@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..055be6f6b1 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_UNSPECIFIED,

Can you please add a new error type for this specific error case, i.e. 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
Li Zhang April 8, 2021, 2:32 a.m. UTC | #2
Hi Cristian

> -----Original Message-----
> From: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Sent: Thursday, April 8, 2021 4:14 AM
> To: Li Zhang <lizh@nvidia.com>; dekelp@nvidia.com; Ori Kam
> <orika@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Matan
> Azrad <matan@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>;
> lironh@marvell.com
> Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon <thomas@monjalon.net>;
> Raslan Darawsheh <rasland@nvidia.com>; Roni Bar Yanai
> <roniba@nvidia.com>
> Subject: RE: [PATCH 2/2] net/mvpp2: check meter packet mode
> 
> External email: Use caution opening links or attachments
> 
> 
> > -----Original Message-----
> > From: Li Zhang <lizh@nvidia.com>
> > Sent: Thursday, April 1, 2021 7:16 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
> > Cc: dev@dpdk.org; thomas@monjalon.net; rasland@nvidia.com;
> > roniba@nvidia.com
> > Subject: [PATCH 2/2] 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 <lizh@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..055be6f6b1 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_UNSPECIFIED,
> 
> Can you please add a new error type for this specific error case, i.e.
> RTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE.
> 
Thanks, I will add it in V2 patch.
> > +                                       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..055be6f6b1 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_UNSPECIFIED,
+					  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,