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 19988A00BE; Mon, 30 May 2022 13:35:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6D8A42B75; Mon, 30 May 2022 13:35:46 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C0EA9400D6 for ; Mon, 30 May 2022 13:35:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653910544; x=1685446544; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=BA0oTg6ChLnBk+vV2+U7/Z2US9mCHA2u3PIFatRQBo4=; b=AV9TYD+yoBlywA0wS3U1zL5LsrDHaFxTwruzvMvjEyMKqvAbNwKSs5x2 k7v9qhaCB1/FLtctEz3T3siEvNLKmFaATL5ZU91lWKRzlxtWktxmL/Mtv tIcU+cnyP+qIlsWcU9rsjOXkwcdLtrmZkWqelzAvmCavqy4j1zrriw7LW 9teG2VVkvyXpfXIajNhfDm7opP8jJjyBqeCve7ni7VsfxUiSXS0ov1N7i +kgaVS5NF5Nr2O6V7onQ3HU53WVHkk1ouIr0BYl1o+1chHDldeI72KJbS dZuJByjt2StVHHwPCXUbY/2CFik+UlLlsJ7Xg5TB7lPDOjiUZZ5YDH76v A==; X-IronPort-AV: E=McAfee;i="6400,9594,10362"; a="255464381" X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="255464381" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 04:35:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="575896208" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga007.jf.intel.com with ESMTP; 30 May 2022 04:35:37 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 30 May 2022 04:35:36 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 30 May 2022 04:35:36 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 30 May 2022 04:35:36 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.42) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 30 May 2022 04:35:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QtnubSJsI+4GSMP3kOfUFE5rJMzgCeGEJi9Y8fTRayDaiygs4D5Wo/WxtYW469hoCGfvnYkgJ+NGW5sAU0ju0yl/uJ5HRZYxGjSojvXCYYgRoAzC1NmdRnZK0UCItuizNkmLgIzfLsga9Lw6QGCVacu1mHfuK59tqRF+za3hIzdh84tINtWJ5H5SUbZf9xMnhByZrMXYQzjhY9SuVtUEtv/1aibKZWvFniuzJacnzaZHiwQscAiOCLm+Lw5ueB0j/azKCjnmxqgxGhW7ZJUfrrIrsCvwkbiGdp01elXsYFbjoyY9jetjTuozMLIBFv6Spzs7X8D3Ty41yManszPE+w== 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=aSfDhZjdBt0cSyjevO2oJufEaPmFSQH0XrFRNF9nH9Q=; b=A9swkEOrtdenY+EgzG2l2Pt533cj4+ktK6ubIMPxeaGoLt5INNeSUN3oGTV5dPE2T3VPbNe1YLVhtGI6eiReC8pNQ7ZJIm3ctyieFzo5ndK7gbWCQRU5T0OVyturzaAdcU2SK+STIpvdn5IOlp8wazhF+xDApMB0rkUqp1kWrFen+VDZmtSZpK327AJlHMD0AGqYJmI3IHWUmzzZ/dfZdUew0yJlzTeWqUl5K2Xb6yzAE8JEtNxQ9p3T596sjiAeKtLwaYYMS4zkwT2xI1gdfYvLvcLqOI0KSDO0jpkcQqeSEsIG874OgkUMSmsKO2vVHPsuRtGdbX3xSUdd9rHjaA== 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 DM8PR11MB5670.namprd11.prod.outlook.com (2603:10b6:8:37::12) by DM6PR11MB4330.namprd11.prod.outlook.com (2603:10b6:5:1dc::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.15; Mon, 30 May 2022 11:35:34 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::89de:bffb:b66b:516b]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::89de:bffb:b66b:516b%7]) with mapi id 15.20.5293.019; Mon, 30 May 2022 11:35:34 +0000 From: "Dumitrescu, Cristian" To: "Danilewicz, MarcinX" , "dev@dpdk.org" , "Singh, Jasvinder" CC: "Ajmera, Megha" , "Liu, Yu Y" Subject: RE: [PATCH v2] sched: enable CMAN at runtime Thread-Topic: [PATCH v2] sched: enable CMAN at runtime Thread-Index: AQHYZgGyjgFuks/050iPI+ktClNfX603YlpQ Date: Mon, 30 May 2022 11:35:34 +0000 Message-ID: References: <20220511135304.258809-1-marcinx.danilewicz@intel.com> <20220512131036.507178-1-marcinx.danilewicz@intel.com> In-Reply-To: <20220512131036.507178-1-marcinx.danilewicz@intel.com> Accept-Language: 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: 50c297c6-7f29-4e31-86e5-08da4230827b x-ms-traffictypediagnostic: DM6PR11MB4330:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Vd96MWONp3x3BqbKDBUY6BHUHDds50wUBGAbbu1jSN1tOhqU2xgAEbHWnmFroQLfmtIAhEedQl0AIIiTJ6ocgmHyJ+2bjvx6LbqwYaxzm+jghL9IwYvWgwu3xg+2jJ/IvoAWB90TRFel0lOrdfpZdJpW3JmskWPxy5gklWcopju4jcAr/MVxydOuRuYyx3T8xNmFTWcHdlcrOeke3ihZNETehm3FuAUz0XL5hZ1+FnYomwCtcwVT8qScxmG7xEVID2orXVSwJCPTITGZAR7EhnNtYt3zvpn9JQKva3DexM3ti2qtJL499u9EBgx5kXIMNoYKXLm4SkJLQmmQMQcbn2IzdI9jD+29aQIxhEnfLeVoTWSnvtP3qFYCsmK/As3jXNgQWE5U3zDvGtsbTWaSZSDaKRO5yyfEIJ7X+JszCH57kOcI9fg+DUvVt5+4SUfkwiyaYB+0SoYu6ifEdxUrF3OxPPHwuBV9a8YB234fo9bA7XPsHaNmKPRJraknd7hZnawTB1wqfQi3SO/GRBjJ+RspBY0bBksqrvauVNGtpOhpuFmFoJBUCxwZZzNXbLrrW6oC0lSKBpZnI/vCnzUUdrFuCc6dwfO2cw8MVyXzKQglW4KYB1hpx5P/ybmfPEpqEHpDZ5tjAny1Eo+6WqjSVWCXQbLvfAy++5FCUbW8HDlEgWdr5eiJY9rnMZ6PEU9dM4GLiV5/XWplrODJnpnXzA== 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:(13230001)(366004)(66946007)(2906002)(71200400001)(66476007)(64756008)(66446008)(316002)(4326008)(8676002)(66556008)(76116006)(107886003)(5660300002)(33656002)(83380400001)(53546011)(9686003)(38070700005)(508600001)(82960400001)(6506007)(122000001)(7696005)(55016003)(26005)(186003)(86362001)(8936002)(110136005)(52536014)(6636002)(54906003)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7Yfz0IS9c5I8RwBNf4FvshopjLOQLberErQ6Lg/13nhkspSxjDlkltFqfQyz?= =?us-ascii?Q?oVKft6avF7GAkRPSg2U65mF+3TZQJNi0BOj93+dK4/8FPdMn8U3HVY7W0IFg?= =?us-ascii?Q?ZjDffnNHicS6Cze5fO4ZxMCCJhfX7EAcpC+jrleMF0SstnCr0AV4EIXsYpsu?= =?us-ascii?Q?4dv9Ebls7w/zhub6tPAIF66wi26ozNRkgIGnKAHMyU6N8qc5G9UDID7PopFY?= =?us-ascii?Q?SCfGysYqwxbnGHUktuh3sqPYMBxL21P6pNSB3lQOKk//cMxKC783L65xQnWx?= =?us-ascii?Q?OMnBWJUkazMF6GjZRd/eDU9xfvv4pMxf4FyR5qKbhWrCJe8OQQdDyyFekifh?= =?us-ascii?Q?oaz7iK4kH493M3PD0s/4/hUtcq+KbpOrsBiwTkA9Mk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us-ascii?Q?btP0tOTbb/7tQd1NFyWI3YOz7p6x57x1jf50R2u8L9yS2JXEpQk1B+nhRaF3?= =?us-ascii?Q?+3c/5I9dpCs+xHk/66giAyL1glE8hJaXXSR6ztw93E+69oP+D6ZYvFoHNG3s?= =?us-ascii?Q?aYdD404k5undApCZf9bh5g5mM7f6YfahlXqEpcoTvJS5ejNlWQ28vbkPYCUz?= =?us-ascii?Q?u7Ue9Yd4V70metx744er9dey5NwfAiezsrxIz9hOwBprCnfDJ0AroUtvN9Xs?= =?us-ascii?Q?Ou09zjeyjDasoSgbPa3GSEeyyESTe6//y33C9m1sD59H3jVNYXzqpX4eGaDc?= =?us-ascii?Q?7GiJQ283k7QTUptPNTUiBZatLFBFWdD5daXEqLvHeqkYKZazqzHsIybB45uk?= =?us-ascii?Q?OO26A0nrQGxnEfYNORCDEs1JefWK7Hh1YGTpoGgF0M8kd/ZFG7vovlgdLsBD?= =?us-ascii?Q?nyti5VYqUhbZUNrRu5qSALhLSJmv4vg6b3WBgiGyD7ZGumfKEYtjhz426gqS?= =?us-ascii?Q?MlJ0GeAgLRHPDMLyZ12eXDa406FC0Lw=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: DM8PR11MB5670.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50c297c6-7f29-4e31-86e5-08da4230827b X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2022 11:35:34.1031 (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: MI/z22KoEJzPQC7E/sKTYi09kh1LTT79D5c+un9G3TR8EtbIun9fj3TLB4Q7fRBwbH2vToJdUanMhy+p0P/d67weszBUESYyvQsjA8bSz3k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4330 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 Hi Marcin, Comments inline below. > -----Original Message----- > From: Danilewicz, MarcinX > Sent: Thursday, May 12, 2022 2:11 PM > To: dev@dpdk.org; Singh, Jasvinder ; > Dumitrescu, Cristian > Cc: Ajmera, Megha > Subject: [PATCH v2] sched: enable CMAN at runtime >=20 > Added changes to enable CMAN (RED or PIE) at init > from profile configuration file. >=20 > By default CMAN code is enable but not in use, when > there is no RED or PIE profile configured. >=20 > Log: v2 change in rte_sched.h to avoid ABI breakage. >=20 > Signed-off-by: Marcin Danilewicz > --- > 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 | 14 +-- > examples/qos_sched/cfg_file.h | 2 - > examples/qos_sched/init.c | 4 - > examples/qos_sched/main.h | 2 - > examples/qos_sched/profile.cfg | 130 ++++++++++----------- > examples/qos_sched/profile_pie.cfg | 142 ++++++++++++++++++++++ > examples/qos_sched/profile_red.cfg | 143 +++++++++++++++++++++++ > lib/sched/rte_sched.c | 53 ++------- > lib/sched/rte_sched.h | 2 + > 12 files changed, 371 insertions(+), 140 deletions(-) > create mode 100644 examples/qos_sched/profile_pie.cfg > create mode 100644 examples/qos_sched/profile_red.cfg >=20 > diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c > index ec74bee939..db14934832 100644 > --- a/lib/sched/rte_sched.c > +++ b/lib/sched/rte_sched.c > -#ifdef RTE_SCHED_CMAN > static int > rte_sched_red_config(struct rte_sched_port *port, > struct rte_sched_subport *s, > @@ -1161,9 +1156,11 @@ rte_sched_cman_config(struct rte_sched_port > *port, > else if (params->cman_params->cman_mode =3D=3D > RTE_SCHED_CMAN_PIE) > return rte_sched_pie_config(port, s, params, n_subports); >=20 > + else if (params->cman_params->cman_mode =3D=3D > RTE_SCHED_CMAN_NONE) > + return 1; > + > return -EINVAL; > } > -#endif Yes, you do need to remove the #ifdef ... #endif around this function, but = no, you don't need to change this function, as it is only called when param= s->cman_params !=3D NULL, i.e. CMAN is enabled. As mentioned before, there = is no need to add the CMAN_NONE to the enumeration, as the CMAN_NONE value = is equivalent to params->cman_params being set to NULL. >=20 > int > rte_sched_subport_config(struct rte_sched_port *port, > @@ -1254,19 +1251,20 @@ rte_sched_subport_config(struct > rte_sched_port *port, > s->n_pipe_profiles =3D params->n_pipe_profiles; > s->n_max_pipe_profiles =3D params->n_max_pipe_profiles; >=20 > -#ifdef RTE_SCHED_CMAN > + s->cman_enabled =3D false; > + > if (params->cman_params !=3D NULL) { > - s->cman_enabled =3D true; > status =3D rte_sched_cman_config(port, s, params, > n_subports); > if (status) { > - RTE_LOG(NOTICE, SCHED, > - "%s: CMAN configuration fails\n", > __func__); > - return status; > + if (status !=3D 1) { > + RTE_LOG(NOTICE, SCHED, > + "%s: CMAN configuration > fails\n", __func__); > + return status; > + } > + } else { > + s->cman_enabled =3D true; > } > - } else { > - s->cman_enabled =3D false; > } > -#endif >=20 Same comment here: yes, remove the #ifdef ... #endif, but no need to change= this code fragment, as it sets correctly the s->cman_enabled flag, which i= s then the only flag used by the rest of the code. Again, no need to have a= CMAN_NONE in the enumeration, as the same is achieved by setting params->c= man_params to NULL. > /* Scheduling loop detection */ > s->pipe_loop =3D RTE_SCHED_PIPE_INVALID; > @@ -1825,14 +1823,10 @@ > rte_sched_port_update_queue_stats_on_drop(struct rte_sched_subport > *subport, >=20 > qe->stats.n_pkts_dropped +=3D 1; > qe->stats.n_bytes_dropped +=3D pkt_len; > -#ifdef RTE_SCHED_CMAN > if (subport->cman_enabled) > qe->stats.n_pkts_cman_dropped +=3D n_pkts_cman_dropped; > -#endif > } Please don't forget to remove the __rte_unused attribute for the n_pkts_cma= n_dropped in the function parameters, right? Regards, Cristian