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 4D471A034C; Mon, 8 Aug 2022 10:07:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0291942C45; Mon, 8 Aug 2022 10:06:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 392D942C29 for ; Mon, 8 Aug 2022 10:06:27 +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 277LTX4g015930 for ; Mon, 8 Aug 2022 01:06:26 -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=2IejpeZY/nkwaNuPwnjsg58FbpV/xxhag3Aym+WoklQ=; b=NqVONjcYDkWDSebmNK3rK0k3kO21hpcKHlLpynANlWULvvPX/B+9p1qj4b2FItAbdxwh 5vwizUQN6Q76ctncIoh0/qG0cHUHQV8SriyxEycY3EX3KWdN0I+vpveVyVtlQP7A26gA 3sGbKmzr0YJjkpTnIcu44tpHKoTPfA+MTvu6Q3klZ9xOXDPWPtKy323+KvTPgZ73ETPH jI5RZt2N4NGa2TmfDwVGRmB6VpS9gF8YgHyxFAFP5QvJM1WZhmtdGiEEyhVhdGdAq65J R7u3F8AjbK/z+4Azbvkdtr7RZxwxoKJeXL65U0QrijlV9GHBFQjKLtgpxxlRLzR5SvBy oA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3hsnnqnf7e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 08 Aug 2022 01:06:26 -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; Mon, 8 Aug 2022 01:06:24 -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; Mon, 8 Aug 2022 01:06:24 -0700 Received: from BG-LT92004.corp.innovium.com (unknown [10.28.160.62]) by maili.marvell.com (Postfix) with ESMTP id E24D43F7051; Mon, 8 Aug 2022 01:06:22 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Archana Muniganti , Tejasree Kondoj , Subject: [PATCH 07/18] crypto/cnxk: remove MAC len check for AEAD Date: Mon, 8 Aug 2022 13:35:55 +0530 Message-ID: <20220808080606.220-8-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220808080606.220-1-anoobj@marvell.com> References: <20220808080606.220-1-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: AWqPsCUrFXXu864xWNA3MCMUu6ulHR0j X-Proofpoint-GUID: AWqPsCUrFXXu864xWNA3MCMUu6ulHR0j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-08_05,2022-08-05_01,2022-06-22_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 For both AES-GCM and ChaChaPoly, digest size must be non-zero. So remove the conditional handling in the datapath. Signed-off-by: Anoob Joseph --- drivers/crypto/cnxk/cnxk_se.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index 35d074ea34..2c44dba9a0 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -2453,6 +2453,7 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, m_dst = sym_op->m_dst; if (sess->aes_gcm || sess->chacha_poly) { + struct rte_mbuf *m; uint8_t *salt; uint8_t *aad_data; uint16_t aad_len; @@ -2483,20 +2484,19 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, cpt_fc_salt_update(&sess->roc_se_ctx, salt); sess->salt = *(uint32_t *)salt; } - fc_params.iv_buf = salt + 4; - if (likely(sess->mac_len)) { - struct rte_mbuf *m = cpt_m_dst_get(cpt_op, m_src, m_dst); - /* hmac immediately following data is best case */ - if (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + - mc_hash_off != - (uint8_t *)sym_op->aead.digest.data)) { - flags |= ROC_SE_VALID_MAC_BUF; - fc_params.mac_buf.size = sess->mac_len; - fc_params.mac_buf.vaddr = - sym_op->aead.digest.data; - inplace = 0; - } + fc_params.iv_buf = PLT_PTR_ADD(salt, 4); + fc_params.mac_buf.size = 0; + fc_params.mac_buf.vaddr = NULL; + m = cpt_m_dst_get(cpt_op, m_src, m_dst); + + /* Digest immediately following data is best case */ + if (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + mc_hash_off != + (uint8_t *)sym_op->aead.digest.data)) { + flags |= ROC_SE_VALID_MAC_BUF; + fc_params.mac_buf.size = sess->mac_len; + fc_params.mac_buf.vaddr = sym_op->aead.digest.data; + inplace = 0; } } else { uint32_t ci_data_length = sym_op->cipher.data.length; -- 2.25.1