DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@mellanox.com>
To: Thomas Monjalon <thomas@monjalon.net>,
	"Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Asaf Penso <asafp@mellanox.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] malloc: fix memory element size in case of padding
Date: Tue, 26 Nov 2019 13:39:57 +0000	[thread overview]
Message-ID: <DB6PR05MB3190A2E4D0C964F590C30724AC450@DB6PR05MB3190.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1842633.FO3dX0cGTE@xps>



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, November 26, 2019 9:30 PM
> To: Burakov, Anatoly <anatoly.burakov@intel.com>
> Cc: Xueming(Steven) Li <xuemingl@mellanox.com>; dev@dpdk.org; Asaf
> Penso <asafp@mellanox.com>; 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 <xuemingl@mellanox.com>
> > >>> ---
> > >>> --- 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 <anatoly.burakov@intel.com>
> > >
> > > 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.

  reply	other threads:[~2019-11-26 13:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 14:25 Xueming Li
2019-11-21 15:14 ` Burakov, Anatoly
2019-11-25 23:24   ` Thomas Monjalon
2019-11-26 12:57     ` Burakov, Anatoly
2019-11-26 13:30       ` Thomas Monjalon
2019-11-26 13:39         ` Xueming(Steven) Li [this message]
2019-11-26 13:45           ` Thomas Monjalon
2019-11-26 14:55             ` Burakov, Anatoly
2019-11-26 15:01             ` Thomas Monjalon
2019-11-26 15:26   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB6PR05MB3190A2E4D0C964F590C30724AC450@DB6PR05MB3190.eurprd05.prod.outlook.com \
    --to=xuemingl@mellanox.com \
    --cc=anatoly.burakov@intel.com \
    --cc=asafp@mellanox.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).