From patchwork Fri Jun 17 10:02:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Fialko X-Patchwork-Id: 112996 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 4CACAA0093; Fri, 17 Jun 2022 12:02:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A088A41141; Fri, 17 Jun 2022 12:02:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 005BD410FC for ; Fri, 17 Jun 2022 12:02:28 +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 25H3k8sc020527 for ; Fri, 17 Jun 2022 03:02:28 -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=bz/YhJFtC4Gs9Bt+cEMHcI/VlYe56yBJ6djOzSOWhb8=; b=WId3FFrzT5nchsLrS2HsgGVed7wA4Z59VxLUgXqoz5qlq2+0rj/Crp4+gSgVMm5QBqo1 +txrI3FTN27QF7Xx3Nv7uz6qq2Xl6ariLYPUa6UqmWODa8Cv+bHuc4OOe4SU9Rts7LCw SqwIMLER01uZdqZFEjZ3UAcs76Z2kkycEmikIffM1q1zxTWDu0oVMXjLHpJPXrP5PfTw nJODREwPc5B1e4AktKrUaUcDND9xhGVI6ZvjU/vPIAjjRrCBG5Fkf1m9VUKzh1m8R8NB BF0XzXnwxWazKqyfyuFHmr6DQaRpsX/AX3i//7bn8TKFH5GGwtqq9GYyvLpnalD57dG7 rQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3grj05s96e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 17 Jun 2022 03:02:28 -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; Fri, 17 Jun 2022 03:02:26 -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; Fri, 17 Jun 2022 03:02:26 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 93E5E3F7086; Fri, 17 Jun 2022 03:02:24 -0700 (PDT) From: Volodymyr Fialko To: , Jerin Jacob CC: , Volodymyr Fialko Subject: [PATCH 1/2] app/eventdev: add null checks for cop allocations Date: Fri, 17 Jun 2022 12:02:16 +0200 Message-ID: <20220617100217.3356870-2-vfialko@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617100217.3356870-1-vfialko@marvell.com> References: <20220617100217.3356870-1-vfialko@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: JLrOxDQhAczrwD7-N2rIOhuPTQwz59dQ X-Proofpoint-ORIG-GUID: JLrOxDQhAczrwD7-N2rIOhuPTQwz59dQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-17_08,2022-06-16_01,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 Crypto operation allocation may fail in case when total size of queue pairs is bigger then pool size. Signed-off-by: Volodymyr Fialko Acked-by: Jerin Jacob --- app/test-eventdev/test_perf_common.c | 40 ++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index b41785492e..a5e031873d 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -367,6 +367,7 @@ crypto_adapter_enq_op_new(struct prod_data *p) struct evt_options *opt = t->opt; uint16_t qp_id = p->ca.cdev_qp_id; uint8_t cdev_id = p->ca.cdev_id; + uint64_t alloc_failures = 0; uint32_t flow_counter = 0; struct rte_crypto_op *op; struct rte_mbuf *m; @@ -386,9 +387,17 @@ crypto_adapter_enq_op_new(struct prod_data *p) op = rte_crypto_op_alloc(t->ca_op_pool, RTE_CRYPTO_OP_TYPE_SYMMETRIC); + if (unlikely(op == NULL)) { + alloc_failures++; + continue; + } + m = rte_pktmbuf_alloc(pool); - if (m == NULL) + if (unlikely(m == NULL)) { + alloc_failures++; + rte_crypto_op_free(op); continue; + } rte_pktmbuf_append(m, len); sym_op = op->sym; @@ -404,6 +413,11 @@ crypto_adapter_enq_op_new(struct prod_data *p) op = rte_crypto_op_alloc(t->ca_op_pool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); + if (unlikely(op == NULL)) { + alloc_failures++; + continue; + } + asym_op = op->asym; asym_op->modex.base.data = modex_test_case.base.data; asym_op->modex.base.length = modex_test_case.base.len; @@ -418,6 +432,10 @@ crypto_adapter_enq_op_new(struct prod_data *p) count++; } + + if (opt->verbose_level > 1 && alloc_failures) + printf("%s(): lcore %d allocation failures: %"PRIu64"\n", + __func__, rte_lcore_id(), alloc_failures); } static inline void @@ -430,6 +448,7 @@ crypto_adapter_enq_op_fwd(struct prod_data *p) const uint64_t nb_pkts = t->nb_pkts; struct rte_mempool *pool = t->pool; struct evt_options *opt = t->opt; + uint64_t alloc_failures = 0; uint32_t flow_counter = 0; struct rte_crypto_op *op; struct rte_event ev; @@ -455,9 +474,17 @@ crypto_adapter_enq_op_fwd(struct prod_data *p) op = rte_crypto_op_alloc(t->ca_op_pool, RTE_CRYPTO_OP_TYPE_SYMMETRIC); + if (unlikely(op == NULL)) { + alloc_failures++; + continue; + } + m = rte_pktmbuf_alloc(pool); - if (m == NULL) + if (unlikely(m == NULL)) { + alloc_failures++; + rte_crypto_op_free(op); continue; + } rte_pktmbuf_append(m, len); sym_op = op->sym; @@ -473,6 +500,11 @@ crypto_adapter_enq_op_fwd(struct prod_data *p) op = rte_crypto_op_alloc(t->ca_op_pool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); + if (unlikely(op == NULL)) { + alloc_failures++; + continue; + } + asym_op = op->asym; asym_op->modex.base.data = modex_test_case.base.data; asym_op->modex.base.length = modex_test_case.base.len; @@ -489,6 +521,10 @@ crypto_adapter_enq_op_fwd(struct prod_data *p) count++; } + + if (opt->verbose_level > 1 && alloc_failures) + printf("%s(): lcore %d allocation failures: %"PRIu64"\n", + __func__, rte_lcore_id(), alloc_failures); } static inline int From patchwork Fri Jun 17 10:02:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Fialko X-Patchwork-Id: 112997 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 54EC2A0093; Fri, 17 Jun 2022 12:02:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C45D4280B; Fri, 17 Jun 2022 12:02:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5ED9D427F3 for ; Fri, 17 Jun 2022 12:02:31 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25H3v4ma006661 for ; Fri, 17 Jun 2022 03:02:30 -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=WWx7NHL0IPUdY3qru0cF5HGf3ryN0zHmLC/DM/pKDes=; b=F0D1wU5FdEM6CrfcpLs0v2dkheeSxr65Z3AgFPd7HjbnSQy9oO/SI1IYyx7t6+RxYnWr FogAQDY2IBLURKUjN7nXp6hUp0Cx3BOODsC6+oN3Q8NPBW5MAGEsqGM6MfI8AcqisER2 ipeehBDKfpn1zlvkwxFI0KCkZSHXQMsV8gTwxq85yoM8abORbBTIRmkmYHL4LZV3qqnS 3yJY+L+IUbg68QQOdOYEzKpwpb58BXsx5nOqj6+rAQCI7hNFhLB4a7/CgpHwitwtzgEm AW08rihszUw4n4CCSVB7DgXd/BAyB+4pOr7hQgKW56KuNcpmpQLa/IFrZYprbZNJF0c6 WQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3grj5h98rh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 17 Jun 2022 03:02:30 -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.18; Fri, 17 Jun 2022 03:02:29 -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.2 via Frontend Transport; Fri, 17 Jun 2022 03:02:29 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 630853F7057; Fri, 17 Jun 2022 03:02:27 -0700 (PDT) From: Volodymyr Fialko To: , Jerin Jacob CC: , Volodymyr Fialko Subject: [PATCH 2/2] app/eventdev: increase number of qp descriptors Date: Fri, 17 Jun 2022 12:02:17 +0200 Message-ID: <20220617100217.3356870-3-vfialko@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617100217.3356870-1-vfialko@marvell.com> References: <20220617100217.3356870-1-vfialko@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: Yh6bHWlZs6Ve17uOJq-c1PqzN7SUMdQE X-Proofpoint-ORIG-GUID: Yh6bHWlZs6Ve17uOJq-c1PqzN7SUMdQE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-17_08,2022-06-16_01,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 Increase number of cryptodev queue pair descriptors by default. Signed-off-by: Volodymyr Fialko --- app/test-eventdev/test_perf_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c index a5e031873d..81420be73a 100644 --- a/app/test-eventdev/test_perf_common.c +++ b/app/test-eventdev/test_perf_common.c @@ -6,7 +6,7 @@ #include "test_perf_common.h" -#define NB_CRYPTODEV_DESCRIPTORS 128 +#define NB_CRYPTODEV_DESCRIPTORS 1024 #define DATA_SIZE 512 struct modex_test_data { enum rte_crypto_asym_xform_type xform_type;