mbuf: support dynamic fields and flags dyn-mbuf4
authorOlivier Matz <olivier.matz@6wind.com>
Thu, 17 Oct 2019 14:42:19 +0000 (16:42 +0200)
committerOlivier Matz <olivier.matz@6wind.com>
Fri, 25 Oct 2019 15:00:49 +0000 (17:00 +0200)
commited207aab967f167fed673f4cbb9d507522edf3e6
treeb4654465158fc56192fe67a431903eb6b848d5c4
parent927a0e20e2415f718ceb346cd94bbf930ad9f29a
mbuf: support dynamic fields and flags

Many features require to store data inside the mbuf. As the room in mbuf
structure is limited, it is not possible to have a field for each
feature. Also, changing fields in the mbuf structure can break the API
or ABI.

This commit addresses these issues, by enabling the dynamic registration
of fields or flags:

- a dynamic field is a named area in the rte_mbuf structure, with a
  given size (>= 1 byte) and alignment constraint.
- a dynamic flag is a named bit in the rte_mbuf structure.

The typical use case is a PMD that registers space for an offload
feature, when the application requests to enable this feature.  As
the space in mbuf is limited, the space should only be reserved if it
is going to be used (i.e when the application explicitly asks for it).

The registration can be done at any moment, but it is not possible
to unregister fields or flags.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
app/test/test_mbuf.c
doc/guides/rel_notes/release_19_11.rst
lib/librte_eal/common/include/rte_common.h
lib/librte_mbuf/Makefile
lib/librte_mbuf/meson.build
lib/librte_mbuf/rte_mbuf.h
lib/librte_mbuf/rte_mbuf_dyn.c [new file with mode: 0644]
lib/librte_mbuf/rte_mbuf_dyn.h [new file with mode: 0644]
lib/librte_mbuf/rte_mbuf_version.map