From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2645A04C1; Thu, 21 Nov 2019 16:14:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C337D2BA3; Thu, 21 Nov 2019 16:14:15 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2760F2BA2; Thu, 21 Nov 2019 16:14:13 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 07:14:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,226,1571727600"; d="scan'208";a="259400155" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.92]) ([10.237.220.92]) by FMSMGA003.fm.intel.com with ESMTP; 21 Nov 2019 07:14:11 -0800 To: Xueming Li Cc: Asaf Penso , dev@dpdk.org, stable@dpdk.org References: <1574346302-1263-1-git-send-email-xuemingl@mellanox.com> From: "Burakov, Anatoly" Message-ID: Date: Thu, 21 Nov 2019 15:14:10 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1574346302-1263-1-git-send-email-xuemingl@mellanox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] malloc: fix memory element size in case of padding X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 21-Nov-19 2:25 PM, Xueming Li wrote: > This patch fixes wrong inner memory element size when joining two > elements. > > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org > > Signed-off-by: Xueming Li > --- > lib/librte_eal/common/malloc_elem.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c > index afacb1813c..885d00424b 100644 > --- a/lib/librte_eal/common/malloc_elem.c > +++ b/lib/librte_eal/common/malloc_elem.c > @@ -487,6 +487,10 @@ join_elem(struct malloc_elem *elem1, struct malloc_elem *elem2) > else > elem1->heap->last = elem1; > elem1->next = next; > + if (elem1->pad) { > + struct malloc_elem *inner = RTE_PTR_ADD(elem1, elem1->pad); > + inner->size = elem1->size - elem1->pad; > + } > } > > struct malloc_elem * > Reviewed-by: Anatoly Burakov -- Thanks, Anatoly