From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 222BDA0553; Fri, 10 Jun 2022 15:46:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 146E24069C; Fri, 10 Jun 2022 15:46:44 +0200 (CEST) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by mails.dpdk.org (Postfix) with ESMTP id 6B2B240689 for ; Fri, 10 Jun 2022 15:46:42 +0200 (CEST) Received: by mail-qv1-f43.google.com with SMTP id ea7so18632581qvb.12 for ; Fri, 10 Jun 2022 06:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+Sx1tVk0FO34a+QCEJM/+2DsIhpLyJM/3Clt3jyxPf4=; b=ZCexcFU4YPK1u/leF90WaPidAmJ+k3xHrgAO3hbwC7CuMirBE3KfTaBobS9ro7kZyT +ckdvlXNkOmsgGnTiOtIIYzXKOkKaEH0P1HO73RzUObpJZ44BZ3gSW/x8HHcYqeXHQ7U PT7GeskJFK2DX5FqgMrNNYHHhLelqu0uSzLnLhTfjNDICl9goEDAyrgeREQO/L7cCR+r 3uqLyqHRYsYVD6aiO+Q13XjpPmUDPkHs28SrSyD9X4/qW5aFTO/5zcr6Eh2OlHAqtBSM +nF/2CKj8hqB18Fxp7gVeXRacKHftNylmO7FoKijhy0c2PGHwwYtTs7LZDYavTNAzNjR 0EAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+Sx1tVk0FO34a+QCEJM/+2DsIhpLyJM/3Clt3jyxPf4=; b=0gZ7+4JHUf9LRw4pIgnjwcWTjDhbZ7DKt+rQeUsLfBPeZ64OuVzuDnj3fIOnvE1ew8 GmWEsn4WJYgEyyNQIXN+3EiTbsLaE4wyQvfXz+Msw5jdeO9b4kS10J9oJkOXIrNXWX/X CWzKdCdL0hS0U0/xgwF6xOD2wW//vvuL8g5jJgMUQeNoSYU9fR7lnNedSZycxh9C6zoj qdmKcZy+iSn/gKI4GcYfQLhP5G09whpUgf9XnOhGyq6PlhlQaKQ/RUaNa35BHd+mkzFL dWEXIPjFv4BaLsl7qF0ziicBWadu3JfBhOJo1A01e9HztnCpbH/NnwKamt8nw+Ff1mGk b3nQ== X-Gm-Message-State: AOAM533KL9NoXA7KraBwa3BJZstAotbg/zPjpy8zPqLZIulsQP0dCuv8 BvRcXhJAPfVGpp7Gl/4tbvr0y7IaANWlF5HhIGs= X-Google-Smtp-Source: ABdhPJwhsL3UK6ngUig5wHrwSPOzB5a0hqwExcbR8zxzmalC8ZkAAtXlrJzlwuwMKZnj/s2f8sIIWO0nkPnWRpinFGY= X-Received: by 2002:ad4:594d:0:b0:46b:afcf:fb67 with SMTP id eo13-20020ad4594d000000b0046bafcffb67mr17176701qvb.11.1654868801735; Fri, 10 Jun 2022 06:46:41 -0700 (PDT) MIME-Version: 1.0 References: <20220523095954.3181-1-pbhagavatula@marvell.com> <20220523095954.3181-2-pbhagavatula@marvell.com> In-Reply-To: <20220523095954.3181-2-pbhagavatula@marvell.com> From: Jerin Jacob Date: Fri, 10 Jun 2022 19:16:15 +0530 Message-ID: Subject: Re: [PATCH 2/2] examples: use mempool cache for vector pool To: Pavan Nikhilesh Cc: Jerin Jacob , Radu Nicolau , Akhil Goyal , Sunil Kumar Kori , dpdk-dev Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, May 23, 2022 at 3:30 PM wrote: > > From: Pavan Nikhilesh > > 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 Acked-by: Jerin Jacob > --- > 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 >