diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2021-11-08 21:49:35 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-11-11 16:20:11 +0200 |
commit | fd1b433b2f0d05915dcb1dd95a1180ad73937ea2 (patch) | |
tree | 3b9fb352103c90f394e8b1c3ba85c96dd820b949 /platform/linux-dpdk/include | |
parent | 840ab48c2ec573583c0b7e3906c520dc37c1ad93 (diff) |
linux-dpdk: pool: move user area from buffer to shm
Instead of storing the user area directly in each buffer, reserve a
shared memory area for this purpose for each pool, and store only a
pointer in each buffer. This is similar to linux-gen.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include')
5 files changed, 10 insertions, 3 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h index cb9bd7e34..2f4d65281 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h @@ -43,7 +43,7 @@ typedef struct _odp_packet_inline_offset_t { uint16_t pkt_len; uint16_t seg_len; uint16_t nb_segs; - uint16_t udata; + uint16_t user_area; uint16_t rss; uint16_t ol_flags; uint64_t rss_flag; diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h index ed2778789..f3526fb60 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h @@ -208,7 +208,7 @@ _ODP_INLINE void *odp_packet_user_ptr(odp_packet_t pkt) _ODP_INLINE void *odp_packet_user_area(odp_packet_t pkt) { - return (void *)((char *)pkt + _odp_packet_inline.udata); + return _odp_pkt_get(pkt, void *, user_area); } _ODP_INLINE uint32_t odp_packet_user_area_size(odp_packet_t pkt) diff --git a/platform/linux-dpdk/include/odp_buffer_internal.h b/platform/linux-dpdk/include/odp_buffer_internal.h index e47030ea7..674c6d716 100644 --- a/platform/linux-dpdk/include/odp_buffer_internal.h +++ b/platform/linux-dpdk/include/odp_buffer_internal.h @@ -71,6 +71,9 @@ struct odp_buffer_hdr_t { /* Pool pointer */ void *pool_ptr; + + /* User area pointer */ + void *uarea_addr; }; /* diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h index 6618d413d..0d2e6f478 100644 --- a/platform/linux-dpdk/include/odp_config_internal.h +++ b/platform/linux-dpdk/include/odp_config_internal.h @@ -127,7 +127,7 @@ extern "C" { /* * Number of shared memory blocks reserved for implementation internal use. */ -#define CONFIG_INTERNAL_SHM_BLOCKS 20 +#define CONFIG_INTERNAL_SHM_BLOCKS (ODP_CONFIG_POOLS + 20) /* * Maximum number of shared memory blocks. diff --git a/platform/linux-dpdk/include/odp_pool_internal.h b/platform/linux-dpdk/include/odp_pool_internal.h index f95a44440..0b5df61af 100644 --- a/platform/linux-dpdk/include/odp_pool_internal.h +++ b/platform/linux-dpdk/include/odp_pool_internal.h @@ -76,6 +76,10 @@ typedef struct ODP_ALIGNED_CACHE { uint8_t pool_ext; odp_pool_param_t params; odp_pool_ext_param_t ext_param; + odp_shm_t uarea_shm; + uint64_t uarea_shm_size; + uint32_t uarea_size; + uint8_t *uarea_base_addr; char name[ODP_POOL_NAME_LEN]; } pool_t; |