From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hiroyuki MIKITA Subject: Re: [PATCH] mbuf: decrease refcnt when detaching Date: Tue, 17 May 2016 01:24:34 +0900 Message-ID: References: <1463327436-6863-1-git-send-email-h.mikita89@gmail.com> <2601191342CEEE43887BDE71AB97725836B50F15@irsmsx105.ger.corp.intel.com> <2574937.kpQRctJEWQ@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: dev@dpdk.org To: Thomas Monjalon , "Ananyev, Konstantin" , Olivier Matz Return-path: Received: from mail-yw0-f195.google.com (mail-yw0-f195.google.com [209.85.161.195]) by dpdk.org (Postfix) with ESMTP id 51B018D28 for ; Mon, 16 May 2016 18:24:54 +0200 (CEST) Received: by mail-yw0-f195.google.com with SMTP id i22so20125648ywc.1 for ; Mon, 16 May 2016 09:24:54 -0700 (PDT) In-Reply-To: <2574937.kpQRctJEWQ@xps13> 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" Hi all, Thanks for suggestions. I think the Oliver's first option is good. I introduce the new function and will replace rte_pktmbuf_detach() with it in a future release. 2016-05-16 18:13 GMT+09:00 Thomas Monjalon : > 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 >