DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second.
@ 2021-01-25  1:02 Li Zhang
  2021-01-25  1:02 ` [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on meter Li Zhang
  0 siblings, 1 reply; 10+ messages in thread
From: Li Zhang @ 2021-01-25  1:02 UTC (permalink / raw)
  To: dekelp, orika, viacheslavo, matan; +Cc: dev, thomas, rasland

Li Zhang (1):
  lib/librte_ethdev: add definitions for packet per second.

 lib/librte_ethdev/rte_mtr.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on meter
  2021-01-25  1:02 [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second Li Zhang
@ 2021-01-25  1:02 ` Li Zhang
  2021-01-25  1:20   ` [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second Li Zhang
  2021-02-12 21:35   ` [dpdk-dev] [PATCH] [RFC]: " Ajit Khaparde
  0 siblings, 2 replies; 10+ messages in thread
From: Li Zhang @ 2021-01-25  1:02 UTC (permalink / raw)
  To: dekelp, orika, viacheslavo, matan; +Cc: dev, thomas, rasland

Currently the flow Meter algorithms in rte_flow only supports bytes per second(BPS).
Such as Single Rate Three Color Marker (srTCM rfc2697)
This RFC adds the packet per second definition in Meter algorithms structure,
to support the rte_mtr APIs with type srTCM pps mode.
The below structure will be extended:
rte_mtr_algorithm
rte_mtr_meter_profile
Signed-off-by: Li Zhang <lizh@nvidia.com>
---
 lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h
index 916a09c5c3..6413892aec 100644
--- a/lib/librte_ethdev/rte_mtr.h
+++ b/lib/librte_ethdev/rte_mtr.h
@@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
 
 	/** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
 	RTE_MTR_TRTCM_RFC4115,
+
+	/** Single Rate Three Color Marker (srTCM) in Packet per second mode */
+	RTE_MTR_SRTCM_PPS,
 };
 
 /**
@@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
 			/** Excess Burst Size (EBS) (bytes). */
 			uint64_t ebs;
 		} trtcm_rfc4115;
+
+		/** Items only valid when *alg* is set to srTCM - PPS. */
+		struct {
+			/** Committed Information Rate (CIR)(packets/second). */
+			uint64_t cir;
+
+			/** Committed Burst Size (CBS) (bytes). */
+			uint64_t cbs;
+
+			/** Excess Burst Size (EBS) (bytes). */
+			uint64_t ebs;
+		} srtcm_pps;
 	};
 };
 
@@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
 	 */
 	uint32_t meter_trtcm_rfc4115_n_max;
 
+	/** Maximum number of MTR objects that can have their meter configured
+	 * to run the srTCM packet per second algorithm. The value of 0 
+	 * indicates this metering algorithm is not supported. 
+	 * The maximum value is *n_max*.
+	 */
+	uint32_t meter_srtcm_pps_n_max;
+
 	/** Maximum traffic rate that can be metered by a single MTR object. For
 	 * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC 2698,
 	 * this is the maximum PIR rate. For trTCM RFC 4115, this is the maximum
@@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
 	 */
 	int color_aware_trtcm_rfc4115_supported;
 
+	/**
+	* When non-zero, it indicates that color aware mode is supported for
+	* the srTCM packet per second  metering algorithm.
+	*/
+	int color_aware_srtcm_pps_supported;
+
 	/** When non-zero, it indicates that the policer packet recolor actions
 	 * are supported.
 	 * @see enum rte_mtr_policer_action
-- 
2.21.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second.
  2021-01-25  1:02 ` [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on meter Li Zhang
@ 2021-01-25  1:20   ` Li Zhang
  2021-01-25  1:20     ` [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter Li Zhang
  2021-02-12 21:35   ` [dpdk-dev] [PATCH] [RFC]: " Ajit Khaparde
  1 sibling, 1 reply; 10+ messages in thread
From: Li Zhang @ 2021-01-25  1:20 UTC (permalink / raw)
  To: dekelp, orika, viacheslavo, matan; +Cc: dev, thomas, rasland

Li Zhang (1):
  lib/librte_ethdev: add definitions for packet per second.

 lib/librte_ethdev/rte_mtr.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter
  2021-01-25  1:20   ` [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second Li Zhang
@ 2021-01-25  1:20     ` Li Zhang
  2021-01-28 18:27       ` Ferruh Yigit
  0 siblings, 1 reply; 10+ messages in thread
From: Li Zhang @ 2021-01-25  1:20 UTC (permalink / raw)
  To: dekelp, orika, viacheslavo, matan; +Cc: dev, thomas, rasland

Currently the flow Meter algorithms in rte_flow
only supports bytes per second(BPS).
Such as Single Rate Three Color Marker (srTCM rfc2697)
This RFC adds the packet per second definition in
Meter algorithms structure,
to support the rte_mtr APIs with type srTCM pps mode.
The below structure will be extended:
rte_mtr_algorithm
rte_mtr_meter_profile
Signed-off-by: Li Zhang <lizh@nvidia.com>
---
 lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h
index 916a09c5c3..3e88904faf 100644
--- a/lib/librte_ethdev/rte_mtr.h
+++ b/lib/librte_ethdev/rte_mtr.h
@@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
 
 	/** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
 	RTE_MTR_TRTCM_RFC4115,
+
+	/** Single Rate Three Color Marker (srTCM) in Packet per second mode */
+	RTE_MTR_SRTCM_PPS,
 };
 
 /**
@@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
 			/** Excess Burst Size (EBS) (bytes). */
 			uint64_t ebs;
 		} trtcm_rfc4115;
