From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=XFKq/Sd16bQn3xmF2mkKVDre098vQeYkiY2EA34TGjI=; b=gujYEwPwOmNx3eNby0qz3EA6ItkVqlFNR5gpZ4Jz+Qy9zfKzKyOUX27x9dFpRacNGC Jc3DT2if68/zz3xiaOFvfUYGVaX066UyXmtXBc50GRH15rC1KWNVwnHxjb8c+V5kMf+l lHBF3Pfel0X+xJqs/AiYRGUoNq166rnmiqCdwvF0Rw2DOJlI3tAZumdjON+DMQKA1hpl 8AeMGvjgQjdmIHS0wXxDmRnqJCbqDj/Hlxk++RXMyFdzOzLyyvJzVK9v/RSHGnV2OCgp qXEUU52Ne15ti+wb5RJFV3PSb+GwvTDUeU0rz/hg46MKpEFHVDwn26cMGc2RMSnN3dcp pZVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=XFKq/Sd16bQn3xmF2mkKVDre098vQeYkiY2EA34TGjI=; b=KnUsykSFCrcZ02+TZvJTWFFyaJt52jA4VU1VnQKj0n3N8d08ddZud3a2pW/USvLL2S s1UyHian1JXBHg8odBNw3QMXzfWLutV6pGtia84XMeI33ZLYS8aUbDJ0l4y9WX16DH6Q FfH6cbqZg9Z7rlPSBcXkv6Co2+54y5AfmShRatI9fKIdAYHWRsfJP9SNDjeXhOR9ioWL oO5Gxu6BV6zFO6t9xvqKwiVA2Rh3wP0wTE3bcZL9QpmQE7DoiW4Kdi7DIYZnth2bqwCZ pSSh8Pl7R+/+6F9XW+/vmTUYxSLi5n9xyef9UqhIbPyj5DWF0zsRL9ilgYI14dshsvMX Z4lg== X-Gm-Message-State: AOPr4FVwrTEcS01ttwldthefM3KD/FXK+uAINRGKPbK6ELjSDt4mpaxb7OplYmLW3mNp7aia X-Received: by 10.194.5.132 with SMTP id s4mr28169262wjs.118.1463390031884; Mon, 16 May 2016 02:13:51 -0700 (PDT) Received: from xps13.localnet (232.202.154.77.rev.sfr.net. [77.154.202.232]) by smtp.gmail.com with ESMTPSA id s10sm32695452wjp.3.2016.05.16.02.13.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 May 2016 02:13:51 -0700 (PDT) From: Thomas Monjalon To: Hiroyuki MIKITA Cc: dev@dpdk.org, "Ananyev, Konstantin" , olivier.matz@6wind.com Date: Mon, 16 May 2016 11:13:49 +0200 Message-ID: <2574937.kpQRctJEWQ@xps13> User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1463327436-6863-1-git-send-email-h.mikita89@gmail.com> <2601191342CEEE43887BDE71AB97725836B50F15@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] mbuf: decrease refcnt when detaching 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, 16 May 2016 09:13:52 -0000 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