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 F3821A0350; Tue, 1 Mar 2022 19:00:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 837D440DF6; Tue, 1 Mar 2022 19:00:44 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id D5BDA40040 for ; Tue, 1 Mar 2022 19:00:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646157642; x=1677693642; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8BDc2jTvBAFeBpUQBdZYB1vHah1tOM7yz4RZmr9yjZA=; b=K9Ir8ilLuabZJcVuzH6PtSmDRt4DDxqrrZNg2+pivtHauV8GP4fveeiT XMgPilS43Y2CCSbhCQmYS4waP5UdA/hzM5JhIWg6kT5BAxE9kzZuPQUrs rrYz/HCIUSyT/UvN5sT3Bvh/nuSArtqPv25C5E7JCX0/stI8FU67Y5DUL 6yCVbMTVkuV0ED5ISFEOX3YoewTAzmbFRGmQbxy2bt+0Urrvcw1PfwrL1 rQTNEJHIdlGxztcrkP4DhU9C752SacpI42gXZhOJmVodlxIvdBtz8UySS cI+vPGU5kyo4zl+yiuAovBpXjLlP1jGTxw072gcE8DCgwpxqgI1R7AG0l A==; X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="233170079" X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="233170079" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 10:00:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="685811474" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga001.fm.intel.com with ESMTP; 01 Mar 2022 10:00:40 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 1 Mar 2022 10:00:39 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 1 Mar 2022 10:00:39 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Tue, 1 Mar 2022 10:00:39 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 1 Mar 2022 10:00:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jLHrP8z7h+2pCaAuswgwHg8xp3SV6ZbN1ruZINJnGYdVxe/bMqHqJBzUh5bVuRhy0XMtCVqBmSr/V1m8KNI0n6Q0WCPFH3TkU1h5yHVSQmts6I0V7f4L8A77PbmG8yC5hzrmEcX2H060o0OYWUf+kMUnAYb0ZmPhE89KFaipz8FoaZd3yc3Y+pW+Y+kun7vxcIvqqu0l5TwoTij9qghyejqAiPScEvkcAAfFSatCoHoSlFWafw2E9ZcJ6DGefjjTtccdPHJmTj8vrs1Le/gjm9dm082NSNmKyogNvYlW64HcviRtzpQlC07S8Et35ZlhxXLdoSLGDIvQh69z8KUa2w== 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=he2bgLZ9UFSWLVC9xjHPMIVIlyZRsHskWNtxACq59RY=; b=Xh8bPNinpXyRZIBK35pV3FDEMyy6aTiXDv9kZmtvJyLcwlk14pSvWtYELVfJSO25hxVwRxsMWKeAYJ+0m1OgJYcwA3N+gJ3wFruW18w+an+93vz8n3pxZ3PqXJysHDdJBGgCqonx4T1yIZnqAMRdxa7GaN1ek7f22lThts3hiujpPuLRQD8MABte7dX6Ha9bAS7tzC1iFJzoBxyosvoYGodr+XISUvTlfs73/8qIbIwpwr4VOd9EDLzdhodCuwKjS5Lr7PwNg6JKUDQdfXjSVjVFmtnzOeUd1bQjai7bXLmh0KbTLaY6sI+o9IzVLR9hPbrCa1m1AoH2Bm9XGF1pKQ== 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 DM5PR11MB1756.namprd11.prod.outlook.com (2603:10b6:3:114::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Tue, 1 Mar 2022 18:00:36 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::69dc:2fe0:11fb:f157]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::69dc:2fe0:11fb:f157%4]) with mapi id 15.20.5017.027; Tue, 1 Mar 2022 18:00:36 +0000 From: "Dumitrescu, Cristian" To: Stephen Hemminger , Weiguo Li CC: "Singh, Jasvinder" , "wojciechx.liguzinski@intel.com" , "dev@dpdk.org" Subject: RE: [PATCH v3] sched: remove useless malloc in pie data init Thread-Topic: [PATCH v3] sched: remove useless malloc in pie data init Thread-Index: AQHYLTLDIQmsxuq5bkmxoD/3mHx0mKyqw3cAgAANJgA= Date: Tue, 1 Mar 2022 18:00:36 +0000 Message-ID: References: <20220301090812.61bab2ea@hermes.local> In-Reply-To: <20220301090812.61bab2ea@hermes.local> 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: c15f60fe-85a8-4c81-d6c9-08d9fbad6371 x-ms-traffictypediagnostic: DM5PR11MB1756: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: P+y2HexnOoRUAemdSqdqvEGoDj2YUG7GQdRM2F7uVMJx+ElRUQQiA2qf1hUksR3c8HH8arcMD0mk/kvmKdR7ofuq/6t+AQDPXxycmuqn0zJH4TMsgsA2WiCJHpxJNE40oCGbfMPOBTLbgMcyPCtWIajjTFNKXOa8+jsuREe8/2WPhqFoa6CmBEDAJoo8h2xhaQjaeXM5l2BPBlkDS3mdYh/wTgq8LHuKq6LB54cJCu35owx6TbWfjqlw+Zem8vHiq0C+N4IwzTLawIZNKrsf8OFn5dHDo/VLZjRwsNegjJDrHkMNG0cG9SyWDmLoiUdjgePCDq4VQw6vBIv/1dw1hNlFiRtT5vIiagKjgjmzA0END2DFBFWaH6edFGQCqabjr9yyRWjkVw76wXdY/TrpFGWIZhBX46vxrGSU1gmapxLma0NE/bTEmGWZdTVnmyA/XnnGrNOz/Z+FEdYwwoMHTj6Ig5oNxIBXYXTZ3hrlWRmq/sUAP8zS9DSfhP3Ij2q/nPS+Tp61FBNg94Qk16In4+G/5OSDZJd6osFKUGN+zf/l0zMHgiP0OwlN4xrWYhkPF4CH/ssw6MqU+YLPK+7I5SBg91wVmUXUdcGZ+37i1/a7VZLllV/rHISC+0o83GJGWTHcgOvkFiodsbglZGVPWbLU/4bKfsAyOxD9/ubHID/chzM+g4UiJxwbFpByCAA11HvojSWjHGzSG+cctNwyEg== 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)(76116006)(122000001)(66556008)(316002)(86362001)(66446008)(26005)(8676002)(66476007)(52536014)(64756008)(4326008)(82960400001)(186003)(7696005)(6506007)(71200400001)(508600001)(38070700005)(9686003)(38100700002)(54906003)(53546011)(110136005)(2906002)(33656002)(83380400001)(5660300002)(55016003)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7OiHRXg+W2N+I0TDOzyBYi4F3Nb6QumcHwEvH3UB9Ks48/p4IG62u8msaZ76?= =?us-ascii?Q?VO1u6hPw2S7u9d/PZig313FTRcnzY7pjpBvHeZffgSLJl6mdrxQxMAtVJ2E9?= =?us-ascii?Q?H2iQifBKzTzp9mwoLrIdsqJ1Cyj84WKEjSBMJhKrCFCmCWwwY4vbBNVIBvGB?= =?us-ascii?Q?w20INYDwNFGvLFeZpgWHjFYiznphd2CBtvRgeEf/ODA5EgqSExCuRQxrDdpZ?= =?us-ascii?Q?axkhtOv+8V31OsLDTNGs0WekBN/isb3JYX6vgprt3ElqSHk1LeStljS+pdUd?= =?us-ascii?Q?PWsbanFwiZhvnzs9kLha58ehEIcL+VwJ45MDq4z7TrpsYGpoLS6cLfglQDmr?= =?us-ascii?Q?Uq3QhgYCKTtj7yTDY8CF77Vt72Ot6Jyc9fwgLnwApiG/rVF60bvsUA6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ue7K9gAS6CccMos4PhfwEieie7Akma5vhz?= =?us-ascii?Q?1YK9yqVPylLbvyFwX4gfrMjE4v6B2DFJoklM5+E4i9n+d/nD8JrKvLz64nlq?= =?us-ascii?Q?jF2rWaLLncpRHU77gUYiTkZnIhpsV6tNswZwL06BbkCtBsxb3cFQs+kEyU09?= =?us-ascii?Q?DkeNKuD5tEcUoVKK3hOd+lMTksmieFwdQkfzEnBGQg+La2xTgmEKt6k2No4Y?= =?us-ascii?Q?BNQoz0OOYhHKsQ7SPWEwg/+OsEBvQD1ib+BSPVHlM/i7d2AjNhL10Q7bjxBX?= =?us-ascii?Q?Kp/7yP0W0M/0X87vwyyOdyKFMbYVpOMYfGowGpatKosPv4XyLilSIwFqK+8h?= =?us-ascii?Q?Hv9coxaK295IRdTbdBxsGjS+h1rLIZLfKmCv5Uhruaju3uo9QWCIaH3T2c7o?= =?us-ascii?Q?UmRusQ=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: DM8PR11MB5670.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c15f60fe-85a8-4c81-d6c9-08d9fbad6371 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2022 18:00:36.4872 (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: 0jGcI821k2FA8Hse7yx5+4Eh4a/nY3oLv1sbKjpFAaeILTEv98EEmRPxvL6pFfIxv+1Qzsj+RVSWHUQhFF+l9qAfHEI6RfxccEMeo8vNX8w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1756 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: Tuesday, March 1, 2022 5:08 PM > To: Weiguo Li > Cc: Dumitrescu, Cristian ; Singh, Jasvinde= r > ; wojciechx.liguzinski@intel.com; dev@dpdk.org > Subject: Re: [PATCH v3] sched: remove useless malloc in pie data init >=20 > On Tue, 1 Mar 2022 14:07:56 +0800 > Weiguo Li wrote: >=20 > > 'rte_pie_rt_data_init(NULL)' is not expected, and it's ought to > > fail when this happen. The malloc inside the function didn't work. > > So remove the malloc otherwise will lead to a memory leak. > > > > Fixes: 44c730b0e37971 ("sched: add PIE based congestion management") > > > > Signed-off-by: Weiguo Li >=20 > Acked-by: Stephen Hemminger Hi Li, I suggest you also replace all the assignments to zero in this function wit= h a memset(0) of the entire structure. I see we set all fields to zero by d= irect assignment, with the exception of qlen_bytes, which looks like anothe= r small issue to me that we could fix here. The memset(0) should work even = if later on we might need to set some fields to a non-zero value, as this c= an be done immediately after the memset(0). Ok with you? Acked-by: Cristian Dumitrescu