DPDK patches and discussions
 help / color / mirror / Atom feed
From: Arek Kusztal <arkadiuszx.kusztal@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, kai.ji@intel.com, ciara.power@intel.com,
	Arek Kusztal <arkadiuszx.kusztal@intel.com>
Subject: [PATCH 1/2] crypto/qat: add hash mode 2
Date: Wed, 19 Apr 2023 19:51:08 +0000	[thread overview]
Message-ID: <20230419195109.1659341-1-arkadiuszx.kusztal@intel.com> (raw)

This commit adds hash mode 2 to the Intel
QuickAssist Technology symmetric crypto PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/common/qat/qat_adf/icp_qat_fw_la.h | 10 ++++++++++
 drivers/crypto/qat/qat_sym_session.h       |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/drivers/common/qat/qat_adf/icp_qat_fw_la.h b/drivers/common/qat/qat_adf/icp_qat_fw_la.h
index c4901eb869..fe57d8e488 100644
--- a/drivers/common/qat/qat_adf/icp_qat_fw_la.h
+++ b/drivers/common/qat/qat_adf/icp_qat_fw_la.h
@@ -80,6 +80,10 @@ struct icp_qat_fw_la_bulk_req {
 #define ICP_QAT_FW_LA_PARTIAL_END 2
 #define QAT_LA_PARTIAL_BITPOS 0
 #define QAT_LA_PARTIAL_MASK 0x3
+#define QAT_FW_LA_MODE2_BITPOS 5
+#define QAT_FW_LA_MODE2 1
+#define QAT_FW_LA_NO_MODE2 0
+#define QAT_FW_LA_MODE2_MASK 0x1
 #define ICP_QAT_FW_LA_FLAGS_BUILD(zuc_proto, gcm_iv_len, auth_rslt, proto, \
 	cmp_auth, ret_auth, update_state, \
 	ciph_iv, ciphcfg, partial) \
@@ -187,6 +191,12 @@ struct icp_qat_fw_la_bulk_req {
 	QAT_FIELD_SET(flags, val, QAT_LA_PARTIAL_BITPOS, \
 	QAT_LA_PARTIAL_MASK)
 
+#define ICP_QAT_FW_HASH_FLAG_MODE2_SET(flags, val) \
+	QAT_FIELD_SET(flags, \
+		val, \
+		QAT_FW_LA_MODE2_BITPOS, \
+		QAT_FW_LA_MODE2_MASK)
+
 struct icp_qat_fw_cipher_req_hdr_cd_pars {
 	union {
 		struct {
diff --git a/drivers/crypto/qat/qat_sym_session.h b/drivers/crypto/qat/qat_sym_session.h
index 6322d7e3bc..d487bca11f 100644
--- a/drivers/crypto/qat/qat_sym_session.h
+++ b/drivers/crypto/qat/qat_sym_session.h
@@ -47,6 +47,7 @@
 					ICP_QAT_HW_CIPHER_DECRYPT)
 
 #define QAT_AES_CMAC_CONST_RB 0x87
+#define QAT_PREFIX_TABLE_SZ	128
 
 #define QAT_CRYPTO_SLICE_SPC	1
 #define QAT_CRYPTO_SLICE_UCS	2
@@ -77,6 +78,7 @@ typedef int (*qat_sym_build_request_t)(void *in_op, struct qat_sym_session *ctx,
 struct qat_sym_cd {
 	struct icp_qat_hw_cipher_algo_blk cipher;
 	struct icp_qat_hw_auth_algo_blk hash;
+	uint8_t prefix_state[QAT_PREFIX_TABLE_SZ] __rte_cache_aligned;
 } __rte_packed __rte_cache_aligned;
 
 struct qat_sym_session {
-- 
2.25.1


             reply	other threads:[~2023-04-19 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19 19:51 Arek Kusztal [this message]
2023-04-19 19:51 ` [PATCH 2/2] crypto/qat: add sm3 hmac Arek Kusztal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230419195109.1659341-1-arkadiuszx.kusztal@intel.com \
    --to=arkadiuszx.kusztal@intel.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=kai.ji@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).