DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adam Dybkowski <adamx.dybkowski@intel.com>
To: dev@dpdk.org, fiona.trahe@intel.com, akhil.goyal@nxp.com,
	arturx.trybula@intel.com
Cc: Adam Dybkowski <adamx.dybkowski@intel.com>
Subject: [dpdk-dev] [PATCH 1/4] common/qat: add QAT RAM bank definitions
Date: Mon, 26 Aug 2019 09:44:58 +0200	[thread overview]
Message-ID: <20190826074501.10653-1-adamx.dybkowski@intel.com> (raw)

This patch adds QAT RAM bank definitions and related macros.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
 drivers/common/qat/qat_adf/icp_qat_fw_comp.h | 73 ++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/drivers/common/qat/qat_adf/icp_qat_fw_comp.h b/drivers/common/qat/qat_adf/icp_qat_fw_comp.h
index 813817720..c89a2c2fd 100644
--- a/drivers/common/qat/qat_adf/icp_qat_fw_comp.h
+++ b/drivers/common/qat/qat_adf/icp_qat_fw_comp.h
@@ -479,4 +479,77 @@ struct icp_qat_fw_comp_resp {
 	/**< Common response params (checksums and byte counts) */
 };
 
+/* RAM Bank definitions */
+#define QAT_FW_COMP_BANK_FLAG_MASK 0x1
+
+#define QAT_FW_COMP_BANK_I_BITPOS 8
+#define QAT_FW_COMP_BANK_H_BITPOS 7
+#define QAT_FW_COMP_BANK_G_BITPOS 6
+#define QAT_FW_COMP_BANK_F_BITPOS 5
+#define QAT_FW_COMP_BANK_E_BITPOS 4
+#define QAT_FW_COMP_BANK_D_BITPOS 3
+#define QAT_FW_COMP_BANK_C_BITPOS 2
+#define QAT_FW_COMP_BANK_B_BITPOS 1
+#define QAT_FW_COMP_BANK_A_BITPOS 0
+
+/**
+ *****************************************************************************
+ * @ingroup icp_qat_fw_comp
+ *      Definition of the ram bank enabled values
+ * @description
+ *      Enumeration used to define whether a ram bank is enabled or not
+ *
+ *****************************************************************************/
+enum icp_qat_fw_comp_bank_enabled {
+	ICP_QAT_FW_COMP_BANK_DISABLED = 0, /*!< BANK DISABLED */
+	ICP_QAT_FW_COMP_BANK_ENABLED = 1,  /*!< BANK ENABLED */
+	ICP_QAT_FW_COMP_BANK_DELIMITER = 2 /**< Delimiter type */
+};
+
+/**
+ ******************************************************************************
+ * @ingroup icp_qat_fw_comp
+ *
+ * @description
+ *      Build the ram bank flags in the compression content descriptor
+ *      which specify which banks are used to save history
+ *
+ * @param bank_i_enable
+ * @param bank_h_enable
+ * @param bank_g_enable
+ * @param bank_f_enable
+ * @param bank_e_enable
+ * @param bank_d_enable
+ * @param bank_c_enable
+ * @param bank_b_enable
+ * @param bank_a_enable
+ *****************************************************************************/
+#define ICP_QAT_FW_COMP_RAM_FLAGS_BUILD(bank_i_enable,                         \
+					bank_h_enable,                         \
+					bank_g_enable,                         \
+					bank_f_enable,                         \
+					bank_e_enable,                         \
+					bank_d_enable,                         \
+					bank_c_enable,                         \
+					bank_b_enable,                         \
+					bank_a_enable)                         \
+	((((bank_i_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                         \
+		<< QAT_FW_COMP_BANK_I_BITPOS) |                                \
+	(((bank_h_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_H_BITPOS) |                                \
+	(((bank_g_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_G_BITPOS) |                                \
+	(((bank_f_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_F_BITPOS) |                                \
+	(((bank_e_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_E_BITPOS) |                                \
+	(((bank_d_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_D_BITPOS) |                                \
+	(((bank_c_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_C_BITPOS) |                                \
+	(((bank_b_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_B_BITPOS) |                                \
+	(((bank_a_enable)&QAT_FW_COMP_BANK_FLAG_MASK)                          \
+		<< QAT_FW_COMP_BANK_A_BITPOS))
+
 #endif
-- 
2.17.1


             reply	other threads:[~2019-09-02 14:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26  7:44 Adam Dybkowski [this message]
2019-08-26  7:44 ` [dpdk-dev] [PATCH 2/4] compress/qat: add stateful decompression Adam Dybkowski
2019-09-20 10:09   ` Trahe, Fiona
2019-08-26  7:45 ` [dpdk-dev] [PATCH 3/4] test/compress: add stateful decompression tests Adam Dybkowski
2019-08-26  7:45 ` [dpdk-dev] [PATCH 4/4] doc/guides: add stateful feature in QAT Adam Dybkowski
2019-09-19 13:34   ` Akhil Goyal
2019-09-19 13:38     ` Akhil Goyal
2019-09-20 12:44 ` [dpdk-dev] [PATCH v2 0/3] compress/qat: add stateful decompression Adam Dybkowski
2019-09-20 12:44   ` [dpdk-dev] [PATCH v2 1/3] common/qat: add QAT RAM bank definitions Adam Dybkowski
2019-09-20 20:06     ` [dpdk-dev] [PATCH v3 0/3] compress/qat: add stateful decompression Adam Dybkowski
2019-09-20 20:06       ` [dpdk-dev] [PATCH v3 1/3] common/qat: add QAT RAM bank definitions Adam Dybkowski
2019-09-24 11:16         ` Trahe, Fiona
2019-09-20 20:06       ` [dpdk-dev] [PATCH v3 2/3] compress/qat: add stateful decompression Adam Dybkowski
2019-09-24 11:17         ` Trahe, Fiona
2019-09-20 20:06       ` [dpdk-dev] [PATCH v3 3/3] test/compress: add stateful decompression tests Adam Dybkowski
2019-09-24 11:18         ` Trahe, Fiona
2019-09-23 15:56       ` [dpdk-dev] [PATCH v3 0/3] compress/qat: add stateful decompression Trahe, Fiona
2019-09-27 14:42         ` Akhil Goyal
2019-09-20 12:44   ` [dpdk-dev] [PATCH v2 2/3] " Adam Dybkowski
2019-09-23  9:46     ` Trahe, Fiona
2019-09-20 12:44   ` [dpdk-dev] [PATCH v2 3/3] test/compress: add stateful decompression tests Adam Dybkowski
  -- strict thread matches above, loose matches on Subject: below --
2019-08-26  7:33 [dpdk-dev] [PATCH 1/4] common/qat: add QAT RAM bank definitions Adam Dybkowski
2019-08-26  7:13 Adam Dybkowski

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=20190826074501.10653-1-adamx.dybkowski@intel.com \
    --to=adamx.dybkowski@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=arturx.trybula@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@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).