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 A074AA04FD; Mon, 30 May 2022 12:54:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82D0242B75; Mon, 30 May 2022 12:54:20 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id C3FE0400D6 for ; Mon, 30 May 2022 12:54:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653908058; x=1685444058; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=RJIbYMJ7X9ydxdYjrVLy4KW0iSUNoFQKBNgb6bxHWbY=; b=FEbPiWFWz0NSa5D12PXFxeN326LiNDvBhH06ClhvSDhOKOtS/73xQQ6D hq8Xi40Al4fpLhRb/t/bj/nTKSTA0kRLrXLI+CRwRND8pcqy8QzpvAuC9 /UawTDsJ/KGnemhoLE1u5jw90vh+Nkca6oVIfmlEFRo8P71D2Cz6xCZYJ 9q8OUzik+2INt2SrsWBzbRdI5VF0eUomZLmKzR0po93IxBNc7mJu7N4Mj IC42hpCw5i0cAeb6tFvSpROMQ+KkuimHIRe68IYIWeH+Y9GmaTiiurs+v sTMAmzelahdQtZbsYZ4194fxwJuuUHKLk37W/wci+FHDHiWakZ8d+11Zg A==; X-IronPort-AV: E=McAfee;i="6400,9594,10362"; a="275057277" X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="275057277" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2022 03:54:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="575882742" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga007.jf.intel.com with ESMTP; 30 May 2022 03:54:17 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX605.amr.corp.intel.com (10.22.229.18) 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 03:54:17 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.2308.27 via Frontend Transport; Mon, 30 May 2022 03:54:17 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) 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.2308.27; Mon, 30 May 2022 03:54:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F+T67XjP10LEuxNoFibWSI3XaaHXT3kAC7FoV8/9BRUnkVRf8PpPXALv+hjeLLt0PnMbLAwAMuI+PkTBEgT+a//XoC0+jsX/0WHycZfC2QbDKXxL44Sw6pw3J6Duk5Ksxc5Z55EOYaaUMiUZAyF9ljqQ29p4130i+rN2NznIHsKuZmKyrxoC+y9//8rnlbFcw8kmrSQNH/kYpm6Sr30raHbrK2H/4tCuk5++hCF69j7qd3pzlxIkAnAjzjOryJWGHkF/kmAYpLtiGPi3gfBQb1BbfZk0a9rQ18M/3NzdcxVPgYqaQJr6QYEqaNNCEJ2PRMaFNdW9AC7VF53aYGAgaA== 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=WQ8dnMHZTL/4oQIvlzB+wEh2v2RmyjdDhIyozx24HME=; b=BegWHrrEwWwkCYnOR1LdC0PU7vA7P1x4liHYQN6hO7yXEThihR3puXeS35lJaQiZ3ouKaWNVf6mRhFq98PHLCsgYAkhEFvZ1IQjaYHUi6t604oqobTY7oO03sCNe3KLvJKU/7ldpd5RpKMuZL+dDeTvgXhOvZV/9wyJ2OJcfAjFMciB2Y9RPJxGl4oYRVNZ5lQioqPUEXmbQ5R3ZdDR+QwwQdYmi0YJwI2UsOUUDHppDR4WQB/WXPDcdAe4AZKngDUKS2wcjaCvAcCCOFVM8vmSzR4kxxaAZLhCQkyjUgStdezt8jYbFiiQ7RSVNFn0F4tUSQRTMDM5cFjW9rFzZbw== 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 SN6PR11MB2894.namprd11.prod.outlook.com (2603:10b6:805:d7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Mon, 30 May 2022 10:54:14 +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 10:54:14 +0000 From: "Dumitrescu, Cristian" To: "Danilewicz, MarcinX" , "dev@dpdk.org" , "Singh, Jasvinder" CC: "Ajmera, Megha" , "Liu, Yu Y" Subject: RE: [PATCH v6] sched: enable traffic class oversubscription conditionally Thread-Topic: [PATCH v6] sched: enable traffic class oversubscription conditionally Thread-Index: AQHYdAGgMporU/PU1ESxr15HtPRuLq03PUIw Date: Mon, 30 May 2022 10:54:14 +0000 Message-ID: References: <20220527000900.795357-1-marcinx.danilewicz@intel.com> <20220530084520.827724-1-marcinx.danilewicz@intel.com> In-Reply-To: <20220530084520.827724-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: 65e675fe-917b-4b39-ffa4-08da422abc75 x-ms-traffictypediagnostic: SN6PR11MB2894: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: sHPTqVIPkAgYh5EdWD9DVeB2J8AJTwdKjA+mtP/DmaQ/2PVzruKJEo7dwAMPA3FDH8NLo6SUdQ9N7HtTb9n+WpyeKxx097OLJYz2Nv7IamdztYt8aiKl86H0XQpQQkywNiyqcvExl2UWUD/xwelb3YY3X9knEI0ImnJLAIxe103X6Wgkprg/zaUr4jQPGV4EnqkGnObLv1VMfkFYGHe3KiYZkBJ1F3/O3XAr/5c9lVV7TAjflxHHBUM6lX/F0XgvsBLtg/dHOq6XZKVb2CRM/iSupiCeRoKWMc4aUowRIvZyjtrO2bN3tJCh/h3hvt7RhotnFUNXM5uJk+pmhwCkc/GoptN9fFR9c3bRd2TCB1+rIx/9AK9vXlSNPqg2/n5Uw7eJIkwz95ddHK7VxQ44v4Unt4Pw3rgH2uR1UcGkxUBKI+YxQfY25WGFII9DLaUJw37rT3krb771JhRIa4+5f2AyAvNT1fl50yrK9FjpUZPcBaiFnkOLDRGLYUG935MjxMGrwzV3OwS/BWM7MBMRelLGaiKePu/WN7NSouJVbrnWOLL0BBHwJVq5KxH5Hz9NyEQC5+Uv8zmj+isAiruzgMN/U3ZqfzCSiote5htNruBJwuwKOpTARrsmga6mn0XxCmrCYnxMhifxRcam2JQkTX0Rtfu/QyHLE3JPCHFlJaX7oIyvUDCPGCKfebw5+ZWvB2arwvSh5RMCif0Bd44KgA== 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)(52536014)(4326008)(66446008)(8676002)(64756008)(66556008)(66476007)(76116006)(66946007)(38100700002)(5660300002)(86362001)(186003)(8936002)(107886003)(508600001)(33656002)(71200400001)(9686003)(26005)(110136005)(6636002)(54906003)(7696005)(6506007)(316002)(2906002)(82960400001)(55016003)(83380400001)(122000001)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tMOu5OcMMtXdeN2RXwP+xoMHIrw9y2XnnB9sVIE3saoQ96JL8d6VmeNtcfWe?= =?us-ascii?Q?qL3zWEMZlAQirLuBVF9SPPDRIj+xfIhTpCAWLYCYeTjW4nx4ctWxjslOprKy?= =?us-ascii?Q?BCWf1UpKV54hUU66Ejt27cRG6ZZQsQ763CKz+Mz093C3Ck3fCv7fDoZjleDS?= =?us-ascii?Q?IA0FIYpFC1vE+tT9a3dVFSJ4SkkRiXwMuih4taMR6gQqD83aA5t6KKIsqDzz?= =?us-ascii?Q?YPNpGXTU7KUjh4KUBcM9iCXQQsaryn3AxmOlx5IeZ/kfL6u/CWBdzeeXbrDr?= =?us-ascii?Q?3r6mrXLsVzY3MqGWu3F4ru3icpE3XHtkwHEyjdIZvyYBYvVtOwID0ns3cphQ?= =?us-ascii?Q?wGOsbt5mkiVifR0Ho8qQwdqD2HSRheLfd2Yj0FtT0r8AZuiJdrJV8o9TtCZ7?= =?us-ascii?Q?fFiJGXoyGKwToN/S/6SYhixzTfR5+gJYi759Z9TY6w8+tlZ8lrUJe4opoOwN?= =?us-ascii?Q?lYtpybn4VCAD8XFkgLtc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6JwmDWzg4+wKSz18N+pREo1ScjumAuUIkMSiv/5iNn6m1RmsRLLlliR?= =?us-ascii?Q?90iaZGI99AoXHGLRhveuaPQjv1q4QBqNPMfA1FDVa/jYw5KVOQuYkadePfKF?= =?us-ascii?Q?ibSMhNftf6/eZLvavhGlyjTKL8CC4Az9aw5N0ceRxhCOA66K/U8WiOlmkdlq?= =?us-ascii?Q?bq5QdtlYU6sEWoFd4Mh+lus/lGqwkvHwlubZ6/eDC0ejL4c8X9u4UQ8x0HiZ?= =?us-ascii?Q?/r6IaZwn4rGMB/5iAOL4MSWFqbcjU9p62RkKFNMYTXUKU+5j/sKMKxMCtOJ8?= =?us-ascii?Q?9l9jrXmZ/JX8XM+WngLyu2MOSLujtOMZCaUE2FtJ9kajc6T6LEWhZw2doI0B?= =?us-ascii?Q?RJfdrLBIZaCJcSxNzEYBzkC4Skod1JA=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: 65e675fe-917b-4b39-ffa4-08da422abc75 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2022 10:54:14.3786 (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: KxwGYhYFB7L7ncD05/SvXFJ/UZGwKuy/+OysLNyBsE6bXRaMagfEkiRroHqzwdAIedNcyJuln6NkRdMmKLklrpRNs/3B8eBMNv9JPSbA+aA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2894 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. > @@ -2403,8 +2481,16 @@ grinder_schedule(struct rte_sched_port *port, > uint32_t pkt_len =3D pkt->pkt_len + port->frame_overhead; > uint32_t be_tc_active; >=20 > - if (!grinder_credits_check(port, subport, pos)) > - return 0; > + switch (subport->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; > + } >=20 Using a switch statement for a binary condition instead of if-else does not= make sense to me. I know you mention you saw better performance with the s= witch, but I am pretty sure it is not the switch providing the performance = increase. You are using if-else for testing the new subport->tc_ov_enabled = throughout the code (an example is just below in your patch), so I suggest = you do the same here: if (subport->tc_ov_enabled) { if (!grinder_credits_check_with_tc_ov(port, subport, pos)) return 0; } else { if (!grinder_credits_check(port, subport, pos)) return 0; } > /* Advance port time */ > port->time +=3D pkt_len; > @@ -2770,7 +2856,11 @@ grinder_handle(struct rte_sched_port *port, > subport->profile; >=20 > grinder_prefetch_tc_queue_arrays(subport, pos); > - grinder_credits_update(port, subport, pos); > + > + if (subport->tc_ov_enabled) > + grinder_credits_update_with_tc_ov(port, subport, > pos); > + else > + grinder_credits_update(port, subport, pos); >=20 > grinder->state =3D e_GRINDER_PREFETCH_MBUF; > return 0; > -- > 2.25.1 Regards, Cristian