patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Olivier Matz <>
Cc: "Zhang, AlvinX" <>,
	"Burakov, Anatoly" <>,
	Andrew Rybchenko <>,
	Bruce Richardson <>,
	David Marchand <>,
	dpdk stable <>
Subject: [dpdk-stable] [PATCH v2 0/3] mempool: fix mempool virt populate with small chunks
Date: Fri, 17 Jan 2020 15:57:51 +0100
Message-ID: <> (raw)
In-Reply-To: <>

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


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/             |  1 +
 lib/librte_mempool/rte_mempool.c           | 88 ++++++++++++++++++++--
 lib/librte_mempool/rte_mempool.h           | 14 +++-
 lib/librte_mempool/ |  7 ++
 6 files changed, 105 insertions(+), 12 deletions(-)


  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:

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

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ \
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone