From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] mbuf: remove inconsistent assert statements Date: Thu, 09 Jun 2016 17:27:37 +0200 Message-ID: <11387408.tmVAJa3yAF@xps13> References: <1465374688-11729-1-git-send-email-adrien.mazarguil@6wind.com> <57591EEA.9040807@6wind.com> <2601191342CEEE43887BDE71AB97725836B6D90C@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Olivier Matz , Adrien Mazarguil , "Zhang, Helin" To: "Ananyev, Konstantin" Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 5A1F62716 for ; Thu, 9 Jun 2016 17:27:40 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id k204so65636454wmk.0 for ; Thu, 09 Jun 2016 08:27:40 -0700 (PDT) In-Reply-To: <2601191342CEEE43887BDE71AB97725836B6D90C@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" 2016-06-09 13:21, Ananyev, Konstantin: > From: Olivier Matz [mailto:olivier.matz@6wind.com] > > Today: > > > > /* allowed */ > > m = rte_pktmbuf_alloc(); > > rte_pktmbuf_free(m); > > > > /* not allowed */ > > m = rte_mbuf_raw_alloc(); > > __rte_mbuf_raw_free(m); > > > > /* we should do instead (strange): */ > > m = rte_mbuf_raw_alloc(); > > rte_pktmbuf_free(m); > > > > What I suggest to have: > > > > /* allowed, no change */ > > m = rte_pktmbuf_alloc(); > > rte_pktmbuf_free(m); > > > > /* allowed, these functions would be symetrical */ > > m = rte_mbuf_raw_alloc(); > > rte_mbuf_raw_free(m); > > > > /* not allowed, m->refcnt is uninitialized */ > > m = rte_mbuf_raw_alloc(); > > rte_pktmbuf_free(m); > > Hmm, and what it will buy us (except of symmetry)? API consistency is important. It is a matter of making our users confident in DPDK. I would not like to use a library where I need to check in the doc for each function because I don't remember and I'm not confident that the function fish() do some fishing or hunting.