DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Liguzinski, WojciechX" <wojciechx.liguzinski@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Singh, Jasvinder" <jasvinder.singh@intel.com>
Cc: "Dharmappa, Savinay" <savinay.dharmappa@intel.com>,
	"Ajmera, Megha" <megha.ajmera@intel.com>
Subject: Re: [dpdk-dev] [RFC PATCH v4 1/3] sched: add PIE based congestion management
Date: Fri, 16 Jul 2021 13:20:13 +0000
Message-ID: <DM8PR11MB56707320E15DD14FA5C9046AEB119@DM8PR11MB5670.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210705080421.18736-2-wojciechx.liguzinski@intel.com>

Hi Wojciech,

> -----Original Message-----
> From: Liguzinski, WojciechX <wojciechx.liguzinski@intel.com>
> Sent: Monday, July 5, 2021 9:04 AM
> To: dev@dpdk.org; Singh, Jasvinder <jasvinder.singh@intel.com>;
> Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: Dharmappa, Savinay <savinay.dharmappa@intel.com>; Ajmera, Megha
> <megha.ajmera@intel.com>
> Subject: [RFC PATCH v4 1/3] sched: add PIE based congestion management
> 
> Implement PIE based congestion management based on rfc8033
> 
> Signed-off-by: Liguzinski, WojciechX <wojciechx.liguzinski@intel.com>
> ---
>  drivers/net/softnic/rte_eth_softnic_tm.c |   6 +-
>  lib/sched/meson.build                    |  10 +-
>  lib/sched/rte_pie.c                      |  82 +++++
>  lib/sched/rte_pie.h                      | 393 +++++++++++++++++++++++
>  lib/sched/rte_sched.c                    | 229 +++++++++----
>  lib/sched/rte_sched.h                    |  53 ++-
>  lib/sched/version.map                    |   3 +
>  7 files changed, 685 insertions(+), 91 deletions(-)
>  create mode 100644 lib/sched/rte_pie.c
>  create mode 100644 lib/sched/rte_pie.h
> 

<snip>

> diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h
> index c1a772b70c..a5fe6266cd 100644
> --- a/lib/sched/rte_sched.h
> +++ b/lib/sched/rte_sched.h
> @@ -61,9 +61,10 @@ extern "C" {
>  #include <rte_mbuf.h>
>  #include <rte_meter.h>
> 
> -/** Random Early Detection (RED) */
> -#ifdef RTE_SCHED_RED
> +/** Active Queue Management */
> +#ifdef RTE_SCHED_AQM

We typically use the term Congestion Management for this, it is already used in rte_tm.h for example. Please replace AQM with CMAN _everywhere_:

#ifdef RTE_SCHED_CMAN

>  #include "rte_red.h"
> +#include "rte_pie.h"
>  #endif
> 
>  /** Maximum number of queues per pipe.
> @@ -110,6 +111,28 @@ extern "C" {
>  #define RTE_SCHED_FRAME_OVERHEAD_DEFAULT      24
>  #endif
> 
> +/**
> + * Active Queue Management (AQM) mode
> + *
> + * This is used for controlling the admission of packets into a packet queue
> or
> + * group of packet queues on congestion.
> + *
> + * The *Random Early Detection (RED)* algorithm works by proactively
> dropping
> + * more and more input packets as the queue occupancy builds up. When
> the queue
> + * is full or almost full, RED effectively works as *tail drop*. The *Weighted
> + * RED* algorithm uses a separate set of RED thresholds for each packet
> color.
> + *
> + * Similar to RED, Proportional Integral Controller Enhanced (PIE) randomly
> + * drops a packet at the onset of the congestion and tries to control the
> + * latency around the target value. The congestion detection, however, is
> based
> + * on the queueing latency instead of the queue length like RED. For more
> + * information, refer RFC8033.
> + */
> +enum rte_sched_aqm_mode {
> +	RTE_SCHED_AQM_WRED, /**< Weighted Random Early Detection
> (WRED) */
> +	RTE_SCHED_AQM_PIE,  /**< Proportional Integral Controller
> Enhanced (PIE) */
> +};
> +
>  /*
>   * Pipe configuration parameters. The period and credits_per_period
>   * parameters are measured in bytes, with one byte meaning the time
> @@ -174,9 +197,17 @@ struct rte_sched_subport_params {
>  	/** Max allowed profiles in the pipe profile table */
>  	uint32_t n_max_pipe_profiles;
> 
> -#ifdef RTE_SCHED_RED
> -	/** RED parameters */
> -	struct rte_red_params
> red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS];
> +#ifdef RTE_SCHED_AQM
> +	/** Active Queue Management mode */
> +	enum rte_sched_aqm_mode aqm;
> +
> +	RTE_STD_C11
> +	union {
> +		/** WRED parameters */
> +		struct rte_red_params
> wred_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS];
> +		/** PIE parameters */
> +		struct rte_pie_params
> pie_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
> +	};
>  #endif
>  };
> 

