examples: use mempool cache for vector pool

Use mempool cache for vector mempool as vectors are freed by the Tx
routine, also increase the minimum pool size to 512 to avoid resource
contention on Rx.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Pavan Nikhilesh 2022-05-23 15:29:54 +05:30 committed by Jerin Jacob
parent d67332bca0
commit 31edfc4af9
3 changed files with 10 additions and 6 deletions

View File

@ -820,12 +820,12 @@ eh_rx_adapter_configure(struct eventmode_conf *em_conf,
em_conf->ext_params.vector_size) + 1;
if (per_port_pool)
nb_elem = nb_ports * nb_elem;
nb_elem = RTE_MAX(512U, nb_elem);
}
nb_elem += rte_lcore_count() * 32;
vector_pool = rte_event_vector_pool_create(
"vector_pool", nb_elem, 0,
em_conf->ext_params.vector_size,
socket_id);
"vector_pool", nb_elem, 32,
em_conf->ext_params.vector_size, socket_id);
if (vector_pool == NULL) {
EH_LOG_ERR("failed to create event vector pool");
return -ENOMEM;

View File

@ -678,8 +678,10 @@ main(int argc, char **argv)
vec_size = rsrc->evt_vec.size;
nb_vec = (nb_mbufs + vec_size - 1) / vec_size;
nb_vec = RTE_MAX(512U, nb_vec);
nb_vec += rte_lcore_count() * 32;
rsrc->evt_vec_pool = rte_event_vector_pool_create(
"vector_pool", nb_vec, 0, vec_size, rte_socket_id());
"vector_pool", nb_vec, 32, vec_size, rte_socket_id());
if (rsrc->evt_vec_pool == NULL)
rte_panic("Cannot init event vector pool\n");
}

View File

@ -1049,9 +1049,11 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)
nb_vec = (nb_mbuf + evt_rsrc->vector_size - 1) /
evt_rsrc->vector_size;
nb_vec = RTE_MAX(512U, nb_vec);
nb_vec += rte_lcore_count() * 32;
snprintf(s, sizeof(s), "vector_pool_%d", portid);
vector_pool[portid] = rte_event_vector_pool_create(
s, nb_vec, 0, evt_rsrc->vector_size, socketid);
s, nb_vec, 32, evt_rsrc->vector_size, socketid);
if (vector_pool[portid] == NULL)
rte_exit(EXIT_FAILURE,
"Failed to create vector pool for port %d\n",