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 CA264A04DD; Tue, 26 Nov 2019 14:30:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ABB765B3E; Tue, 26 Nov 2019 14:30:20 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id AAE744CA6; Tue, 26 Nov 2019 14:30:19 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EE7092267A; Tue, 26 Nov 2019 08:30:18 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 26 Nov 2019 08:30:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=mQkbtOE3ifEm5veKom/HOaZXVZYb0Y/Qn1UrkI0IbIs=; b=OypI3D+YBT8A ZrmT7wrasU434PM7FR8JzmiT0hManOfdZPoCOeM5DZ8X09icuXxGu1Ch1AvsTz75 +GGixndCFfevQBPADypD4mqPD6YJewUu/QXBVaHn9H/CKM5LRCtGlzBeTZbuZS1l UMtYGcWGic45Wyc8GGiL/Rn2CPUYUFw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=mQkbtOE3ifEm5veKom/HOaZXVZYb0Y/Qn1UrkI0Ib Is=; b=pacU2SJ6x5tNMUtVs40v59f1tsu5GgScSDF4/Bk8O+b8yzmbaPbqTpxRq WHtNuqWYQSFzUpW5o3vhw/E8OlaIvE7wSprFtrCgEUVLSbStoR/1/D5WutZg+A5S NW3h1UMhE1DhLmKmHObC+BRSrGlN4bQxD/0UJzry/V72qodSuaaygyEMGAsWvTwD PtiVI5DfLuxUGr6zrKjmaH8Sgwo8FaJvHagR0dMj1D6G9ySEJ5bTStnpsWZk8Xy2 4JR0UzP703XFjXEhoKU2Kg3w97KGa/1WH3JTNvYNXgpcqpGQYbF9Ryj7eyeY5nfI ZGhyr0ePusHKz7LodV6et1t+WhToQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeifedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf hppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhh ohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C52123060065; Tue, 26 Nov 2019 08:30:17 -0500 (EST) From: Thomas Monjalon To: "Burakov, Anatoly" Cc: Xueming Li , dev@dpdk.org, Asaf Penso , stable@dpdk.org, david.marchand@redhat.com Date: Tue, 26 Nov 2019 14:30:16 +0100 Message-ID: <1842633.FO3dX0cGTE@xps> In-Reply-To: References: <1574346302-1263-1-git-send-email-xuemingl@mellanox.com> <1911864.xaV5BFYatv@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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" 26/11/2019 13:57, Burakov, Anatoly: > On 25-Nov-19 11:24 PM, Thomas Monjalon wrote: > > 21/11/2019 16:14, Burakov, Anatoly: > >> 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 > >>> --- > >>> --- 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; > >>> + } > >>> } > >> > >> Reviewed-by: Anatoly Burakov > > > > I don't understand this patch. > > The variable inner is never used. > > What am I missing? > > > > For padded elements, malloc element has two headers - the "outer" header > with empty space after it, and the "inner" header, after which the user > memory actually starts. This makes it so that, when joining elements, if > the outer element had a pad, we also update the inner element size to match. Where the variable "inner" is used in this function?