From patchwork Fri Feb 24 05:48:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 124478 X-Patchwork-Delegate: thomas@monjalon.net 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 756DA41D5B; Fri, 24 Feb 2023 06:48:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD6A740EF0; Fri, 24 Feb 2023 06:48:23 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 364F940DF6 for ; Fri, 24 Feb 2023 06:48:22 +0100 (CET) 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 31O3N3Dp009275 for ; Thu, 23 Feb 2023 21:48:21 -0800 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=UwoXYDdfJ8qUyb0D7a/jgCmfcaTfQRnuDwANueriP1M=; b=HmSTzey07DcS+VdYhOa0tfX4IsDEsrM12V37T96XY8QGyYUnEsqMegIlQlhfA+JYfyav N8sSbCrMTKg/IgFmzQiVbAuK7J82K+HeZY5Ic3rFykn3Uvq1SMBFMHLsk8Vw9D676Esf +tnHVNZR369V89nAEjLgQgdbSoSW4TE9jAd/wXMLnMc/evA2BHGPDEbc8A7/xaOQpd/r kRlL5fJ9GVhUF+tzJhS6aP1SLRDETRIrEUg3Ocdql8F01VkneX08s665U16R/q9JFv7S XFghH+M+A/38Xz6nZFyqMnX9a38fVXtWbOazsArlUt0KMwZfLNQe9BCkezHvdoL7mEVa PA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nxfkwa3an-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 23 Feb 2023 21:48:21 -0800 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.42; Thu, 23 Feb 2023 21:48:20 -0800 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.42 via Frontend Transport; Thu, 23 Feb 2023 21:48:20 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 8D1CD3F7080; Thu, 23 Feb 2023 21:48:18 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH 02/11] crypto/cnxk: make sg version check const Date: Fri, 24 Feb 2023 11:18:04 +0530 Message-ID: <20230224054813.2855914-3-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230224054813.2855914-1-ktejasree@marvell.com> References: <20230224054813.2855914-1-ktejasree@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: XlUFzoPbk3LhQAuIHSpCY4PVEkxWGVDT X-Proofpoint-ORIG-GUID: XlUFzoPbk3LhQAuIHSpCY4PVEkxWGVDT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-24_02,2023-02-23_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 Remove sg_ver2 from burst structure and make it as const argument for compiler optimized code. Signed-off-by: Tejasree Kondoj --- drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c index 4ee6b944c4..92f7002db9 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c @@ -38,7 +38,6 @@ struct ops_burst { struct cn10k_sso_hws *ws; struct cnxk_cpt_qp *qp; uint16_t nb_ops; - bool is_sg_ver2; }; /* Holds information required to send vector of operations */ @@ -489,7 +488,8 @@ cn10k_cpt_vec_submit(struct vec_request vec_tbl[], uint16_t vec_tbl_len, struct } static inline int -ca_lmtst_vec_submit(struct ops_burst *burst, struct vec_request vec_tbl[], uint16_t *vec_tbl_len) +ca_lmtst_vec_submit(struct ops_burst *burst, struct vec_request vec_tbl[], uint16_t *vec_tbl_len, + const bool is_sg_ver2) { struct cpt_inflight_req *infl_reqs[PKTS_PER_LOOP]; uint64_t lmt_base, lmt_arg, io_addr; @@ -537,7 +537,7 @@ ca_lmtst_vec_submit(struct ops_burst *burst, struct vec_request vec_tbl[], uint1 infl_req = infl_reqs[i]; infl_req->op_flags = 0; - ret = cn10k_cpt_fill_inst(qp, &burst->op[i], inst, infl_req, burst->is_sg_ver2); + ret = cn10k_cpt_fill_inst(qp, &burst->op[i], inst, infl_req, is_sg_ver2); if (unlikely(ret != 1)) { plt_cpt_dbg("Could not process op: %p", burst->op[i]); if (i != 0) @@ -620,7 +620,7 @@ next_op:; } static inline uint16_t -ca_lmtst_burst_submit(struct ops_burst *burst) +ca_lmtst_burst_submit(struct ops_burst *burst, const bool is_sg_ver2) { struct cpt_inflight_req *infl_reqs[PKTS_PER_LOOP]; uint64_t lmt_base, lmt_arg, io_addr; @@ -660,7 +660,7 @@ ca_lmtst_burst_submit(struct ops_burst *burst) infl_req = infl_reqs[i]; infl_req->op_flags = 0; - ret = cn10k_cpt_fill_inst(qp, &burst->op[i], inst, infl_req, burst->is_sg_ver2); + ret = cn10k_cpt_fill_inst(qp, &burst->op[i], inst, infl_req, is_sg_ver2); if (unlikely(ret != 1)) { plt_dp_dbg("Could not process op: %p", burst->op[i]); if (i != 0) @@ -729,7 +729,6 @@ cn10k_cpt_crypto_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_ev burst.ws = ws; burst.qp = NULL; burst.nb_ops = 0; - burst.is_sg_ver2 = is_sg_ver2; for (i = 0; i < nb_events; i++) { op = ev[i].event_ptr; @@ -743,8 +742,8 @@ cn10k_cpt_crypto_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_ev if (qp != burst.qp) { if (burst.nb_ops) { if (is_vector) { - submitted = - ca_lmtst_vec_submit(&burst, vec_tbl, &vec_tbl_len); + submitted = ca_lmtst_vec_submit(&burst, vec_tbl, + &vec_tbl_len, is_sg_ver2); /* * Vector submission is required on qp change, but not in * other cases, since we could send several vectors per @@ -753,7 +752,7 @@ cn10k_cpt_crypto_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_ev cn10k_cpt_vec_submit(vec_tbl, vec_tbl_len, burst.qp); vec_tbl_len = 0; } else { - submitted = ca_lmtst_burst_submit(&burst); + submitted = ca_lmtst_burst_submit(&burst, is_sg_ver2); } count += submitted; if (unlikely(submitted != burst.nb_ops)) @@ -769,9 +768,10 @@ cn10k_cpt_crypto_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_ev /* Max nb_ops per burst check */ if (++burst.nb_ops == PKTS_PER_LOOP) { if (is_vector) - submitted = ca_lmtst_vec_submit(&burst, vec_tbl, &vec_tbl_len); + submitted = ca_lmtst_vec_submit(&burst, vec_tbl, &vec_tbl_len, + is_sg_ver2); else - submitted = ca_lmtst_burst_submit(&burst); + submitted = ca_lmtst_burst_submit(&burst, is_sg_ver2); count += submitted; if (unlikely(submitted != burst.nb_ops)) goto vec_submit; @@ -781,9 +781,9 @@ cn10k_cpt_crypto_adapter_enqueue(void *ws, struct rte_event ev[], uint16_t nb_ev /* Submit the rest of crypto operations */ if (burst.nb_ops) { if (is_vector) - count += ca_lmtst_vec_submit(&burst, vec_tbl, &vec_tbl_len); + count += ca_lmtst_vec_submit(&burst, vec_tbl, &vec_tbl_len, is_sg_ver2); else - count += ca_lmtst_burst_submit(&burst); + count += ca_lmtst_burst_submit(&burst, is_sg_ver2); } vec_submit: