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 5DE8EA00BE for ; Fri, 18 Feb 2022 15:38:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DBCA40E2D; Fri, 18 Feb 2022 15:38:54 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id D73A240141; Fri, 18 Feb 2022 15:38:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645195132; x=1676731132; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=imJwVB4Ed37DY62OIqUFOIWoo6Dk+85uimeb4LKhjvQ=; b=M03AYydOqT0RIxbvNEgLbF2UA/6n9dTYzycfD3Js2LBFMRTAKDpEEryP mWVR8j1uwo/zdA8cIyqBMvfyjLsuKAtMHrKNt3owD+mHUKL0hKAB/0As4 xDX+sk51mCb5VPskKmhdN7bHhfgyNppEiEk9aY/+1krxGFsBeHXRnwj10 YGTtHwUb/pcaDrrA2gL0BnW0GW7waxAeJugd0FCMhoK+kG+RM374AiWVO D5NrVSG7VaKHMEDLl1EWoGSJHKUQBYlFcv8S9diuzLt71zvsTyVxEa1SK llkLiY7vosNaPIJyabs5v+yLbJSTHsu2PfvhhHca/eP569tBXoCNEUj8R Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250891150" X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="250891150" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 06:38:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,379,1635231600"; d="scan'208";a="637757185" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP; 18 Feb 2022 06:38:50 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 18 Feb 2022 06:38:49 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Fri, 18 Feb 2022 06:38:49 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) 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.20; Fri, 18 Feb 2022 06:38:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UVnc2+J5t3ZLtSIpaFTF+lP+OAwSyf2tcuJPvCCl+TgRtxMM8UC6NUdHeP9P4bIq8Wnqs2DAjSzDgh+GWr4MdtF/Kv9mUjQqRrb4QZgL2+mRxlvrPrwXQCKwlPeRF/A0g4XI6T3bWPCj0fCr9FeaDaDFeqjWaggDMlRkFG32Q7AoJhI5obwJZKGY2IMPm7gb0ltSaXqcKVLwM1CFvQI10uzo3S+G2lUPi+DRjnwkZKrdJ5FDBoWz7qpG8Sh7sHjWOTYWOuzMBmczzmF7/tHahgCTaB3LgsLLPnDeIksa8R6roddDebtljdXN5A29dL+LuVokylAragbENUuXz6pGww== 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=tsbX1Dz5KLiX/8DGzAuGHc7U7w3cRAxsyEZq0kmNwYU=; b=i+rTVDCUwsVWSV8V7yYW4cCYadKBjrWzzQV7Z2bhreiTHTmrzFhJSIxfwfPaugqb5YqdXgwYrEJYR0gngKtfa1ygOr6jq/7YKAHRyRT+hZb7H0D0NxugjbUnKY7benA8LMEf3C/EBvTFhwHgp/CueeNmhtsTZLwIn7QEP7WSofcw3rzDGUGD1BHBR+99gXwqlsL2ce9WSTbAFDBsu8UCLQeYoj+tvd4t72munVXB+sY47J0nJAcWAFjU5tsdA+WfOtJcHaXGpHNwdhUZUQCX+cZsBlrK5ao1iijeSRTaCEoPEEmh8ZPxx2RhloMo6yJzvKwUkJHfqDzjo9IM4CTJdg== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by DM6PR11MB3865.namprd11.prod.outlook.com (2603:10b6:5:19d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.17; Fri, 18 Feb 2022 14:38:47 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2%4]) with mapi id 15.20.4995.024; Fri, 18 Feb 2022 14:38:47 +0000 Message-ID: <191c80de-37d4-da06-5fef-fdc3e47c58cb@intel.com> Date: Fri, 18 Feb 2022 14:38:41 +0000 Content-Language: en-US To: Weiguo Li , CC: , , References: From: Ferruh Yigit Subject: Re: [PATCH] net/sfc: fix the argument to sizeof for unit cache X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0281.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::29) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 781f85cd-12b8-408c-871a-08d9f2ec5f24 X-MS-TrafficTypeDiagnostic: DM6PR11MB3865:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nDppr8TToWWWkrUc1X4LuapKmePhIv/7cHrgEo0wfuezk2Lnh7pdOU1IVejEsuZpGyBr1y7Mj2wx9VyLpGrEGZjc7y86vA9E8FcgMVmEaUA7OlBoOAUbgHnjVuULZmNi8/2oRMdYlwEUBieBBcAtwYPFHlWrArcgK+o9KJjomaOw1gUKRplTlqiwTZBimCzIMPE0EMdCvTgxuRydYzQtjhyvorR8YEB4SHAQeh4ibi14KO9tbG3nMZIsKHbHGVAdxb4pNTojH7Ek8ncJUrPmfMwY08qQhNH77reAhuuUxnOF3e7OJZIZu80QseE4xijUgeHq6sfAq8eNEUOFTxuDB5DC7zgtbFYARhxGMiO9U5F8GoimfftQvJoVF7B1nB6SsUZMAdyPoUXeJ49UEe/RXDEpb4T3zfEVLhJd/MAsIof0l2GrwteIVY8Kqd+ovV08T5dFqn7C7Etfs8nudvWQlkOQgQ0uh1nAHxgfpKtXGXXmTXLfSiOhGfkR6jOKskr8iIa8UfQbRVSMXZbhhYBgyLMCoL/YjFA1QMVQI2pHFzlRh7XcC4xhnjQsk9QTCr2cz1GrrnvAJSPNwSEWnZn2zRqgOVQ3ejyXlEuAyX8/oZvAO1fYgYLKJhmLqQosAc5cET9XVtf1/VaWXl+7PM1lleeNyDmBJG4VV4pxihvwtMocEj+apyETj1xwsuQLBF7RzuzCel6cBS2DjYzlvEYxNZM6gzMGPL8ts40Tzg7SQNBaXx/Sl/yMPVvoBNOJs2K/zayB275/Hbkmpbt8r7jcZNtA1U8hdDAwpctasLm+DCuWPQpWHRNsfeQgDBkh/XHD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(66476007)(4326008)(66556008)(8676002)(66946007)(316002)(44832011)(6486002)(508600001)(966005)(31686004)(86362001)(82960400001)(36756003)(31696002)(38100700002)(5660300002)(186003)(26005)(6506007)(6666004)(53546011)(2616005)(6512007)(83380400001)(8936002)(2906002)(48020200001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U09TTjhKKzMzRXBKdXp2LzFCKzB5SDhCcEJTMDZIMEFyQi91K0JkM2d5SUp3?= =?utf-8?B?aWFYajQ4dmp0eG5pSGJiM0FINW5KZmJzb0ZzdWcyNm1sUkE3UGZTR3I3STU5?= =?utf-8?B?Z3lRUysrSUticTdqRlN5cC9MQUNIMStIcXlUdGwzckJGK25iUnZCTDZJTFV4?= =?utf-8?B?NGp3ei9ST1JvN2NBTFNiNFpXcVVENlVaOHdqU3hlc25mRllLeit1Tnltam1Q?= =?utf-8?B?b0JGbThiVDkvbEoyaWNHTGU5WkxiZmg4enAxbURocEpneVZieFpmWjNKK2F3?= =?utf-8?B?SEViRklDaDBndUVNVnU3Q3BLVnREY1RuWk81dm5tdGM1UmhpbFB1bFRqRDZI?= =?utf-8?B?NElTWlZuUnhReVQ0czNCTXM1OEZGaHBub3hUYytldHVhMTZuTHlXeEhCbFdv?= =?utf-8?B?Ym1zVnVVQ09Vd3JNcW9NakJDdVgvZnFyNG8zcVZoaWIyWGVGRH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S-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2022 14:38:47.5037 (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: NpnQHb93KIyE0H8Y3QjAVFuwQL+osmqcI27UT1suZIIVseCB2mt/x8vy0Wts4100kEEtWyllXHLdgbEr3Es/XQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3865 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 12/21/2021 6:41 AM, Weiguo Li wrote: > The size of unit cache should be sizeof(**cache) instead of > sizeof(*cache). Memory reallocation is inadequate by sizeof(*cache) > for the platform whose size of pointer is 32-bits. Found by coccinelle > (see https://coccinelle.gitlabpages.inria.fr/website) script. > > Fixes: 63abf8d29225 ("net/sfc: support SW stats groups") > Cc: stable@dpdk.org > > Signed-off-by: Weiguo Li > --- > drivers/net/sfc/sfc_sw_stats.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/sfc/sfc_sw_stats.c b/drivers/net/sfc/sfc_sw_stats.c > index 70259660c0..81f5aa3cc4 100644 > --- a/drivers/net/sfc/sfc_sw_stats.c > +++ b/drivers/net/sfc/sfc_sw_stats.c > @@ -777,7 +777,7 @@ sfc_sw_xstats_configure(struct sfc_adapter *sa) > > memset(*reset_vals, 0, nb_supported * sizeof(**reset_vals)); > > - *cache = rte_realloc(*cache, cache_count * sizeof(*cache), 0); > + *cache = rte_realloc(*cache, cache_count * sizeof(**cache), 0); > if (*cache == NULL) { > rc = ENOMEM; > goto fail_cache; Hi Andrew, Ivan, This patch seems missed, and it looks a valid fix to me. Do you have any comment on patch?