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 47327A0540; Wed, 6 Jul 2022 10:54:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3198440A7F; Wed, 6 Jul 2022 10:54:01 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 0F71D40691 for ; Wed, 6 Jul 2022 10:53:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657097640; x=1688633640; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=3qn1+xh1WSkP4EEFq8C3j7RrEif0zb/yTnGvEa+S7gg=; b=R0ASsbCa+reo8G3wdlUINw/w6rESq6VcMmX5FSs9LZH+YPlkxSq1IZWY 94QbdKW/ZxiIi/BYM29x/THtHP2PV/7EgzUFTJeEjx/+lqWKxh4IqCa7g pJtw6wWoFJEakCasmJX4B+WCBAdt/bbmDqj83WM+lwHB2zBuBRzCgU8Rw zD7ZPtVg2ZuuUHhh3CcipcmzV6DSQds+8OE5NTmi7mCMjVuMMUUTlqIfH trDn5tKSHEAQ7zUnx1yldtNdM8E3ktro0Ag50NaqcVMG+qGrLYyseObXo 5y3Tdp9nbT628V7R2bqcrHllEAlVEim6GWZK2a/3USSqJi2slk7bTAhmn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10399"; a="263472724" X-IronPort-AV: E=Sophos;i="5.92,249,1650956400"; d="scan'208";a="263472724" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 01:53:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,249,1650956400"; d="scan'208";a="625800284" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP; 06 Jul 2022 01:53:58 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2308.27; Wed, 6 Jul 2022 01:53:58 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 6 Jul 2022 01:53:58 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.46) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 6 Jul 2022 01:53:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GpD6y0doBoWKrZm7b5mPzhV1QUZZttMEg9rvvKstAppx3xgjvVYMNtButTNkXVoDC8grrlTDMZIGl7jGpBbMSJE3t0WAQrKE7tQLgaiHtv9lCYtNjcXcwQOw5PJRfF7JNNVJ73TFXEKWCvlYDVcIvXkkIpP2EIgUWyEz/iyCVGLZo6BvwdbB47G9s+Fe5ogSoFX1jVqQF5FfZWw/bSO3I/qA+xD0DRdIdoGEAmVNJNyJvB1jFWlxFZesJm/TX7SciwIq4A/yCgvRQknH1yTEubCzrCV1rV5tXRTpiz6/SQAFsRud7x4xj092UlsUKpYoS8HX4i1tuxoHiTFcgcwmDw== 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=Y30EmTZLvC42QRgyctP2WxrsllsnzfTg2ukD8lH2u8w=; b=lO2vlbpeLcnBHhZfJhqU+RhMPBuk6gAoJaz5Uu3QXk1XoEU8nwM298IdGbPPH2kSWbmQ/5SpnmRcwVFYfJkUwfI5UkyGWKGliTi3PqLZjrF/p6X/JIjxna1PxRUCQp0ywvFXybgq6ObMUTfssn8NvsX60ys7hMM58WGKL9P+oMFBbwjbSBzQOZirn7TCuqlM6wUzfp+OTShMUKuwg44bXRgc6Xt32d9HDOqpqIcCFen2z7M61djESXw9TEUJMWxgOqLarxLYC/S821yZm8R6rZx/j9zV/4CIddP0rQn4taoEuYtTFzv9HbMDcCoUHYst3nkJgk3JfblDTuiOd/yOOA== 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 Received: from CY4PR11MB1589.namprd11.prod.outlook.com (2603:10b6:910:e::13) by DM6PR11MB4028.namprd11.prod.outlook.com (2603:10b6:5:195::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Wed, 6 Jul 2022 08:53:55 +0000 Received: from CY4PR11MB1589.namprd11.prod.outlook.com ([fe80::d8a8:752a:a43c:b7db]) by CY4PR11MB1589.namprd11.prod.outlook.com ([fe80::d8a8:752a:a43c:b7db%10]) with mapi id 15.20.5417.016; Wed, 6 Jul 2022 08:53:55 +0000 From: "Singh, Jasvinder" To: "Danilewicz, MarcinX" , "dev@dpdk.org" , "Dumitrescu, Cristian" CC: "Ajmera, Megha" Subject: RE: [PATCH v8] sched: enable CMAN at runtime Thread-Topic: [PATCH v8] sched: enable CMAN at runtime Thread-Index: AQHYkJF41r5q1C/aJk28fi3TbaVJm61xBPlw Date: Wed, 6 Jul 2022 08:53:55 +0000 Message-ID: References: <20220704091926.549909-1-marcinx.danilewicz@intel.com> <20220705170533.709971-1-marcinx.danilewicz@intel.com> In-Reply-To: <20220705170533.709971-1-marcinx.danilewicz@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 068f7ab2-f5d1-4eb1-7c44-08da5f2d0ef7 x-ms-traffictypediagnostic: DM6PR11MB4028:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dV/k7Jfc7PuatHJ9XRoR3pP+lR/HWSCJXM4RiZcsd7GenNyyx6fyfLJvMUnTIIlWhPqD03Gz0/bRErkg6OFGbmMzw8rRazAT/F2neK1IEiRhuZd2dmsGzy5hKRhy0tHcvosuRtJzNJxNqUHxClQ+HIKcxBh1+7yVSHfRTOoBcWgF5pdAQWimizidUMQ1/7kILxw6EUZINHnCJN7qhPBGLJAq5j1Oo/EHSWA7W4aNvCRo0KL/pOW6yJDs1gKkNFmC5rjD3PGchdB29TM3r0PUvCFlgNV8Eo1YAF2UDCzFMbMaC4ceI9l9Nq9DJHcNocbmbbBrK5L0EU2FK7/2+C+9s0Gu1gXQ208YhpwhS8zB9GdnPIP5x8uI+bcPaD+3o4XDHjF8wAxWQ0Ex63r3ThYFgBblRGkSNqupF7tpHe0auK3OJNXKRph4UpOhLDIOBfWB13vuubhAcHFZbzZSukDlhGpbUP1gfSGm6oqCVauZhzDELMYrWzXG4g22C7NAhwR6EE4A/jhAD6/YiLy18/8hjxaMdHDApro28CMBV0HsavvduBsJ4kAoXn7P9eWr+lxO9GTHAFsB7ZCn0dPvI9MtrLPjIb6AffYFWChHR3flmmzGJ74KLbbPd2bRTLz788msaD8npoQwveS1MovvUPEuiiFaCUrRWfy/JAiFmvGKFrqX9+mPKfdBcc3GESM9ZaKBse0miBJSAE3HP6HJF+11qxWctqzhTIxqi/IaNo0uE9rx8w/qHXSCDG75gvi4iL3PUuw/7Fp3buZ13pWCbuIGuGb8M4f5fVBEIBpnzMPA7lo+18WDhgkXXw8GG2jgAxY5 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB1589.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(396003)(366004)(346002)(376002)(39860400002)(136003)(316002)(110136005)(6636002)(83380400001)(26005)(33656002)(186003)(9686003)(6506007)(5660300002)(86362001)(55016003)(2906002)(107886003)(7696005)(66556008)(66476007)(66446008)(64756008)(38100700002)(66946007)(8676002)(4326008)(76116006)(478600001)(41300700001)(71200400001)(122000001)(53546011)(38070700005)(82960400001)(52536014)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nHAMHD7VCo0AjEmuqAoyf5YhQxxfcrwch3HaPfKb7AUP9KowUCxrL38x87rv?= =?us-ascii?Q?u5fymwN1AKGJWP1zSbuDYL+/d1wIkmBAeR2soo+6TOxNLrTNX3keS4YTVGJk?= =?us-ascii?Q?H4DY6pOZ3lOFPkaT2g4gVHGRygVIPY/iBLMvQX8kW0q+LntdRxEySz6azzRQ?= =?us-ascii?Q?OCjGTy2/qY7WWoMY7oK6DiFD0dK7D6SxXv0NAIWJqfQsC6HMKnuO5kEjYEW8?= =?us-ascii?Q?FByXneIPCwq75kfLYEWGwxz3Dyah1DmgriKCeZp5WjSl4q8uVaEdVnF5/kBn?= =?us-ascii?Q?09faMO+Of0Kqcvvx1PtE/m9aVzxbq+KpvGL+NwBik42It0CTjUBuh9qlbxhc?= =?us-ascii?Q?eruzj/95ALboIGlk4xw8jwDbDE9KlINdT+AmvA5Y4vkpVEDVns9x4Ipkq9yy?= =?us-ascii?Q?lpToSDBNJME68zcPuyPVzFl4AbLlM0e8kMPJ4hmg5J8y/3BK1ARv2Lxm1SXB?= =?us-ascii?Q?fbKTV6AS4VdHHZTPYn5pWvjdYXqtYmJM2jrUwGb5gmNSCce2qe7fmJdCWMp9?= =?us-ascii?Q?1YD5pL/Nkqa4NlyN6dYN+cIffaD2bSffVWnSX8+VuXIRCc9CmRSZURARKWp8?= =?us-ascii?Q?SBp3D2/W30TX8BBCC/349JxR7Z+k8TDpmiDwneCJtDVQS8tU0UWwLkhOVp09?= =?us-ascii?Q?pyRm6XOHnK4SQTephEXK7HkwFlocOM0CZuWsHI5rgo1HIbKt1DfTg962gbL5?= =?us-ascii?Q?C7DGLZ5f7hIUHX1mzamrmnnmcjFhcVFPv6twkBIBA9IX31Vfal2/ugqzzgFg?= =?us-ascii?Q?hlLR1k64y/73tZdYICk+h3jJgtNN++IyrXRrdA7vDpXLuIX6txY6wW9ErbU+?= =?us-ascii?Q?KnQi+rYqVmblRCQO/BHn23/ZrNTZNVA6JuyclVSnY0H6y+90+v1hGTbprm2s?= =?us-ascii?Q?ib8OSLr8pGg85uxaV5a8FtNUDL5kzxGR/o2KA6HT27H5wPmWhqhTO7PWLq7U?= =?us-ascii?Q?4AWB4bAOwFPmeU3C+eCWm0tardXqjjZeOZgGIPOQnDObVTdWLVUGgEKD8n+L?= =?us-ascii?Q?Aa94EOWi46UUl4JYEVc72nIs75lj2Lis6vYTIBuswND10hySZVcA66PGXK63?= =?us-ascii?Q?Uf1f145amIP0sABwd1x+NkYFxvPMmymey9Z33bLPoyy6+KvMlIHoZ0B/9XLe?= =?us-ascii?Q?Le2XSJrhyCo1YaiqtAVDo1JCvqBgNENsprISpx6zbksFMFAW7cAs5Rkr3nDy?= =?us-ascii?Q?LctHiVCRo8i2JoPwl9+wPk43B8+IVoeUCKs2MzejL+lP7mmPIZdNPwvXNGCb?= =?us-ascii?Q?20ZdkFAub9mw43xuPKY+0wXvmDbzY/PiFhfbk07KHMJieiOo9vrRyq9PtvKr?= =?us-ascii?Q?XJsWR2ZSi1WToeNAZKeTQfd2CxKM1QF+P9Xx2Ikm9iXu2QMgqZMcrU9+TfBL?= =?us-ascii?Q?5gqaMH904UFsjV21ePTFI9K/juInz5GtxPVq/crG/wSuWCxrP2//XaoWza8L?= =?us-ascii?Q?poMWXNNW5Ujh0Cqdok/WPDHhSgqCx3n1rCsolSbCgZV4kh4MHwMajzL8O86v?= =?us-ascii?Q?otpEW4hgrY0+3rfhTxwVfV3y9Y6tANEf3shKyiiW8rpDBkG1NXazbZLwTq+2?= =?us-ascii?Q?1ywnlEu/ZTqg/Dj5i9uQWM9V//3LighJQuFhLR83zXCRyQYvz5PaXyXmpeaN?= =?us-ascii?Q?pA=3D=3D?= 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: CY4PR11MB1589.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 068f7ab2-f5d1-4eb1-7c44-08da5f2d0ef7 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2022 08:53:55.5301 (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: zbAkaOkagz3J9iIOBmsOWnS3UHXJu3sw3ON2YXC3lnl8jG0egNzHB7HGV6ilCJQgL7EHCQ+qALVz9z87UTe3WjSI+/7dvj0pBb8pnYXxPaU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4028 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Danilewicz, MarcinX > Sent: Tuesday, July 5, 2022 6:06 PM > To: dev@dpdk.org; Singh, Jasvinder ; > Dumitrescu, Cristian > Cc: Ajmera, Megha > Subject: [PATCH v8] sched: enable CMAN at runtime >=20 > Added changes to enable CMAN (RED or PIE) at init from profile configurat= ion > file. >=20 > By default CMAN code is enable but not in use, when there is no RED or PI= E > profile configured. >=20 > Signed-off-by: Marcin Danilewicz > --- > Log: v2 change in rte_sched.h to avoid ABI breakage. > v3 changes from comments > v4 rebase to 22.07-rc1 > v5 rebase to main latest > v6 commit message fixed > v7 changes from comments > v8 with changes from comments You need to explicitly mention the changes done in each version to help rev= iewer easily locate the changes. > config/rte_config.h | 3 - > drivers/net/softnic/rte_eth_softnic_tm.c | 12 -- > examples/ip_pipeline/tmgr.c | 4 - > examples/qos_sched/cfg_file.c | 47 +------- > examples/qos_sched/cfg_file.h | 5 - > examples/qos_sched/init.c | 76 +----------- > examples/qos_sched/main.h | 2 - > examples/qos_sched/profile.cfg | 135 +-------------------- > examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ > examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ > lib/sched/rte_sched.c | 47 +------- > 11 files changed, 296 insertions(+), 320 deletions(-) create mode 10064= 4 > examples/qos_sched/profile_pie.cfg > create mode 100644 examples/qos_sched/profile_red.cfg >=20 > diff --git a/config/rte_config.h b/config/rte_config.h index > 46549cb062..ae56a86394 100644 > --- a/config/rte_config.h > +++ b/config/rte_config.h > @@ -88,9 +88,6 @@ > /* rte_power defines */ > #define RTE_MAX_LCORE_FREQS 64 >=20 > -/* rte_sched defines */ > -// RTE_SCHED_CMAN is not set > - > /* rte_graph defines */ > #define RTE_GRAPH_BURST_SIZE 256 > #define RTE_LIBRTE_GRAPH_STATS 1 > diff --git a/drivers/net/softnic/rte_eth_softnic_tm.c > b/drivers/net/softnic/rte_eth_softnic_tm.c > index 6a7766ba1c..3e4bed81e9 100644 > --- a/drivers/net/softnic/rte_eth_softnic_tm.c > +++ b/drivers/net/softnic/rte_eth_softnic_tm.c > @@ -420,11 +420,7 @@ pmd_tm_node_type_get(struct rte_eth_dev *dev, > return 0; > } >=20 > -#ifdef RTE_SCHED_CMAN > -#define WRED_SUPPORTED 1 > -#else > #define WRED_SUPPORTED 0 > -#endif >=20 > #define STATS_MASK_DEFAULT \ > (RTE_TM_STATS_N_PKTS | \ > @@ -2300,8 +2296,6 @@ tm_tc_wred_profile_get(struct rte_eth_dev *dev, > uint32_t tc_id) > return NULL; > } >=20 > -#ifdef RTE_SCHED_CMAN > - > static void > wred_profiles_set(struct rte_eth_dev *dev, uint32_t subport_id) { @@ - > 2325,12 +2319,6 @@ wred_profiles_set(struct rte_eth_dev *dev, uint32_t > subport_id) > } > } >=20 > -#else > - > -#define wred_profiles_set(dev, subport_id) > - > -#endif > - > static struct tm_shared_shaper * > tm_tc_shared_shaper_get(struct rte_eth_dev *dev, struct tm_node > *tc_node) { diff --git a/examples/ip_pipeline/tmgr.c > b/examples/ip_pipeline/tmgr.c index b138e885cf..e68e9961be 100644 > --- a/examples/ip_pipeline/tmgr.c > +++ b/examples/ip_pipeline/tmgr.c > @@ -17,7 +17,6 @@ static uint32_t n_subport_profiles; static struct > rte_sched_pipe_params > pipe_profile[TMGR_PIPE_PROFILE_MAX]; >=20 > -#ifdef RTE_SCHED_CMAN > static struct rte_sched_cman_params cman_params =3D { > .red_params =3D { > /* Traffic Class 0 Colors Green / Yellow / Red */ @@ -86,7 > +85,6 @@ static struct rte_sched_cman_params cman_params =3D { > [12][2] =3D {.min_th =3D 32, .max_th =3D 64, .maxp_inv =3D 10, > .wq_log2 =3D 9}, > }, > }; > -#endif /* RTE_SCHED_CMAN */ >=20 > static uint32_t n_pipe_profiles; >=20 > @@ -96,9 +94,7 @@ static const struct rte_sched_subport_params > subport_params_default =3D { > .pipe_profiles =3D pipe_profile, > .n_pipe_profiles =3D 0, /* filled at run time */ > .n_max_pipe_profiles =3D RTE_DIM(pipe_profile), -#ifdef > RTE_SCHED_CMAN > .cman_params =3D &cman_params, > -#endif /* RTE_SCHED_CMAN */ > }; Similar to what is discussed for qos_sched sample app, set cman_params to N= ULL and remove default parameters for "static struct rte_sched_cman_params= cman_params" above.=20 > static struct tmgr_port_list tmgr_port_list; diff --git > a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c index > 450482f07d..7f4114bd56 100644 > --- a/examples/qos_sched/cfg_file.c > +++ b/examples/qos_sched/cfg_file.c > @@ -23,6 +23,8 @@ > uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE]; > uint32_t n_active_queues; >=20 > +struct rte_sched_cman_params cman_params; > + > int > cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params > *port_params) { @@ -229,40 +231,6 @@ cfg_load_subport_profile(struct > rte_cfgfile *cfg, > return 0; > } >=20 > -#ifdef RTE_SCHED_CMAN > -void set_subport_cman_params(struct rte_sched_subport_params > *subport_p, > - struct rte_sched_cman_params > cman_p) > -{ > - int j, k; > - subport_p->cman_params->cman_mode =3D cman_p.cman_mode; > - > - for (j =3D 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) { > - if (subport_p->cman_params->cman_mode =3D=3D > - RTE_SCHED_CMAN_RED) { > - for (k =3D 0; k < RTE_COLORS; k++) { > - subport_p->cman_params- > >red_params[j][k].min_th =3D > - cman_p.red_params[j][k].min_th; > - subport_p->cman_params- > >red_params[j][k].max_th =3D > - cman_p.red_params[j][k].max_th; > - subport_p->cman_params- > >red_params[j][k].maxp_inv =3D > - cman_p.red_params[j][k].maxp_inv; > - subport_p->cman_params- > >red_params[j][k].wq_log2 =3D > - cman_p.red_params[j][k].wq_log2; > - } > - } else { > - subport_p->cman_params- > >pie_params[j].qdelay_ref =3D > - cman_p.pie_params[j].qdelay_ref; > - subport_p->cman_params- > >pie_params[j].dp_update_interval =3D > - cman_p.pie_params[j].dp_update_interval; > - subport_p->cman_params- > >pie_params[j].max_burst =3D > - cman_p.pie_params[j].max_burst; > - subport_p->cman_params->pie_params[j].tailq_th =3D > - cman_p.pie_params[j].tailq_th; > - } > - } > -} > -#endif > - > int > cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_param= s > *subport_params) { @@ -276,11 +244,7 @@ cfg_load_subport(struct > rte_cfgfile *cfg, struct rte_sched_subport_params *subpo > memset(active_queues, 0, sizeof(active_queues)); > n_active_queues =3D 0; >=20 > -#ifdef RTE_SCHED_CMAN > - struct rte_sched_cman_params cman_params =3D { > - .cman_mode =3D RTE_SCHED_CMAN_RED, > - .red_params =3D { }, > - }; > + subport_params->cman_params =3D NULL; No need to set subport_params->cman_params again to null as it is already = set to NULL in init.c. =20 > if (rte_cfgfile_has_section(cfg, "red")) { > cman_params.cman_mode =3D RTE_SCHED_CMAN_RED; @@ - > 387,7 +351,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct > rte_sched_subport_params *subpo >=20 > } > } > -#endif /* RTE_SCHED_CMAN */ >=20 > for (i =3D 0; i < MAX_SCHED_SUBPORTS; i++) { > char sec_name[CFG_NAME_LEN]; > @@ -465,9 +428,7 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct > rte_sched_subport_params *subpo > } > } > } > -#ifdef RTE_SCHED_CMAN > - set_subport_cman_params(subport_params+i, > cman_params); > -#endif > + subport_params[i].cman_params =3D &cman_params; Since cman_params_is global variable, memory is allocated regardless of whe= ther cman mechanism is enabled or disabled. So subport_params->cman_params = will never point to NULL even when red/pie is disabled. Define local flag = "cman_enabled" and set his flag if red or pie is enabled and check this fla= g to set subport_params[i].cman_params to cman_params.