From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH] mbuf: remove inconsistent assert statements Date: Mon, 20 Jun 2016 15:49:36 +0200 Message-ID: <20160620134936.GV7621@6wind.com> References: <1465374688-11729-1-git-send-email-adrien.mazarguil@6wind.com> <2601191342CEEE43887BDE71AB97725836B6CE18@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" , Olivier Matz To: "Ananyev, Konstantin" Return-path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id ED5EF6C9D for ; Mon, 20 Jun 2016 15:49:38 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id f126so70315400wma.1 for ; Mon, 20 Jun 2016 06:49:38 -0700 (PDT) Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB97725836B6CE18@irsmsx105.ger.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jun 08, 2016 at 10:34:17AM +0000, Ananyev, Konstantin wrote: > Hi Adrien, > > > > > 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. > > Yes, it refcnt supposed to be set to 0 by __rte_pktmbuf_prefree_seg(). > Wright now, it is a user responsibility to make sure refcnt==0 before pushing > mbuf back to the pool. > Not sure why do you consider that wrong? > If the user calls __rte_mbuf_raw_free() manualy it is his responsibility to make > sure mbuf's refcn==0. > BTW, why are you doing it? > The comment clearly states that the function is for internal use: > /** > * @internal Put mbuf back into its original mempool. > * The use of that function is reserved for RTE internal needs. > * Please use rte_pktmbuf_free(). > * > * @param m > * The mbuf to be freed. > */ > static inline void __attribute__((always_inline)) > __rte_mbuf_raw_free(struct rte_mbuf *m) Bottom line is that I'm dropping this patch for now. We'll update our last mlx5 patchset to do it properly and keep these assert in place. Thanks. -- Adrien Mazarguil 6WIND