+
+		/** Items only valid when *alg* is set to srTCM - PPS. */
+		struct {
+			/** Committed Information Rate (CIR)(packets/second). */
+			uint64_t cir;
+
+			/** Committed Burst Size (CBS) (bytes). */
+			uint64_t cbs;
+
+			/** Excess Burst Size (EBS) (bytes). */
+			uint64_t ebs;
+		} srtcm_pps;
 	};
 };
 
@@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
 	 */
 	uint32_t meter_trtcm_rfc4115_n_max;
 
+	/** Maximum number of MTR objects that can have their meter configured
+	 * to run the srTCM packet per second algorithm. The value of 0
+	 * indicates this metering algorithm is not supported.
+	 * The maximum value is *n_max*.
+	 */
+	uint32_t meter_srtcm_pps_n_max;
+
 	/** Maximum traffic rate that can be metered by a single MTR object. For
 	 * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC 2698,
 	 * this is the maximum PIR rate. For trTCM RFC 4115, this is the maximum
@@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
 	 */
 	int color_aware_trtcm_rfc4115_supported;
 
+	/**
+	 * When non-zero, it indicates that color aware mode is supported for
+	 * the srTCM packet per second  metering algorithm.
+	 */
+	int color_aware_srtcm_pps_supported;
+
 	/** When non-zero, it indicates that the policer packet recolor actions
 	 * are supported.
 	 * @see enum rte_mtr_policer_action
-- 
2.21.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter
  2021-01-25  1:20     ` [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter Li Zhang
@ 2021-01-28 18:27       ` Ferruh Yigit
  2021-02-12  7:40         ` Morten Brørup
  0 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2021-01-28 18:27 UTC (permalink / raw)
  To: Li Zhang, dekelp, orika, viacheslavo, matan, Dumitrescu, Cristian
  Cc: dev, thomas, rasland

On 1/25/2021 1:20 AM, Li Zhang wrote:
> Currently the flow Meter algorithms in rte_flow
> only supports bytes per second(BPS).
> Such as Single Rate Three Color Marker (srTCM rfc2697)
> This RFC adds the packet per second definition in
> Meter algorithms structure,
> to support the rte_mtr APIs with type srTCM pps mode.
> The below structure will be extended:
> rte_mtr_algorithm
> rte_mtr_meter_profile
> Signed-off-by: Li Zhang <lizh@nvidia.com>

cc'ed Cristian for review/comment.

> ---
>   lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h
> index 916a09c5c3..3e88904faf 100644
> --- a/lib/librte_ethdev/rte_mtr.h
> +++ b/lib/librte_ethdev/rte_mtr.h
> @@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
>   
>   	/** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
>   	RTE_MTR_TRTCM_RFC4115,
> +
> +	/** Single Rate Three Color Marker (srTCM) in Packet per second mode */
> +	RTE_MTR_SRTCM_PPS,
>   };
>   
>   /**
> @@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
>   			/** Excess Burst Size (EBS) (bytes). */
>   			uint64_t ebs;
>   		} trtcm_rfc4115;
> +
> +		/** Items only valid when *alg* is set to srTCM - PPS. */
> +		struct {
> +			/** Committed Information Rate (CIR)(packets/second). */
> +			uint64_t cir;
> +
> +			/** Committed Burst Size (CBS) (bytes). */
> +			uint64_t cbs;
> +
> +			/** Excess Burst Size (EBS) (bytes). */
> +			uint64_t ebs;
> +		} srtcm_pps;
>   	};
>   };
>   
> @@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
>   	 */
>   	uint32_t meter_trtcm_rfc4115_n_max;
>   
> +	/** Maximum number of MTR objects that can have their meter configured
> +	 * to run the srTCM packet per second algorithm. The value of 0
> +	 * indicates this metering algorithm is not supported.
> +	 * The maximum value is *n_max*.
> +	 */
> +	uint32_t meter_srtcm_pps_n_max;
> +
>   	/** Maximum traffic rate that can be metered by a single MTR object. For
>   	 * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC 2698,
>   	 * this is the maximum PIR rate. For trTCM RFC 4115, this is the maximum
> @@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
>   	 */
>   	int color_aware_trtcm_rfc4115_supported;
>   
> +	/**
> +	 * When non-zero, it indicates that color aware mode is supported for
> +	 * the srTCM packet per second  metering algorithm.
> +	 */
> +	int color_aware_srtcm_pps_supported;
> +
>   	/** When non-zero, it indicates that the policer packet recolor actions
>   	 * are supported.
>   	 * @see enum rte_mtr_policer_action
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter
  2021-01-28 18:27       ` Ferruh Yigit
@ 2021-02-12  7:40         ` Morten Brørup
  2021-02-23  2:07           ` Li Zhang
  0 siblings, 1 reply; 10+ messages in thread
From: Morten Brørup @ 2021-02-12  7:40 UTC (permalink / raw)
  To: Ferruh Yigit, Li Zhang, dekelp, orika, viacheslavo, matan,
	Dumitrescu, Cristian
  Cc: dev, thomas, rasland

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ferruh Yigit
> Sent: Thursday, January 28, 2021 7:28 PM
> 
> On 1/25/2021 1:20 AM, Li Zhang wrote:
> > Currently the flow Meter algorithms in rte_flow
> > only supports bytes per second(BPS).
> > Such as Single Rate Three Color Marker (srTCM rfc2697)
> > This RFC adds the packet per second definition in
> > Meter algorithms structure,
> > to support the rte_mtr APIs with type srTCM pps mode.
> > The below structure will be extended:
> > rte_mtr_algorithm
> > rte_mtr_meter_profile
> > Signed-off-by: Li Zhang <lizh@nvidia.com>
> 
> cc'ed Cristian for review/comment.
> 
> > ---
> >   lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
> >   1 file changed, 28 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_mtr.h
> b/lib/librte_ethdev/rte_mtr.h
> > index 916a09c5c3..3e88904faf 100644
> > --- a/lib/librte_ethdev/rte_mtr.h
> > +++ b/lib/librte_ethdev/rte_mtr.h
> > @@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
> >
> >   	/** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
> >   	RTE_MTR_TRTCM_RFC4115,
> > +
> > +	/** Single Rate Three Color Marker (srTCM) in Packet per second
> mode */
> > +	RTE_MTR_SRTCM_PPS,
> >   };
> >
> >   /**
> > @@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
> >   			/** Excess Burst Size (EBS) (bytes). */
> >   			uint64_t ebs;
> >   		} trtcm_rfc4115;
> > +
> > +		/** Items only valid when *alg* is set to srTCM - PPS. */
> > +		struct {
> > +			/** Committed Information Rate (CIR)(packets/second).
> */
> > +			uint64_t cir;
> > +
> > +			/** Committed Burst Size (CBS) (bytes). */
> > +			uint64_t cbs;
> > +
> > +			/** Excess Burst Size (EBS) (bytes). */
> > +			uint64_t ebs;
> > +		} srtcm_pps;

