Show a patch.

GET /api/patches/41054/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 41054,
    "url": "http://patches.dpdk.org/api/patches/41054/",
    "web_url": "http://patches.dpdk.org/patch/41054/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<1528892062-4997-21-git-send-email-tomaszx.jozwiak@intel.com>",
    "date": "2018-06-13T12:14:04",
    "name": "[v3,20/38] crypto/qat: move to using new device structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fd99536c009d3c838946fafe71c2f737c68b4472",
    "submitter": {
        "id": 949,
        "url": "http://patches.dpdk.org/api/people/949/",
        "name": "Tomasz Jozwiak",
        "email": "tomaszx.jozwiak@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "http://patches.dpdk.org/api/users/22/",
        "username": "pdelarag",
        "first_name": "Pablo",
        "last_name": "de Lara Guarch",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/41054/mbox/",
    "series": [
        {
            "id": 111,
            "url": "http://patches.dpdk.org/api/series/111/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=111",
            "date": "2018-06-13T12:13:44",
            "name": "crypto/qat: refactor to support multiple services",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/111/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41054/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/41054/checks/",
    "tags": {},
    "headers": {
        "X-Mailer": "git-send-email 2.7.4",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Date": "Wed, 13 Jun 2018 14:14:04 +0200",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "To": "fiona.trahe@intel.com,\n\ttomaszx.jozwiak@intel.com,\n\tdev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org",
        "References": "<1523040732-3290-1-git-send-email-fiona.trahe@intel.com>\n\t<1528892062-4997-1-git-send-email-tomaszx.jozwiak@intel.com>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "Tomasz Jozwiak <tomaszx.jozwiak@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,218,1526367600\"; d=\"scan'208\";a=\"63727757\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D37221EFB2;\n\tWed, 13 Jun 2018 14:15:20 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id F2E431EF8E\n\tfor <dev@dpdk.org>; Wed, 13 Jun 2018 14:15:01 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jun 2018 05:14:58 -0700",
            "from tjozwiax-mobl.ger.corp.intel.com (HELO localhost.localdomain)\n\t([10.103.104.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 13 Jun 2018 05:14:52 -0700"
        ],
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "Subject": "[dpdk-dev] [PATCH v3 20/38] crypto/qat: move to using new device\n\tstructure",
        "In-Reply-To": "<1528892062-4997-1-git-send-email-tomaszx.jozwiak@intel.com>",
        "Message-Id": "<1528892062-4997-21-git-send-email-tomaszx.jozwiak@intel.com>",
        "X-ExtLoop1": "1",
        "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Original-To": "patchwork@dpdk.org"
    },
    "content": "From: Fiona Trahe <fiona.trahe@intel.com>\n\nStruct qat_pmd_private held the data needed by cryptodev, common code\nnow gets most data from struct qat_pci_device instead. qat_pmd_private\nis trimmed to hold only sym crypto data and renamed qat_sym_private\nto reflect its usage.\nSpecifically\n - remove max_nb_queue_pairs from qat_pmd_private, get from qp_hw_data\n - remove max_nb_sesssions from qat_pmd_private as not needed.\n - remove qat_gen from qat_pmd_private, get from qat_pci_device instead.\n - use qat_pci_device throughout common code instead of qat_pmd_private\n - rename qat_pmd_private to qat_sym_dev_private - this now holds only\n   sym-specific data for the cryptodev API\n - extend pci device name to <bdf>_qat for clarity, was just <bdf>\n - update qp mem and cookiepool names to reflect the appropriate device,\n   service and qp.\n - rename qat_dev_info_get() to qat_sym_dev_info_get() as mostly sym,\n   not enough common info to warrant a generic fn.\n\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\n---\n drivers/crypto/qat/qat_device.c        | 17 +++++++-----\n drivers/crypto/qat/qat_device.h        | 37 +++++++++++---------------\n drivers/crypto/qat/qat_qp.c            | 26 +++++++++---------\n drivers/crypto/qat/qat_qp.h            |  4 +--\n drivers/crypto/qat/qat_sym.c           | 11 ++++----\n drivers/crypto/qat/qat_sym.h           |  8 ------\n drivers/crypto/qat/qat_sym_session.c   |  8 +++---\n drivers/crypto/qat/rte_qat_cryptodev.c | 32 +++++++++++-----------\n 8 files changed, 65 insertions(+), 78 deletions(-)",
    "diff": "diff --git a/drivers/crypto/qat/qat_device.c b/drivers/crypto/qat/qat_device.c\nindex 75af1e8bc..8ad3162e1 100644\n--- a/drivers/crypto/qat/qat_device.c\n+++ b/drivers/crypto/qat/qat_device.c\n@@ -57,12 +57,12 @@ int qat_dev_close(struct rte_cryptodev *dev)\n \treturn 0;\n }\n \n-void qat_dev_info_get(struct rte_cryptodev *dev,\n+void qat_sym_dev_info_get(struct rte_cryptodev *dev,\n \t\t\tstruct rte_cryptodev_info *info)\n {\n-\tstruct qat_pmd_private *internals = dev->data->dev_private;\n+\tstruct qat_sym_dev_private *internals = dev->data->dev_private;\n \tconst struct qat_qp_hw_data *sym_hw_qps =\n-\t\tqp_gen_config[internals->qat_dev_gen]\n+\t\tqp_gen_config[internals->qat_dev->qat_dev_gen]\n \t\t\t      .qp_hw_data[QAT_SERVICE_SYMMETRIC];\n \n \tPMD_INIT_FUNC_TRACE();\n@@ -71,7 +71,7 @@ void qat_dev_info_get(struct rte_cryptodev *dev,\n \t\t\tqat_qps_per_service(sym_hw_qps, QAT_SERVICE_SYMMETRIC);\n \t\tinfo->feature_flags = dev->feature_flags;\n \t\tinfo->capabilities = internals->qat_dev_capabilities;\n-\t\tinfo->sym.max_nb_sessions = internals->max_nb_sessions;\n+\t\tinfo->sym.max_nb_sessions = RTE_QAT_PMD_MAX_NB_SESSIONS;\n \t\tinfo->driver_id = cryptodev_qat_driver_id;\n \t\tinfo->pci_dev = RTE_DEV_TO_PCI(dev->device);\n \t}\n@@ -83,6 +83,7 @@ qat_pci_get_dev(uint8_t dev_id)\n {\n \treturn &qat_pci_devices[dev_id];\n }\n+\n static struct qat_pci_device *\n qat_pci_get_named_dev(const char *name)\n {\n@@ -133,7 +134,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)\n \tchar name[QAT_DEV_NAME_MAX_LEN];\n \n \trte_pci_device_name(&pci_dev->addr, name, sizeof(name));\n-\n+\tsnprintf(name+strlen(name), QAT_DEV_NAME_MAX_LEN-strlen(name), \"_qat\");\n \tif (qat_pci_get_named_dev(name) != NULL) {\n \t\tPMD_DRV_LOG(ERR, \"QAT device with name %s already allocated!\",\n \t\t\t\tname);\n@@ -148,6 +149,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)\n \n \tqat_dev = qat_pci_get_dev(qat_dev_id);\n \tsnprintf(qat_dev->name, QAT_DEV_NAME_MAX_LEN, \"%s\", name);\n+\tqat_dev->qat_dev_id = qat_dev_id;\n \tqat_dev->pci_dev = pci_dev;\n \tswitch (qat_dev->pci_dev->id.device_id) {\n \tcase 0x0443:\n@@ -169,8 +171,8 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev)\n \n \tqat_nb_pci_devices++;\n \n-\tPMD_DRV_LOG(DEBUG, \"QAT device %d allocated, total QATs %d\",\n-\t\t\t\tqat_dev_id, qat_nb_pci_devices);\n+\tPMD_DRV_LOG(DEBUG, \"QAT device %d allocated, name %s, total QATs %d\",\n+\t\t\tqat_dev->qat_dev_id, qat_dev->name, qat_nb_pci_devices);\n \n \treturn qat_dev;\n }\n@@ -185,6 +187,7 @@ qat_pci_device_release(struct rte_pci_device *pci_dev)\n \t\treturn -EINVAL;\n \n \trte_pci_device_name(&pci_dev->addr, name, sizeof(name));\n+\tsnprintf(name+strlen(name), QAT_DEV_NAME_MAX_LEN-strlen(name), \"_qat\");\n \tqat_dev = qat_pci_get_named_dev(name);\n \tif (qat_dev != NULL) {\n \ndiff --git a/drivers/crypto/qat/qat_device.h b/drivers/crypto/qat/qat_device.h\nindex d83ad632c..855bf6c1c 100644\n--- a/drivers/crypto/qat/qat_device.h\n+++ b/drivers/crypto/qat/qat_device.h\n@@ -32,30 +32,31 @@ extern int qat_sym_qp_release(struct rte_cryptodev *dev,\n  *  - config data\n  *  - runtime data\n  */\n+struct qat_sym_dev_private;\n struct qat_pci_device {\n \n-\t/* data used by all services */\n+\t/* Data used by all services */\n \tchar name[QAT_DEV_NAME_MAX_LEN];\n \t/**< Name of qat pci device */\n+\tuint8_t qat_dev_id;\n+\t/**< Device instance for this qat pci device */\n \tstruct rte_pci_device *pci_dev;\n \t/**< PCI information. */\n \tenum qat_device_gen qat_dev_gen;\n \t/**< QAT device generation */\n \trte_spinlock_t arb_csr_lock;\n-\t/* protects accesses to the arbiter CSR */\n+\t/**< lock to protect accesses to the arbiter CSR */\n \t__extension__\n \tuint8_t attached : 1;\n \t/**< Flag indicating the device is attached */\n \n-\t/* data relating to symmetric crypto service */\n-\tstruct qat_pmd_private *sym_dev;\n+\t/* Data relating to symmetric crypto service */\n+\tstruct qat_sym_dev_private *sym_dev;\n \t/**< link back to cryptodev private data */\n-\tunsigned int max_nb_sym_queue_pairs;\n-\t/**< Max number of queue pairs supported by device */\n \n-\t/* data relating to compression service */\n+\t/* Data relating to compression service */\n \n-\t/* data relating to asymmetric crypto service */\n+\t/* Data relating to asymmetric crypto service */\n \n };\n \n@@ -64,21 +65,13 @@ struct qat_pci_device {\n  * there can be one of these on each qat_pci_device (VF),\n  * in future there may also be private data structures for other services.\n  */\n-struct qat_pmd_private {\n-\tunsigned int max_nb_queue_pairs;\n-\t/**< Max number of queue pairs supported by device */\n-\tunsigned int max_nb_sessions;\n-\t/**< Max number of sessions supported by device */\n-\tenum qat_device_gen qat_dev_gen;\n-\t/**< QAT device generation */\n-\tconst struct rte_cryptodev_capabilities *qat_dev_capabilities;\n-\t/* QAT device capabilities */\n-\tstruct rte_pci_device *pci_dev;\n-\t/**< PCI information. */\n-\tuint8_t dev_id;\n-\t/**< Device ID for this instance */\n+struct qat_sym_dev_private {\n \tstruct qat_pci_device *qat_dev;\n \t/**< The qat pci device hosting the service */\n+\tuint8_t sym_dev_id;\n+\t/**< Device instance for this rte_cryptodev */\n+\tconst struct rte_cryptodev_capabilities *qat_dev_capabilities;\n+\t/* QAT device symmetric crypto capabilities */\n };\n \n struct qat_gen_hw_data {\n@@ -93,7 +86,7 @@ int qat_dev_config(struct rte_cryptodev *dev,\n int qat_dev_start(struct rte_cryptodev *dev);\n void qat_dev_stop(struct rte_cryptodev *dev);\n int qat_dev_close(struct rte_cryptodev *dev);\n-void qat_dev_info_get(struct rte_cryptodev *dev,\n+void qat_sym_dev_info_get(struct rte_cryptodev *dev,\n \tstruct rte_cryptodev_info *info);\n \n struct qat_pci_device *\ndiff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c\nindex 656645e4c..869140fc0 100644\n--- a/drivers/crypto/qat/qat_qp.c\n+++ b/drivers/crypto/qat/qat_qp.c\n@@ -102,7 +102,7 @@ const struct qat_qp_hw_data qat_gen1_qps[QAT_MAX_SERVICES]\n static int qat_qp_check_queue_alignment(uint64_t phys_addr,\n \tuint32_t queue_size_bytes);\n static void qat_queue_delete(struct qat_queue *queue);\n-static int qat_queue_create(struct qat_pmd_private *qat_dev,\n+static int qat_queue_create(struct qat_pci_device *qat_dev,\n \tstruct qat_queue *queue, struct qat_qp_config *, uint8_t dir);\n static int adf_verify_queue_size(uint32_t msg_size, uint32_t msg_num,\n \tuint32_t *queue_size_for_csr);\n@@ -153,7 +153,7 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,\n \t\tsocket_id, RTE_MEMZONE_IOVA_CONTIG, queue_size);\n }\n \n-int qat_qp_setup(struct qat_pmd_private *qat_dev,\n+int qat_qp_setup(struct qat_pci_device *qat_dev,\n \t\tstruct qat_qp **qp_addr,\n \t\tuint16_t queue_pair_id,\n \t\tstruct qat_qp_config *qat_qp_conf)\n@@ -164,8 +164,8 @@ int qat_qp_setup(struct qat_pmd_private *qat_dev,\n \tchar op_cookie_pool_name[RTE_RING_NAMESIZE];\n \tuint32_t i;\n \n-\tPMD_DRV_LOG(DEBUG, \"Setup qp %u on device %d gen %d\",\n-\t\t\tqueue_pair_id, qat_dev->dev_id, qat_dev->qat_dev_gen);\n+\tPMD_DRV_LOG(DEBUG, \"Setup qp %u on qat pci device %d gen %d\",\n+\t\tqueue_pair_id, qat_dev->qat_dev_id, qat_dev->qat_dev_gen);\n \n \tif ((qat_qp_conf->nb_descriptors > ADF_MAX_DESC) ||\n \t\t(qat_qp_conf->nb_descriptors < ADF_MIN_DESC)) {\n@@ -218,10 +218,12 @@ int qat_qp_setup(struct qat_pmd_private *qat_dev,\n \tadf_configure_queues(qp);\n \tadf_queue_arb_enable(&qp->tx_q, qp->mmap_bar_addr);\n \n-\tsnprintf(op_cookie_pool_name, RTE_RING_NAMESIZE, \"%s_%s_qp_op_%d_%hu\",\n-\t\tpci_dev->driver->driver.name, qat_qp_conf->service_str,\n-\t\tqat_dev->dev_id, queue_pair_id);\n+\tsnprintf(op_cookie_pool_name, RTE_RING_NAMESIZE,\n+\t\t\t\t\t\"%s%d_cookies_%s_qp%hu\",\n+\t\tpci_dev->driver->driver.name, qat_dev->qat_dev_id,\n+\t\tqat_qp_conf->service_str, queue_pair_id);\n \n+\tPMD_DRV_LOG(DEBUG, \"cookiepool: %s\", op_cookie_pool_name);\n \tqp->op_cookie_pool = rte_mempool_lookup(op_cookie_pool_name);\n \tif (qp->op_cookie_pool == NULL)\n \t\tqp->op_cookie_pool = rte_mempool_create(op_cookie_pool_name,\n@@ -270,7 +272,7 @@ int qat_qp_release(struct qat_qp **qp_addr)\n \t}\n \n \tPMD_DRV_LOG(DEBUG, \"Free qp on qat_pci device %d\",\n-\t\t\tqp->qat_dev->dev_id);\n+\t\t\t\tqp->qat_dev->qat_dev_id);\n \n \t/* Don't free memory if there are still responses to be processed */\n \tif (qp->inflights16 == 0) {\n@@ -322,7 +324,7 @@ static void qat_queue_delete(struct qat_queue *queue)\n }\n \n static int\n-qat_queue_create(struct qat_pmd_private *qat_dev, struct qat_queue *queue,\n+qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,\n \t\tstruct qat_qp_config *qp_conf, uint8_t dir)\n {\n \tuint64_t queue_base;\n@@ -347,9 +349,9 @@ qat_queue_create(struct qat_pmd_private *qat_dev, struct qat_queue *queue,\n \t * Allocate a memzone for the queue - create a unique name.\n \t */\n \tsnprintf(queue->memz_name, sizeof(queue->memz_name),\n-\t\t\"%s_%s_%s_%d_%d_%d\",\n-\t\tpci_dev->driver->driver.name, qp_conf->service_str,\n-\t\t\"qp_mem\", qat_dev->dev_id,\n+\t\t\t\"%s_%d_%s_%s_%d_%d\",\n+\t\tpci_dev->driver->driver.name, qat_dev->qat_dev_id,\n+\t\tqp_conf->service_str, \"qp_mem\",\n \t\tqueue->hw_bundle_number, queue->hw_queue_number);\n \tqp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes,\n \t\t\tqp_conf->socket_id);\ndiff --git a/drivers/crypto/qat/qat_qp.h b/drivers/crypto/qat/qat_qp.h\nindex f808e16a5..d482d5732 100644\n--- a/drivers/crypto/qat/qat_qp.h\n+++ b/drivers/crypto/qat/qat_qp.h\n@@ -85,7 +85,7 @@ struct qat_qp {\n \tenum qat_device_gen qat_dev_gen;\n \tbuild_request_t build_request;\n \tprocess_response_t process_response;\n-\tstruct qat_pmd_private *qat_dev;\n+\tstruct qat_pci_device *qat_dev;\n \t/**< qat device this qp is on */\n } __rte_cache_aligned;\n \n@@ -101,7 +101,7 @@ int\n qat_qp_release(struct qat_qp **qp_addr);\n \n int\n-qat_qp_setup(struct qat_pmd_private *qat_dev,\n+qat_qp_setup(struct qat_pci_device *qat_dev,\n \t\tstruct qat_qp **qp_addr, uint16_t queue_pair_id,\n \t\tstruct qat_qp_config *qat_qp_conf);\n \ndiff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c\nindex b74dfa634..e77fbe4c4 100644\n--- a/drivers/crypto/qat/qat_sym.c\n+++ b/drivers/crypto/qat/qat_sym.c\n@@ -204,7 +204,7 @@ qat_sym_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,\n \treturn qat_enqueue_op_burst(qp, (void **)ops, nb_ops);\n }\n \n-int\n+static int\n qat_sym_process_response(void **op, uint8_t *resp,\n \t\t__rte_unused void *op_cookie,\n \t\t__rte_unused enum qat_device_gen qat_dev_gen)\n@@ -293,8 +293,7 @@ set_cipher_iv_ccm(uint16_t iv_length, uint16_t iv_offset,\n \t\t\tiv_length);\n }\n \n-\n-int\n+static int\n qat_sym_build_request(void *in_op, uint8_t *out_msg,\n \t\tvoid *op_cookie, enum qat_device_gen qat_dev_gen)\n {\n@@ -773,9 +772,9 @@ int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,\n \n \tstruct qat_qp **qp_addr =\n \t\t\t(struct qat_qp **)&(dev->data->queue_pairs[qp_id]);\n-\tstruct qat_pmd_private *qat_private = dev->data->dev_private;\n+\tstruct qat_sym_dev_private *qat_private = dev->data->dev_private;\n \tconst struct qat_qp_hw_data *sym_hw_qps =\n-\t\t\tqp_gen_config[qat_private->qat_dev_gen]\n+\t\t\tqp_gen_config[qat_private->qat_dev->qat_dev_gen]\n \t\t\t\t      .qp_hw_data[QAT_SERVICE_SYMMETRIC];\n \tconst struct qat_qp_hw_data *qp_hw_data = sym_hw_qps + qp_id;\n \n@@ -798,7 +797,7 @@ int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,\n \tqat_qp_conf.socket_id = socket_id;\n \tqat_qp_conf.service_str = \"sym\";\n \n-\tret = qat_qp_setup(qat_private, qp_addr, qp_id, &qat_qp_conf);\n+\tret = qat_qp_setup(qat_private->qat_dev, qp_addr, qp_id, &qat_qp_conf);\n \tif (ret != 0)\n \t\treturn ret;\n \ndiff --git a/drivers/crypto/qat/qat_sym.h b/drivers/crypto/qat/qat_sym.h\nindex 37bec3ce3..78b40e378 100644\n--- a/drivers/crypto/qat/qat_sym.h\n+++ b/drivers/crypto/qat/qat_sym.h\n@@ -29,14 +29,6 @@ struct qat_sym_op_cookie {\n \tphys_addr_t qat_sgl_dst_phys_addr;\n };\n \n-int\n-qat_sym_build_request(void *in_op, uint8_t *out_msg,\n-\t\tvoid *op_cookie, enum qat_device_gen qat_dev_gen);\n-\n-int\n-qat_sym_process_response(void **op, uint8_t *resp,\n-\t\t__rte_unused void *op_cookie, enum qat_device_gen qat_dev_gen);\n-\n void qat_sym_stats_get(struct rte_cryptodev *dev,\n \tstruct rte_cryptodev_stats *stats);\n void qat_sym_stats_reset(struct rte_cryptodev *dev);\ndiff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c\nindex a08e93037..68d7773a2 100644\n--- a/drivers/crypto/qat/qat_sym_session.c\n+++ b/drivers/crypto/qat/qat_sym_session.c\n@@ -64,7 +64,7 @@ bpi_cipher_ctx_init(enum rte_crypto_cipher_algorithm cryptodev_algo,\n \n static int\n qat_is_cipher_alg_supported(enum rte_crypto_cipher_algorithm algo,\n-\t\tstruct qat_pmd_private *internals)\n+\t\tstruct qat_sym_dev_private *internals)\n {\n \tint i = 0;\n \tconst struct rte_cryptodev_capabilities *capability;\n@@ -85,7 +85,7 @@ qat_is_cipher_alg_supported(enum rte_crypto_cipher_algorithm algo,\n \n static int\n qat_is_auth_alg_supported(enum rte_crypto_auth_algorithm algo,\n-\t\tstruct qat_pmd_private *internals)\n+\t\tstruct qat_sym_dev_private *internals)\n {\n \tint i = 0;\n \tconst struct rte_cryptodev_capabilities *capability;\n@@ -201,7 +201,7 @@ qat_sym_session_configure_cipher(struct rte_cryptodev *dev,\n \t\tstruct rte_crypto_sym_xform *xform,\n \t\tstruct qat_sym_session *session)\n {\n-\tstruct qat_pmd_private *internals = dev->data->dev_private;\n+\tstruct qat_sym_dev_private *internals = dev->data->dev_private;\n \tstruct rte_crypto_cipher_xform *cipher_xform = NULL;\n \tint ret;\n \n@@ -495,7 +495,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,\n \t\t\t\tstruct qat_sym_session *session)\n {\n \tstruct rte_crypto_auth_xform *auth_xform = qat_get_auth_xform(xform);\n-\tstruct qat_pmd_private *internals = dev->data->dev_private;\n+\tstruct qat_sym_dev_private *internals = dev->data->dev_private;\n \tuint8_t *key_data = auth_xform->key.data;\n \tuint8_t key_length = auth_xform->key.length;\n \ndiff --git a/drivers/crypto/qat/rte_qat_cryptodev.c b/drivers/crypto/qat/rte_qat_cryptodev.c\nindex ad8a56374..6d807177e 100644\n--- a/drivers/crypto/qat/rte_qat_cryptodev.c\n+++ b/drivers/crypto/qat/rte_qat_cryptodev.c\n@@ -33,7 +33,7 @@ static struct rte_cryptodev_ops crypto_qat_ops = {\n \t\t.dev_start\t\t= qat_dev_start,\n \t\t.dev_stop\t\t= qat_dev_stop,\n \t\t.dev_close\t\t= qat_dev_close,\n-\t\t.dev_infos_get\t\t= qat_dev_info_get,\n+\t\t.dev_infos_get\t\t= qat_sym_dev_info_get,\n \n \t\t.stats_get\t\t= qat_sym_stats_get,\n \t\t.stats_reset\t\t= qat_sym_stats_reset,\n@@ -77,12 +77,12 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)\n \tstruct rte_cryptodev_pmd_init_params init_params = {\n \t\t\t.name = \"\",\n \t\t\t.socket_id = qat_pci_dev->pci_dev->device.numa_node,\n-\t\t\t.private_data_size = sizeof(struct qat_pmd_private),\n+\t\t\t.private_data_size = sizeof(struct qat_sym_dev_private),\n \t\t\t.max_nb_sessions = RTE_QAT_PMD_MAX_NB_SESSIONS\n \t};\n \tchar name[RTE_CRYPTODEV_NAME_MAX_LEN];\n \tstruct rte_cryptodev *cryptodev;\n-\tstruct qat_pmd_private *internals;\n+\tstruct qat_sym_dev_private *internals;\n \n \tsnprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, \"%s_%s\",\n \t\t\tqat_pci_dev->name, \"sym\");\n@@ -109,27 +109,25 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)\n \tinternals->qat_dev = qat_pci_dev;\n \tqat_pci_dev->sym_dev = internals;\n \n-\tinternals->max_nb_sessions = init_params.max_nb_sessions;\n-\tinternals->pci_dev = RTE_DEV_TO_PCI(cryptodev->device);\n-\tinternals->dev_id = cryptodev->data->dev_id;\n-\tswitch (internals->pci_dev->id.device_id) {\n-\tcase 0x0443:\n-\t\tinternals->qat_dev_gen = QAT_GEN1;\n+\tinternals->sym_dev_id = cryptodev->data->dev_id;\n+\tswitch (qat_pci_dev->qat_dev_gen) {\n+\tcase QAT_GEN1:\n \t\tinternals->qat_dev_capabilities = qat_gen1_sym_capabilities;\n \t\tbreak;\n-\tcase 0x37c9:\n-\tcase 0x19e3:\n-\tcase 0x6f55:\n-\t\tinternals->qat_dev_gen = QAT_GEN2;\n+\tcase QAT_GEN2:\n \t\tinternals->qat_dev_capabilities = qat_gen2_sym_capabilities;\n \t\tbreak;\n \tdefault:\n-\t\tPMD_DRV_LOG(ERR,\n-\t\t\t\t\"Invalid dev_id, can't determine capabilities\");\n+\t\tinternals->qat_dev_capabilities = qat_gen2_sym_capabilities;\n+\t\tPMD_DRV_LOG(DEBUG,\n+\t\t\t\"QAT gen %d capabilities unknown, default to GEN2\",\n+\t\t\t\t\tqat_pci_dev->qat_dev_gen);\n \t\tbreak;\n \t}\n \n-\t\treturn 0;\n+\tPMD_DRV_LOG(DEBUG, \"Created QAT SYM device %s as cryptodev instance %d\",\n+\t\t\tname, internals->sym_dev_id);\n+\treturn 0;\n }\n \n static int\n@@ -143,7 +141,7 @@ qat_sym_dev_destroy(struct qat_pci_device *qat_pci_dev)\n \t\treturn 0;\n \n \t/* free crypto device */\n-\tcryptodev = rte_cryptodev_pmd_get_dev(qat_pci_dev->sym_dev->dev_id);\n+\tcryptodev = rte_cryptodev_pmd_get_dev(qat_pci_dev->sym_dev->sym_dev_id);\n \trte_cryptodev_pmd_destroy(cryptodev);\n \tqat_pci_dev->sym_dev = NULL;\n \n",
    "prefixes": [
        "v3",
        "20/38"
    ]
}