mbuf: support dynamic fields and flags dyn2
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 9 Jul 2019 15:31:29 +0000 (17:31 +0200)
committerOlivier Matz <olivier.matz@6wind.com>
Wed, 10 Jul 2019 09:10:03 +0000 (11:10 +0200)
commitf485d8f04dfc0dc9d673a116f4c197c58678d719
tree35c460de50dda9b73b7ca123015ed3d930c4d9de
parent95d4a506ae40ba5204b79d3a91fa12f22ec50390
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 for now.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
app/test/test_mbuf.c
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