In PPS mode, the burst sizes (ebs, ebs) must be packets, not bytes.

> >   	};
> >   };
> >
> > @@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
> >   	 */
> >   	uint32_t meter_trtcm_rfc4115_n_max;
> >
> > +	/** Maximum number of MTR objects that can have their meter
> configured
> > +	 * to run the srTCM packet per second algorithm. The value of 0
> > +	 * indicates this metering algorithm is not supported.
> > +	 * The maximum value is *n_max*.
> > +	 */
> > +	uint32_t meter_srtcm_pps_n_max;
> > +
> >   	/** Maximum traffic rate that can be metered by a single MTR
> object. For
> >   	 * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC
> 2698,
> >   	 * this is the maximum PIR rate. For trTCM RFC 4115, this is the
> maximum
> > @@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
> >   	 */
> >   	int color_aware_trtcm_rfc4115_supported;
> >
> > +	/**
> > +	 * When non-zero, it indicates that color aware mode is supported
> for
> > +	 * the srTCM packet per second  metering algorithm.

No need for two spaces between the words second and metering.

> > +	 */
> > +	int color_aware_srtcm_pps_supported;
> > +
> >   	/** When non-zero, it indicates that the policer packet recolor
> actions
> >   	 * are supported.
> >   	 * @see enum rte_mtr_policer_action
> >
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on meter
  2021-01-25  1:02 ` [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on meter Li Zhang
  2021-01-25  1:20   ` [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second Li Zhang
@ 2021-02-12 21:35   ` Ajit Khaparde
  2021-02-23  2:11     ` Li Zhang
  1 sibling, 1 reply; 10+ messages in thread
From: Ajit Khaparde @ 2021-02-12 21:35 UTC (permalink / raw)
  To: Li Zhang
  Cc: Dekel Peled, Ori Kam, Slava Ovsiienko, Matan Azrad, dpdk-dev,
	Thomas Monjalon, Raslan Darawsheh

[-- Attachment #1: Type: text/plain, Size: 3127 bytes --]

On Sun, Jan 24, 2021 at 5:02 PM Li Zhang <lizh@nvidia.com> wrote:

> Currently the flow Meter algorithms in rte_flow only supports bytes per
> second(BPS).
> Such as Single Rate Three Color Marker (srTCM rfc2697)
> This RFC adds the packet per second definition in Meter algorithms
> structure,
> to support the rte_mtr APIs with type srTCM pps mode.
>
I thought rfc2697 specified metering using BPS only.
The CIR was measured in bytes per second for IP packets.
Is there a draft or link to the new srTCM mode?



> The below structure will be extended:
> rte_mtr_algorithm
> rte_mtr_meter_profile
> Signed-off-by: Li Zhang <lizh@nvidia.com>
> ---
>  lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h
> index 916a09c5c3..6413892aec 100644
> --- a/lib/librte_ethdev/rte_mtr.h
> +++ b/lib/librte_ethdev/rte_mtr.h
> @@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
>
>         /** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
>         RTE_MTR_TRTCM_RFC4115,
> +
> +       /** Single Rate Three Color Marker (srTCM) in Packet per second
> mode */
> +       RTE_MTR_SRTCM_PPS,
>  };
>
>  /**
> @@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
>                         /** Excess Burst Size (EBS) (bytes). */
>                         uint64_t ebs;
>                 } trtcm_rfc4115;
> +
> +               /** Items only valid when *alg* is set to srTCM - PPS. */
> +               struct {
> +                       /** Committed Information Rate
> (CIR)(packets/second). */
> +                       uint64_t cir;
> +
> +                       /** Committed Burst Size (CBS) (bytes). */
> +                       uint64_t cbs;
> +
> +                       /** Excess Burst Size (EBS) (bytes). */
> +                       uint64_t ebs;
> +               } srtcm_pps;
>         };
>  };
>
> @@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
>          */
>         uint32_t meter_trtcm_rfc4115_n_max;
>
> +       /** Maximum number of MTR objects that can have their meter
> configured
> +        * to run the srTCM packet per second algorithm. The value of 0
> +        * indicates this metering algorithm is not supported.
> +        * The maximum value is *n_max*.
> +        */
> +       uint32_t meter_srtcm_pps_n_max;
> +
>         /** Maximum traffic rate that can be metered by a single MTR
> object. For
>          * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC
> 2698,
>          * this is the maximum PIR rate. For trTCM RFC 4115, this is the
> maximum
> @@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
>          */
>         int color_aware_trtcm_rfc4115_supported;
>
> +       /**
> +       * When non-zero, it indicates that color aware mode is supported
> for
> +       * the srTCM packet per second  metering algorithm.
> +       */
> +       int color_aware_srtcm_pps_supported;
> +
>         /** When non-zero, it indicates that the policer packet recolor
> actions
>          * are supported.
>          * @see enum rte_mtr_policer_action
> --
> 2.21.0
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter
  2021-02-12  7:40         ` Morten Brørup
@ 2021-02-23  2:07           ` Li Zhang
  2021-02-23  8:24             ` Morten Brørup
  0 siblings, 1 reply; 10+ messages in thread
From: Li Zhang @ 2021-02-23  2:07 UTC (permalink / raw)
  To: Morten Brørup, Ferruh Yigit, Dekel Peled, Ori Kam,
	Slava Ovsiienko, Matan Azrad, Dumitrescu, Cristian
  Cc: dev, NBU-Contact-Thomas Monjalon, Raslan Darawsheh

Thanks for your comments.
We changed the struct as below:
struct rte_mtr_meter_profile {
 ......
		/** Items only valid when alg is set to sprTCM. */
		struct {
			/** Committed Information Packet Rate (CIPR). */
			uint64_t cipr;

			/** Committed Packet Burst Size (CPBS). */
			uint64_t cpbs;

			/** Excess Packet Burst Size (EPBS). */
			uint64_t epbs;
		} sprtcm;
}

