aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/pktio/dpdk.c
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2022-06-21 17:23:33 +0300
committerMatias Elo <matias.elo@nokia.com>2022-06-27 14:57:40 +0300
commit6de41dac54c48a65659c4f9f834ad1b45f164f7f (patch)
tree708d6e6475685458252bf5037301d955db5e342f /platform/linux-generic/pktio/dpdk.c
parentf93cefb1f4d05059d7cd390af87163e008d6eee6 (diff)
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 <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform/linux-generic/pktio/dpdk.c')
-rw-r--r--platform/linux-generic/pktio/dpdk.c16
1 files changed, 10 insertions, 6 deletions
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 */