From patchwork Mon May 23 09:59:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 111606 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5324DA04FD; Mon, 23 May 2022 12:00:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B47474161A; Mon, 23 May 2022 12:00:14 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id A25EB41611 for ; Mon, 23 May 2022 12:00:13 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24MLjCUP017461; Mon, 23 May 2022 03:00:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=5oPtHkCGv/nxbwlKXP3LSFJXMighKHEiZ/ScpiFyKO0=; b=Lf07HuPb9mTOZ6vPDO9FQZdQk/LAxfO7ybCU40wkYA+apRGtgGXxLTMmUdK7TRZ1LiJ/ TTrpp188n1NeSbd4oDwP/xLs8PFQUNlPlxgXAZzutXrc3C2/zI6+28ASmECTUwHbs81Q +oICPLE1fTfbJKbzJxf006s8AcLLM+mN74XnMu96JfMIZq+aPF95XPActNJ5KY3wMJir OXbAyhbn6oUywZOvGtpJmiTMqRB9bFva+dpQR/qTsy7xxwaW9e8p9tbK2nPX1o3X0f+F oVDXkAyOfm74rd0RWBaTs1h9OSrgQOa5NuJtyhcjpNgBUBkAdd5q/7xqPeTnuNA9IXt9 bg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3g6ykkw9sh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 23 May 2022 03:00:12 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 23 May 2022 03:00:10 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 23 May 2022 03:00:10 -0700 Received: from MININT-80QBFE8.corp.innovium.com (unknown [10.193.70.72]) by maili.marvell.com (Postfix) with ESMTP id 6EA9B3F70F9; Mon, 23 May 2022 03:00:04 -0700 (PDT) From: To: , Radu Nicolau , Akhil Goyal , Sunil Kumar Kori , Pavan Nikhilesh CC: Subject: [PATCH 2/2] examples: use mempool cache for vector pool Date: Mon, 23 May 2022 15:29:54 +0530 Message-ID: <20220523095954.3181-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523095954.3181-1-pbhagavatula@marvell.com> References: <20220523095954.3181-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 6dARyAO2vV_VbFzE_IQs-B3slkwISq1S X-Proofpoint-ORIG-GUID: 6dARyAO2vV_VbFzE_IQs-B3slkwISq1S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-23_03,2022-05-20_02,2022-02-23_01 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 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",