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 87933A0543; Tue, 21 Jun 2022 10:18:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77F854069C; Tue, 21 Jun 2022 10:18:53 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 709E840151 for ; Tue, 21 Jun 2022 10:18:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655799532; x=1687335532; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=r8DLW22PDGie+VpevGDPVd6/M8JQetTMqHh4zm58KFo=; b=k6DGKiLZskS23+eBwSddgm6nEzy2a+9pQ+MoIojYtpt37ZAG/N/6wlJJ QatGn5s5Ihc1CRaKqYg0Bo/cAh5bhoR9iMezqx/TMW6wVLfBrL3sofEvV 62fcx6kj0FM58Z37hFbzFAcAuC9RyWRTT1fVmNHNxHlw6SqoyG7zT23h9 ksjuU4eoxhX2fx62Pp0qT+honavVj+4KJ7hDhgosyQXJnRCuBfsXHmvA1 fJYmDIJBt+WVcZIJVKhd5jlwXhThXHUcX1VuGX/t7ztgCEgVcbKiesjSH qWB1Bi7A0lFweNINULUL2YMi1NIBFORJ/OtwocMPGJHXnRFoJds8EZ8Sd Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="277609179" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="277609179" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 01:18:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="643515953" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga008.fm.intel.com with ESMTP; 21 Jun 2022 01:18:43 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 21 Jun 2022 01:18:42 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 21 Jun 2022 01:18:42 -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; Tue, 21 Jun 2022 01:18:42 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) 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; Tue, 21 Jun 2022 01:18:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T12Qihlz8owDqauQZR8oIJCgtjPTVOyeI1iBMnx0NVwfX/E3KmQCWOxS4+hQLl92m3iCXtwscc4IaxEHb4beu9T46Wi9CxsQtAAtIWYsjgK1H4IuddOlBToRV73L0oAej9vSrowdhnnMfuMS/hIh0y9Q6zhIzQ4aMf44715Raf5jpbRjU6yrvr7sYXZSx8Z4B2O6SNJy3omS10hMJRmI2fDxPbNjQggB7SQKBQj3Fh9AKatcaBoxA0lW84PwGbGRAYVls10AYi8ugC93qJtQHFkS8qUiRHlbRWsnORPCfv4qulhgPTPtLnPipOXaRfEIoDzRWNLjSG/r0BOIfnEvhA== 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=N4mpJ6vR9XVtain2aKDm7cpY6HKGDLxVRp1TC7uRWeo=; b=NWhFmhnZS98Wqu7mYiAcYRrBcnRCXQlglvJjLHfWqIHZGyb0WjI0stcgUZWnZTVoF1INJRQ+sdsYdFc6e2ikf1k+UKcuI5MNCW2SFeyxoERC2hOAqAC3cWuT0xdlF3qKxND87eeIUjf8Dx8kBaXMREbkJcGCBD7vayIV62B4Ha5FRfHftuxn3jQgu4PESNjChUHB1q64CNyIhmmmZGmCnRydGZeD0grsO1aeFvPwE01b+QDfaq1phRaj5ROPmcT8VBmnQpWd1NRh26N7FDuVzvrusIVXuDRaorDEdnoLGKdMPbzMlzIb9IipmKZstgVuVdfsLaPyiKKzibZ1cAKPmg== 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 DM4PR11MB6358.namprd11.prod.outlook.com (2603:10b6:8:b7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18; Tue, 21 Jun 2022 08:18:40 +0000 Received: from CY4PR11MB1589.namprd11.prod.outlook.com ([fe80::957b:7559:687e:bcb3]) by CY4PR11MB1589.namprd11.prod.outlook.com ([fe80::957b:7559:687e:bcb3%12]) with mapi id 15.20.5353.022; Tue, 21 Jun 2022 08:18:40 +0000 From: "Singh, Jasvinder" To: Stephen Hemminger , "dev@dpdk.org" CC: "Dumitrescu, Cristian" , "Wojciech Liguzinski" Subject: RE: [PATCH v5 3/3] rte_pie: fix incorrect floating point math Thread-Topic: [PATCH v5 3/3] rte_pie: fix incorrect floating point math Thread-Index: AQHYcT7+/eepIZIMG02OHq95IlvN061ZrGCQ Date: Tue, 21 Jun 2022 08:18:40 +0000 Message-ID: References: <20220524184623.480646-1-stephen@networkplumber.org> <20220526202653.99796-1-stephen@networkplumber.org> <20220526202653.99796-4-stephen@networkplumber.org> In-Reply-To: <20220526202653.99796-4-stephen@networkplumber.org> 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: 8ccc99fe-5c58-46b0-5342-08da535ea635 x-ms-traffictypediagnostic: DM4PR11MB6358: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: cCvC4/Vk1AaG1hTqIDatDYJC1KuuG3cLDrdcCjoE7a16jmIDVp0hdz3sUTt9Y52UPuJzCsN8h2SgOqEDEPioZkwIZq8y2ttY6jF2LFFCEoLRn/JMZUYj9m2wxVIBTkK8Ew6AcW7ZReKBt6+HHJKKzm9ejkJ7szM1vcIg7IKouh5UKMkljTpX5K3AFlJGmxZMdfvJ/tS6cSrkmd/l0hcoUdZ40Oo+pCi/AeqhFry48TmuBxUzjXXBP0/gADvq8iArZ1rcCvlyt4+kHHMuriu9fLQDUgjlLz99HDzn0lIKGK2rQ11DhKWu4LWuorB5WR0DnajXHMHSLsqD94Be28sjZ/txDNE4j5DjYi15oQP22jY8Rq2qV2+ZGhwB8Qw/vRv4NJPF/Bq9jbxrVsDcgEcPt9nLMTsHp+e+jvRBD8+b1d8feWM8S76ZF2TPOFwUBTKZQf2K8+3c1drfX0ca13iauxuf1p9tRARUFF0UMyzHphpmbx6OICCCeXlCFt047O5VDFIWSE1Ukk81BKWvHpwv+IZ5MQ+F66n4DE8nBCy9N9jg//wbbFmMTsL62dRKS8dLipLeL2M2+YcwO1na8R3aYmvJJDyaUD5o6GWCFWGeZGhbR5vni+L+Zq2OrrfzGqbslE78PeCHLugTmUvQJUiehC0+g5iMq89VkIcixYN8Il0VKpI2mc2BWoHXAXvCW9fCqXF/5n3MqH2Pu4h70czdvA== 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)(366004)(136003)(346002)(39860400002)(396003)(376002)(38100700002)(55016003)(5660300002)(186003)(83380400001)(122000001)(33656002)(110136005)(71200400001)(8936002)(52536014)(9686003)(8676002)(107886003)(53546011)(41300700001)(26005)(2906002)(6506007)(82960400001)(7696005)(316002)(66446008)(76116006)(64756008)(66556008)(66946007)(4326008)(54906003)(478600001)(66476007)(38070700005)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tOCt95/Og57S2zBO0dAVBa5Ku+5IBfZe5GLaWNjORp2OfaFg6FZIgSHlENb8?= =?us-ascii?Q?pYK/h8+X/LRoSAmk9E6leSqKWcS//2IrVqoJwC/IlImydi7D5TdAIWAz7Tlz?= =?us-ascii?Q?X2qOp80gDq8c5vXwCfGhgIse5NbtvI9EKeKgSuqaCMwLKhrr9rZbD+2rVf3s?= =?us-ascii?Q?NfTx4f9+EUa9AiaUJA2Q4EivELG058rEZcpFrCMf7/cizJXlADvk6gYoA1zj?= =?us-ascii?Q?OpOCy7oPCQG9+tEKVX6sFtipByTeLyAYU0QJ8W9uNO2oDGPsDrDILJFGORXR?= =?us-ascii?Q?0hMG1agkwxr0RHqCH6V+ZSuc+2kcPEIS7qW2bNJdqx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jfJssMvA6Rh885/+/GrgEUIsWZyuYlZSnlvmC5VqHGHy9dxqTNmJf?= =?us-ascii?Q?aRMAIZL75ZO7G7Dki04huGmwekKymRhzdUYpvk6K+QqOOOueTk+CPY2WxTkf?= =?us-ascii?Q?drmZsqzsxvrWGISHAaEyuIxazZsPmCAAtkVo4TCYDzes1wvt2mLAwC4JoejU?= =?us-ascii?Q?0C1tzfNJ7jVyMyQ9el/B7QGvFMY1o4SowIAFJ4pvZiWjBD2bZcayjgSnDiHD?= =?us-ascii?Q?gufGstxisyV+SP+yjHMjCQpbfNj4umPLfLhCRPY0DvJLPGffJhgwdc47yhE6?= =?us-ascii?Q?6kGdlNFWdqlFw69OxEi6y23y7peFUGdu6U8PwlwaPeSaXcYahyZjUfZsOksx?= =?us-ascii?Q?xHAFtpOssf2l/D5n0XloFOLerg3I571Ox558N3zSi9Db6yCEx8gUD4bQlUrO?= =?us-ascii?Q?bnxPT07zmQUkaFcL9+E3n3mA4YyQ6cN47LvNY509siLEH6kF2sLyPwL2JQsh?= =?us-ascii?Q?/Xm/CHdrNTc07bySUpf7tVm+kkXcddG0m4y3OCs7vpGIaM3PcqAhn+cvibWI?= =?us-ascii?Q?2CcwAZTO+PG54fajafMGPV0z1crjd9I=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: 8ccc99fe-5c58-46b0-5342-08da535ea635 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jun 2022 08:18:40.6421 (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: tNZ6Bgr7RBTcwn5RCLMI8qGmc0TOmzcevANsNlBzxmVgMgNJ6y+1Sxt+nIHEIkUOgTNxC1fAujlx6sJuoI8GuQxepkzAX7m8VKiVcduxk0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6358 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: Stephen Hemminger > Sent: Thursday, May 26, 2022 9:27 PM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Dumitrescu, > Cristian ; Singh, Jasvinder > ; Wojciech Liguzinski > > Subject: [PATCH v5 3/3] rte_pie: fix incorrect floating point math >=20 > The function rte_pie_drop was attempting to do a random probability drop, > but because of incorrect usage of fixed point divide it would always retu= rn 1. >=20 > Change to use new rte_drand() instead. >=20 > Fixes: 44c730b0e379 ("sched: add PIE based congestion management") > Signed-off-by: Stephen Hemminger > --- > lib/sched/rte_pie.h | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) >=20 > diff --git a/lib/sched/rte_pie.h b/lib/sched/rte_pie.h index > 3e2c1ef46721..528f2ea878e8 100644 > --- a/lib/sched/rte_pie.h > +++ b/lib/sched/rte_pie.h > @@ -217,7 +217,6 @@ __rte_experimental > _rte_pie_drop(const struct rte_pie_config *pie_cfg, > struct rte_pie *pie) > { > - uint64_t rand_value; > uint64_t qdelay =3D pie_cfg->qdelay_ref / 2; >=20 > /* PIE is active but the queue is not congested: return 0 */ @@ - > 240,9 +239,7 @@ _rte_pie_drop(const struct rte_pie_config *pie_cfg, > if (pie->accu_prob >=3D 8.5) > return 1; >=20 > - rand_value =3D rte_rand()/RTE_RAND_MAX; > - > - if ((double)rand_value < pie->drop_prob) { > + if (rte_drand() < pie->drop_prob) { > pie->accu_prob =3D 0; > return 1; > } > -- > 2.35.1 Acked-by: Jasvinder Singh