Regards,
Li Zhang
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Morten Br?rup
> Sent: Friday, February 12, 2021 3:41 PM
> To: Ferruh Yigit <ferruh.yigit@intel.com>; Li Zhang <lizh@nvidia.com>; Dekel
> Peled <dekelp@nvidia.com>; Ori Kam <orika@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Dumitrescu,
> Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon <thomas@monjalon.net>;
> Raslan Darawsheh <rasland@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second)
> on meter
> 
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ferruh Yigit
> > Sent: Thursday, January 28, 2021 7:28 PM
> >
> > On 1/25/2021 1:20 AM, Li Zhang wrote:
> > > Currently the flow Meter algorithms in rte_flow only supports bytes
> > > per second(BPS).
> > > Such as Single Rate Three Color Marker (srTCM rfc2697) This RFC adds
> > > the packet per second definition in Meter algorithms structure, to
> > > support the rte_mtr APIs with type srTCM pps mode.
> > > The below structure will be extended:
> > > rte_mtr_algorithm
> > > rte_mtr_meter_profile
> > > Signed-off-by: Li Zhang <lizh@nvidia.com>
> >
> > cc'ed Cristian for review/comment.
> >
> > > ---
> > >   lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
> > >   1 file changed, 28 insertions(+)
> > >
> > > diff --git a/lib/librte_ethdev/rte_mtr.h
> > b/lib/librte_ethdev/rte_mtr.h
> > > index 916a09c5c3..3e88904faf 100644
> > > --- a/lib/librte_ethdev/rte_mtr.h
> > > +++ b/lib/librte_ethdev/rte_mtr.h
> > > @@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
> > >
> > >   	/** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
> > >   	RTE_MTR_TRTCM_RFC4115,
> > > +
> > > +	/** Single Rate Three Color Marker (srTCM) in Packet per second
> > mode */
> > > +	RTE_MTR_SRTCM_PPS,
> > >   };
> > >
> > >   /**
> > > @@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
> > >   			/** Excess Burst Size (EBS) (bytes). */
> > >   			uint64_t ebs;
> > >   		} trtcm_rfc4115;
> > > +
> > > +		/** Items only valid when *alg* is set to srTCM - PPS. */
> > > +		struct {
> > > +			/** Committed Information Rate
> (CIR)(packets/second).
> > */
> > > +			uint64_t cir;
> > > +
> > > +			/** Committed Burst Size (CBS) (bytes). */
> > > +			uint64_t cbs;
> > > +
> > > +			/** Excess Burst Size (EBS) (bytes). */
> > > +			uint64_t ebs;
> > > +		} srtcm_pps;
> 
> In PPS mode, the burst sizes (ebs, ebs) must be packets, not bytes.
> 
> > >   	};
> > >   };
> > >
> > > @@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
> > >   	 */
> > >   	uint32_t meter_trtcm_rfc4115_n_max;
> > >
> > > +	/** Maximum number of MTR objects that can have their meter
> > configured
> > > +	 * to run the srTCM packet per second algorithm. The value of 0
> > > +	 * indicates this metering algorithm is not supported.
> > > +	 * The maximum value is *n_max*.
> > > +	 */
> > > +	uint32_t meter_srtcm_pps_n_max;
> > > +
> > >   	/** Maximum traffic rate that can be metered by a single MTR
> > object. For
> > >   	 * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC
> > 2698,
> > >   	 * this is the maximum PIR rate. For trTCM RFC 4115, this is the
> > maximum
> > > @@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
> > >   	 */
> > >   	int color_aware_trtcm_rfc4115_supported;
> > >
> > > +	/**
> > > +	 * When non-zero, it indicates that color aware mode is supported
> > for
> > > +	 * the srTCM packet per second  metering algorithm.
> 
> No need for two spaces between the words second and metering.
> 
> > > +	 */
> > > +	int color_aware_srtcm_pps_supported;
> > > +
> > >   	/** When non-zero, it indicates that the policer packet recolor
> > actions
> > >   	 * are supported.
> > >   	 * @see enum rte_mtr_policer_action
> > >
> >


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on meter
  2021-02-12 21:35   ` [dpdk-dev] [PATCH] [RFC]: " Ajit Khaparde
@ 2021-02-23  2:11     ` Li Zhang
  0 siblings, 0 replies; 10+ messages in thread
From: Li Zhang @ 2021-02-23  2:11 UTC (permalink / raw)
  To: Ajit Khaparde
  Cc: Dekel Peled, Ori Kam, Slava Ovsiienko, Matan Azrad, dpdk-dev,
	NBU-Contact-Thomas Monjalon, Raslan Darawsheh

Yes, RFC2697 is using BPS only.
We change srTCM_PPS mode name to sprTCM.
Single Packet Rate Three Color Marker (sprTCM) - - similar to IETF RFC 2697 but rate is packet per second.
There is no draft or link to this new mode (sprTCM)

Regards,
Li Zhang
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ajit Khaparde
> Sent: Saturday, February 13, 2021 5:36 AM
> To: Li Zhang <lizh@nvidia.com>
> Cc: Dekel Peled <dekelp@nvidia.com>; Ori Kam <orika@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> dpdk-dev <dev@dpdk.org>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Raslan Darawsheh <rasland@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on
> meter
> 
> On Sun, Jan 24, 2021 at 5:02 PM Li Zhang <lizh@nvidia.com> wrote:
> 
> > Currently the flow Meter algorithms in rte_flow only supports bytes
> > per second(BPS).
> > Such as Single Rate Three Color Marker (srTCM rfc2697) This RFC adds
> > the packet per second definition in Meter algorithms structure, to
> > support the rte_mtr APIs with type srTCM pps mode.
> >
> I thought rfc2697 specified metering using BPS only.
> The CIR was measured in bytes per second for IP packets.
> Is there a draft or link to the new srTCM mode?
> 
> 
> 
> > The below structure will be extended:
> > rte_mtr_algorithm
> > rte_mtr_meter_profile
> > Signed-off-by: Li Zhang <lizh@nvidia.com>
> > ---
> >  lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
> >  1 file changed, 28 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h
> > index 916a09c5c3..6413892aec 100644
> > --- a/lib/librte_ethdev/rte_mtr.h
> > +++ b/lib/librte_ethdev/rte_mtr.h
> > @@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
> >
> >         /** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
> >         RTE_MTR_TRTCM_RFC4115,
> > +
> > +       /** Single Rate Three Color Marker (srTCM) in Packet per
> > + second
> > mode */
> > +       RTE_MTR_SRTCM_PPS,
> >  };
> >
> >  /**
> > @@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
> >                         /** Excess Burst Size (EBS) (bytes). */
> >                         uint64_t ebs;
> >                 } trtcm_rfc4115;
> > +
> > +               /** Items only valid when *alg* is set to srTCM - PPS. */
> > +               struct {
> > +                       /** Committed Information Rate
> > (CIR)(packets/second). */
> > +                       uint64_t cir;
> > +
> > +                       /** Committed Burst Size (CBS) (bytes). */
> > +                       uint64_t cbs;
> > +
> > +                       /** Excess Burst Size (EBS) (bytes). */
> > +                       uint64_t ebs;
> > +               } srtcm_pps;
> >         };
> >  };
> >
> > @@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
> >          */
> >         uint32_t meter_trtcm_rfc4115_n_max;
> >
> > +       /** Maximum number of MTR objects that can have their meter
> > configured
> > +        * to run the srTCM packet per second algorithm. The value of 0
> > +        * indicates this metering algorithm is not supported.
> > +        * The maximum value is *n_max*.
> > +        */
> > +       uint32_t meter_srtcm_pps_n_max;
> > +
> >         /** Maximum traffic rate that can be metered by a single MTR
> > object. For
> >          * srTCM RFC 2697, this is the maximum CIR rate. For trTCM RFC
> > 2698,
> >          * this is the maximum PIR rate. For trTCM RFC 4115, this is
> > the maximum @@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
> >          */
> >         int color_aware_trtcm_rfc4115_supported;
> >
> > +       /**
> > +       * When non-zero, it indicates that color aware mode is
> > + supported
> > for
> > +       * the srTCM packet per second  metering algorithm.
> > +       */
> > +       int color_aware_srtcm_pps_supported;
> > +
> >         /** When non-zero, it indicates that the policer packet
> > recolor actions
> >          * are supported.
> >          * @see enum rte_mtr_policer_action
> > --
> > 2.21.0
> >
> >

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter
  2021-02-23  2:07           ` Li Zhang
@ 2021-02-23  8:24             ` Morten Brørup
  0 siblings, 0 replies; 10+ messages in thread
From: Morten Brørup @ 2021-02-23  8:24 UTC (permalink / raw)
  To: Li Zhang, Ferruh Yigit, Dekel Peled, Ori Kam, Slava Ovsiienko,
	Matan Azrad, Dumitrescu, Cristian
  Cc: dev, NBU-Contact-Thomas Monjalon, Raslan Darawsheh

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Li Zhang
> Sent: Tuesday, February 23, 2021 3:07 AM
> 
> Thanks for your comments.
> We changed the struct as below:
> struct rte_mtr_meter_profile {
>  ......
> 		/** Items only valid when alg is set to sprTCM. */
> 		struct {
> 			/** Committed Information Packet Rate (CIPR). */
> 			uint64_t cipr;
> 
> 			/** Committed Packet Burst Size (CPBS). */
> 			uint64_t cpbs;
> 
> 			/** Excess Packet Burst Size (EPBS). */
> 			uint64_t epbs;
> 		} sprtcm;
> }

