Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/42990/?format=api
http://patches.dpdk.org/api/patches/42990/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1531411499-13156-10-git-send-email-fiona.trahe@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "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", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1531411499-13156-10-git-send-email-fiona.trahe@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1531411499-13156-10-git-send-email-fiona.trahe@intel.com", "date": "2018-07-12T16:04:52", "name": "[v6,09/16] compress/qat: add fns to configure and clear device", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7a96e4ac0a0af467d7f7451cc426b4f260b8eded", "submitter": { "id": 423, "url": "http://patches.dpdk.org/api/people/423/?format=api", "name": "Fiona Trahe", "email": "fiona.trahe@intel.com" }, "delegate": { "id": 22, "url": "http://patches.dpdk.org/api/users/22/?format=api", "username": "pdelarag", "first_name": "Pablo", "last_name": "de Lara Guarch", "email": "pablo.de.lara.guarch@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1531411499-13156-10-git-send-email-fiona.trahe@intel.com/mbox/", "series": [ { "id": 520, "url": "http://patches.dpdk.org/api/series/520/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=520", "date": "2018-07-11T11:56:53", "name": "compress/qat: add compression PMD", "version": 5, "mbox": "http://patches.dpdk.org/series/520/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/42990/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/42990/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6386C1B509;\n\tThu, 12 Jul 2018 18:05:40 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 4206F1B4E2\n\tfor <dev@dpdk.org>; Thu, 12 Jul 2018 18:05:34 +0200 (CEST)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Jul 2018 09:05:31 -0700", "from sivswdev01.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.45])\n\tby fmsmga006.fm.intel.com with ESMTP; 12 Jul 2018 09:05:21 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,343,1526367600\"; d=\"scan'208\";a=\"245184208\"", "From": "Fiona Trahe <fiona.trahe@intel.com>", "To": "dev@dpdk.org", "Cc": "pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com,\n\ttomaszx.jozwiak@intel.com", "Date": "Thu, 12 Jul 2018 17:04:52 +0100", "Message-Id": "<1531411499-13156-10-git-send-email-fiona.trahe@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<1531310229-17448-1-git-send-email-fiona.trahe@intel.com>", "References": "<1531310229-17448-1-git-send-email-fiona.trahe@intel.com>", "Subject": "[dpdk-dev] [PATCH v6 09/16] compress/qat: add fns to configure and\n\tclear device", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add functions to configure and clear the qat comp device,\nincluding the creation and freeing of the xform pool\nand the freeing of queue-pairs.\n\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\nSigned-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>\n---\n drivers/compress/qat/qat_comp_pmd.c | 95 +++++++++++++++++++++++++++++++++++++\n drivers/compress/qat/qat_comp_pmd.h | 7 +++\n 2 files changed, 102 insertions(+)", "diff": "diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c\nindex 5ae6caf..beab6e3 100644\n--- a/drivers/compress/qat/qat_comp_pmd.c\n+++ b/drivers/compress/qat/qat_comp_pmd.c\n@@ -99,3 +99,98 @@ qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,\n \n \treturn ret;\n }\n+\n+static struct rte_mempool *\n+qat_comp_create_xform_pool(struct qat_comp_dev_private *comp_dev,\n+\t\t\t uint32_t num_elements)\n+{\n+\tchar xform_pool_name[RTE_MEMPOOL_NAMESIZE];\n+\tstruct rte_mempool *mp;\n+\n+\tsnprintf(xform_pool_name, RTE_MEMPOOL_NAMESIZE,\n+\t\t\t\"%s_xforms\", comp_dev->qat_dev->name);\n+\n+\tQAT_LOG(DEBUG, \"xformpool: %s\", xform_pool_name);\n+\tmp = rte_mempool_lookup(xform_pool_name);\n+\n+\tif (mp != NULL) {\n+\t\tQAT_LOG(DEBUG, \"xformpool already created\");\n+\t\tif (mp->size != num_elements) {\n+\t\t\tQAT_LOG(DEBUG, \"xformpool wrong size - delete it\");\n+\t\t\trte_mempool_free(mp);\n+\t\t\tmp = NULL;\n+\t\t\tcomp_dev->xformpool = NULL;\n+\t\t}\n+\t}\n+\n+\tif (mp == NULL)\n+\t\tmp = rte_mempool_create(xform_pool_name,\n+\t\t\t\tnum_elements,\n+\t\t\t\tqat_comp_xform_size(), 0, 0,\n+\t\t\t\tNULL, NULL, NULL, NULL, rte_socket_id(),\n+\t\t\t\t0);\n+\tif (mp == NULL) {\n+\t\tQAT_LOG(ERR, \"Err creating mempool %s w %d elements of size %d\",\n+\t\t\txform_pool_name, num_elements, qat_comp_xform_size());\n+\t\treturn NULL;\n+\t}\n+\n+\treturn mp;\n+}\n+\n+static void\n+_qat_comp_dev_config_clear(struct qat_comp_dev_private *comp_dev)\n+{\n+\t/* Free private_xform pool */\n+\tif (comp_dev->xformpool) {\n+\t\t/* Free internal mempool for private xforms */\n+\t\trte_mempool_free(comp_dev->xformpool);\n+\t\tcomp_dev->xformpool = NULL;\n+\t}\n+}\n+\n+int\n+qat_comp_dev_config(struct rte_compressdev *dev,\n+\t\tstruct rte_compressdev_config *config)\n+{\n+\tstruct qat_comp_dev_private *comp_dev = dev->data->dev_private;\n+\tint ret = 0;\n+\n+\tif (config->max_nb_streams != 0) {\n+\t\tQAT_LOG(ERR,\n+\t\"QAT device does not support STATEFUL so max_nb_streams must be 0\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tcomp_dev->xformpool = qat_comp_create_xform_pool(comp_dev,\n+\t\t\t\t\tconfig->max_nb_priv_xforms);\n+\tif (comp_dev->xformpool == NULL) {\n+\n+\t\tret = -ENOMEM;\n+\t\tgoto error_out;\n+\t}\n+\treturn 0;\n+\n+error_out:\n+\t_qat_comp_dev_config_clear(comp_dev);\n+\treturn ret;\n+}\n+\n+\n+int\n+qat_comp_dev_close(struct rte_compressdev *dev)\n+{\n+\tint i;\n+\tint ret = 0;\n+\tstruct qat_comp_dev_private *comp_dev = dev->data->dev_private;\n+\n+\tfor (i = 0; i < dev->data->nb_queue_pairs; i++) {\n+\t\tret = qat_comp_qp_release(dev, i);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\t}\n+\n+\t_qat_comp_dev_config_clear(comp_dev);\n+\n+\treturn ret;\n+}\ndiff --git a/drivers/compress/qat/qat_comp_pmd.h b/drivers/compress/qat/qat_comp_pmd.h\nindex 5a4bc31..b10a66f 100644\n--- a/drivers/compress/qat/qat_comp_pmd.h\n+++ b/drivers/compress/qat/qat_comp_pmd.h\n@@ -41,5 +41,12 @@ int\n qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,\n \t\t uint32_t max_inflight_ops, int socket_id);\n \n+int\n+qat_comp_dev_config(struct rte_compressdev *dev,\n+\t\tstruct rte_compressdev_config *config);\n+\n+int\n+qat_comp_dev_close(struct rte_compressdev *dev);\n+\n #endif\n #endif /* _QAT_COMP_PMD_H_ */\n", "prefixes": [ "v6", "09/16" ] }{ "id": 42990, "url": "