From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] mbuf: decrease refcnt when detaching Date: Tue, 17 May 2016 14:43:19 +0200 Message-ID: <2164081.rUYNJaTDcf@xps13> References: <1463327436-6863-1-git-send-email-h.mikita89@gmail.com> <1463417600-20943-1-git-send-email-h.mikita89@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, olivier.matz@6wind.com To: Hiroyuki Mikita , konstantin.ananyev@intel.com Return-path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 337A769F9 for ; Tue, 17 May 2016 14:43:31 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id a17so28854905wme.0 for ; Tue, 17 May 2016 05:43:31 -0700 (PDT) In-Reply-To: <1463417600-20943-1-git-send-email-h.mikita89@gmail.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-05-17 01:53, Hiroyuki Mikita: > The rte_pktmbuf_detach() function should decrease refcnt on a direct > buffer. > > Signed-off-by: Hiroyuki Mikita > --- > v2: > * introduced a new function rte_pktmbuf_detach2() which decrease refcnt. As you have noticed, "whenever the indirect buffer is detached, the reference counter on the direct buffer is decremented." So the current behaviour of rte_pktmbuf_detach() is buggy. Why not fix it without renaming? If you consider this behavioral bug is part of the API, we can fix it in a new function unattach and deprecate detach. But Konstantin, why do you want to keep a restore function? What is the need? Please explicit the function name for the detach operation in doc/guides/prog_guide/mbuf_lib.rst (whatever detach2 or unattach). > * marked rte_pktmbuf_detach() as deprecated. > * added comments about refcnt to rte_pktmbuf_attach() and rte_pktmbuf_detach(). > * checked refcnt when detaching in unit tests. > * added this issue to release notes.