crypto/qat: check for service type
authorFiona Trahe <fiona.trahe@intel.com>
Wed, 13 Jun 2018 12:14:20 +0000 (14:14 +0200)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 27 Jun 2018 23:25:33 +0000 (01:25 +0200)
Other services, apart from symmetric crypto,
such as compression, will be added in future patches.
Therefore, the assumption that only symmetric crypto
operations are processed will not be valid anymore,
and service type needs to be checked.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
drivers/crypto/qat/qat_qp.c
drivers/crypto/qat/qat_qp.h

index b190f2c..f9d3762 100644 (file)
@@ -239,6 +239,7 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 
        qp->qat_dev_gen = qat_dev->qat_dev_gen;
        qp->build_request = qat_qp_conf->build_request;
+       qp->service_type = qat_qp_conf->hw->service_type;
        qp->qat_dev = qat_dev;
 
        PMD_DRV_LOG(DEBUG, "QP setup complete: id: %d, cookiepool: %s",
@@ -612,7 +613,10 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)
        while (*(uint32_t *)resp_msg != ADF_RING_EMPTY_SIG &&
                        resp_counter != nb_ops) {
 
-               qat_sym_process_response(ops, resp_msg);
+               if (tmp_qp->service_type == QAT_SERVICE_SYMMETRIC)
+                       qat_sym_process_response(ops, resp_msg);
+               /* add qat_asym_process_response here */
+               /* add qat_comp_process_response here */
 
                head = adf_modulo(head + rx_queue->msg_size,
                                  rx_queue->modulo_mask);
index 0b3d6d3..59db945 100644 (file)
@@ -79,6 +79,7 @@ struct qat_qp {
        uint32_t nb_descriptors;
        enum qat_device_gen qat_dev_gen;
        build_request_t build_request;
+       enum qat_service_type service_type;
        struct qat_pci_device *qat_dev;
        /**< qat device this qp is on */
 } __rte_cache_aligned;