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 E3E4E4298D; Wed, 19 Apr 2023 22:02:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46C6D42C4D; Wed, 19 Apr 2023 22:02:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id BA25941141 for ; Wed, 19 Apr 2023 22:02:03 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33JIheck006482 for ; Wed, 19 Apr 2023 13:02:03 -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=WnDlofTvD1/InWUvu3j/A6E6WAEDn82pBxx2sf4tww0=; b=k0AIwpOZR2OAX+N5BReCfANo/ficqrmyYPSuxxeKy6gdCjYEu+uXFMA/FdHcUoR/zGf3 3drSbrmE2eTjB/ZhatQ2EY+hAtZ658m+kyDfynIzdAOuF6pc0m/RKnVsCJcYmyKumIhK HcoehVb6ru3I2828dF/93/umM0tWUwz+W3Y+CaDRoQpCXAvx1Z/b9/QAuX4tcFgSZGI6 eFPcVXRFv/po1RSFBKTEPkL3fiLp2ys0LyldG7ANKnVoWfJ9Q95pS3zoJ0eIlXXfmbb8 rPjW9BAVtHwgLrwauG+EZAzLhvfaUj44x6vzC1gsP4JnQrdY80UIqlkdTofyr03nAszX Wg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q2917uyja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 19 Apr 2023 13:02:03 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 19 Apr 2023 13:02:00 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 19 Apr 2023 13:02:00 -0700 Received: from MININT-80QBFE8.corp.innovium.com (unknown [10.28.164.122]) by maili.marvell.com (Postfix) with ESMTP id 66DF43F7055; Wed, 19 Apr 2023 13:01:59 -0700 (PDT) From: To: CC: , Pavan Nikhilesh Subject: [PATCH 3/3] app/eventdev: prevent mempool exhaustion Date: Thu, 20 Apr 2023 01:31:51 +0530 Message-ID: <20230419200151.2474-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419200151.2474-1-pbhagavatula@marvell.com> References: <20230419200151.2474-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: GMxf3hD4mw8gVnguZLAqHul0MVGX1kZY X-Proofpoint-ORIG-GUID: GMxf3hD4mw8gVnguZLAqHul0MVGX1kZY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-19_14,2023-04-18_01,2023-02-09_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 Prevent mempool exhaustion due to elements being stuck in lcore local caches. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_perf_common.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index 68af3cb346..5e0255cfeb 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -1859,34 +1859,35 @@ int perf_mempool_setup(struct evt_test *test, struct evt_options *opt) { struct test_perf *t = evt_test_priv(test); + unsigned int cache_sz; + cache_sz = RTE_MIN(RTE_MEMPOOL_CACHE_MAX_SIZE, (opt->pool_sz / 1.5) / t->nb_workers); if (opt->prod_type == EVT_PROD_TYPE_SYNT || opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) { t->pool = rte_mempool_create(test->name, /* mempool name */ opt->pool_sz, /* number of elements*/ sizeof(struct perf_elt), /* element size*/ - 512, /* cache size*/ + cache_sz, /* cache size*/ 0, NULL, NULL, perf_elt_init, /* obj constructor */ NULL, opt->socket_id, 0); /* flags */ } else if (opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR && - opt->crypto_op_type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC) { + opt->crypto_op_type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC) { t->pool = rte_mempool_create(test->name, /* mempool name */ opt->pool_sz, /* number of elements*/ sizeof(struct perf_elt) + modex_test_case.result_len, /* element size*/ - 512, /* cache size*/ + cache_sz, /* cache size*/ 0, NULL, NULL, NULL, /* obj constructor */ NULL, opt->socket_id, 0); /* flags */ } else { t->pool = rte_pktmbuf_pool_create(test->name, /* mempool name */ opt->pool_sz, /* number of elements*/ - 512, /* cache size*/ + cache_sz, /* cache size*/ 0, RTE_MBUF_DEFAULT_BUF_SIZE, opt->socket_id); /* flags */ - } if (t->pool == NULL) { -- 2.25.1