From: Olivier Matz <olivier.matz@6wind.com>
To: Gregory Etelson <gregory@weka.io>
Cc: dev@dpdk.org, thomas@monjalon.net
Subject: Re: [PATCH v2] mbuf: fix bulk allocation when debug enabled
Date: Wed, 10 May 2017 16:42:35 +0200 [thread overview]
Message-ID: <20170510164235.62fcb469@platinum> (raw)
In-Reply-To: <1802735.EECn92tGJO@polaris>
Hi,
On Sat, 06 May 2017 10:26:49 +0300, Gregory Etelson <gregory@weka.io> wrote:
> 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
>
Fixes: 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool")
> Signed-off-by: Gregory Etelson <gregory@weka.io>
> ---
> lib/librte_mbuf/rte_mbuf.h | 25 ++++++++++++-------------
> 1 file changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index 9097f18..05b8300 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -788,6 +788,13 @@ rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value)
> void
> rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header);
>
> +#define MBUF_RAW_ALLOC_CHECK(m_) do { \
> + RTE_ASSERT(rte_mbuf_refcnt_read(m_) == 1); \
> + RTE_ASSERT(m_->next == NULL); \
> + RTE_ASSERT(m_->nb_segs == 1); \
> + __rte_mbuf_sanity_check(m_, 0); \
> +} while (0)
> +
Few nits:
- maybe 'm_' could be 'm'
- some parenthesis could be added for safety
Thomas, I know you're in hurry for 17.05, I think this fix should
go in. If you want, I can send a v3 with this small changes if you
need it now.
Regards,
Olivier
next prev parent reply other threads:[~2017-05-10 14:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-06 7:26 [PATCH v2] mbuf: fix bulk allocation when debug enabled Gregory Etelson
2017-05-10 14:42 ` Olivier Matz [this message]
2017-05-10 14:54 ` Thomas Monjalon
2017-05-10 15:13 ` [PATCH v3] " Olivier Matz
2017-05-10 16:17 ` 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=20170510164235.62fcb469@platinum \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
--cc=gregory@weka.io \
--cc=thomas@monjalon.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.