[PATCH 04/11] crypto/cnxk: use direct mode for zero aad length

Tejasree Kondoj ktejasree at marvell.com
Fri Feb 24 06:48:06 CET 2023


Using direct mode if aad length is zero.

Signed-off-by: Tejasree Kondoj <ktejasree at marvell.com>
---
 drivers/crypto/cnxk/cnxk_se.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h
index c16027ec75..69cd343eea 100644
--- a/drivers/crypto/cnxk/cnxk_se.h
+++ b/drivers/crypto/cnxk/cnxk_se.h
@@ -2258,9 +2258,9 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess,
 
 		aad_data = sym_op->aead.aad.data;
 		aad_len = sess->aad_length;
-		if (likely((aad_data + aad_len) ==
-			   rte_pktmbuf_mtod_offset(m_src, uint8_t *,
-						   sym_op->aead.data.offset))) {
+		if (likely((aad_len == 0) ||
+			   ((aad_data + aad_len) ==
+			    rte_pktmbuf_mtod_offset(m_src, uint8_t *, sym_op->aead.data.offset)))) {
 			d_offs = (d_offs - aad_len) | (d_offs << 16);
 			d_lens = (d_lens + aad_len) | (d_lens << 32);
 		} else {
-- 
2.25.1



More information about the dev mailing list