The members dispatch and xstat_off of the structure rte_node can be min cache aligned to make room for future expansion and to make sure have better performance. Add corresponding comments.
Due to the modification of the alignment of some members of the rte_node structure, update file release_24_11.rst. Signed-off-by: Huichao Cai <chcch...@163.com> --- doc/guides/rel_notes/release_24_11.rst | 3 +++ lib/graph/rte_graph_worker_common.h | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index 592116b979..6903b1d0f0 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -425,6 +425,9 @@ ABI Changes * graph: added ``graph`` field to the ``dispatch`` structure in the ``rte_node`` structure. +* graph: The members ``dispatch`` and ``xstat_off`` of the structure ``rte_node`` have been + marked as RTE_CACHE_LINE_MIN_SIZE bytes aligned. + Known Issues ------------ diff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h index 4c2432b47f..d36abec08b 100644 --- a/lib/graph/rte_graph_worker_common.h +++ b/lib/graph/rte_graph_worker_common.h @@ -104,16 +104,21 @@ struct __rte_cache_aligned rte_node { /** Original process function when pcap is enabled. */ rte_node_process_t original_process; + /** Fast path area cache line 1. */ union { /* Fast schedule area for mcore dispatch model */ - struct { + alignas(RTE_CACHE_LINE_MIN_SIZE) struct { unsigned int lcore_id; /**< Node running lcore. */ uint64_t total_sched_objs; /**< Number of objects scheduled. */ uint64_t total_sched_fail; /**< Number of scheduled failure. */ struct rte_graph *graph; /**< Graph corresponding to lcore_id. */ } dispatch; }; + + /** Fast path area cache line 2. */ + alignas(RTE_CACHE_LINE_MIN_SIZE) rte_graph_off_t xstat_off; /**< Offset to xstat counters. */ + /* Fast path area */ __extension__ struct __rte_cache_aligned { #define RTE_NODE_CTX_SZ 16 -- 2.27.0