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 E2DB341D5F; Fri, 24 Feb 2023 10:40:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05451410EA; Fri, 24 Feb 2023 10:40:28 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4DD4F40DF6 for ; Fri, 24 Feb 2023 10:40:24 +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 31O71t03027270 for ; Fri, 24 Feb 2023 01:40:23 -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=B396B8zj95ApDTmNFUaAFkMW9qyvQ5ZwrHZy7aru7hs+PesYAB7Igpo+SWQVOpyTg1DW NuX+lKts7N358uPJx9+FDntqwTqoGtAa1o/RWckFO6PMONyPTiMXoDTslZklC+yjHDcE JH8A6NAJcVZUeLffsp4TF2yfOHJ5+ZasL9pZm3GxXeSVCPzRA9mHNp5uuqZSAwXBQvi9 NIXWn2QnD6SDflPBrVeOBD72IfdWKf4AfATCwW1n9BGp6lhsU5V8+C/eNrpX9HQTnPl1 rwHFAfuIoAfXeViLVlOLvSZ4rMn/QwFnlwQEDgSmgHcMmT04HdXuOTohKgGfxeyyyhzd tQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nxfkwb2ga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 24 Feb 2023 01:40:23 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 24 Feb 2023 01:40:21 -0800 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.42 via Frontend Transport; Fri, 24 Feb 2023 01:40:21 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 4B25D3F7048; Fri, 24 Feb 2023 01:40:19 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Gowrishankar Muthukrishnan , Subject: [PATCH v2 02/11] crypto/cnxk: make sg version check const Date: Fri, 24 Feb 2023 15:10:05 +0530 Message-ID: <20230224094014.3246764-3-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230224094014.3246764-1-ktejasree@marvell.com> References: <20230224094014.3246764-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: GmNfIzKN70rXH3eSOEeouiGZKPbixSwu X-Proofpoint-ORIG-GUID: GmNfIzKN70rXH3eSOEeouiGZKPbixSwu 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_05,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: -- 2.25.1