From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Cc: "Zhang, AlvinX" <alvinx.zhang@intel.com>,
"Burakov, Anatoly" <anatoly.burakov@intel.com>,
Andrew Rybchenko <arybchenko@solarflare.com>,
Bruce Richardson <bruce.richardson@intel.com>,
David Marchand <david.marchand@redhat.com>,
dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] [PATCH v2 0/3] mempool: fix mempool virt populate with small chunks
Date: Fri, 17 Jan 2020 15:57:51 +0100 [thread overview]
Message-ID: <20200117145754.11682-1-olivier.matz@6wind.com> (raw)
In-Reply-To: <20200109132720.15664-1-olivier.matz@6wind.com>
rte_mempool_populate_virt() sometimes fail, when it calls
rte_mempool_populate_iova() with an area which is too small to store one
object. This should not be an error.
I prepared a v2 which implements an ABI compatibility through symbol
versioning, as suggested [1]. It looks a bit overkill to me, but it
was an interresting exercice.
v2 changes:
- The initial requirement is to fix an issue at mempool creation. As
the fix will probably be backported in 19.11.x, the first patch
in the patchset does not break API/ABI.
- Using symbol versioning helps to preserve ABI, but for the API
the breakage has to be announced 1 release in advance, so there
is a separate patch for this.
- There is a 3rd patch for 20.05 that makes the new API public and
implements ABI versioning (if ok, I'll remove it from the patchset in
next version and send it separately)
- It appears that returning -ENOBUFS instead of -EINVAL is not ideal
because, in theory, mempool_ops_alloc_once() could also return
-ENOBUFS, and it would be forwarded to the caller by
rte_mempool_populate_iova() too, and misinterpreted as "there is not
enough room".
Returning 0 instead of -ENOBUFS was initially suggested by Anatoly,
and it does not suffer from this problem. It is doable if we properly
document that the memory chunk is not added to the mempool when
returning 0. It has an impact on populate_virt(), which has to be
versioned too.
There are some checkpatch warnings, but I'm not sure how if I
should solve them:
- it complains about forward declaration in .c, but without it, it does
not compile due to additional warnings in cflags
- it complains that modified symbols should be marked as experimental
Thanks to David for helping me to test and fix the ABI part of the
patchset.
[1] http://patchwork.dpdk.org/patch/64369/
Olivier Matz (3):
mempool: fix mempool virt populate with small chunks
doc: announce API change for mempool IOVA populate
mempool: return 0 if area is too small on populate
doc/guides/rel_notes/deprecation.rst | 5 ++
examples/ntb/ntb_fwd.c | 2 +-
lib/librte_mempool/meson.build | 1 +
lib/librte_mempool/rte_mempool.c | 88 ++++++++++++++++++++--
lib/librte_mempool/rte_mempool.h | 14 +++-
lib/librte_mempool/rte_mempool_version.map | 7 ++
6 files changed, 105 insertions(+), 12 deletions(-)
--
2.20.1
next prev parent reply other threads:[~2020-01-17 14:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 13:27 [dpdk-stable] [PATCH] " Olivier Matz
2020-01-09 13:40 ` [dpdk-stable] [dpdk-dev] " David Marchand
2020-01-09 13:46 ` Olivier Matz
2020-01-09 13:52 ` [dpdk-stable] " Burakov, Anatoly
2020-01-09 14:23 ` Olivier Matz
2020-01-09 14:29 ` Burakov, Anatoly
2020-01-09 14:58 ` [dpdk-stable] [dpdk-dev] " Bruce Richardson
2020-01-17 14:57 ` Olivier Matz [this message]
2020-01-17 14:57 ` [dpdk-stable] [PATCH v2 1/3] " Olivier Matz
2020-01-17 14:57 ` [dpdk-stable] [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-stable] [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-01-20 12:02 ` [dpdk-stable] [dpdk-dev] [PATCH v2 0/3] mempool: fix mempool virt populate with small chunks 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=20200117145754.11682-1-olivier.matz@6wind.com \
--to=olivier.matz@6wind.com \
--cc=alvinx.zhang@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=arybchenko@solarflare.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--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).