patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: santosh <santosh.shukla@caviumnetworks.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	Olivier Matz <olivier.matz@6wind.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>, <jerin.jacob@caviumnetworks.com>
Subject: Re: [dpdk-stable] [dpdk-dev] [RFC v2 01/17] mempool: fix phys contig check if populate default skipped
Date: Thu, 1 Feb 2018 12:18:36 +0300	[thread overview]
Message-ID: <ab9fde30-b9af-f838-49c9-a4b59910afa9@solarflare.com> (raw)
In-Reply-To: <90005aad-1508-44bc-92a4-7c5d5f7b0246@caviumnetworks.com>

On 02/01/2018 12:09 PM, santosh wrote:
> On Thursday 01 February 2018 12:24 PM, Andrew Rybchenko wrote:
>> On 02/01/2018 08:05 AM, santosh wrote:
>>> On Wednesday 31 January 2018 10:15 PM, Olivier Matz wrote:
>>>> On Tue, Jan 23, 2018 at 01:15:56PM +0000, Andrew Rybchenko wrote:
>>>>> There is not specified dependency between rte_mempool_populate_default()
>>>>> and rte_mempool_populate_iova(). So, the second should not rely on the
>>>>> fact that the first adds capability flags to the mempool flags.
>>>>>
>>>>> Fixes: 65cf769f5e6a ("mempool: detect physical contiguous objects")
>>>>> Cc: stable@dpdk.org
>>>>>
>>>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>>> Looks good to me. I agree it's strange that the mp->flags are
>>>> updated with capabilities only in rte_mempool_populate_default().
>>>> I see that this behavior is removed later in the patchset since the
>>>> get_capa() is removed!
>>>>
>>>> However maybe this single patch could go in 18.02.
>>>> +Santosh +Jerin since it's mostly about Octeon.
>>> rte_mempool_xmem_size should return correct size if MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS flag
>>> is set in 'mp->flags'. Thats why _ops_get_capabilities() called in _populate_default() but not
>>> at _populate_iova().
>>> I think, this 'alone' patch may break octeontx mempool.
>> The patch does not touch rte_mempool_populate_default().
>> _ops_get_capabilities() is still called there before
>> rte_mempool_xmem_size(). The theoretical problem which
>> the patch tries to fix is the case when
>> rte_mempool_populate_default() is not called at all. I.e. application
>> calls _ops_get_capabilities() to get flags, then, together with
>> mp->flags, calls rte_mempool_xmem_size() directly, allocates
>> calculated amount of memory and calls _populate_iova().
>>
> In that case, Application does like below:
>
> 	/* Get mempool capabilities */
> 	mp_flags = 0;
> 	ret = rte_mempool_ops_get_capabilities(mp, &mp_flags);
> 	if ((ret < 0) && (ret != -ENOTSUP))
> 		return ret;
>
> 	/* update mempool capabilities */
> 	mp->flags |= mp_flags;

Above line is not mandatory. "mp->flags | mp_flags" could be simply
passed to  rte_mempool_xmem_size() below.

> 	/* calc xmem sz */
> 	size = rte_mempool_xmem_size(n, total_elt_sz, pg_shift,
> 					mp->flags);
>
> 	/* rsrv memory */
> 	mz = rte_memzone_reserve_aligned(mz_name, size,...);
>
> 	/* now populate iova */
> 	ret = rte_mempool_populate_iova(mp,,..);
>
> won't it work?
>
> However I understand that clubbing `_get_ops_capa() + flag-updation` into _populate_iova()
> perhaps better from user PoV.
>
>> Since later patches of the series reconsider memory size
>> calculation etc, it is up to you if it makes sense to apply it
>> in 18.02 as a fix.

  reply	other threads:[~2018-02-01  9:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1511539591-20966-1-git-send-email-arybchenko@solarflare.com>
     [not found] ` <1516713372-10572-1-git-send-email-arybchenko@solarflare.com>
2018-01-23 13:15   ` [dpdk-stable] " Andrew Rybchenko
2018-01-31 16:45     ` Olivier Matz
2018-02-01  5:05       ` santosh
2018-02-01  6:54         ` Andrew Rybchenko
2018-02-01  9:09           ` santosh
2018-02-01  9:18             ` Andrew Rybchenko [this message]
2018-02-01  9:30               ` [dpdk-stable] [dpdk-dev] " santosh
2018-02-01 10:00                 ` Andrew Rybchenko
2018-02-01 10:14                   ` Olivier Matz
2018-02-01 10:33                     ` santosh
2018-02-01 14:02                       ` Andrew Rybchenko
2018-02-01 10:17                   ` santosh
2018-02-01 14:02     ` [dpdk-stable] [PATCH] " Andrew Rybchenko
2018-02-05 23:53       ` Thomas Monjalon
     [not found]   ` <1521994855-8808-1-git-send-email-arybchenko@solarflare.com>
2018-03-25 16:20     ` [dpdk-stable] [PATCH v2 01/11] mempool: fix memhdr leak when no objects are populated Andrew Rybchenko
     [not found]   ` <1522080591-24705-1-git-send-email-arybchenko@solarflare.com>
2018-03-26 16:09     ` [dpdk-stable] [PATCH v3 " Andrew Rybchenko
2018-04-06 15:50       ` Olivier Matz
     [not found] ` <1523885080-17168-1-git-send-email-arybchenko@solarflare.com>
2018-04-16 13:24   ` [dpdk-stable] [PATCH v4 " Andrew Rybchenko

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=ab9fde30-b9af-f838-49c9-a4b59910afa9@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=olivier.matz@6wind.com \
    --cc=santosh.shukla@caviumnetworks.com \
    --cc=stable@dpdk.org \
    /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).