That is certainly not an improvement! Please stick with the broadly accepted industry standard names (CIR, CBS, EBS, etc.). Newly invented names like CIPR will only cause confusion. Please note that CIR, CBS, EBS don't say anything about their units; it could be bytes, packets, cells, frames, messages or anything else. So it is perfectly natural using the same names for packets instead of bytes.

I propose the following modifications instead.

For the algorithm, keep the "Single Rate Three Color Marker" name mentioned in the RFCs, but indicate that the variant is packet based:

	/** Single Rate Three Color Marker, Packet based (srTCMp). */
	RTE_MTR_SRTCMP,

Or if you prefer the packet based indicator at the front instead:

	/** Packet based Single Rate Three Color Marker (psrTCM). */
	RTE_MTR_PSRTCM,

And for the meter profile, keep the industry standard names, but update the descriptions:

 		/** Items only valid when *alg* is set to srTCMp. */
 		struct {
 			/** Committed Information Rate (CIR) (packets/second). */
 			uint64_t cir;
 
 			/** Committed Burst Size (CBS) (packets). */
 			uint64_t cbs;
 
 			/** Excess Burst Size (EBS) (packets). */
 			uint64_t ebs;
 		} srtcmp;


Come to think of it: Is the unit packets, or is it actually Ethernet frames? In other words: Does a 4 KB TCP packet that the NIC's offload function chops up into three Ethernet frames count as one or three in this algorithm?


