From patchwork Tue Dec 6 08:15:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 17699 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 9D4622B96; Tue, 6 Dec 2016 09:16:09 +0100 (CET) Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by dpdk.org (Postfix) with ESMTP id 46D022B8F for ; Tue, 6 Dec 2016 09:16:06 +0100 (CET) Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id 3E174440045; Tue, 6 Dec 2016 10:16:06 +0200 (IST) From: Baruch Siach To: dev@dpdk.org Cc: John McNamara , Olivier Matz , Baruch Siach Date: Tue, 6 Dec 2016 10:15:55 +0200 Message-Id: X-Mailer: git-send-email 2.10.2 Subject: [dpdk-dev] [PATCH] doc: correct description of attach to indirect mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since commit 4a96e8b652 ("mbuf: allow to clone an indirect mbuf") attaching to an indirect mbuf creates a clone of that mbuf. Update the mbuf documentation to match. Signed-off-by: Baruch Siach --- doc/guides/prog_guide/mbuf_lib.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/guides/prog_guide/mbuf_lib.rst b/doc/guides/prog_guide/mbuf_lib.rst index f0aa21a6d4aa..6e73fc5a834b 100644 --- a/doc/guides/prog_guide/mbuf_lib.rst +++ b/doc/guides/prog_guide/mbuf_lib.rst @@ -253,7 +253,8 @@ Similarly, whenever the indirect buffer is detached, the reference counter on th If the resulting reference counter is equal to 0, the direct buffer is freed since it is no longer in use. There are a few things to remember when dealing with indirect buffers. -First of all, it is not possible to attach an indirect buffer to another indirect buffer. +First of all, an indirect buffer is never attached to another indirect buffer. +Attempting to attach buffer A to indirect buffer B that is attached to C, makes rte_pktmbuf_attach() automatically attach A to C, effectively cloning B. Secondly, for a buffer to become indirect, its reference counter must be equal to 1, that is, it must not be already referenced by another indirect buffer. Finally, it is not possible to reattach an indirect buffer to the direct buffer (unless it is detached first).