mbuf: move next pointer to first cache line if PA disabled

Swapped position of mbuf next pointer and second dynamic field (dynfield2)
if the build is configured to disable IOVA as PA.
This is to move the mbuf next pointer to first cache line.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
Shijith Thotton 2022-10-08 02:32:09 +05:30 committed by Thomas Monjalon
parent 03b57eb7ab
commit 5812b32773
2 changed files with 17 additions and 5 deletions

View File

@ -421,6 +421,9 @@ ABI Changes
* eal: Updated EAL thread names from ``lcore-worker-<lcore_id>`` to
``rte-worker-<lcore_id>`` so that DPDK can accommodate lcores higher than 99.
* mbuf: Replaced ``buf_iova`` field with ``next`` field and added a new field
``dynfield2`` at its place in second cacheline if ``RTE_IOVA_AS_PA`` is 0.
* ethdev: enum ``RTE_FLOW_ITEM`` was affected by deprecation procedure.
* ethdev: enum ``RTE_FLOW_ACTION`` was affected by deprecation procedure.

View File

@ -479,10 +479,11 @@ struct rte_mbuf {
rte_iova_t buf_iova __rte_aligned(sizeof(rte_iova_t));
#else
/**
* Reserved for dynamic fields
* if physical address field is disabled.
* Next segment of scattered packet.
* This field is valid when physical address field is undefined.
* Otherwise next pointer in the second cache line will be used.
*/
uint64_t dynfield2;
struct rte_mbuf *next;
#endif
/* next 8 bytes are initialised on RX descriptor rearm */
@ -599,11 +600,19 @@ struct rte_mbuf {
/* second cache line - fields only used in slow path or on TX */
RTE_MARKER cacheline1 __rte_cache_min_aligned;
#if RTE_IOVA_AS_PA
/**
* Next segment of scattered packet. Must be NULL in the last segment or
* in case of non-segmented packet.
* Next segment of scattered packet. Must be NULL in the last
* segment or in case of non-segmented packet.
*/
struct rte_mbuf *next;
#else
/**
* Reserved for dynamic fields
* when the next pointer is in first cache line (i.e. RTE_IOVA_AS_PA is 0).
*/
uint64_t dynfield2;
#endif
/* fields to support TX offloads */
RTE_STD_C11