mbuf: fix bulk allocation when debug enabled
authorGregory Etelson <gregory@weka.io>
Wed, 10 May 2017 15:13:10 +0000 (17:13 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 10 May 2017 16:15:34 +0000 (18:15 +0200)
commit83baf56aa725cfee07dc6c706777e2019aa2c861
tree0058e942adbf6b53fa9d6ba3372ec33e022c8e5b
parent8b3ee85efe11fd11a09e677f488f7ebed288b20f
mbuf: fix bulk allocation when debug enabled

The debug assertions when allocating a raw mbuf are not correct since
commit 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool"),
which triggers a panic when using this function in debug mode

Change the expected number of segments to 1 instead of 0, and
factorize these sanity checks.

Fixes: 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool")

Signed-off-by: Gregory Etelson <gregory@weka.io>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mbuf/rte_mbuf.h