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 8481FA0507; Wed, 27 Apr 2022 11:37:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 775A941145; Wed, 27 Apr 2022 11:37:38 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id CD63B41145 for ; Wed, 27 Apr 2022 11:37:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651052257; x=1682588257; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=JbCekczOZerAakiHh8tlgx9fk8HAEaUmyj51fIia91M=; b=LQotLhnWvLPXyRWpzpOVBj1T9yNabgI5679+EZwnQeqct9NXM7Cnm+ur EGK3D7u6HvhvoDYGPmLa2r4geLtCrEQ3OQyBD6YZtc1tJedJ1NyTPOnDW HBxXuel8b1M+7dz5ih6dH8thMwmPD89Jgf1IaBv1CWn092XKDxcbJ5u8y Y9Oopy74jcvQzYi14JS57VDS+P2DlmlfgDtKV/sT2AKUD1vQ6LNNrjQvX 5KGXjhBUxqKWllb1KwV0hTCzeRes/QnIG16aOdAQvSbzPA1rDlaxZiMMq zVcULr1uIYRb3kuZ944eOyzfetQTdAnI9LHbjs+dgFLM+/IbOm9dg3Be+ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10329"; a="265684937" X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="265684937" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2022 02:37:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="617432556" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga008.fm.intel.com with ESMTP; 27 Apr 2022 02:37:34 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 27 Apr 2022 02:37:34 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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 via Frontend Transport; Wed, 27 Apr 2022 02:37:34 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.48) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 27 Apr 2022 02:37:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+S7nGNhDtf5YE5QpQOAD6PJVtXQczBfix+aACDCsjqQJLyrZ3U0bWMuw4GzgJ6XenKU8MeMal0wE5BBRR+a2loGvMsjuMd3PM1Gz0hcwgW3dFXj8XPicYP08tVnjSCCkG2KoHsgqyvVKVNcjwhk6uVxX/X2RrjmgzHCQfgjcOEk4FAVkX5n8CLjhQc+YpZb/A12W+u8/ek7gjheW503hv11G1e2iAe/gcSmBpz8+KjFo8Hp0/lpYF/tSo5d5IAHsTOhEqwxZJkTiAaM7hQTnpYkM6f65jMYJ3xh0QUN4CVv8H4YrXb50lVbySlQQckwddSHJv/dcmbR6bmsIxXX0Q== 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=QsnCjT9+xYOML//Ifcmu8XkeS++GtwuQLlUylYft9bQ=; b=B5ZdqScIMMuHFqd53CUTBtdO35IAUVLOah8ZhzVCl1yqV0hFBmBKwkz0inYtxXN7ekDbCg0iuAYa8PCek2SUaZj4/oQdnKHXJK4uUONkjpijjeHG8uXjaXEE5bes7VJQm8dlzgLMQQ1CJuBeGTkrYmq7waeOblbch+QFfvQQudHoWXGzNQd3zhOuUTAwMktEEsQAElSnriKrcwG82erUWx7RUnU18wHiSAQ0ZfqnQFRhme+uL5pKn2yOdTXZFHwsgR3ydwCb+MoVgRIi7E/bI9z2aI+p9nSYEIoCl+Bry4xaGiY7EvfFKGTuqtZ1hdK9ob/R4zx94XmRKITYmITavw== 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 BL3PR11MB5684.namprd11.prod.outlook.com (2603:10b6:208:33f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Wed, 27 Apr 2022 09:37:32 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::5dc9:53d7:3ece:fa2d]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::5dc9:53d7:3ece:fa2d%2]) with mapi id 15.20.5186.021; Wed, 27 Apr 2022 09:37:32 +0000 From: "Dumitrescu, Cristian" To: "Danilewicz, MarcinX" , "dev@dpdk.org" CC: "Singh, Jasvinder" Subject: RE: [PATCH v3] sched: enable/disable TC OV at runtime Thread-Topic: [PATCH v3] sched: enable/disable TC OV at runtime Thread-Index: AQHYWhUYjAKP/cdvoEWc0/B3jtyvYK0Df+XQgAAAsnA= Date: Wed, 27 Apr 2022 09:37:32 +0000 Message-ID: References: <20220427085848.491395-1-marcinx.danilewicz@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.401.20 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: 3b668718-e1a5-4590-edfd-08da28318de5 x-ms-traffictypediagnostic: BL3PR11MB5684: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: wm1orVCPoBTrjhHfUOlxFiSuuqO5QIWogQvpW2lq55sXR3DfrL5HvQq9WiQaUbnIwS4VjKiMLypegdp6r18mAcmOpRPiQ4mjTjj0ZKd2fy89j1atCvVjjJ4XOoGc8RzsSCQtGSgOF+eHD9E44xgbHqAoq+A+mjLJBMwMQ/OWLAVPRihp8+HQtPjW7k+8dJuUTwYtSChWJG2XWK2RljlAqH7yHM7mEseV3q7vU7xpzREmpUrMIQiOu2XOejP7dr3Sfh2aRl4+iWf2kWebq4kyn/atEjKbMdWksLBZ/eVZlsy2lPeX+6hr3s7vHiXc2p8XyTQJ3X2TyZzB3GLygGFrNRMUDH7QLzdqzbPVD+y804RVk/GyrABkKqL7Lid/r7Cy/Hl/vxSUOfhHgYnFP48N+2Io6Tq2Rjyjje/gIiDd2J/I8pB09JDDBm1WlL3iIWttfHV/bnBOCFVAPMjqCgZ17KLzEEnSv3UG9i9dwBPpFYOavoA5C4jtctucndS8M7CAZHagzdIGpF1eVsmHiUNdWDVuqg0zTiczVgTCiSpzU2+vjj81Leyal+CGsTOsIaBG9QETTVLlfw9DYqaVqVAzrV8TLjuX2k12bxcQz5mUULUNAIAkt7papHut0rr5Z6VEsfNeIGk5pmhop2rChejnnIGOCa/Mxv9z2tkCGarjfCZN1gpRD/oWFCq3IuRrkhpiO1TZCCalyjGO5oqEURESLg== 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)(107886003)(71200400001)(508600001)(86362001)(9686003)(53546011)(6506007)(122000001)(26005)(38100700002)(38070700005)(82960400001)(186003)(66476007)(33656002)(2906002)(30864003)(66946007)(2940100002)(66556008)(7696005)(316002)(55016003)(76116006)(5660300002)(8936002)(110136005)(4326008)(52536014)(83380400001)(64756008)(8676002)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dgDo2PqdxP8tK/q1/7XOBJHM7dzQQTYTCV9WT9KBm2ZCuqHj4y5JOV+SqrSv?= =?us-ascii?Q?YOJU/+jAhpo3aog+MIbtuv0dulPG64Mu5ub3G8p1zmJUl2/RelCSxRse7cFH?= =?us-ascii?Q?fZPVUPCVg8mgnlkf9/npJn/VsTeglI2xZDxOzTaaeR4Y7OFKP3ZW0pEt161+?= =?us-ascii?Q?3efq/QuwxZrmR6aS/cVl1hKV7K1Kt+TyStB2qlxnf6X3Yz/JxMH8gkGzscsw?= =?us-ascii?Q?hILMGtM1dzUZ8XEJ7QuIQRWGeigo0FVLNFYvklL0OT4exO+xtrm3CAKOk+7G?= =?us-ascii?Q?nOC4T4FL3g/syiVR9fxC0+Z3HCLf+H//Da0f2flb/cLJaFa7tij5HrVvVCs3?= =?us-ascii?Q?mQG1CMA6twZV3GDJaQZ9hB8Z73MU0I0xevIi0ttXf2C0Wmj37rAcrM6qJ555?= =?us-ascii?Q?q0DD10U5qhc3mVEutlGRvWFBZOql7rfOVw+3fRaVMznBXkU7Lotl2wN9LbZ4?= =?us-ascii?Q?tjWq91IpnO6PIsui09sujuopyA3h6TqB2cWsSjy/dslIL8pUY1fyMvkSaCTK?= =?us-ascii?Q?aTaejOnJS9wkaq4dra2YlZbQs/8M+1s9tRlu3ZsRBygBZ0OV1uaKES9AfOWC?= =?us-ascii?Q?PAPQJuVVd9IeF8B5ov2wMMooyUPLUrNA6N4JPbp9TYep8PD4VmEtI0jK7N64?= =?us-ascii?Q?rmozBOM74dRN+6ygcf2WQLNRYlPhjD9AlVVe0G06AkGCREpWJlwF2LlOFHhB?= =?us-ascii?Q?XemN4FKg/3LbP+F5h3FsWcVi4/LLfq6+i3hvgNz/n3l9AZ8Kb6V6w/Io4La8?= =?us-ascii?Q?6AxDBt5d14fFYV2SxFNolF1ChfPFLnGlAoT7jqDjsZ/5wxDcEdtObgXtkaAB?= =?us-ascii?Q?ufpLl8X1qeTIGEiJeMvL3s8huWoIqVbJykhv/K9dahLPOOJnRFl8Jlm2VDP+?= =?us-ascii?Q?kk+evqyGRJz7hkyZ/LguB3az8CYRKFBIgdbQQWOEDdH3fw8bOlHByVXVsrZC?= =?us-ascii?Q?lFvwiSy6tyMZhfe2W1MNepgRHukiKyOkD4ThOwHRXwVorTQVAYrIdM5c+Abm?= =?us-ascii?Q?J4xTiI/YXeyWS3gXptDg/NVVumUTROwY0HT6PQIXOKKL4oFWMBvPyWYoDbgS?= =?us-ascii?Q?h/V7mXuG9DrqdDmWM7XQ9itCkKWivuaU/w4uPngOH0gZyPcTPz6PHkdbH3SG?= =?us-ascii?Q?Ex+5TFuPA4DyvPjl4vedW3lb5RZYZ/Ess+WyC+JROBbBZwoNVZzdP56vD8ZC?= =?us-ascii?Q?0orLUfQ9X46IFrQy6SuZm98vJ18FUNFhBAxbdEavsv5o+opxe41CsJ52xKuS?= =?us-ascii?Q?MODNVFlA9Orc48rD3iY/UIJzwH2hubQzsSh9KpUPRONOGHd/qHC64zj0B8lM?= =?us-ascii?Q?/kQ5ileJNTPDrPR9SU3pY26UGrbEkYH7lZlpXFFxKym1BinMKmVHnsV5aZh1?= =?us-ascii?Q?So2hcfrK6PTMnqoi7OEBpEWE4FU7lf7H73y+l6JJTiCkYHC2M1Hw4lkLFbbL?= =?us-ascii?Q?QOcSqckfgXRBLqzN0I/vHS/zkbwi9NX3mFPaRC7rt1vgjkFOvmL7l7L+P6fN?= =?us-ascii?Q?MyVz3LMJQ0goTHZgwVyeZLQVr95aBGLu7i6oUQ82V0yTFLXQRdurN6qAWcTh?= =?us-ascii?Q?97BAcer+/iahs32AZqw/egGZT6AH8t8NyvEg5q75TbVEoATVL976QJV/QgmY?= =?us-ascii?Q?M+ndA8zUnwUkRbskTXhX4xjwiIM/9jOIsrDaBDJYzZ12gpzYeEgO24/pT8gA?= =?us-ascii?Q?fUiX+aoBEVdZV2NUQYnxfkTzZ6svoJRX27k7lyJTh58DczzCDnL097NLhE9s?= =?us-ascii?Q?mw7E/i6gBhsqsCLxhTGMpcWRWAbdsf0=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: 3b668718-e1a5-4590-edfd-08da28318de5 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2022 09:37:32.5354 (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: LcabYAesDOJNB/XltkmfrzQc79lM15ptpekon5UJAVD+7ZXbcufg1WBbsZpxiVqPgrQLAtBR7mjdTdwO8OWsDeGzRg8fDvHXqW3KD4ccha8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB5684 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 Adding Jasvinder > -----Original Message----- > From: Dumitrescu, Cristian > Sent: Wednesday, April 27, 2022 10:37 AM > To: Marcin Danilewicz ; dev@dpdk.org > Subject: RE: [PATCH v3] sched: enable/disable TC OV at runtime >=20 > Marcin, >=20 > Every time you send a new version, you need to copy the maintainers and t= he > other relevant people, otherwise there is a high chance we are not going = to see > your patch, thanks! I only saw this one due to pure chance ;) >=20 > Regards, > Cristian >=20 > > -----Original Message----- > > From: Marcin Danilewicz > > Sent: Wednesday, April 27, 2022 9:59 AM > > To: dev@dpdk.org > > Subject: [PATCH v3] sched: enable/disable TC OV at runtime > > > > Added new API to enable or disable TC over subscription for best > > effort traffic class at subport level. > > Added changes after review and increased throughput. > > > > By default TC OV is disabled. > > > > Signed-off-by: Marcin Danilewicz > > --- > > lib/sched/rte_sched.c | 189 +++++++++++++++++++++++++++++++++++------- > > lib/sched/rte_sched.h | 18 ++++ > > lib/sched/version.map | 3 + > > 3 files changed, 178 insertions(+), 32 deletions(-) > > > > diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c > > index ec74bee939..6e7d81df46 100644 > > --- a/lib/sched/rte_sched.c > > +++ b/lib/sched/rte_sched.c > > @@ -213,6 +213,9 @@ struct rte_sched_subport { > > uint8_t *bmp_array; > > struct rte_mbuf **queue_array; > > uint8_t memory[0] __rte_cache_aligned; > > + > > + /* TC oversubscription activation */ > > + int is_tc_ov_enabled; > > } __rte_cache_aligned; > > > > struct rte_sched_port { > > @@ -1165,6 +1168,45 @@ rte_sched_cman_config(struct rte_sched_port > > *port, > > } > > #endif > > > > +int > > +rte_sched_subport_tc_ov_config(struct rte_sched_port *port, > > + uint32_t subport_id, > > + bool tc_ov_enable) > > +{ > > + struct rte_sched_subport *s; > > + struct rte_sched_subport_profile *profile; > > + > > + if (port =3D=3D NULL) { > > + RTE_LOG(ERR, SCHED, > > + "%s: Incorrect value for parameter port\n", __func__); > > + return -EINVAL; > > + } > > + > > + if (subport_id >=3D port->n_subports_per_port) { > > + RTE_LOG(ERR, SCHED, > > + "%s: Incorrect value for parameter subport id\n", > > __func__); > > + return -EINVAL; > > + } > > + > > + s =3D port->subports[subport_id]; > > + s->is_tc_ov_enabled =3D tc_ov_enable ? 1 : 0; > > + > > + if (s->is_tc_ov_enabled) { > > + /* TC oversubscription */ > > + s->tc_ov_wm_min =3D port->mtu; > > + s->tc_ov_period_id =3D 0; > > + s->tc_ov =3D 0; > > + s->tc_ov_n =3D 0; > > + s->tc_ov_rate =3D 0; > > + > > + profile =3D port->subport_profiles + s->profile; > > + s->tc_ov_wm_max =3D rte_sched_time_ms_to_bytes(profile- > > >tc_period, > > + s->pipe_tc_be_rate_max); > > + s->tc_ov_wm =3D s->tc_ov_wm_max; > > + } > > + return 0; > > +} > > + > > int > > rte_sched_subport_config(struct rte_sched_port *port, > > uint32_t subport_id, > > @@ -1254,6 +1296,9 @@ 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; > > > > + /* TC over-subscription is disabled by default */ > > + s->is_tc_ov_enabled =3D 0; > > + > > #ifdef RTE_SCHED_CMAN > > if (params->cman_params !=3D NULL) { > > s->cman_enabled =3D true; > > @@ -1316,13 +1361,6 @@ rte_sched_subport_config(struct rte_sched_port > > *port, > > > > for (i =3D 0; i < RTE_SCHED_PORT_N_GRINDERS; i++) > > s->grinder_base_bmp_pos[i] =3D > > RTE_SCHED_PIPE_INVALID; > > - > > - /* TC oversubscription */ > > - s->tc_ov_wm_min =3D port->mtu; > > - s->tc_ov_period_id =3D 0; > > - s->tc_ov =3D 0; > > - s->tc_ov_n =3D 0; > > - s->tc_ov_rate =3D 0; > > } > > > > { > > @@ -1342,9 +1380,6 @@ rte_sched_subport_config(struct rte_sched_port > > *port, > > else > > profile->tc_credits_per_period[i] =3D 0; > > > > - s->tc_ov_wm_max =3D rte_sched_time_ms_to_bytes(profile- > > >tc_period, > > - s- > > >pipe_tc_be_rate_max); > > - s->tc_ov_wm =3D s->tc_ov_wm_max; > > s->profile =3D subport_profile_id; > > > > } > > @@ -1417,17 +1452,20 @@ rte_sched_pipe_config(struct rte_sched_port > > *port, > > double pipe_tc_be_rate =3D > > (double) params- > > >tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] > > / (double) params->tc_period; > > - uint32_t tc_be_ov =3D s->tc_ov; > > > > - /* Unplug pipe from its subport */ > > - s->tc_ov_n -=3D params->tc_ov_weight; > > - s->tc_ov_rate -=3D pipe_tc_be_rate; > > - s->tc_ov =3D s->tc_ov_rate > subport_tc_be_rate; > > + if (s->is_tc_ov_enabled) { > > + uint32_t tc_be_ov =3D s->tc_ov; > > > > - if (s->tc_ov !=3D tc_be_ov) { > > - RTE_LOG(DEBUG, SCHED, > > - "Subport %u Best-effort TC oversubscription is > > OFF (%.4lf >=3D %.4lf)\n", > > - subport_id, subport_tc_be_rate, s- > > >tc_ov_rate); > > + /* Unplug pipe from its subport */ > > + s->tc_ov_n -=3D params->tc_ov_weight; > > + s->tc_ov_rate -=3D pipe_tc_be_rate; > > + s->tc_ov =3D s->tc_ov_rate > subport_tc_be_rate; > > + > > + if (s->tc_ov !=3D tc_be_ov) { > > + RTE_LOG(DEBUG, SCHED, > > + "Subport %u Best-effort TC > > oversubscription is OFF (%.4lf >=3D %.4lf)\n", > > + subport_id, subport_tc_be_rate, s- > > >tc_ov_rate); > > + } > > } > > > > /* Reset the pipe */ > > @@ -1460,19 +1498,22 @@ rte_sched_pipe_config(struct rte_sched_port > > *port, > > double pipe_tc_be_rate =3D > > (double) params- > > >tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASS_BE] > > / (double) params->tc_period; > > - uint32_t tc_be_ov =3D s->tc_ov; > > > > - s->tc_ov_n +=3D params->tc_ov_weight; > > - s->tc_ov_rate +=3D pipe_tc_be_rate; > > - s->tc_ov =3D s->tc_ov_rate > subport_tc_be_rate; > > + if (s->is_tc_ov_enabled) { > > + uint32_t tc_be_ov =3D s->tc_ov; > > + > > + s->tc_ov_n +=3D params->tc_ov_weight; > > + s->tc_ov_rate +=3D pipe_tc_be_rate; > > + s->tc_ov =3D s->tc_ov_rate > subport_tc_be_rate; > > > > - if (s->tc_ov !=3D tc_be_ov) { > > - RTE_LOG(DEBUG, SCHED, > > - "Subport %u Best effort TC oversubscription is > > ON (%.4lf < %.4lf)\n", > > - subport_id, subport_tc_be_rate, s- > > >tc_ov_rate); > > + if (s->tc_ov !=3D tc_be_ov) { > > + RTE_LOG(DEBUG, SCHED, > > + "Subport %u Best effort TC > > oversubscription is ON (%.4lf < %.4lf)\n", > > + subport_id, subport_tc_be_rate, s- > > >tc_ov_rate); > > + } > > + p->tc_ov_period_id =3D s->tc_ov_period_id; > > + p->tc_ov_credits =3D s->tc_ov_wm; > > } > > - p->tc_ov_period_id =3D s->tc_ov_period_id; > > - p->tc_ov_credits =3D s->tc_ov_wm; > > } > > > > return 0; > > @@ -2318,6 +2359,45 @@ grinder_credits_update(struct rte_sched_port > > *port, > > pipe->tb_credits =3D RTE_MIN(pipe->tb_credits, params->tb_size); > > pipe->tb_time +=3D n_periods * params->tb_period; > > > > + /* Subport TCs */ > > + if (unlikely(port->time >=3D subport->tc_time)) { > > + for (i =3D 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) > > + subport->tc_credits[i] =3D sp->tc_credits_per_period[i]; > > + > > + subport->tc_time =3D port->time + sp->tc_period; > > + } > > + > > + /* Pipe TCs */ > > + if (unlikely(port->time >=3D pipe->tc_time)) { > > + for (i =3D 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) > > + pipe->tc_credits[i] =3D params->tc_credits_per_period[i]; > > + pipe->tc_time =3D port->time + params->tc_period; > > + } > > +} > > + > > +static inline void > > +grinder_credits_update_with_tc_ov(struct rte_sched_port *port, > > + struct rte_sched_subport *subport, uint32_t pos) > > +{ > > + struct rte_sched_grinder *grinder =3D subport->grinder + pos; > > + struct rte_sched_pipe *pipe =3D grinder->pipe; > > + struct rte_sched_pipe_profile *params =3D grinder->pipe_params; > > + struct rte_sched_subport_profile *sp =3D grinder->subport_params; > > + uint64_t n_periods; > > + uint32_t i; > > + > > + /* Subport TB */ > > + n_periods =3D (port->time - subport->tb_time) / sp->tb_period; > > + subport->tb_credits +=3D n_periods * sp->tb_credits_per_period; > > + subport->tb_credits =3D RTE_MIN(subport->tb_credits, sp->tb_size); > > + subport->tb_time +=3D n_periods * sp->tb_period; > > + > > + /* Pipe TB */ > > + n_periods =3D (port->time - pipe->tb_time) / params->tb_period; > > + pipe->tb_credits +=3D n_periods * params->tb_credits_per_period; > > + pipe->tb_credits =3D RTE_MIN(pipe->tb_credits, params->tb_size); > > + pipe->tb_time +=3D n_periods * params->tb_period; > > + > > /* Subport TCs */ > > if (unlikely(port->time >=3D subport->tc_time)) { > > subport->tc_ov_wm =3D > > @@ -2348,6 +2428,39 @@ grinder_credits_update(struct rte_sched_port > > *port, > > static inline int > > grinder_credits_check(struct rte_sched_port *port, > > struct rte_sched_subport *subport, uint32_t pos) > > +{ > > + struct rte_sched_grinder *grinder =3D subport->grinder + pos; > > + struct rte_sched_pipe *pipe =3D grinder->pipe; > > + struct rte_mbuf *pkt =3D grinder->pkt; > > + uint32_t tc_index =3D grinder->tc_index; > > + uint64_t pkt_len =3D pkt->pkt_len + port->frame_overhead; > > + uint64_t subport_tb_credits =3D subport->tb_credits; > > + uint64_t subport_tc_credits =3D subport->tc_credits[tc_index]; > > + uint64_t pipe_tb_credits =3D pipe->tb_credits; > > + uint64_t pipe_tc_credits =3D pipe->tc_credits[tc_index]; > > + int enough_credits; > > + > > + /* Check pipe and subport credits */ > > + enough_credits =3D (pkt_len <=3D subport_tb_credits) && > > + (pkt_len <=3D subport_tc_credits) && > > + (pkt_len <=3D pipe_tb_credits) && > > + (pkt_len <=3D pipe_tc_credits); > > + > > + if (!enough_credits) > > + return 0; > > + > > + /* Update pipe and subport credits */ > > + subport->tb_credits -=3D pkt_len; > > + subport->tc_credits[tc_index] -=3D pkt_len; > > + pipe->tb_credits -=3D pkt_len; > > + pipe->tc_credits[tc_index] -=3D pkt_len; > > + > > + return 1; > > +} > > + > > +static inline int > > +grinder_credits_check_with_tc_ov(struct rte_sched_port *port, > > + struct rte_sched_subport *subport, uint32_t pos) > > { > > struct rte_sched_grinder *grinder =3D subport->grinder + pos; > > struct rte_sched_pipe *pipe =3D grinder->pipe; > > @@ -2403,8 +2516,16 @@ grinder_schedule(struct rte_sched_port *port, > > uint32_t pkt_len =3D pkt->pkt_len + port->frame_overhead; > > uint32_t be_tc_active; > > > > - if (!grinder_credits_check(port, subport, pos)) > > - return 0; > > + switch (subport->is_tc_ov_enabled) { > > + case 1: > > + if (!grinder_credits_check_with_tc_ov(port, subport, pos)) > > + return 0; > > + break; > > + case 0: > > + if (!grinder_credits_check(port, subport, pos)) > > + return 0; > > + break; > > + } > > > > /* Advance port time */ > > port->time +=3D pkt_len; > > @@ -2770,7 +2891,11 @@ grinder_handle(struct rte_sched_port *port, > > subport->profile; > > > > grinder_prefetch_tc_queue_arrays(subport, pos); > > - grinder_credits_update(port, subport, pos); > > + > > + if (unlikely(subport->is_tc_ov_enabled)) > > + grinder_credits_update_with_tc_ov(port, subport, pos); > > + else > > + grinder_credits_update(port, subport, pos); > > > > grinder->state =3D e_GRINDER_PREFETCH_MBUF; > > return 0; > > diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h > > index 5ece64e527..94febe1d94 100644 > > --- a/lib/sched/rte_sched.h > > +++ b/lib/sched/rte_sched.h > > @@ -579,6 +579,24 @@ rte_sched_port_enqueue(struct rte_sched_port > *port, > > struct rte_mbuf **pkts, uint > > int > > rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf > **pkts, > > uint32_t n_pkts); > > > > +/** > > + * Hierarchical scheduler subport TC OV enable/disable config. > > + * Note that this function is safe to use at runtime > > + * to enable/disable TC OV for subport. > > + * > > + * @param port > > + * Handle to port scheduler instance > > + * @param subport_id > > + * Subport ID > > + * @param tc_ov_enable > > + * Boolean flag to enable/disable TC OV > > + * @return > > + * 0 upon success, error code otherwise > > + */ > > +__rte_experimental > > +int > > +rte_sched_subport_tc_ov_config(struct rte_sched_port *port, uint32_t > > subport_id, bool tc_ov_enable); > > + > > #ifdef __cplusplus > > } > > #endif > > diff --git a/lib/sched/version.map b/lib/sched/version.map > > index d22c07fc9f..c6e994d8df 100644 > > --- a/lib/sched/version.map > > +++ b/lib/sched/version.map > > @@ -34,4 +34,7 @@ EXPERIMENTAL { > > # added in 21.11 > > rte_pie_rt_data_init; > > rte_pie_config_init; > > + > > + # added in 22.03 > > + rte_sched_subport_tc_ov_config; > > }; > > -- > > 2.25.1 > > > > -------------------------------------------------------------- > > Intel Research and Development Ireland Limited > > Registered in Ireland > > Registered Office: Collinstown Industrial Park, Leixlip, County Kildare > > Registered Number: 308263 > > > > > > This e-mail and any attachments may contain confidential material for t= he > sole > > use of the intended recipient(s). Any review or distribution by others = is > > strictly prohibited. If you are not the intended recipient, please cont= act the > > sender and delete all copies.