From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D79F7A04FD; Thu, 26 Dec 2019 13:54:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 126EB1BF83; Thu, 26 Dec 2019 13:54:22 +0100 (CET) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id BEE281BF75 for ; Thu, 26 Dec 2019 13:54:20 +0100 (CET) Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 8A9F235C121; Thu, 26 Dec 2019 13:54:20 +0100 (CET) From: Olivier Matz To: dev@dpdk.org Cc: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 26 Dec 2019 13:54:10 +0100 Message-Id: <20191226125410.25591-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] mbuf: document how to set length when attaching ext buffer 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" From: Jörg Thalheim Enhance API documentation of rte_pktmbuf_attach_extbuf() to explain that the attached mbuf is initialized with length = 0. Link: https://bugs.dpdk.org/show_bug.cgi?id=362 Signed-off-by: Jörg Thalheim Signed-off-by: Olivier Matz --- Hi, This patch is a slight reword of a patch submitted in bug id 362 by Jörg Thalheim. @Jörg, feel free to comment if I missed something. Thanks Olivier lib/librte_mbuf/rte_mbuf.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 219b110b7..2d4bda251 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -924,10 +924,14 @@ rte_pktmbuf_ext_shinfo_init_helper(void *buf_addr, uint16_t *buf_len, * provided via shinfo. This callback function will be called once all the * mbufs are detached from the buffer (refcnt becomes zero). * - * The headroom for the attaching mbuf will be set to zero and this can be - * properly adjusted after attachment. For example, ``rte_pktmbuf_adj()`` + * The headroom length of the attaching mbuf will be set to zero and this + * can be properly adjusted after attachment. For example, ``rte_pktmbuf_adj()`` * or ``rte_pktmbuf_reset_headroom()`` might be used. * + * Similarly, the packet length is initialized to 0. If the buffer contains + * data, the user has to adjust ``data_len`` and the ``pkt_len`` field of + * the mbuf accordingly. + * * More mbufs can be attached to the same external buffer by * ``rte_pktmbuf_attach()`` once the external buffer has been attached by * this API. -- 2.20.1