* [PATCH 1/2] app/eventdev: use mempool cache for vector pool
@ 2022-05-23 9:59 pbhagavatula
2022-05-23 9:59 ` [PATCH 2/2] examples: " pbhagavatula
2022-06-10 13:44 ` [PATCH 1/2] app/eventdev: " Jerin Jacob
0 siblings, 2 replies; 5+ messages in thread
From: pbhagavatula @ 2022-05-23 9:59 UTC (permalink / raw)
To: jerinj; +Cc: dev, Pavan Nikhilesh
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
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>
---
app/test-eventdev/test_pipeline_common.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index c66656cd39..856a2f1a52 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -338,9 +338,10 @@ pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
if (opt->ena_vector) {
unsigned int nb_elem = (opt->pool_sz / opt->vector_size) << 1;
- nb_elem = nb_elem ? nb_elem : 1;
+ nb_elem = RTE_MAX(512U, nb_elem);
+ nb_elem += evt_nr_active_lcores(opt->wlcores) * 32;
vector_pool = rte_event_vector_pool_create(
- "vector_pool", nb_elem, 0, opt->vector_size,
+ "vector_pool", nb_elem, 32, opt->vector_size,
opt->socket_id);
if (vector_pool == NULL) {
evt_err("failed to create event vector pool");
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] examples: use mempool cache for vector pool
2022-05-23 9:59 [PATCH 1/2] app/eventdev: use mempool cache for vector pool pbhagavatula
@ 2022-05-23 9:59 ` pbhagavatula
2022-06-10 13:46 ` Jerin Jacob
2022-06-10 13:44 ` [PATCH 1/2] app/eventdev: " Jerin Jacob
1 sibling, 1 reply; 5+ messages in thread
From: pbhagavatula @ 2022-05-23 9:59 UTC (permalink / raw)
To: jerinj, Radu Nicolau, Akhil Goyal, Sunil Kumar Kori, Pavan Nikhilesh; +Cc: dev
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
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>
---
examples/ipsec-secgw/event_helper.c | 8 ++++----
examples/l2fwd-event/main.c | 4 +++-
examples/l3fwd/main.c | 4 +++-
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/examples/ipsec-secgw/event_helper.c b/examples/ipsec-secgw/event_helper.c
index 172ab8e716..b36f20a3fd 100644
--- a/examples/ipsec-secgw/event_helper.c
+++ b/examples/ipsec-secgw/event_helper.c
@@ -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;
diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c
index dcc72f3f1e..44303d10c2 100644
--- a/examples/l2fwd-event/main.c
+++ b/examples/l2fwd-event/main.c
@@ -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");
}
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index a629198223..896a347db3 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1006,9 +1006,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",
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] app/eventdev: use mempool cache for vector pool
2022-05-23 9:59 [PATCH 1/2] app/eventdev: use mempool cache for vector pool pbhagavatula
2022-05-23 9:59 ` [PATCH 2/2] examples: " pbhagavatula
@ 2022-06-10 13:44 ` Jerin Jacob
2022-06-13 5:56 ` Jerin Jacob
1 sibling, 1 reply; 5+ messages in thread
From: Jerin Jacob @ 2022-06-10 13:44 UTC (permalink / raw)
To: Pavan Nikhilesh; +Cc: Jerin Jacob, dpdk-dev
On Mon, May 23, 2022 at 3:30 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> 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>
> ---
> app/test-eventdev/test_pipeline_common.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
> index c66656cd39..856a2f1a52 100644
> --- a/app/test-eventdev/test_pipeline_common.c
> +++ b/app/test-eventdev/test_pipeline_common.c
> @@ -338,9 +338,10 @@ pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
> if (opt->ena_vector) {
> unsigned int nb_elem = (opt->pool_sz / opt->vector_size) << 1;
>
> - nb_elem = nb_elem ? nb_elem : 1;
> + nb_elem = RTE_MAX(512U, nb_elem);
> + nb_elem += evt_nr_active_lcores(opt->wlcores) * 32;
> vector_pool = rte_event_vector_pool_create(
> - "vector_pool", nb_elem, 0, opt->vector_size,
> + "vector_pool", nb_elem, 32, opt->vector_size,
> opt->socket_id);
> if (vector_pool == NULL) {
> evt_err("failed to create event vector pool");
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] examples: use mempool cache for vector pool
2022-05-23 9:59 ` [PATCH 2/2] examples: " pbhagavatula
@ 2022-06-10 13:46 ` Jerin Jacob
0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2022-06-10 13:46 UTC (permalink / raw)
To: Pavan Nikhilesh
Cc: Jerin Jacob, Radu Nicolau, Akhil Goyal, Sunil Kumar Kori, dpdk-dev
On Mon, May 23, 2022 at 3:30 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> 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>
> ---
> examples/ipsec-secgw/event_helper.c | 8 ++++----
> examples/l2fwd-event/main.c | 4 +++-
> examples/l3fwd/main.c | 4 +++-
> 3 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/examples/ipsec-secgw/event_helper.c b/examples/ipsec-secgw/event_helper.c
> index 172ab8e716..b36f20a3fd 100644
> --- a/examples/ipsec-secgw/event_helper.c
> +++ b/examples/ipsec-secgw/event_helper.c
> @@ -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;
> diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c
> index dcc72f3f1e..44303d10c2 100644
> --- a/examples/l2fwd-event/main.c
> +++ b/examples/l2fwd-event/main.c
> @@ -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");
> }
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index a629198223..896a347db3 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -1006,9 +1006,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",
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] app/eventdev: use mempool cache for vector pool
2022-06-10 13:44 ` [PATCH 1/2] app/eventdev: " Jerin Jacob
@ 2022-06-13 5:56 ` Jerin Jacob
0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2022-06-13 5:56 UTC (permalink / raw)
To: Pavan Nikhilesh; +Cc: Jerin Jacob, dpdk-dev
On Fri, Jun 10, 2022 at 7:14 PM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Mon, May 23, 2022 at 3:30 PM <pbhagavatula@marvell.com> wrote:
> >
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > 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>
Series applied to dpdk-next-net-eventdev/for-main. Thanks
>
>
> > ---
> > app/test-eventdev/test_pipeline_common.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
> > index c66656cd39..856a2f1a52 100644
> > --- a/app/test-eventdev/test_pipeline_common.c
> > +++ b/app/test-eventdev/test_pipeline_common.c
> > @@ -338,9 +338,10 @@ pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
> > if (opt->ena_vector) {
> > unsigned int nb_elem = (opt->pool_sz / opt->vector_size) << 1;
> >
> > - nb_elem = nb_elem ? nb_elem : 1;
> > + nb_elem = RTE_MAX(512U, nb_elem);
> > + nb_elem += evt_nr_active_lcores(opt->wlcores) * 32;
> > vector_pool = rte_event_vector_pool_create(
> > - "vector_pool", nb_elem, 0, opt->vector_size,
> > + "vector_pool", nb_elem, 32, opt->vector_size,
> > opt->socket_id);
> > if (vector_pool == NULL) {
> > evt_err("failed to create event vector pool");
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-13 5:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 9:59 [PATCH 1/2] app/eventdev: use mempool cache for vector pool pbhagavatula
2022-05-23 9:59 ` [PATCH 2/2] examples: " pbhagavatula
2022-06-10 13:46 ` Jerin Jacob
2022-06-10 13:44 ` [PATCH 1/2] app/eventdev: " Jerin Jacob
2022-06-13 5:56 ` Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).