Med venlig hilsen / kind regards
- Morten Brørup

> 
> Regards,
> Li Zhang
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Morten Br?rup
> > Sent: Friday, February 12, 2021 3:41 PM
> > To: Ferruh Yigit <ferruh.yigit@intel.com>; Li Zhang
> <lizh@nvidia.com>; Dekel
> > Peled <dekelp@nvidia.com>; Ori Kam <orika@nvidia.com>; Slava
> Ovsiienko
> > <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Dumitrescu,
> > Cristian <cristian.dumitrescu@intel.com>
> > Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon <thomas@monjalon.net>;
> > Raslan Darawsheh <rasland@nvidia.com>
> > Subject: Re: [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet
> per second)
> > on meter
> >
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ferruh Yigit
> > > Sent: Thursday, January 28, 2021 7:28 PM
> > >
> > > On 1/25/2021 1:20 AM, Li Zhang wrote:
> > > > Currently the flow Meter algorithms in rte_flow only supports
> bytes
> > > > per second(BPS).
> > > > Such as Single Rate Three Color Marker (srTCM rfc2697) This RFC
> adds
> > > > the packet per second definition in Meter algorithms structure,
> to
> > > > support the rte_mtr APIs with type srTCM pps mode.
> > > > The below structure will be extended:
> > > > rte_mtr_algorithm
> > > > rte_mtr_meter_profile
> > > > Signed-off-by: Li Zhang <lizh@nvidia.com>
> > >
> > > cc'ed Cristian for review/comment.
> > >
> > > > ---
> > > >   lib/librte_ethdev/rte_mtr.h | 28 ++++++++++++++++++++++++++++
> > > >   1 file changed, 28 insertions(+)
> > > >
> > > > diff --git a/lib/librte_ethdev/rte_mtr.h
> > > b/lib/librte_ethdev/rte_mtr.h
> > > > index 916a09c5c3..3e88904faf 100644
> > > > --- a/lib/librte_ethdev/rte_mtr.h
> > > > +++ b/lib/librte_ethdev/rte_mtr.h
> > > > @@ -119,6 +119,9 @@ enum rte_mtr_algorithm {
> > > >
> > > >   	/** Two Rate Three Color Marker (trTCM) - IETF RFC 4115. */
> > > >   	RTE_MTR_TRTCM_RFC4115,
> > > > +
> > > > +	/** Single Rate Three Color Marker (srTCM) in Packet per
> second
> > > mode */
> > > > +	RTE_MTR_SRTCM_PPS,
> > > >   };
> > > >
> > > >   /**
> > > > @@ -171,6 +174,18 @@ struct rte_mtr_meter_profile {
> > > >   			/** Excess Burst Size (EBS) (bytes). */
> > > >   			uint64_t ebs;
> > > >   		} trtcm_rfc4115;
> > > > +
> > > > +		/** Items only valid when *alg* is set to srTCM -
> PPS. */
> > > > +		struct {
> > > > +			/** Committed Information Rate
> > (CIR)(packets/second).
> > > */
> > > > +			uint64_t cir;
> > > > +
> > > > +			/** Committed Burst Size (CBS) (bytes). */
> > > > +			uint64_t cbs;
> > > > +
> > > > +			/** Excess Burst Size (EBS) (bytes). */
> > > > +			uint64_t ebs;
> > > > +		} srtcm_pps;
> >
> > In PPS mode, the burst sizes (ebs, ebs) must be packets, not bytes.
> >
> > > >   	};
> > > >   };
> > > >
> > > > @@ -317,6 +332,13 @@ struct rte_mtr_capabilities {
> > > >   	 */
> > > >   	uint32_t meter_trtcm_rfc4115_n_max;
> > > >
> > > > +	/** Maximum number of MTR objects that can have their meter
> > > configured
> > > > +	 * to run the srTCM packet per second algorithm. The value
> of 0
> > > > +	 * indicates this metering algorithm is not supported.
> > > > +	 * The maximum value is *n_max*.
> > > > +	 */
> > > > +	uint32_t meter_srtcm_pps_n_max;
> > > > +
> > > >   	/** Maximum traffic rate that can be metered by a single
> MTR
> > > object. For
> > > >   	 * srTCM RFC 2697, this is the maximum CIR rate. For trTCM
> RFC
> > > 2698,
> > > >   	 * this is the maximum PIR rate. For trTCM RFC 4115, this
> is the
> > > maximum
> > > > @@ -342,6 +364,12 @@ struct rte_mtr_capabilities {
> > > >   	 */
> > > >   	int color_aware_trtcm_rfc4115_supported;
> > > >
> > > > +	/**
> > > > +	 * When non-zero, it indicates that color aware mode is
> supported
> > > for
> > > > +	 * the srTCM packet per second  metering algorithm.
> >
> > No need for two spaces between the words second and metering.
> >
> > > > +	 */
> > > > +	int color_aware_srtcm_pps_supported;
> > > > +
> > > >   	/** When non-zero, it indicates that the policer packet
> recolor
> > > actions
> > > >   	 * are supported.
> > > >   	 * @see enum rte_mtr_policer_action
> > > >
> > >


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-23  8:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25  1:02 [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second Li Zhang
2021-01-25  1:02 ` [dpdk-dev] [PATCH] [RFC]: adds support PPS(packet per second) on meter Li Zhang
2021-01-25  1:20   ` [dpdk-dev] [RFC 0/1] lib/librte_ethdev: Meter algorithms support packet per second Li Zhang
2021-01-25  1:20     ` [dpdk-dev] [PATCH] [RFC, v2]: adds support PPS(packet per second) on meter Li Zhang
2021-01-28 18:27       ` Ferruh Yigit
2021-02-12  7:40         ` Morten Brørup
2021-02-23  2:07           ` Li Zhang
2021-02-23  8:24             ` Morten Brørup
2021-02-12 21:35   ` [dpdk-dev] [PATCH] [RFC]: " Ajit Khaparde
2021-02-23  2:11     ` Li Zhang

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git