From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id E8C359604 for ; Wed, 8 Jun 2016 10:31:46 +0200 (CEST) Received: by mail-wm0-f45.google.com with SMTP id k204so5794929wmk.0 for ; Wed, 08 Jun 2016 01:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=M6yP6jfiudaXKMGtZLLgPViDeFl2HZRdlO4tOjNsZew=; b=Z467XD09n/GWi/4gdIsf0WnOUfT1silymxQAJ8cmYIdDMli0IDLPXd2+3n4UvIqI+t +5v92aCNiWjcJUNG55+bAT1/1vYv1iRKgjXeX1Az/7KtYGdASsYp8ODoKcSs07mynM7m sIpU7Kc9nEildz1odAipOoSAlGK9JNvasUx8YzsAZHx4IBAxAd2mVBWYVX7ADFXQ9oqN zOq6ic7VC/PLdCJn7B6i76nLRkiv9ZiZT2k+NmaYs/sG6i/Ay6i94Jvjy5Ixq8UKpoED cVXP0yVr2NVQVhoVuaqyPliuDv/4mzikg1MNBt1N7/zXr+sHNQq9Zsek+L9EpcjiHsAf Nq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=M6yP6jfiudaXKMGtZLLgPViDeFl2HZRdlO4tOjNsZew=; b=Y4Bh8u2fy3rrHAbS0Y6mvDkeZiPUl2gXF3KN+8LWl6ZjnJ4k3EFfzdMb889KOKim0H 52Mkosjc+y3uVABmlYrq1Q5tRFzuhhmvTvbabjubiN2W3b8iK0vsABGnuU/8qxKAZNkm +1z4/CnlT1pneeYh3gZePrpG/l+/nTe/89jDmpJ5ao6jEeymH/TIw+RxNYvX0wkOIqeb tqV2HX4PDGu3i5bAUOQj+ZlT+WSfVpvdPfb89wkvRuoBMh2B5/cf4GkgvSZpzHnuB91I ecMdbD9bAtI6TqnX5MBtIDrQ38EWkiQfwoeoD7VvYtzwQHAql/ymOciwtokGlmf16YYF p4zQ== X-Gm-Message-State: ALyK8tL7RpTfJWRwQh21nLGseSH4lcnXt+TcUO71zdkbFytJRbfTt4jmBDluii2fcD+ZXi35 X-Received: by 10.28.92.20 with SMTP id q20mr3650043wmb.76.1465374706613; Wed, 08 Jun 2016 01:31:46 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id k62sm23446184wmb.7.2016.06.08.01.31.45 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2016 01:31:46 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Cc: Olivier Matz Date: Wed, 8 Jun 2016 10:31:28 +0200 Message-Id: <1465374688-11729-1-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] mbuf: remove inconsistent assert statements X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2016 08:31:47 -0000 An assertion failure occurs in __rte_mbuf_raw_free() (called by a few PMDs) when compiling DPDK with CONFIG_RTE_LOG_LEVEL=RTE_LOG_DEBUG and starting applications with a log level high enough to trigger it. While rte_mbuf_raw_alloc() sets refcount to 1, __rte_mbuf_raw_free() expects it to be 0. Considering users are not expected to reset the reference count to satisfy assert() and that raw functions are designed on purpose without safety belts, remove these checks. Signed-off-by: Adrien Mazarguil --- lib/librte_mbuf/rte_mbuf.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 11fa06d..7070bb8 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1108,7 +1108,6 @@ static inline struct rte_mbuf *rte_mbuf_raw_alloc(struct rte_mempool *mp) if (rte_mempool_get(mp, &mb) < 0) return NULL; m = (struct rte_mbuf *)mb; - RTE_ASSERT(rte_mbuf_refcnt_read(m) == 0); rte_mbuf_refcnt_set(m, 1); __rte_mbuf_sanity_check(m, 0); @@ -1133,7 +1132,6 @@ __rte_mbuf_raw_alloc(struct rte_mempool *mp) static inline void __attribute__((always_inline)) __rte_mbuf_raw_free(struct rte_mbuf *m) { - RTE_ASSERT(rte_mbuf_refcnt_read(m) == 0); rte_mempool_put(m->pool, m); } -- 2.1.4