From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by dpdk.org (Postfix) with ESMTP id 59003234 for ; Wed, 10 May 2017 16:42:38 +0200 (CEST) Received: by mail-wr0-f175.google.com with SMTP id l50so46703816wrc.3 for ; Wed, 10 May 2017 07:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zh4LMaSSC+LmfFOJfwPcp2WDZky0hhOlihKSPqs6IwM=; b=uc2kMrb4nQgCQN0i9jNmDNkr2SSBIL6IBxw2UQA3orVC/USVtDv3JSqm3NJqNjRK9S USfegt4LiFJWA/rJwCNifvusPxNR/IstAN9xaFOrsyNJPaNbt38T059NwgZEP5voUhTe rfr/LGolpupdPedNAO0GH6Byb8bODJ+BexIOOtUktpIn4A3XjWW/12hdYeR1oaiwI914 Cjda2YQEYFlxaMoEGuabZKCJEz07AcCj4D7gckDQ0j2ZlZyq6gSFv6O4deTt+1/jGMS5 nqss2tMtESYBcLbtukCgGgbOPySXS9RNVbG2roiyF3WtjXiE63OV022OY0hIjn1eTMYX uY+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zh4LMaSSC+LmfFOJfwPcp2WDZky0hhOlihKSPqs6IwM=; b=jy+KwbV8GRZ8tyeK3PC4ZIRzio+YT115L4OeSj9b5xxiuCkefcLxLVpm4Bp+Ijarir gVKFcp9mePgF/6dAhQWKNJNqX6vuPyM7amo8thRQnA3KZWN8TAKvnKeW+23pmkPdOMIm I4KZ6/IJ2Bg3TUf0tQXhdWC4P1QSC/xJ0fxCElfjAcqcF0cHlMQh20ioyWMd1htWXl7l ntnYvA/QfWFzzVUQfdxHHLwWhOy9tkhZT72ATlsrLvdxz8Ly0RQxeS17lJ77t3OEy9ll f1aDzFW3mWdCS70hiaVgBT48A/eGfwnTPyoj3lPmmws1udI0PcWDEvpaNTLQ9Pnpugoe cmAg== X-Gm-Message-State: AODbwcBQY+jM+mHPW/hChjylOW9qkuGyBKzc1uzpShyonseQxmv+PgrR TaLnLc0eXvaPAFh/RSQ= X-Received: by 10.223.138.139 with SMTP id y11mr4330885wry.22.1494427358047; Wed, 10 May 2017 07:42:38 -0700 (PDT) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id 184sm3313280wmr.30.2017.05.10.07.42.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 May 2017 07:42:37 -0700 (PDT) Date: Wed, 10 May 2017 16:42:35 +0200 From: Olivier Matz To: Gregory Etelson Cc: dev@dpdk.org, thomas@monjalon.net Message-ID: <20170510164235.62fcb469@platinum> In-Reply-To: <1802735.EECn92tGJO@polaris> References: <1802735.EECn92tGJO@polaris> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] mbuf: fix bulk allocation when debug enabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 May 2017 14:42:38 -0000 Hi, On Sat, 06 May 2017 10:26:49 +0300, Gregory Etelson 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 > --- > 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