From 6de41dac54c48a65659c4f9f834ad1b45f164f7f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 21 Jun 2022 17:23:33 +0300 Subject: linux-gen: dpdk: reduce pkt_cache_t memory footprint Use smaller data types and remove alignment constraint from pkt_cache_t. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- platform/linux-generic/pktio/dpdk.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'platform/linux-generic/pktio/dpdk.c') diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 7ef52f0c5..61478f08f 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -101,6 +101,8 @@ ODP_STATIC_ASSERT((DPDK_NB_MBUF % DPDK_MEMPOOL_CACHE_SIZE == 0) && /* Minimum RX burst size */ #define DPDK_MIN_RX_BURST 4 +ODP_STATIC_ASSERT(DPDK_MIN_RX_BURST <= UINT8_MAX, "DPDK_MIN_RX_BURST too large"); + /* Limits for setting link MTU */ #define DPDK_MTU_MIN (RTE_ETHER_MIN_MTU + _ODP_ETHHDR_LEN) #define DPDK_MTU_MAX (9000 + _ODP_ETHHDR_LEN) @@ -114,11 +116,13 @@ typedef struct { uint8_t set_flow_hash; } dpdk_opt_t; -typedef struct ODP_ALIGNED_CACHE { - /** array for storing extra RX packets */ +typedef struct { + /* Array for storing extra RX packets */ struct rte_mbuf *pkt[DPDK_MIN_RX_BURST]; - unsigned int idx; /**< head of cache */ - unsigned int count; /**< packets in cache */ + /* Head of cache */ + uint8_t idx; + /* Packets in cache */ + uint8_t count; } pkt_cache_t; /* DPDK pktio specific data */ @@ -127,12 +131,12 @@ typedef struct ODP_ALIGNED_CACHE { /* Packet output capabilities */ odp_pktout_config_opt_t pktout_capa; - /* Minimum RX burst size */ - unsigned int min_rx_burst; /* DPDK port identifier */ uint16_t port_id; /* Maximum transmission unit */ uint16_t mtu; + /* Minimum RX burst size */ + uint8_t min_rx_burst; /* No locking for rx */ uint8_t lockless_rx; /* No locking for tx */ -- cgit v1.2.3