From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: dev@dpdk.org, Andrew Rybchenko <arybchenko@solarflare.com>,
stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] mempool: fix mempool virt populate with small chunks
Date: Thu, 9 Jan 2020 14:29:08 +0000 [thread overview]
Message-ID: <6e43ec20-4fa5-55fa-6ca9-2ffca9bcf7dc@intel.com> (raw)
In-Reply-To: <20200109142351.GJ22738@platinum>
On 09-Jan-20 2:23 PM, Olivier Matz wrote:
> On Thu, Jan 09, 2020 at 01:52:41PM +0000, Burakov, Anatoly wrote:
>> On 09-Jan-20 1:27 PM, Olivier Matz wrote:
>>> To populate a mempool with a virtual area, the mempool code calls
>>> rte_mempool_populate_iova() for each iova-contiguous area. It happens
>>> (rarely) that this area is too small to store one object. In this case,
>>> rte_mempool_populate_iova() returns an error, which is forwarded by
>>> rte_mempool_populate_virt().
>>>
>>> This case should not throw an error in
>>> rte_mempool_populate_virt(). Instead, the area that is too small should
>>> just be ignored.
>>>
>>> To fix this issue, change the return value of
>>> rte_mempool_populate_iova() to -ENOBUFS when no object can be populated,
>>> so it can be ignored by the caller. As this would be an API change, add
>>> a compat wrapper to keep the current API unchanged. The wrapper will be
>>> removed for 20.11.
>>>
>>> Fixes: 354788b60cfd ("mempool: allow populating with unaligned virtual area")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
>>> ---
>>>
>>
>> The approach fixes the issue on my end, so
>>
>> Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
>>
>>> Is there a simple way to ensure that we won't forget to remove the
>>> wrapper for 20.11? Anatoly suggested me to use versioned symbols, but
>>> it's not clear to me how.
>>>
>>
>> Yes, i'd like to do better than "ah shur we won't forget pinky swear".
>>
>> Can't we do this with ABI versioning? E.g.
>>
>> rte_populate_iova_v20() ... returns EINVAL
>>
>> rte_populate_iova_v21() ... returns ENOBUFS
>>
>> I'm pretty sure, even if it doesn't break, it will still be more likely to
>> not be forgotten because there's almost a guarantee that someone will grep
>> for symbol versioning macros across the codebase around 20.11 timeframe.
>
> Without using symbol versionning, would this be ok too?
>
> int
> rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,
> rte_iova_t iova, size_t len, rte_mempool_memchunk_free_cb_t *free_cb,
> void *opaque)
> {
> int ret;
>
> ret = __rte_mempool_populate_iova(mp, vaddr, iova, len, free_cb, opaque);
>
> #if RTE_VERSION < RTE_VERSION_NUM(20, 11, 0, 0)
> if (ret == -ENOBUFS)
> ret = -EINVAL;
> #endif
>
> return ret;
> }
>
>
Well it would certainly work :) it just makes it more likely that this
will be missed.
How about, we leave your patch as is, and then you submit another patch
marked for [20.11] and mark it as Deferred straight away? This is
probably the best method to not forget that i can think of, if you're so
averse to symbol versioning :D
>
>> --
>> Thanks,
>> Anatoly
--
Thanks,
Anatoly
next prev parent reply other threads:[~2020-01-09 14:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 13:27 Olivier Matz
2020-01-09 13:40 ` David Marchand
2020-01-09 13:46 ` Olivier Matz
2020-01-09 13:52 ` Burakov, Anatoly
2020-01-09 14:23 ` Olivier Matz
2020-01-09 14:29 ` Burakov, Anatoly [this message]
2020-01-09 14:58 ` Bruce Richardson
2020-01-17 14:57 ` [dpdk-dev] [PATCH v2 0/3] " Olivier Matz
2020-01-17 14:57 ` [dpdk-dev] [PATCH v2 1/3] " Olivier Matz
2020-01-17 14:57 ` [dpdk-dev] [PATCH v2 2/3] doc: announce API change for mempool IOVA populate Olivier Matz
2020-01-17 20:32 ` David Marchand
2020-01-17 14:57 ` [dpdk-dev] [PATCH v2 3/3] [20.05] mempool: return 0 if area is too small on populate Olivier Matz
2020-01-17 20:32 ` David Marchand
2020-04-25 22:23 ` [dpdk-dev] [PATCH v3] " Thomas Monjalon
2020-04-26 16:52 ` [dpdk-dev] [PATCH v4] " Thomas Monjalon
2020-05-04 12:49 ` [dpdk-dev] [PATCH v5] " Olivier Matz
2020-05-04 12:54 ` Andrew Rybchenko
2020-05-04 15:47 ` Lukasz Wojciechowski
2020-05-04 22:30 ` Thomas Monjalon
2020-04-27 11:44 ` [dpdk-dev] [PATCH v3] " Ray Kinsella
2020-04-27 18:02 ` Lukasz Wojciechowski
2020-01-20 12:02 ` [dpdk-dev] [PATCH v2 0/3] mempool: fix mempool virt populate with small chunks Thomas Monjalon
2020-01-16 1:23 [dpdk-dev] [PATCH] " Zhang, AlvinX
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=6e43ec20-4fa5-55fa-6ca9-2ffca9bcf7dc@intel.com \
--to=anatoly.burakov@intel.com \
--cc=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=olivier.matz@6wind.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).