DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] common/qat: read slice configuration
@ 2022-08-17  8:10 Arek Kusztal
  0 siblings, 0 replies; only message in thread
From: Arek Kusztal @ 2022-08-17  8:10 UTC (permalink / raw)
  To: dev; +Cc: gakhil, kai.ji, Arek Kusztal

Read slice configuration of QAT capabilities.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/common/qat/qat_device.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index db4b087d2b..d25a696c5e 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -368,6 +368,7 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 			{ SYM_ENQ_THRESHOLD_NAME, 0 },
 			{ ASYM_ENQ_THRESHOLD_NAME, 0 },
 			{ COMP_ENQ_THRESHOLD_NAME, 0 },
+			{ "DISABLE SLICE", 0},
 			{ NULL, 0 },
 	};
 
@@ -390,6 +391,17 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		return -ENODEV;
 	}
 
+	if (qat_pci_dev->qat_dev_gen == QAT_GEN3) {
+		uint32_t capa = 0;
+		const uint32_t offset = 0x4c;
+
+		if (rte_pci_read_config(pci_dev, &capa, 4, offset) < 0) {
+			RTE_LOG(ERR, EAL,
+				"Cannot read slice configuration\n");
+		}
+		qat_dev_cmd_param[4].val |= (0x400 & capa) | (0x800 & capa);
+	}
+
 	sym_ret = qat_sym_dev_create(qat_pci_dev, qat_dev_cmd_param);
 	if (sym_ret == 0) {
 		num_pmds_created++;
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-17  9:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17  8:10 [PATCH] common/qat: read slice configuration Arek Kusztal

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).