From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=VSbDj1h8S1lVEoYfvsB6VKHe741DCS9Esa2lkXGeFYI=; b=HvxGVE8qgZM/xtNVHS7xDTSQWuzpFqlu+PkN2l96N1NgvUOJe13KWKlaZhd5mLlfOh +a/TOFzUM1/XxLFdPPi0Wn9EfvnmjYxfRzCotBxro6PSSW3jaO56b1dNHcJDysxr1XzT 4fdMLzXM0EjOLbxc4HLjSsSstwe8M7VeQbCQZIrwTVXkuX0tW2xBEcvOlgh+AZUZP9NB pygk6DvWllTWk90qYOJ1d6gQFKNvb+9pQHEmnH3+ecGIxhSCCrM/L8CVx8Add3Knkq1V JG5Ldd02KaFJvAUhK7XedeeRay5gmAPk0LD0B/9KTW+vu2ycupIxA5lsGlchCt3XavNm efLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=VSbDj1h8S1lVEoYfvsB6VKHe741DCS9Esa2lkXGeFYI=; b=a7JTzqpCP7zpb1nq6qK4lg0XFdKvOR857gvYy5cCvJhEbb6iBKQ4+XU+JPQLDUhW++ e+vOF857vsmv1xWm8DeMN2NbgKikZEoeYrtulyL/p69P16XRijJhpQf9xg1RxXzg3OUu Mb+h0G/9faImO1QR+fPt4wRQ5xhraJJxR6zBQzZQH7npS9kF4oO8GyLl9OH1ZkicBw55 zZ4GrV4MicAIrBpD1EEbapb1e1QZSdMkxcEQSNw9TCUmbWFImnZ54pY3VTUc0YYlg6iT XBXw8pNNqWNXGXM/y6jTJFK4dRYYUaxTeMkyG/xhSk59Rkanz500yv/ARC0aO/PN0c1S 3QdQ== X-Gm-Message-State: ALyK8tITzO5h+B+YKQ/euSWHnM/gHwxDqSwu9P44Bx3KChc/FIKMe/htAmf8uy/uA/ShieRd X-Received: by 10.28.169.66 with SMTP id s63mr11796778wme.87.1466430578646; Mon, 20 Jun 2016 06:49:38 -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 el4sm30987773wjd.23.2016.06.20.06.49.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2016 06:49:37 -0700 (PDT) Date: Mon, 20 Jun 2016 15:49:36 +0200 From: Adrien Mazarguil To: "Ananyev, Konstantin" Cc: "dev@dpdk.org" , Olivier Matz Message-ID: <20160620134936.GV7621@6wind.com> Mail-Followup-To: "Ananyev, Konstantin" , "dev@dpdk.org" , Olivier Matz 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 Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB97725836B6CE18@irsmsx105.ger.corp.intel.com> Subject: Re: [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: Mon, 20 Jun 2016 13:49:39 -0000 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