From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=1v0wVYb5GkudirF80TuYXCF801t/3RGQQd3VrRd659A=; b=RWrlTK1g9+c2oK7CMO2dpzmqX+nwmfeFpq4Xe1rmtcPrz4wZuHw36V5CW/nvhSvEuN UecI6PBGbxdDkHem0qa4HV3GLDCT9QoMm9NJJ4/KwyW/jUvbpUBQOI6qh+Mb/5YL4GkH REWgxVJ17BsgF5hmIeaSrYm13+ORki/jQZ9H/vHDMJoSpTpxmLvulh7lyPIiwC3+LE2H 7teZDGj/suvs84H1JgjHC8iZhPWHsGL6XlH8AeFbme5NBaaspHVwIyPyfN8k0vcX9iQm dM708WMVSIJGQgCuC4gtoCxu786xf0MxbuvTM0EFnd14ypdXhTA9YHh4xrFl4d5dRaUT Nyeg== 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=1v0wVYb5GkudirF80TuYXCF801t/3RGQQd3VrRd659A=; b=H1o9/K1nxMJsIuROYoP/8hTajvbYDUpeuIeH+gv71xhLkg+6CVZgu9Wh/CWn79RPuM 5U0AqLKTErGM3lRHRTLsMP4DRrUsbP64thYkjCJDA6N0I87iPSMJQAr9LY0EPmKGR+bB 15C0synnosYXd3ku9UrVsvd6bf/C7xKyw12KaZhUOZGihwXw2u/QHFCmbSnK0h/C9jC3 d23I30I/hiEb3cOH8CxrXQBW4HaXL5/pTyIDd2WkzuHYZqpJAtaFQaOnHj6KP5DaqlLy psssiJ5aZElAxjkS2SuM9G/ey3qTfNCSIyhz9BhE86O+8A0bwxbBhpGATVtySxQ6mR8+ s2hQ== X-Gm-Message-State: AOPr4FWJ5nI2vjyiVzw3jeOFM2wiGkI88fiRRYIw80jY4XJRUiMh/X0ZuQSfi4J67K1AUNzC X-Received: by 10.194.79.70 with SMTP id h6mr1437740wjx.157.1463489010523; Tue, 17 May 2016 05:43:30 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id kq9sm2923066wjc.26.2016.05.17.05.43.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2016 05:43:29 -0700 (PDT) From: Thomas Monjalon To: Hiroyuki Mikita , konstantin.ananyev@intel.com Cc: dev@dpdk.org, olivier.matz@6wind.com Date: Tue, 17 May 2016 14:43:19 +0200 Message-ID: <2164081.rUYNJaTDcf@xps13> User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1463417600-20943-1-git-send-email-h.mikita89@gmail.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] 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: Tue, 17 May 2016 12:43:31 -0000 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.