We cannot have definitions of global variables in header files, we can only have extern declarations in header files and the definition in .c files.

Please create a global structure called rte_sched_cman_params that includes the both the WRED and the PIE parameters:

struct rte_sched_cman_params {
	enum rte_sched_cman cman_mode;

	union {
		/** WRED parameters */
		struct rte_red_params red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS];

		/** PIE parameters */
		struct rte_pie_params pie_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
	};
};

Then please instantiate this structure in one of the .c files.

Please do not rename red to wred (as done in multiple places in this patch set).

> @@ -208,9 +239,9 @@ struct rte_sched_subport_stats {
>  	/** Number of bytes dropped for each traffic class */
>  	uint64_t
> n_bytes_tc_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
> 
> -#ifdef RTE_SCHED_RED
> -	/** Number of packets dropped by red */
> -	uint64_t
> n_pkts_red_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
> +#ifdef RTE_SCHED_AQM
> +	/** Number of packets dropped by active queue management
> scheme */
> +	uint64_t
> n_pkts_aqm_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
>  #endif
>  };
> 

Please remove the #ifdefs and consolidate these stats into a single generic structure:

struct rte_sched_subport_stats {
	...
	uint64_t n_pkts_cman_dropped[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
	...
};

You can use the n_pkts_cman_dropped field for both WRED and PIE, depending on the cman_mode.

> @@ -222,9 +253,9 @@ struct rte_sched_queue_stats {
>  	/** Packets dropped */
>  	uint64_t n_pkts_dropped;
> 
> -#ifdef RTE_SCHED_RED
> -	/** Packets dropped by RED */
> -	uint64_t n_pkts_red_dropped;
> +#ifdef RTE_SCHED_AQM
> +	/** Packets dropped by active queue management scheme */
> +	uint64_t n_pkts_aqm_dropped;
>  #endif
> 
>  	/** Bytes successfully written */

Please remove the #ifdefs and consolidate these stats into a single generic structure:

struct rte_sched_queue_stats {
	...
	uint64_t n_pkts_cman_dropped;
	...
};

You can use the n_pkts_cman_dropped field for both WRED and PIE, depending on the cman_mode.

Regards,
Cristian

  reply	other threads:[~2021-07-16 13:20 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 10:58 [dpdk-dev] [RFC PATCH 0/3] Add PIE support for HQoS library Liguzinski, WojciechX
2021-05-24 10:58 ` [dpdk-dev] [RFC PATCH 1/3] sched: add pie based congestion management Liguzinski, WojciechX
2021-05-25  9:16   ` Morten Brørup
2021-06-09  8:36     ` Liguzinski, WojciechX
2021-06-09 12:35       ` Morten Brørup
2021-05-24 10:58 ` [dpdk-dev] [RFC PATCH 2/3] example/qos_sched: add pie support Liguzinski, WojciechX
2021-05-24 10:58 ` [dpdk-dev] [RFC PATCH 3/3] example/ip_pipeline: " Liguzinski, WojciechX
2021-05-24 16:19 ` [dpdk-dev] [RFC PATCH 0/3] Add PIE support for HQoS library Stephen Hemminger
2021-05-25  8:56 ` Morten Brørup
2021-06-07 13:01   ` Liguzinski, WojciechX
2021-06-09 10:53 ` [dpdk-dev] [RFC PATCH v1 " Liguzinski, WojciechX
2021-06-09 10:53   ` [dpdk-dev] [RFC PATCH v1 1/3] sched: add PIE based congestion management Liguzinski, WojciechX
2021-06-09 10:53   ` [dpdk-dev] [RFC PATCH v1 2/3] example/qos_sched: add PIE support Liguzinski, WojciechX
2021-06-09 10:53   ` [dpdk-dev] [RFC PATCH v1 3/3] example/ip_pipeline: " Liguzinski, WojciechX
2021-06-15  9:01   ` [dpdk-dev] [RFC PATCH v2 0/3] Add PIE support for HQoS library Liguzinski, WojciechX
2021-06-15  9:01     ` [dpdk-dev] [RFC PATCH v2 1/3] sched: add PIE based congestion management Liguzinski, WojciechX
2021-06-15  9:01     ` [dpdk-dev] [RFC PATCH v2 2/3] example/qos_sched: add PIE support Liguzinski, WojciechX
2021-06-15 12:23       ` Morten Brørup
2021-06-15  9:02     ` [dpdk-dev] [RFC PATCH v2 3/3] example/ip_pipeline: " Liguzinski, WojciechX
2021-06-21  7:35     ` [dpdk-dev] [RFC PATCH v3 0/3] Add PIE support for HQoS library Liguzinski, WojciechX
2021-06-21  7:35       ` [dpdk-dev] [RFC PATCH v3 1/3] sched: add PIE based congestion management Liguzinski, WojciechX
2021-06-21 18:17         ` Stephen Hemminger
2021-06-22  7:39           ` Liguzinski, WojciechX
2021-06-21  7:35       ` [dpdk-dev] [RFC PATCH v3 2/3] example/qos_sched: add PIE support Liguzinski, WojciechX
2021-06-21  7:35       ` [dpdk-dev] [RFC PATCH v3 3/3] example/ip_pipeline: " Liguzinski, WojciechX
2021-07-05  8:04       ` [dpdk-dev] [RFC PATCH v4 0/3] Add PIE support for HQoS library Liguzinski, WojciechX
2021-07-05  8:04         ` [dpdk-dev] [RFC PATCH v4 1/3] sched: add PIE based congestion management Liguzinski, WojciechX
2021-07-16 13:20           ` Dumitrescu, Cristian [this message]
2021-07-16 15:11           ` Dumitrescu, Cristian
2021-07-05  8:04         ` [dpdk-dev] [RFC PATCH v4 2/3] example/qos_sched: add pie support Liguzinski, WojciechX
2021-07-05  8:04         ` [dpdk-dev] [RFC PATCH v3 3/3] example/ip_pipeline: add PIE support Liguzinski, WojciechX
2021-07-16 12:46         ` [dpdk-dev] [RFC PATCH v4 0/3] Add PIE support for HQoS library Dumitrescu, Cristian
2021-09-07  7:33         ` [dpdk-dev] [RFC PATCH v5 0/5] " Liguzinski, WojciechX
2021-09-07  7:33           ` [dpdk-dev] [RFC PATCH v5 1/5] sched: add PIE based congestion management Liguzinski, WojciechX
2021-09-07 19:14             ` Stephen Hemminger
2021-09-08  8:49               ` Liguzinski, WojciechX
2021-09-07  7:33           ` [dpdk-dev] [RFC PATCH v5 2/5] example/qos_sched: add pie support Liguzinski, WojciechX
2021-09-07  7:33           ` [dpdk-dev] [RFC PATCH v5 3/5] example/ip_pipeline: add PIE support Liguzinski, WojciechX
2021-09-07  7:33           ` [dpdk-dev] [RFC PATCH v5 4/5] doc/guides/prog_guide: added PIE Liguzinski, WojciechX
2021-09-07  7:33           ` [dpdk-dev] [RFC PATCH v5 5/5] app/test: add tests for PIE Liguzinski, WojciechX
2021-09-07 14:11           ` [dpdk-dev] [RFC PATCH v6 0/5] Add PIE support for HQoS library Liguzinski, WojciechX
2021-09-07 14:11             ` [dpdk-dev] [RFC PATCH v6 1/5] sched: add PIE based congestion management Liguzinski, WojciechX
2021-09-07 14:11             ` [dpdk-dev] [RFC PATCH v6 2/5] example/qos_sched: add PIE support Liguzinski, WojciechX
2021-09-07 14:11             ` [dpdk-dev] [RFC PATCH v6 3/5] example/ip_pipeline: " Liguzinski, WojciechX
2021-09-07 14:11             ` [dpdk-dev] [RFC PATCH v6 4/5] doc/guides/prog_guide: added PIE Liguzinski, WojciechX
2021-09-07 14:11             ` [dpdk-dev] [RFC PATCH v6 5/5] app/test: add tests for PIE Liguzinski, WojciechX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM8PR11MB56707320E15DD14FA5C9046AEB119@DM8PR11MB5670.namprd11.prod.outlook.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=megha.ajmera@intel.com \
    --cc=savinay.dharmappa@intel.com \
    --cc=wojciechx.liguzinski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://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/ https://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