DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ciara Power <ciara.power@intel.com>
To: dev@dpdk.org
Cc: Ciara Power <ciara.power@intel.com>, Kai Ji <kai.ji@intel.com>
Subject: [PATCH 1/4] crypto/qat: add new gen3 device
Date: Tue, 19 Dec 2023 15:51:20 +0000	[thread overview]
Message-ID: <20231219155124.4133385-2-ciara.power@intel.com> (raw)
In-Reply-To: <20231219155124.4133385-1-ciara.power@intel.com>

Add new gen3 QAT device ID.
This device has a wireless slice, but other gen3 devices do not, so we
must set a flag to indicate this wireless enabled device.

Capabilities for the device are slightly different from base gen3
capabilities, some are removed from the list for this device.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/common/qat/qat_device.c              | 13 +++++++++++++
 drivers/common/qat/qat_device.h              |  2 ++
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 11 +++++++++++
 3 files changed, 26 insertions(+)

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index f55dc3c6f0..0e7d387d78 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -53,6 +53,9 @@ static const struct rte_pci_id pci_id_qat_map[] = {
 		{
 			RTE_PCI_DEVICE(0x8086, 0x18a1),
 		},
+		{
+			RTE_PCI_DEVICE(0x8086, 0x578b),
+		},
 		{
 			RTE_PCI_DEVICE(0x8086, 0x4941),
 		},
@@ -194,6 +197,7 @@ pick_gen(const struct rte_pci_device *pci_dev)
 	case 0x18ef:
 		return QAT_GEN2;
 	case 0x18a1:
+	case 0x578b:
 		return QAT_GEN3;
 	case 0x4941:
 	case 0x4943:
@@ -205,6 +209,12 @@ pick_gen(const struct rte_pci_device *pci_dev)
 	}
 }
 
+static int
+wireless_slice_support(uint16_t pci_dev_id)
+{
+	return pci_dev_id == 0x578b;
+}
+
 struct qat_pci_device *
 qat_pci_device_allocate(struct rte_pci_device *pci_dev,
 		struct qat_dev_cmd_param *qat_dev_cmd_param)
@@ -282,6 +292,9 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev,
 	qat_dev->qat_dev_id = qat_dev_id;
 	qat_dev->qat_dev_gen = qat_dev_gen;
 
+	if (wireless_slice_support(pci_dev->id.device_id))
+		qat_dev->has_wireless_slice = 1;
+
 	ops_hw = qat_dev_hw_spec[qat_dev->qat_dev_gen];
 	NOT_NULL(ops_hw->qat_dev_get_misc_bar, goto error,
 		"QAT internal error! qat_dev_get_misc_bar function not set");
diff --git a/drivers/common/qat/qat_device.h b/drivers/common/qat/qat_device.h
index aa7988bb74..43e4752812 100644
--- a/drivers/common/qat/qat_device.h
+++ b/drivers/common/qat/qat_device.h
@@ -135,6 +135,8 @@ struct qat_pci_device {
 	/**< Per generation specific information */
 	uint32_t slice_map;
 	/**< Map of the crypto and compression slices */
+	uint16_t has_wireless_slice;
+	/**< Wireless Slices supported */
 };
 
 struct qat_gen_hw_data {
diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c b/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c
index 02bcdb06b1..bc53e2e0f1 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c
@@ -255,6 +255,17 @@ qat_sym_crypto_cap_get_gen3(struct qat_cryptodev_private *internals,
 				RTE_CRYPTO_AUTH_SM3_HMAC))) {
 			continue;
 		}
+		if (internals->qat_dev->has_wireless_slice && (
+			check_auth_capa(&capabilities[iter],
+				RTE_CRYPTO_AUTH_KASUMI_F9) ||
+			check_cipher_capa(&capabilities[iter],
+				RTE_CRYPTO_CIPHER_KASUMI_F8) ||
+			check_cipher_capa(&capabilities[iter],
+				RTE_CRYPTO_CIPHER_DES_CBC) ||
+			check_cipher_capa(&capabilities[iter],
+				RTE_CRYPTO_CIPHER_DES_DOCSISBPI)))
+			continue;
+
 		memcpy(addr + curr_capa, capabilities + iter,
 			sizeof(struct rte_cryptodev_capabilities));
 		curr_capa++;
-- 
2.25.1


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

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 15:51 [PATCH 0/4] add new QAT " Ciara Power
2023-12-19 15:51 ` Ciara Power [this message]
2023-12-19 15:51 ` [PATCH 2/4] crypto/qat: add zuc256 wireless slice for gen3 Ciara Power
2023-12-19 15:51 ` [PATCH 3/4] crypto/qat: add new gen3 CMAC macros Ciara Power
2023-12-19 15:51 ` [PATCH 4/4] crypto/qat: disable asym and compression for new gen3 device Ciara Power
2024-02-23 15:12 ` [PATCH v2 0/4] add new QAT gen3 and gen5 Ciara Power
2024-02-23 15:12   ` [PATCH v2 1/4] common/qat: add new gen3 device Ciara Power
2024-02-23 15:12   ` [PATCH v2 2/4] common/qat: add zuc256 wireless slice for gen3 Ciara Power
2024-02-23 15:12   ` [PATCH v2 3/4] common/qat: add new gen3 CMAC macros Ciara Power
2024-02-23 15:12   ` [PATCH v2 4/4] common/qat: add gen5 device Ciara Power
2024-02-26 13:32   ` [PATCH v2 0/4] add new QAT gen3 and gen5 Ji, Kai
2024-02-29  9:48     ` Kusztal, ArkadiuszX
2024-02-26 17:08 ` [PATCH v3 " Ciara Power
2024-02-26 17:08   ` [PATCH v3 1/4] common/qat: add new gen3 device Ciara Power
2024-02-26 17:08   ` [PATCH v3 2/4] common/qat: add zuc256 wireless slice for gen3 Ciara Power
2024-02-26 17:08   ` [PATCH v3 3/4] common/qat: add new gen3 CMAC macros Ciara Power
2024-02-26 17:08   ` [PATCH v3 4/4] common/qat: add gen5 device Ciara Power
2024-02-29 18:53   ` [EXT] [PATCH v3 0/4] add new QAT gen3 and gen5 Akhil Goyal

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=20231219155124.4133385-2-ciara.power@intel.com \
    --to=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --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).