Show a patch.

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

{
    "id": 41045,
    "url": "http://patches.dpdk.org/api/patches/41045/",
    "web_url": "http://patches.dpdk.org/patch/41045/",
    "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-13-git-send-email-tomaszx.jozwiak@intel.com>",
    "date": "2018-06-13T12:13:56",
    "name": "[v3,12/38] crypto/qat: move sym-specific qp code to sym file",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a3be8993b44a3f8c5965122da5b9a88bb382ef8b",
    "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/41045/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/41045/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/41045/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:13:56 +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=\"63727699\"",
        "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 C80641EF87;\n\tWed, 13 Jun 2018 14:14:51 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 724331EF44\n\tfor <dev@dpdk.org>; Wed, 13 Jun 2018 14:14:43 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jun 2018 05:14:43 -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:42 -0700"
        ],
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-Amp-File-Uploaded": "False",
        "Subject": "[dpdk-dev] [PATCH v3 12/38] crypto/qat: move sym-specific qp code\n\tto sym file",
        "In-Reply-To": "<1528892062-4997-1-git-send-email-tomaszx.jozwiak@intel.com>",
        "Message-Id": "<1528892062-4997-13-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\nMove sym qp setup code from qat_qp.c to qat_sym.c\n\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\n---\n drivers/crypto/qat/qat_qp.c  | 78 ++----------------------------------\n drivers/crypto/qat/qat_qp.h  |  6 +++\n drivers/crypto/qat/qat_sym.c | 75 ++++++++++++++++++++++++++++++++++\n 3 files changed, 84 insertions(+), 75 deletions(-)",
    "diff": "diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c\nindex 5a543f6cb..d1d2be34f 100644\n--- a/drivers/crypto/qat/qat_qp.c\n+++ b/drivers/crypto/qat/qat_qp.c\n@@ -20,11 +20,7 @@\n \n #define ADF_MAX_DESC\t\t\t\t4096\n #define ADF_MIN_DESC\t\t\t\t128\n-#define ADF_SYM_TX_RING_DESC_SIZE\t\t128\n-#define ADF_SYM_RX_RING_DESC_SIZE\t\t32\n-#define ADF_SYM_TX_QUEUE_STARTOFF\t\t2\n-/* Offset from bundle start to 1st Sym Tx queue */\n-#define ADF_SYM_RX_QUEUE_STARTOFF\t\t10\n+\n #define ADF_ARB_REG_SLOT\t\t\t0x1000\n #define ADF_ARB_RINGSRVARBEN_OFFSET\t\t0x19C\n \n@@ -74,7 +70,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-static int qat_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,\n+int qat_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,\n \t\tstruct qat_qp_config *qat_qp_conf)\n {\n \tstruct qat_qp *qp;\n@@ -174,71 +170,7 @@ static int qat_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,\n \treturn -EFAULT;\n }\n \n-\n-\n-int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,\n-\tconst struct rte_cryptodev_qp_conf *qp_conf,\n-\tint socket_id, struct rte_mempool *session_pool __rte_unused)\n-{\n-\tstruct qat_qp *qp;\n-\tint ret = 0;\n-\tuint32_t i;\n-\tstruct qat_qp_config qat_qp_conf;\n-\n-\t/* If qp is already in use free ring memory and qp metadata. */\n-\tif (dev->data->queue_pairs[qp_id] != NULL) {\n-\t\tret = qat_sym_qp_release(dev, qp_id);\n-\t\tif (ret < 0)\n-\t\t\treturn ret;\n-\t}\n-\tif (qp_id >= (ADF_NUM_SYM_QPS_PER_BUNDLE *\n-\t\t\t\t\tADF_NUM_BUNDLES_PER_DEV)) {\n-\t\tPMD_DRV_LOG(ERR, \"qp_id %u invalid for this device\", qp_id);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\n-\tqat_qp_conf.hw_bundle_num = (qp_id/ADF_NUM_SYM_QPS_PER_BUNDLE);\n-\tqat_qp_conf.tx_ring_num = (qp_id%ADF_NUM_SYM_QPS_PER_BUNDLE) +\n-\t\t\tADF_SYM_TX_QUEUE_STARTOFF;\n-\tqat_qp_conf.rx_ring_num = (qp_id%ADF_NUM_SYM_QPS_PER_BUNDLE) +\n-\t\t\tADF_SYM_RX_QUEUE_STARTOFF;\n-\tqat_qp_conf.tx_msg_size = ADF_SYM_TX_RING_DESC_SIZE;\n-\tqat_qp_conf.rx_msg_size = ADF_SYM_RX_RING_DESC_SIZE;\n-\tqat_qp_conf.build_request = qat_sym_build_request;\n-\tqat_qp_conf.process_response = qat_sym_process_response;\n-\tqat_qp_conf.cookie_size = sizeof(struct qat_sym_op_cookie);\n-\tqat_qp_conf.nb_descriptors = qp_conf->nb_descriptors;\n-\tqat_qp_conf.socket_id = socket_id;\n-\tqat_qp_conf.service_str = \"sym\";\n-\n-\tret = qat_qp_setup(dev, qp_id, &qat_qp_conf);\n-\tif (ret != 0)\n-\t\treturn ret;\n-\n-\tqp = (struct qat_qp *)dev->data->queue_pairs[qp_id];\n-\n-\tfor (i = 0; i < qp->nb_descriptors; i++) {\n-\n-\t\tstruct qat_sym_op_cookie *sql_cookie =\n-\t\t\t\tqp->op_cookies[i];\n-\n-\t\tsql_cookie->qat_sgl_src_phys_addr =\n-\t\t\t\trte_mempool_virt2iova(sql_cookie) +\n-\t\t\t\toffsetof(struct qat_sym_op_cookie,\n-\t\t\t\tqat_sgl_list_src);\n-\n-\t\tsql_cookie->qat_sgl_dst_phys_addr =\n-\t\t\t\trte_mempool_virt2iova(sql_cookie) +\n-\t\t\t\toffsetof(struct qat_sym_op_cookie,\n-\t\t\t\tqat_sgl_list_dst);\n-\t}\n-\n-\treturn ret;\n-\n-}\n-\n-static int qat_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)\n+int qat_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)\n {\n \tstruct qat_qp *qp =\n \t\t\t(struct qat_qp *)dev->data->queue_pairs[queue_pair_id];\n@@ -273,10 +205,6 @@ static int qat_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)\n }\n \n \n-int qat_sym_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)\n-{\n-\treturn qat_qp_release(dev, queue_pair_id);\n-}\n \n \n static void qat_queue_delete(struct qat_queue *queue)\ndiff --git a/drivers/crypto/qat/qat_qp.h b/drivers/crypto/qat/qat_qp.h\nindex edebb8773..0cdf37f61 100644\n--- a/drivers/crypto/qat/qat_qp.h\n+++ b/drivers/crypto/qat/qat_qp.h\n@@ -77,4 +77,10 @@ qat_enqueue_op_burst(void *qp, void **ops, uint16_t nb_ops);\n uint16_t\n qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops);\n \n+int\n+qat_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id);\n+\n+int\n+qat_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,\n+\t\tstruct qat_qp_config *qat_qp_conf);\n #endif /* _QAT_QP_H_ */\ndiff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c\nindex ab8ce2c96..4f86f2258 100644\n--- a/drivers/crypto/qat/qat_sym.c\n+++ b/drivers/crypto/qat/qat_sym.c\n@@ -23,6 +23,12 @@\n  */\n #define BPI_MAX_ENCR_IV_LEN ICP_QAT_HW_AES_BLK_SZ\n \n+#define ADF_SYM_TX_RING_DESC_SIZE\t\t128\n+#define ADF_SYM_RX_RING_DESC_SIZE\t\t32\n+#define ADF_SYM_TX_QUEUE_STARTOFF\t\t2\n+/* Offset from bundle start to 1st Sym Tx queue */\n+#define ADF_SYM_RX_QUEUE_STARTOFF\t\t10\n+\n /** Encrypt a single partial block\n  *  Depends on openssl libcrypto\n  *  Uses ECB+XOR to do CFB encryption, same result, more performant\n@@ -798,3 +804,72 @@ void qat_sym_stats_reset(struct rte_cryptodev *dev)\n \t\tmemset(&(qp[i]->stats), 0, sizeof(qp[i]->stats));\n \tPMD_DRV_LOG(DEBUG, \"QAT crypto: stats cleared\");\n }\n+\n+\n+\n+int qat_sym_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)\n+{\n+\treturn qat_qp_release(dev, queue_pair_id);\n+}\n+\n+int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,\n+\tconst struct rte_cryptodev_qp_conf *qp_conf,\n+\tint socket_id, struct rte_mempool *session_pool __rte_unused)\n+{\n+\tstruct qat_qp *qp;\n+\tint ret = 0;\n+\tuint32_t i;\n+\tstruct qat_qp_config qat_qp_conf;\n+\n+\t/* If qp is already in use free ring memory and qp metadata. */\n+\tif (dev->data->queue_pairs[qp_id] != NULL) {\n+\t\tret = qat_sym_qp_release(dev, qp_id);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t}\n+\tif (qp_id >= (ADF_NUM_SYM_QPS_PER_BUNDLE *\n+\t\t\t\t\tADF_NUM_BUNDLES_PER_DEV)) {\n+\t\tPMD_DRV_LOG(ERR, \"qp_id %u invalid for this device\", qp_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\n+\tqat_qp_conf.hw_bundle_num = (qp_id/ADF_NUM_SYM_QPS_PER_BUNDLE);\n+\tqat_qp_conf.tx_ring_num = (qp_id%ADF_NUM_SYM_QPS_PER_BUNDLE) +\n+\t\t\tADF_SYM_TX_QUEUE_STARTOFF;\n+\tqat_qp_conf.rx_ring_num = (qp_id%ADF_NUM_SYM_QPS_PER_BUNDLE) +\n+\t\t\tADF_SYM_RX_QUEUE_STARTOFF;\n+\tqat_qp_conf.tx_msg_size = ADF_SYM_TX_RING_DESC_SIZE;\n+\tqat_qp_conf.rx_msg_size = ADF_SYM_RX_RING_DESC_SIZE;\n+\tqat_qp_conf.build_request = qat_sym_build_request;\n+\tqat_qp_conf.process_response = qat_sym_process_response;\n+\tqat_qp_conf.cookie_size = sizeof(struct qat_sym_op_cookie);\n+\tqat_qp_conf.nb_descriptors = qp_conf->nb_descriptors;\n+\tqat_qp_conf.socket_id = socket_id;\n+\tqat_qp_conf.service_str = \"sym\";\n+\n+\tret = qat_qp_setup(dev, qp_id, &qat_qp_conf);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tqp = (struct qat_qp *)dev->data->queue_pairs[qp_id];\n+\n+\tfor (i = 0; i < qp->nb_descriptors; i++) {\n+\n+\t\tstruct qat_sym_op_cookie *sql_cookie =\n+\t\t\t\tqp->op_cookies[i];\n+\n+\t\tsql_cookie->qat_sgl_src_phys_addr =\n+\t\t\t\trte_mempool_virt2iova(sql_cookie) +\n+\t\t\t\toffsetof(struct qat_sym_op_cookie,\n+\t\t\t\tqat_sgl_list_src);\n+\n+\t\tsql_cookie->qat_sgl_dst_phys_addr =\n+\t\t\t\trte_mempool_virt2iova(sql_cookie) +\n+\t\t\t\toffsetof(struct qat_sym_op_cookie,\n+\t\t\t\tqat_sgl_list_dst);\n+\t}\n+\n+\treturn ret;\n+\n+}\n",
    "prefixes": [
        "v3",
        "12/38"
    ]
}