This revision changes direction from the v3 build-time dynfield3 layout. It adds a runtime EAL-configured per-mbuf metadata area that is placed after the fixed struct rte_mbuf header and before per-pool private data. This keeps sizeof(struct rte_mbuf) fixed while allowing deployments that need globally consistent per-mbuf metadata to reserve that storage.
The metadata area is still managed by the mbuf dynamic-field registry. Fields registered with RTE_MBUF_DYNFIELD_F_METADATA are allocated from the metadata area and are not copied by generic mbuf copy, clone, or attach operations. Fields registered without the flag continue to use the existing copied mbuf dynamic-field storage and cannot overlap the metadata area. The existing per-pool private data area does not provide a central layout registry and is configured independently for each mbuf pool. That makes it hard for multiple libraries, drivers, or application modules to safely share metadata without out-of-band coordination, especially when pools are created by different components. Mbuf object layout calculations that need to include the optional metadata area now use rte_mbuf_size(). The primary process validates and publishes the metadata size through the shared mem config; secondary processes may omit the option, but if provided it must match the primary value. The octeontx mempool driver rejects allocation when mbuf metadata is configured because the hardware mbuf header offset must remain 128 bytes. Validation: - git diff --check HEAD~1..HEAD - devtools/check-git-log.sh -n1 - devtools/checkpatches.sh -n1 - ninja -C /tmp/dpdk-upstream-metadata-test-build -j8 app/dpdk-test - app/dpdk-test --mbuf-metadata-size=384 mbuf_autotest - app/dpdk-test --mbuf-metadata-size=512 mbuf_autotest - focused scans for raw post-mbuf pointer arithmetic and direct sizeof(struct rte_mbuf) usage in changed files - AGENTS.md plus dpdk-codereview review gate Randy Tice (1): mbuf: add runtime metadata dynamic-field storage app/test-crypto-perf/cperf_test_common.c | 8 +- app/test-pmd/testpmd.c | 2 +- app/test/suites/meson.build | 14 +++ app/test/test_cryptodev.c | 4 +- app/test/test_cryptodev.h | 3 +- app/test/test_event_crypto_adapter.c | 2 +- app/test/test_mbuf.c | 82 ++++++++++++++--- app/test/test_pdcp.c | 2 +- doc/guides/linux_gsg/eal_args.include.rst | 8 ++ doc/guides/prog_guide/mbuf_lib.rst | 16 ++++ doc/guides/rel_notes/release_26_11.rst | 21 ++++- drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 8 +- drivers/crypto/cnxk/cn20k_cryptodev_ops.c | 8 +- drivers/event/cnxk/cn10k_worker.h | 6 +- drivers/event/cnxk/cn20k_eventdev.c | 2 +- drivers/event/cnxk/cn20k_worker.h | 10 +-- drivers/event/cnxk/cn9k_worker.h | 23 ++--- drivers/event/cnxk/cnxk_eventdev_adptr.c | 2 +- drivers/mempool/dpaa/dpaa_mempool.c | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 6 +- drivers/mempool/octeontx/meson.build | 1 - .../mempool/octeontx/rte_mempool_octeontx.c | 6 ++ drivers/net/af_xdp/rte_eth_af_xdp.c | 6 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- drivers/net/bnxt/bnxt_txr.c | 2 +- drivers/net/cnxk/cn10k_ethdev_sec.c | 2 +- drivers/net/cnxk/cn10k_rx.h | 58 +++++++------ drivers/net/cnxk/cn20k_ethdev_sec.c | 2 +- drivers/net/cnxk/cn20k_rx.h | 19 ++-- drivers/net/cnxk/cnxk_eswitch.c | 4 +- drivers/net/cnxk/cnxk_ethdev.c | 6 +- drivers/net/cnxk/cnxk_ethdev_dp.h | 2 +- drivers/net/cnxk/cnxk_ethdev_sec.c | 6 +- drivers/net/intel/fm10k/fm10k_ethdev.c | 2 +- drivers/net/mlx5/mlx5_trigger.c | 6 +- drivers/net/nfp/flower/nfp_flower.c | 2 +- drivers/net/nfp/nfp_rxtx.c | 2 +- drivers/net/pfe/pfe_hif.c | 2 +- drivers/net/pfe/pfe_hif_lib.c | 4 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/softnic/rte_eth_softnic_mempool.c | 4 +- examples/fips_validation/fips_validation.h | 2 +- examples/fips_validation/main.c | 2 +- examples/ntb/ntb_fwd.c | 2 +- lib/cryptodev/rte_crypto.h | 4 +- lib/eal/common/eal_common_config.c | 3 + lib/eal/common/eal_common_mcfg.c | 16 +++- lib/eal/common/eal_common_options.c | 20 +++++ lib/eal/common/eal_internal_cfg.h | 3 + lib/eal/common/eal_memcfg.h | 4 +- lib/eal/common/eal_option_list.h | 1 + lib/eal/common/eal_private.h | 1 + lib/eal/freebsd/eal.c | 3 +- lib/eal/linux/eal.c | 3 +- lib/mbuf/mbuf_history.c | 4 +- lib/mbuf/rte_mbuf.c | 17 ++-- lib/mbuf/rte_mbuf.h | 9 +- lib/mbuf/rte_mbuf_core.h | 37 ++++++++ lib/mbuf/rte_mbuf_dyn.c | 87 +++++++++++++++---- lib/mbuf/rte_mbuf_dyn.h | 11 ++- lib/pcapng/rte_pcapng.c | 2 +- lib/vhost/vhost.h | 2 +- 62 files changed, 438 insertions(+), 164 deletions(-) -- 2.35.6

