From patchwork Fri Sep 8 05:40:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 131252 X-Patchwork-Delegate: gakhil@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 491D94253E; Fri, 8 Sep 2023 07:40:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4441402F2; Fri, 8 Sep 2023 07:40:12 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D280A4068A for ; Fri, 8 Sep 2023 07:40:11 +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 3885H6XS020867; Thu, 7 Sep 2023 22:40:11 -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=jGIlfmVLKEXeLe0bullhOsVIfWgyWCc1BQjyT51d7jg=; b=ApHedwflIZTyG3AdGh92T9HERGEEvTi2PHcUxfoB2IYZM0KQJEB1bvz8fBAz7PghNiPp YSfWwtap7Qzns/5RCHsZuff8f+bTqf4SgLmWx0Bn1OzOxozaepZuXBB6gZc3xtL9yGaT WmsiC5/TewFSJdVN6Ey5lMSarIWaFdWMxrdu1HXCovwmQZfrYcfyACrYI198pxoQkoki bsCmOcNTelcv/UC76aY7T6MCGkqVgRgy6cdDpy36zbjCxVYHrDBfnzoQLhGlQ6mzQEso ifapGFD5D+GErSFGw/lQ+DlsACyW4OS1ev3k9Yc3ldfSl1FiXX/UG2MzaTHyiGkbHeHd uA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3syk9ajb26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Sep 2023 22:40:11 -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; Thu, 7 Sep 2023 22:40:09 -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; Thu, 7 Sep 2023 22:40:09 -0700 Received: from BG-LT92004.corp.innovium.com (unknown [10.28.163.189]) by maili.marvell.com (Postfix) with ESMTP id 482785B693D; Thu, 7 Sep 2023 22:40:07 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Ciara Power CC: Jerin Jacob , Subject: [PATCH 3/4] app/crypto-perf: remove redundant cast Date: Fri, 8 Sep 2023 11:10:02 +0530 Message-ID: <20230908054003.295-3-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230908054003.295-1-anoobj@marvell.com> References: <20230908054003.295-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: sEwdEI-lGSE9-cXIhLTQqucxq6nYER7w X-Proofpoint-GUID: sEwdEI-lGSE9-cXIhLTQqucxq6nYER7w X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-08_03,2023-09-05_01,2023-05-22_02 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 The API 'rte_cryptodev_get_sec_ctx' returns void *. Type cast is not required. Signed-off-by: Anoob Joseph --- app/test-crypto-perf/cperf_ops.c | 12 ++++++------ app/test-crypto-perf/cperf_test_pmd_cyclecount.c | 4 +--- app/test-crypto-perf/cperf_test_throughput.c | 4 +--- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index 93b9bfb240..5bb2ce954a 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -647,6 +647,7 @@ create_ipsec_session(struct rte_mempool *sess_mp, struct rte_crypto_sym_xform auth_xform = {0}; struct rte_crypto_sym_xform *crypto_xform; struct rte_crypto_sym_xform xform = {0}; + struct rte_security_ctx *ctx; if (options->aead_algo != 0) { /* Setup AEAD Parameters */ @@ -749,8 +750,7 @@ create_ipsec_session(struct rte_mempool *sess_mp, else sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS; - struct rte_security_ctx *ctx = (struct rte_security_ctx *) - rte_cryptodev_get_sec_ctx(dev_id); + ctx = rte_cryptodev_get_sec_ctx(dev_id); /* Create security session */ return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp); @@ -766,6 +766,7 @@ cperf_create_session(struct rte_mempool *sess_mp, struct rte_crypto_sym_xform cipher_xform; struct rte_crypto_sym_xform auth_xform; struct rte_crypto_sym_xform aead_xform; + struct rte_security_ctx *ctx; void *sess = NULL; void *asym_sess = NULL; struct rte_crypto_asym_xform xform = {0}; @@ -853,8 +854,7 @@ cperf_create_session(struct rte_mempool *sess_mp, .crypto_xform = &cipher_xform }; - struct rte_security_ctx *ctx = (struct rte_security_ctx *) - rte_cryptodev_get_sec_ctx(dev_id); + ctx = rte_cryptodev_get_sec_ctx(dev_id); /* Create security session */ return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp); @@ -901,8 +901,8 @@ cperf_create_session(struct rte_mempool *sess_mp, } }, .crypto_xform = &cipher_xform }; - struct rte_security_ctx *ctx = (struct rte_security_ctx *) - rte_cryptodev_get_sec_ctx(dev_id); + + ctx = rte_cryptodev_get_sec_ctx(dev_id); /* Create security session */ return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp); diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c index 0307e82996..d6d4130195 100644 --- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c +++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c @@ -67,9 +67,7 @@ cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx) #ifdef RTE_LIB_SECURITY if (ctx->options->op_type == CPERF_PDCP || ctx->options->op_type == CPERF_DOCSIS) { - struct rte_security_ctx *sec_ctx = - (struct rte_security_ctx *) - rte_cryptodev_get_sec_ctx(ctx->dev_id); + struct rte_security_ctx *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id); rte_security_session_destroy(sec_ctx, (void *)ctx->sess); } else diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index e892a70699..21738e8425 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -44,9 +44,7 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx) else if (ctx->options->op_type == CPERF_PDCP || ctx->options->op_type == CPERF_DOCSIS || ctx->options->op_type == CPERF_IPSEC) { - struct rte_security_ctx *sec_ctx = - (struct rte_security_ctx *) - rte_cryptodev_get_sec_ctx(ctx->dev_id); + struct rte_security_ctx *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id); rte_security_session_destroy( sec_ctx, (void *)ctx->sess);