diff mbox series

common/qat: read slice configuration

Message ID 20220817081044.80362-1-arkadiuszx.kusztal@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers show
Series common/qat: read slice configuration | expand

Checks

Context Check Description
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/checkpatch success coding style OK

Commit Message

Arek Kusztal Aug. 17, 2022, 8:10 a.m. UTC
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 mbox series

Patch

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++;