From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Kl1Aac/b8o7AJwNAX8PC9c0tYF9k59mTIv9h1DM0sBM=; b=hzh/zJODa7S8A20YMMfVgkHuB05P+5Q+B3SSPgOl7PjMijHruOMZStTL9mfShY8xVJ 5QlS6zgqpTE0oZFNGAJoBhm77foNQcvEhZMC/+lcerhGidCEO3K8waDk/QpxX1JdBexM Vk0dV3ZOSE7GkcMI95pWjS8+MrQHmqhhgNXASgVBs5Rr9NK2f5SwfwcUQpIXmW/le03K xyAjx8eUh0dI+S7/VIux12T8AKBg+epvgsMUO10RVP+iLXSafseGlNtzi4dTkEtjjXpQ ohfGWrgmZtvGJAqvKrbqccXu5ADf/sxedTa5tXhU1M7uGi6E8err3pwbXiKPdAaQXKsX 5prQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Kl1Aac/b8o7AJwNAX8PC9c0tYF9k59mTIv9h1DM0sBM=; b=Er7ntD+wS5Oixi2F2SYgK2BQ+6tiqQh213tsCTlU1Z4clnB07WsefDbceFOvI/rLMY 3RZvTMHZ1WWkLZPHOLkaKnPFFyv71Ak9ul+bf53j6ULL4Mo1gIuXSsrKyEkok0WJC+MB 4OWMRy8xIv4bNF+jhAb5F4bF7E14twcIzwD6QsKhEvh3TxHywK9br6BNO/HQx2p8fZiI kVAScxmuxsMlo3qB4HgqFPgMHTdIN7wVrqX/wrd/EnCixo5jZRN+n4EepDOeaVaPxzsm AsL0PguaDKPXEoIQMNYTTEZluDzrFTndurFWhcDzoexIpBWoikNMvr+t95jd3Clyw87o zb/g== X-Gm-Message-State: AOPr4FXxnf+S35iK9xi8PEwjYcmiI7NKFfbEwon/YBn+xrkuD6rF9cLMJgDt2kh+oh+ESRXtN8qiv7JvsmmLhw== X-Received: by 10.129.117.70 with SMTP id q67mr16688164ywc.63.1463415893728; Mon, 16 May 2016 09:24:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.50.214 with HTTP; Mon, 16 May 2016 09:24:34 -0700 (PDT) In-Reply-To: <2574937.kpQRctJEWQ@xps13> References: <1463327436-6863-1-git-send-email-h.mikita89@gmail.com> <2601191342CEEE43887BDE71AB97725836B50F15@irsmsx105.ger.corp.intel.com> <2574937.kpQRctJEWQ@xps13> From: Hiroyuki MIKITA Date: Tue, 17 May 2016 01:24:34 +0900 Message-ID: To: Thomas Monjalon , "Ananyev, Konstantin" , Olivier Matz Cc: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 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 16:24:54 -0000 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 >