From: Jörg Thalheim Date: Mon, 2 Dec 2019 11:47:58 +0000 (+0000) Subject: mbuf: document how to set length when attaching ext buffer X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e088716edeb9d72b48d384007d88376a22321e49;p=dpdk.git mbuf: document how to set length when attaching ext buffer 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 --- diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 219b110b76..2d4bda2512 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.