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 68584A04DD for ; Tue, 26 Nov 2019 14:45:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B38454AE; Tue, 26 Nov 2019 14:45:37 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id EF4914C90; Tue, 26 Nov 2019 14:45:33 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 77FC522949; Tue, 26 Nov 2019 08:45:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 26 Nov 2019 08:45:33 -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=chaVkMmb1XQyJOZtNNysvtDfGdGmYhIRBtYeAyuucL0=; b=fmZs6AEHfhgM atZIMRVfe8FIX+Mmn5mlNoo+my67V1Ixm2IhvWka3KZiAtbGaPI29t3A7j9IZKlv QbnH+nJ0EQaetIJz8yhTKGSbr5fmY83fTdJQNF7FfmoAsbS2pAhO5CgAvwEqwVZU GbXF/fAMCPR/lVxLMW45nxH/Jv3W31Y= 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=chaVkMmb1XQyJOZtNNysvtDfGdGmYhIRBtYeAyuuc L0=; b=ZeMMNMIXz1/pbeK+RJf+2YourCOVPOJKZJXZHtOMPDPR3GnRcMSm1v2k7 0bA0rK6vpAmUntHbQDKmmrr/GGb3rvHt6j5OaLC5ofTyCPginvSUGmLb8gRIYRVs 1bNdDJskYs6itTuaFIushoo/qCP2jQ2DvT59csaiQxbkeGujOAS6c4vdXVA+Ou6a QUn0fUqhWlAsEnVGz4DS/59Wlw3jEOTTHxc/Rlc3ovdxAJj6njPZ9qF0/WPjN45d suFUoMftD9vP9d4t9UCkjb2Jllxd3WI4UTES76jZOoaDm4fe3pCV6oVS9QElWQId lx0UhE7mWU9Lnfr7HC3wDsrxR9E1g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeifedgheejucetufdoteggodetrfdotf 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 059808005A; Tue, 26 Nov 2019 08:45:31 -0500 (EST) From: Thomas Monjalon To: "Xueming(Steven) Li" Cc: "Burakov, Anatoly" , "dev@dpdk.org" , Asaf Penso , "stable@dpdk.org" , "david.marchand@redhat.com" Date: Tue, 26 Nov 2019 14:45:30 +0100 Message-ID: <4234059.lpkmD0fh1P@xps> In-Reply-To: References: <1574346302-1263-1-git-send-email-xuemingl@mellanox.com> <1842633.FO3dX0cGTE@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] malloc: fix memory element size in case of padding X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" 26/11/2019 14:39, Xueming(Steven) Li: > > > -----Original Message----- > > From: Thomas Monjalon > > Sent: Tuesday, November 26, 2019 9:30 PM > > To: Burakov, Anatoly > > Cc: Xueming(Steven) Li ; dev@dpdk.org; Asaf > > Penso ; stable@dpdk.org; > > david.marchand@redhat.com > > Subject: Re: [dpdk-dev] [PATCH] malloc: fix memory element size in case of > > padding > > > > 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? > > > Rte_realloc, inner size is used to copy data. I still don't get it. Am I missing half of the patch? Please give explicit line number.