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 A6DA7A0C4E; Fri, 15 Oct 2021 15:51:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63C3B411CB; Fri, 15 Oct 2021 15:51:08 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 24144410F1 for ; Fri, 15 Oct 2021 15:51:05 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10137"; a="214849761" X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="214849761" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 06:51:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="528112496" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga008.fm.intel.com with ESMTP; 15 Oct 2021 06:51:04 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 15 Oct 2021 06:51:04 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 15 Oct 2021 06:51:03 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 15 Oct 2021 06:51:03 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 15 Oct 2021 06:51:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AWC/n8lDotLjFpWfPEA0jpbWGik7XsiNwEqyOt/JyAbM8OlnQbzc0cFHURVbzxaXu7/SIkwvVVQNrkbgKEJCYdlbwnai9Y9ZV1KlpPhr75pEW/FT/stbXXtwF+BYkqWYCObRw/cExjR4I94mC/NhAS4iPXkmvl+LU4wxM+qlh5iak51hYPOVAeby6J/3HDvcnjorJuZnZSlrJ8yod3PxumXfnMoF/qpeanskUHwWv62Oz9aauev3lJ2Efge3kWmjzS0wsWT1JJNqdp9S+CLqIijuayXUBTie4Dyhs+UQE9IrSszfCbQgoYMxh/FQOqO2gdj8O7mfhhwHRq/v/L5GZg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GMNx2IOz/IgJVWvQPvLbieEU8oLb8mSVfT6LzqcXhNs=; b=FMZ4fTtIncjhNbcAUbM3tMmRfD2EZF5yBS9d+svaAUftBrqvGug0SOoiDDaRsmxOKLCMP8nM4RTZ7DONp5rZcgqLOrsq1qZNol2q65aHwjw/urSZIkZsSsthXVbl1vM5rhtA2CM1Eq6ygzRkXOpAqED7j4nVSsNtOp1cM2sZYHY8A3ey5rAGaF10pP5J2ZvfnIHeFADiiqZDCV3EtLxyX0hKlpXtgYRw3i5D4H0/CgQPwROhe0SaxRKIDmJMi7J3IFZDK4BRFbxx6Qf5j+R60qV9HNqsm7uTUDHCQHQXUMKTqrhe3MWeOJs71r7PTyuZhvhztOwZfaTJtarUbwTlEA== 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=GMNx2IOz/IgJVWvQPvLbieEU8oLb8mSVfT6LzqcXhNs=; b=M17G2zwJWo239FP1VnwY8ktwOqftmpg7EN3p4nURBqcMX1CIISk7MfyvWEbakjXnQLjStb1jMKZ3ZkMBX9CmD+LS49BiC4Hbh7CXntzy82CS1YmDuytuBgN8uoih6p7sEeEy0AfA6hFhhCTb9G29erw6YrBhvtCqFvfeUBkohHI= Received: from DM8PR11MB5670.namprd11.prod.outlook.com (2603:10b6:8:37::12) by DM8PR11MB5574.namprd11.prod.outlook.com (2603:10b6:8:39::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Fri, 15 Oct 2021 13:51:02 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::c0f1:1135:ceb5:ac10]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::c0f1:1135:ceb5:ac10%9]) with mapi id 15.20.4608.017; Fri, 15 Oct 2021 13:51:02 +0000 From: "Dumitrescu, Cristian" To: "Liguzinski, WojciechX" , "dev@dpdk.org" , "Singh, Jasvinder" CC: "Ajmera, Megha" Thread-Topic: [PATCH v14 1/5] sched: add PIE based congestion management Thread-Index: AQHXwZz1UNQTvV75CUa1JhfGkSNbE6vUDv8w Date: Fri, 15 Oct 2021 13:51:02 +0000 Message-ID: References: <20211014153346.2816600-1-wojciechx.liguzinski@intel.com> <20211015081620.2873739-1-wojciechx.liguzinski@intel.com> <20211015081620.2873739-2-wojciechx.liguzinski@intel.com> In-Reply-To: <20211015081620.2873739-2-wojciechx.liguzinski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 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: 8788c50f-6943-4ecd-7be5-08d98fe2d3bd x-ms-traffictypediagnostic: DM8PR11MB5574: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cxExyd7Jn8h+ANtwfxNPJRLP7R0sWJaiNf5R16ji48jyVBICO/lqzSLWzorPyaDsGlD3XTHVQDe6OpPOp+h5K9W12F07FbzXSOI25zH2p7mThZVP7uxQKKmZmJQNuRn5AGkvuuej5FHvbHD69HQCFZfWT8aQ5szRuYWhExhcoeGRnE+s3hknpZvmio6HjdDY0vrfUy2sQ7+EDsZyo+Ygqe8u//PJANE56eurJ1EP8Sz6USUePoSeXsoRdg6umKAzK+y1I2xz8K7I4/7QCmN5vZfhJJvpwX3N80xltj/LKEposQyoFVUbQ64tjf1c8n/OFYZyS7UDOuv6GmfgUpbZrCQWYXpP1KrfmcM+fMtUKZQCiaZvFw8mvCX/7WhVQFYm/GYMM/qNCsB4DLIJzVhBblcONm25bPbmRCnNoGvQckaDfZxDcG+KYYOKb8pqcc3BwpzeijgvL+AdNyd1Cl0qweP32Gr7W5X+88SCsKVJz4tu7adAeSxpxZRE1s5Xfq05Z45YUa+o5B/Bt9lU1oyO0jVDjcEYkLzo42eLlGbdmzlttaIDuILRUniJUgyxLeGUfKPFTiD5baF0eKL1Tup1lpdiummfxlN8rlOrWKV3t8e7k2DE9CzWoUlVUtgjnAvZ/rAUGtRLxzYQEHqqLR8k0dqsnwbZdcP0T0bCEruVblhblNb87zq9v1C/3vnZCi8OW5D0N+z3fqStDxismu76jg== 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:(366004)(122000001)(6636002)(33656002)(7696005)(4326008)(508600001)(5660300002)(38100700002)(316002)(107886003)(8676002)(71200400001)(26005)(9686003)(82960400001)(8936002)(66446008)(6506007)(53546011)(76116006)(66476007)(66556008)(64756008)(66946007)(186003)(38070700005)(2906002)(110136005)(86362001)(55016002)(83380400001)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aoUrnfSVRthBpdIHBh1fer0K8dAgFryRIQOpNoNjwNFaqU9r56gmoX6TNOiv?= =?us-ascii?Q?OxAGuON7A8qE265JWTWsg91+q8HelegD7wRftssiuIHTIYlGVbpD95y4Nptq?= =?us-ascii?Q?qk2HBjm/oOEwYjxpIF1FETg4lIP5Fm3oOMjp+rvw3upkr5Lccj+MKgr3AAQB?= =?us-ascii?Q?h5akkEgHForyUM3XFsnKF3FhTRTZD1zXW4RuLgkcxjpPbQfWAI+orOMNvG3U?= =?us-ascii?Q?CrzxWxuOcFRcTH76ZZlMhMeRFzzpJ5LI1pbGpVI71zQeKJ9OttdlrZqQXWQN?= =?us-ascii?Q?ma0VuVFj7lYmhyBnD/e3fH8wDPUTC+QLy0kC6mpcVIdlgE8BuUO5TLm1EPl0?= =?us-ascii?Q?IUnmeETgGQ3BL2ldp/TrbrsgMpa/U4SoKe37/95a3uASXHIzdyngtdKblwBs?= =?us-ascii?Q?0tQVkJ6uQJc0niGrK1uuSkBJduZ1Y8ela4QefgKzbJPsKezQ/LDfAdo8Et1v?= =?us-ascii?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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: 8788c50f-6943-4ecd-7be5-08d98fe2d3bd X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2021 13:51:02.6790 (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: rdVGtkLjjP9S7lIWY7a3Zff1ldkJsap0nfjrE8VNzDZf/woJxDIGOTUIx+trWqOprXvES3/DuEhF3lgw2Gw9QbUmQJL9Ec6/8G7j8UtU+Sc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5574 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v14 1/5] 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, Thank you for your patchset! Can you please, at least starting from this version, add a short change log= at the top of your file, just after the signoff line? It helps a lot durin= g the review process, and you can find abundant examples in other patchsets= from this email list. One line of description for every change would be ni= ce, thank you. > -----Original Message----- > From: Liguzinski, WojciechX > Sent: Friday, October 15, 2021 9:16 AM > To: dev@dpdk.org; Singh, Jasvinder ; > Dumitrescu, Cristian > Cc: Ajmera, Megha > Subject: [PATCH v14 1/5] 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 | 240 +++++++++----- > lib/sched/rte_sched.h | 63 +++- > lib/sched/version.map | 3 + > 7 files changed, 701 insertions(+), 96 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.c b/lib/sched/rte_sched.c > index a858f61f95..a066eed186 100644 > --- a/lib/sched/rte_sched.c > +++ b/lib/sched/rte_sched.c > @@ -183,8 +187,14 @@ struct rte_sched_subport { > /* Pipe queues size */ > uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; >=20 > -#ifdef RTE_SCHED_RED > - struct rte_red_config > red_config[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS]; > +#ifdef RTE_SCHED_CMAN > + enum rte_sched_cman_mode cman; > + > + RTE_STD_C11 > + union { > + struct rte_red_config > red_config[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS]; > + struct rte_pie_config > pie_config[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]; > + }; > #endif Can you please use here the rte_sched_cman_params structure that you just c= reated in rte_sched.h as opposed to inlining this structure. Yes, I agree i= t might have some ripple effect throughout this file, but I think it should= be very limited, and also quick to do. > diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h > index c1a772b70c..07fcf439d8 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 > +/** Congestion Management */ > +#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 > +/** > + * Congestion Management (CMAN) 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_cman_mode { > + RTE_SCHED_CMAN_WRED, /**< Weighted Random Early Detection > (WRED) */ The algorithm is RED, not WRED. Let's stick to RTE_SCHED_CMAN_RED, please. = The Weighted aspect comes into place when defining the struct rte_sched_cma= n_params::red_params as an array indexed by color below. > + RTE_SCHED_CMAN_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,12 +197,30 @@ 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_CMAN > + /** Congestion Management parameters */ > + struct rte_sched_cman_params *cman_params; You are instantiating struct rte_sched_cma_params here, but you are definin= g it just below, i.e. after you attempted to instantiate it. Aren't you get= ting a build error when compiling with RTE_SCHED_CMAN defined? > #endif > }; >=20 > +#ifdef RTE_SCHED_CMAN > +/* > + * Congestion Management configuration parameters. > + */ > +struct rte_sched_cman_params { > + /** Congestion Management mode */ > + enum rte_sched_cman_mode cman_mode; > + > + union { > + /** WRED parameters */ In the comment: RED parameters instead of WRED, please. > + 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]; > + }; > +}; > +#endif > + > diff --git a/lib/sched/version.map b/lib/sched/version.map > index 53c337b143..54e5e96d4f 100644 > --- a/lib/sched/version.map > +++ b/lib/sched/version.map > @@ -30,4 +30,7 @@ EXPERIMENTAL { > rte_sched_subport_pipe_profile_add; > # added in 20.11 > rte_sched_port_subport_profile_add; > + > + rte_pie_rt_data_init; > + rte_pie_config_init; You need to put a comment about the release when these symbols got introduc= ed, similar to above. > }; > -- > 2.25.1 Thank you for your work! Regards, Cristian