From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66E76A0C50; Fri, 16 Jul 2021 15:20:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DAE2C4067B; Fri, 16 Jul 2021 15:20:18 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id ADEAD40151 for ; Fri, 16 Jul 2021 15:20:17 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10046"; a="210718191" X-IronPort-AV: E=Sophos;i="5.84,245,1620716400"; d="scan'208";a="210718191" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2021 06:20:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,245,1620716400"; d="scan'208";a="563138353" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga004.jf.intel.com with ESMTP; 16 Jul 2021 06:20:16 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Fri, 16 Jul 2021 06:20:15 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Fri, 16 Jul 2021 06:20:15 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Fri, 16 Jul 2021 06:20:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lr8ai8B6M/bT1AcErQAMJoFcWeGOWJK+y/yiIQPxK+wu+m69BmR8KtBoUTwtfXVNDP5N27flbpUbiBh+rSRQ1dfpdHlWZTLcoBwP8dQbVxD7yAKPWbYQGOyMYm3JtZVHVg0fjidisTEcMe3apYSlMH6Oq8yck5qtgr+kpbzvMXHPz3zslWr5Gq0dYuzrNXWfcbFYOjjXPikpDyji/8DxCPh5T26f/aK+WEGIvvlhOAlZeITttNWMJES1XDFiH/Tc+x6AbzD1srS91KXau9Z8Ov1hhH7vP/E/hMY+Hm9MSAY1OOSKBLncEFP9lMX0AmvFouk/Ej2vOGs9MSXobooZxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZRxzraBiZPXvrPAPO/fQfBLLMiLx3owKioe0c5KEO9E=; b=UqPA2IH/+Z0driNzY/q2COPlFPWS8GUlhvczfWuWDsr5hCEUgwlO9GzuAbYv/6eTW51fiZZto0cRBlZXUNvZ/rewRd2DI8LvdI+NpODn+CiFvwMj5PH/Ht+2xGNltXf1uxDYtZ9LJYzimdXAPzfn0qMw9RZZ5X5gchKxxf+fXFrvNxaqnC88o+iSuwmqdJj5N/Sk8EXtMAb+5B4/lbOP6lJ7Q3H8XwL++8WgCx1Qj0reYpi/A8Q6s4SylOun52f8ovfNvmh+v1EW0VvrhT8DWttr1DORf/Q2AljWqdhQ/2MBJP/tNwUtpLClGuQcwLn7nwbgql2PhNeSgfVx/6qRgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZRxzraBiZPXvrPAPO/fQfBLLMiLx3owKioe0c5KEO9E=; b=lJI/myG/9+xEnrukvWYLaCapff2+K7ZnBgi6mA4bZsTAjuDs90C6U5V17TjyJeU1TWYp2c94U3d3Otv1g92aKXJ/8Hnyu/467YlWHcYstd+v9znEi3zFUvSSG/koq2V28Iy+FhRSdW91JhNQB5/I7765Cm+G5FNHKsLYG3JPcaY= Received: from DM8PR11MB5670.namprd11.prod.outlook.com (2603:10b6:8:37::12) by DM8PR11MB5671.namprd11.prod.outlook.com (2603:10b6:8:3c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Fri, 16 Jul 2021 13:20:14 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::4e4:c86b:b091:bc26]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::4e4:c86b:b091:bc26%3]) with mapi id 15.20.4331.026; Fri, 16 Jul 2021 13:20:14 +0000 From: "Dumitrescu, Cristian" To: "Liguzinski, WojciechX" , "dev@dpdk.org" , "Singh, Jasvinder" CC: "Dharmappa, Savinay" , "Ajmera, Megha" Thread-Topic: [RFC PATCH v4 1/3] sched: add PIE based congestion management Thread-Index: AQHXcXRuYkjgM5bpAkmN+sxO+IBGMatFnmjA Date: Fri, 16 Jul 2021 13:20:13 +0000 Message-ID: References: <20210621073506.96017-1-wojciechx.liguzinski@intel.com> <20210705080421.18736-1-wojciechx.liguzinski@intel.com> <20210705080421.18736-2-wojciechx.liguzinski@intel.com> In-Reply-To: <20210705080421.18736-2-wojciechx.liguzinski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 25d0403d-0e72-43fd-ae4e-08d9485c7240 x-ms-traffictypediagnostic: DM8PR11MB5671: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KVsp+v7Fv+Lgpq6CDAIuaVLO9W8Nojj9SnBO10jzWGPhYDn/NLCZG3GpMV6GVPdfLYD4HfGHdfEx2t71k2NUBUM2m2GIGJxiQA8MDqhxMIdtf2rrqB/iTG/T/bwQiBO1gQCcYFftE0qzwguEuOx8KNaAz/ScQ6acB71ap9oVVkDLKY0P7zGol3oewhDA3HLxBxDZ2W1ow4mcyqSqzgf6Z5zyuyV0FOO9m2EUb+pl0IqSvUUCELr2eghZor/X4lpZpTYMAEWon0mru5v4Ans553y3QdmACd7wx3li3kpASgwgPib98Ny9UmE3iwizNGPR0ZD3UR2YZ7z4qMZFs9zUsifrF3grHQRVw4mIV6eJWYLkeMgzkqnlHu/QPWDbmEHgWYpH8ty93ODSDXmpJzIzaskkZfsetwNwHtv08GQXtflYzzlcPPpLsJYKIc+EUv6NV8tsG+QFY7iFVgAS4owgBSUuC/6LlebAwJvGQQxXLVyAlYYdvg7oOxcZEGp5bQq4NW+0ue8C7KAbzngUweBMbHn57+YFqBhb0TwJuEmMW681uXJiyZlAZtqyy+0x2MSPhLlLHsitjjnlC9XrGtGeG795zZ9s20rthCYqie77jRHHWeiWzjnQsP/JYQ91ak6kX3PgZnAdHJeNvYxI/7XwD8peYmFHwxtyoo4PkGrQhkgPl0dfEKI/ckD6nb28nZfbbsOdb5u2raFsRU7nTvKxdw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5670.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(346002)(396003)(376002)(83380400001)(7696005)(107886003)(26005)(186003)(5660300002)(86362001)(33656002)(6636002)(6506007)(52536014)(53546011)(71200400001)(54906003)(316002)(110136005)(478600001)(66446008)(38100700002)(4326008)(9686003)(66946007)(55016002)(122000001)(76116006)(66556008)(2906002)(8676002)(8936002)(64756008)(66476007)(38070700004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?k7HMXWoxpc223nYZkdQhFwVYbLwBieOW13AYg6IPiqSsY2sz/46X3lpfubjD?= =?us-ascii?Q?A9Wesf9bYDeM9ZdzN3jGj9uDRpBx3vbpbM9xyHNTOET9tVIkS7t0iq6abyfF?= =?us-ascii?Q?2h40FJoE9WGZBjA+xVb5fNda0IUJSSURanNd8kWGbWocQ2oDyqBzdNELmZ7i?= =?us-ascii?Q?BpK6YOdy/CbJj8LZVL/5HITBFwlh9DJ5X9hkFQ3Y1EDaN3cAEmEG5WBiygzK?= =?us-ascii?Q?GXg4+tJZHw8MlEOvqj0IoZnofQnHR0Q+kyRvUdSYzl/KT7GnwQ5FDqTPKpl2?= =?us-ascii?Q?wNE1DhEV01cHOjs0HTHhau9dcMbglvxWU/p9HQ2cGc6jxT+b0R6PP09YYtvq?= =?us-ascii?Q?PfdbwYnrwi/kYcqGrMm+0pec1YNpusFU9Z8FA+/rPDHl9Ll7A4+BidmerJ0G?= =?us-ascii?Q?nc3psNcjxFBTrZfbHpUlFCYtE2RZO3b/3skFvF9Fm7qTifStDsgENny6CDrN?= =?us-ascii?Q?cFrvSWxPeyRKIFc3ZPqnDG+xZ3/AMo8m2pHvUWTHGLRJO+Y4n5XfE5icbCp6?= =?us-ascii?Q?CACZHoGu2U2Kz8xGkFdQMtzgiYgMAEzNEtNDZTBvzqaLkNUmBn+kVDdCmir8?= =?us-ascii?Q?qbVpPTjpnTh1Bw/R//cE112i4r61xiXSoKu4Mq3UdWiWWlN+Gc4bhho+9bgH?= =?us-ascii?Q?2ftZZKHcglfp/StoiTffoEKCocCYB02LRB5PJffxpiDelf1JYZflMToDZIkF?= =?us-ascii?Q?HoEaV8L01824BIooOGAVuDHsKn3mx+yFIdkT0g8vdja0rU36GCmeskf87ICx?= =?us-ascii?Q?v9KIbIaepDjVcWwZbOJ2ya0y5NCsUuu2v+t5FP9NWDkFesSwBp6M8NcFlNT0?= =?us-ascii?Q?M7nAbHk3QOQCzRkplrRdWbWU7eGktih/GwM/S5/tOxH3EhwZ9Ef6rbAPLCNJ?= =?us-ascii?Q?6PWG7MxPc1ex5Ad+1Wj/V7vzJJLmZvx+C7gzuh5LUHmzV6Ng61Lu+YpQcmWA?= =?us-ascii?Q?opmVxXMqczFH9X+g07opftcsDqmpZ1eXqCXUvqeaUSnEhmquBcg6TqblkJkv?= =?us-ascii?Q?yv4ARZKhLsmcYYfdUdsmuUyj+ZnmrpgPm4C/6ZfAi+Z30EdgWxUf9xNIPzCB?= =?us-ascii?Q?ZdnwbARzHgkEXwt+HQDodkWSe86h7qPEK22+ZcUw53qiFuJKWJwgwwsrR0rD?= =?us-ascii?Q?Za5SBZgIQocjmZ5ARU+i1nTO766t7Ly58J+v75rnnk1pLiMqJXOna7y2Rq6D?= =?us-ascii?Q?YP77J//xpx/evTocUUvZ1HEeJydv6FACt6NJRleF1Kr/3V+5Vh3uoggG2TA2?= =?us-ascii?Q?BKjkD8c1ahQaYYvtljJsogvW6RWA4Cs9ONzDe1vmG5m0y8nTzJD0GCiq05dd?= =?us-ascii?Q?k4XW+rmLLK/bR0dQYpB4EkOM?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5670.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25d0403d-0e72-43fd-ae4e-08d9485c7240 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2021 13:20:13.9812 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xq6aAYcl74BZt72dOFJSDp7oFkl7/UEFmFS+m/BOaouuzTrMTa1tgRaiSoNlsu2H6qCz9ucWKTTOOwuU9SF2HQP68+sHR3H9tUeHEcm7izE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5671 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC PATCH v4 1/3] sched: add PIE based congestion management X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Wojciech, > -----Original Message----- > From: Liguzinski, WojciechX > Sent: Monday, July 5, 2021 9:04 AM > To: dev@dpdk.org; Singh, Jasvinder ; > Dumitrescu, Cristian > Cc: Dharmappa, Savinay ; Ajmera, Megha > > Subject: [RFC PATCH v4 1/3] sched: add PIE based congestion management >=20 > Implement PIE based congestion management based on rfc8033 >=20 > Signed-off-by: Liguzinski, WojciechX > --- > 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 >=20 > 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 > #include >=20 > -/** 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 use= d 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 >=20 > /** Maximum number of queues per pipe. > @@ -110,6 +111,28 @@ extern "C" { > #define RTE_SCHED_FRAME_OVERHEAD_DEFAULT 24 > #endif >=20 > +/** > + * Active Queue Management (AQM) mode > + * > + * This is used for controlling the admission of packets into a packet q= ueue > 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 *We= ighted > + * RED* algorithm uses a separate set of RED thresholds for each packet > color. > + * > + * Similar to RED, Proportional Integral Controller Enhanced (PIE) rando= mly > + * drops a packet at the onset of the congestion and tries to control th= e > + * latency around the target value. The congestion detection, however, i= s > based > + * on the queueing latency instead of the queue length like RED. For mor= e > + * 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; >=20 > -#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 > }; >=20 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]; >=20 > -#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 > }; >=20 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; >=20 > -#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 >=20 > /** 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