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 A89D34263E; Tue, 26 Sep 2023 08:00:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A71740E7C; Tue, 26 Sep 2023 07:59:25 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 9FD8140E64 for ; Tue, 26 Sep 2023 07:59:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38Q5rcMO024020 for ; Mon, 25 Sep 2023 22:59:22 -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=n+VSn42UB+H6fK+Cl9VSWJe4E3HJX+7CqWqM2v+LKIc=; b=BJpXbO0ueJtdiMHMbUdjXTpPIz6NyTIrAR9DGsIuokQqCJvD7NvTIngWiC9vxTJnV6a6 5iudZt/mvD3eEdorUrR5qGwX9bm6B+3/3V5tBAvWq5ymcjnysJDw4a8CZXzofiOWs4ka joy3U593lHILYaF5YKUkibTjA2OzTjaGN3PUDutQS9aJh7zC9vvcvl1a6SAWh97AGdT6 NA6XFzKeAyTHfWi/+X0ZMRbyCjLqZcUsUNkhNHmT5CuzANjk1dS9W5cEk9o5Vs7rAhzH 2AXu3T5STIsMrC4DIgjd5cOR3AlDZqasp4x1f+4WCLGql4ZXqqSUXeZgCigfSq5Iy5oq xA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3t9wcqr1va-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 25 Sep 2023 22:59:22 -0700 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.48; Mon, 25 Sep 2023 22:59:21 -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.48 via Frontend Transport; Mon, 25 Sep 2023 22:59:21 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 099913F708E; Mon, 25 Sep 2023 22:59:18 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Aakash Sasidharan , Anoob Joseph , Gowrishankar Muthukrishnan , Vidya Sagar Velumuri , Subject: [PATCH v2 12/15] crypto/cnxk: add support for packets with cipher len zero Date: Tue, 26 Sep 2023 11:28:44 +0530 Message-ID: <20230926055847.2707473-13-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230926055847.2707473-1-ktejasree@marvell.com> References: <20230926055847.2707473-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: jfpN8sIrYrNxRGfnDqK0HFgBaKH8aCvo X-Proofpoint-GUID: jfpN8sIrYrNxRGfnDqK0HFgBaKH8aCvo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-26_04,2023-09-25_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 From: Aakash Sasidharan For cipher only zero length packets, submit it to CPT with passthrough opcode. Signed-off-by: Aakash Sasidharan --- drivers/crypto/cnxk/cnxk_se.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index 1fbae54c76..f6884be5ad 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -45,7 +45,8 @@ struct cnxk_se_sess { uint8_t is_sm3 : 1; uint8_t passthrough : 1; uint8_t is_sm4 : 1; - uint8_t rsvd : 2; + uint8_t cipher_only : 1; + uint8_t rsvd : 1; uint8_t cpt_op : 4; uint8_t zsk_flag : 4; uint8_t zs_cipher : 4; @@ -2192,6 +2193,7 @@ fill_sess_cipher(struct rte_crypto_sym_xform *xform, struct cnxk_se_sess *sess) } } + sess->cipher_only = 1; sess->zsk_flag = zsk_flag; sess->zs_cipher = zs_cipher; sess->aes_gcm = 0; @@ -3308,9 +3310,19 @@ static __rte_always_inline int __rte_hot cpt_sym_inst_fill(struct cnxk_cpt_qp *qp, struct rte_crypto_op *op, struct cnxk_se_sess *sess, struct cpt_inflight_req *infl_req, struct cpt_inst_s *inst, const bool is_sg_ver2) { + enum cpt_dp_thread_type dp_thr_type; int ret; - switch (sess->dp_thr_type) { + dp_thr_type = sess->dp_thr_type; + + /* + * With cipher only, microcode expects that cipher length is non-zero. To accept such + * instructions, send to CPT as passthrough. + */ + if (unlikely(sess->cipher_only && op->sym->cipher.data.length == 0)) + dp_thr_type = CPT_DP_THREAD_TYPE_PT; + + switch (dp_thr_type) { case CPT_DP_THREAD_TYPE_PT: ret = fill_passthrough_params(op, inst); break; -- 2.25.1