X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fguides%2Fprog_guide%2Fmbuf_lib.rst;h=2f190b40e43a0dc145aae80aae9159e534efede0;hb=6abd886826cf4c99dff83d3d2f5099e52937c147;hp=0d3223b0815354303ecce64d26e436480130cddc;hpb=d27a6261875d203424e93d7316a0e92852f367b5;p=dpdk.git diff --git a/doc/guides/prog_guide/mbuf_lib.rst b/doc/guides/prog_guide/mbuf_lib.rst index 0d3223b081..2f190b40e4 100644 --- a/doc/guides/prog_guide/mbuf_lib.rst +++ b/doc/guides/prog_guide/mbuf_lib.rst @@ -207,6 +207,29 @@ The list of flags and their precise meaning is described in the mbuf API documentation (rte_mbuf.h). Also refer to the testpmd source code (specifically the csumonly.c file) for details. +Dynamic fields and flags +~~~~~~~~~~~~~~~~~~~~~~~~ + +The size of the mbuf is constrained and limited; +while the amount of metadata to save for each packet is quite unlimited. +The most basic networking information already find their place +in the existing mbuf fields and flags. + +If new features need to be added, the new fields and flags should fit +in the "dynamic space", by registering some room in the mbuf structure: + +dynamic field + named area in the mbuf structure, + with a given size (at least 1 byte) and alignment constraint. + +dynamic flag + named bit in the mbuf structure, + stored in the field ``ol_flags``. + +The dynamic fields and flags are managed with the functions ``rte_mbuf_dyn*``. + +It is not possible to unregister fields or flags. + .. _direct_indirect_buffer: Direct and Indirect Buffers @@ -243,8 +266,8 @@ can be found in several of the sample applications, for example, the IPv4 Multic Debug ----- -In debug mode (CONFIG_RTE_MBUF_DEBUG is enabled), -the functions of the mbuf library perform sanity checks before any operation (such as, buffer corruption, bad type, and so on). +In debug mode, the functions of the mbuf library perform sanity checks before any operation (such as, buffer corruption, +bad type, and so on). Use Cases ---------