From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] mbuf: decrease refcnt when detaching Date: Mon, 16 May 2016 11:13:49 +0200 Message-ID: <2574937.kpQRctJEWQ@xps13> References: <1463327436-6863-1-git-send-email-h.mikita89@gmail.com> <2601191342CEEE43887BDE71AB97725836B50F15@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Ananyev, Konstantin" , olivier.matz@6wind.com To: Hiroyuki MIKITA Return-path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 10AB38D3A for ; Mon, 16 May 2016 11:13:52 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id g17so125478540wme.1 for ; Mon, 16 May 2016 02:13:52 -0700 (PDT) In-Reply-To: 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-05-16 11:46, Hiroyuki MIKITA: > Now, the attach operation increases refcnt, but the detach does not decrease it. > I think both operations should affect refcnt or not. > Which design is intended? > > In "6.7. Direct and Indirect Buffers" of Programmer's Guide, > it is mentioned that "...whenever an indirect buffer is attached to > the direct buffer, > the reference counter on the direct buffer is incremented. > Similarly, whenever the indirect buffer is detached, > the reference counter on the direct buffer is decremented." The doc is the reference. The doxygen comment should explicit every details of the behaviour. And the unit tests must validate every parts of the behaviour. Probably there is a bug which is not (yet) tested. Please see the function testclone_testupdate_testdetach. Thanks