Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/39097/?format=api
https://patches.dpdk.org/api/patches/39097/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180427132407.13385-8-pablo.de.lara.guarch@intel.com/", "project": { "id": 1, "url": "https://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": "<20180427132407.13385-8-pablo.de.lara.guarch@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180427132407.13385-8-pablo.de.lara.guarch@intel.com", "date": "2018-04-27T13:24:00", "name": "[dpdk-dev,v6,07/14] compressdev: support stateful operations", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "90600bd83901f599079d096330d7221e5b66d36b", "submitter": { "id": 9, "url": "https://patches.dpdk.org/api/people/9/?format=api", "name": "De Lara Guarch, Pablo", "email": "pablo.de.lara.guarch@intel.com" }, "delegate": { "id": 22, "url": "https://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": "https://patches.dpdk.org/project/dpdk/patch/20180427132407.13385-8-pablo.de.lara.guarch@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/39097/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/39097/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 220F28E72;\n\tFri, 27 Apr 2018 15:24:21 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby dpdk.org (Postfix) with ESMTP id 141F58DAA\n\tfor <dev@dpdk.org>; Fri, 27 Apr 2018 15:24:08 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Apr 2018 06:24:08 -0700", "from silpixa00399464.ir.intel.com (HELO\n\tsilpixa00399464.ger.corp.intel.com) ([10.237.222.157])\n\tby fmsmga005.fm.intel.com with ESMTP; 27 Apr 2018 06:24:06 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.49,335,1520924400\"; d=\"scan'208\";a=\"223862533\"", "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>", "To": "dev@dpdk.org", "Cc": "fiona.trahe@intel.com, shally.verma@cavium.com, ahmed.mansour@nxp.com,\n\tAshish.Gupta@cavium.com, Pablo de Lara <pablo.de.lara.guarch@intel.com>, \n\tShally Verma <shally.verma@caviumnetworks.com>,\n\tAshish Gupta <ashish.gupta@caviumnetworks.com>", "Date": "Fri, 27 Apr 2018 14:24:00 +0100", "Message-Id": "<20180427132407.13385-8-pablo.de.lara.guarch@intel.com>", "X-Mailer": "git-send-email 2.14.3", "In-Reply-To": "<20180427132407.13385-1-pablo.de.lara.guarch@intel.com>", "References": "<1517595924-25963-1-git-send-email-fiona.trahe@intel.com>\n\t<20180427132407.13385-1-pablo.de.lara.guarch@intel.com>", "Subject": "[dpdk-dev] [PATCH v6 07/14] compressdev: support stateful operations", "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Fiona Trahe <fiona.trahe@intel.com>\n\nAdded stream data (stream) in compression operation,\nwhich will contain the private data from each PMD\nto support stateful operations.\nAlso, added functions to create/free this data.\n\nSigned-off-by: Fiona Trahe <fiona.trahe@intel.com>\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\nSigned-off-by: Shally Verma <shally.verma@caviumnetworks.com>\nSigned-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>\n---\n lib/librte_compressdev/rte_compressdev.c | 49 +++++++++++++++++++++\n lib/librte_compressdev/rte_compressdev.h | 50 ++++++++++++++++++++++\n lib/librte_compressdev/rte_compressdev_pmd.h | 41 ++++++++++++++++++\n lib/librte_compressdev/rte_compressdev_version.map | 2 +\n 4 files changed, 142 insertions(+)", "diff": "diff --git a/lib/librte_compressdev/rte_compressdev.c b/lib/librte_compressdev/rte_compressdev.c\nindex 0af1b4927..0ffc43bb9 100644\n--- a/lib/librte_compressdev/rte_compressdev.c\n+++ b/lib/librte_compressdev/rte_compressdev.c\n@@ -602,6 +602,55 @@ rte_compressdev_private_xform_free(uint8_t dev_id, void *priv_xform)\n \treturn 0;\n }\n \n+int __rte_experimental\n+rte_compressdev_stream_create(uint8_t dev_id,\n+\t\tconst struct rte_comp_xform *xform,\n+\t\tvoid **stream)\n+{\n+\tstruct rte_compressdev *dev;\n+\tint ret;\n+\n+\tdev = rte_compressdev_get_dev(dev_id);\n+\n+\tif (xform == NULL || dev == NULL || stream == NULL)\n+\t\treturn -EINVAL;\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stream_create, -ENOTSUP);\n+\tret = (*dev->dev_ops->stream_create)(dev, xform, stream);\n+\tif (ret < 0) {\n+\t\tCOMPRESSDEV_LOG(ERR,\n+\t\t\t\"dev_id %d failed to create stream: err=%d\",\n+\t\t\tdev_id, ret);\n+\t\treturn ret;\n+\t};\n+\n+\treturn 0;\n+}\n+\n+\n+int __rte_experimental\n+rte_compressdev_stream_free(uint8_t dev_id, void *stream)\n+{\n+\tstruct rte_compressdev *dev;\n+\tint ret;\n+\n+\tdev = rte_compressdev_get_dev(dev_id);\n+\n+\tif (dev == NULL || stream == NULL)\n+\t\treturn -EINVAL;\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stream_free, -ENOTSUP);\n+\tret = dev->dev_ops->stream_free(dev, stream);\n+\tif (ret < 0) {\n+\t\tCOMPRESSDEV_LOG(ERR,\n+\t\t\t\"dev_id %d failed to free stream: err=%d\",\n+\t\t\tdev_id, ret);\n+\t\treturn ret;\n+\t};\n+\n+\treturn 0;\n+}\n+\n const char * __rte_experimental\n rte_compressdev_name_get(uint8_t dev_id)\n {\ndiff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h\nindex 705e9fe79..f18c7ccf6 100644\n--- a/lib/librte_compressdev/rte_compressdev.h\n+++ b/lib/librte_compressdev/rte_compressdev.h\n@@ -91,6 +91,8 @@ struct rte_compressdev_config {\n \t/**< Total number of queue pairs to configure on a device */\n \tuint16_t max_nb_priv_xforms;\n \t/**< Max number of private_xforms which will be created on the device */\n+\tuint16_t max_nb_streams;\n+\t/**< Max number of streams which will be created on the device */\n };\n \n /**\n@@ -316,6 +318,54 @@ uint16_t __rte_experimental\n rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,\n \t\tstruct rte_comp_op **ops, uint16_t nb_ops);\n \n+/**\n+ * This should alloc a stream from the device's mempool and initialise it.\n+ * The application should call this API when setting up for the stateful\n+ * processing of a set of data on a device. The API can be called multiple\n+ * times to set up a stream for each data set. The handle returned is only for\n+ * use with ops of op_type STATEFUL and must be passed to the PMD\n+ * with every op in the data stream\n+ *\n+ * @param dev_id\n+ * Compress device identifier\n+ * @param xform\n+ * xform data\n+ * @param stream\n+ * Pointer to where PMD's private stream handle should be stored\n+ *\n+ * @return\n+ * - 0 if successful and valid stream handle\n+ * - <0 in error cases\n+ * - Returns -EINVAL if input parameters are invalid.\n+ * - Returns -ENOTSUP if comp device does not support STATEFUL operations.\n+ * - Returns -ENOTSUP if comp device does not support the comp transform.\n+ * - Returns -ENOMEM if the private stream could not be allocated.\n+ *\n+ */\n+int __rte_experimental\n+rte_compressdev_stream_create(uint8_t dev_id,\n+\t\tconst struct rte_comp_xform *xform,\n+\t\tvoid **stream);\n+\n+/**\n+ * This should clear the stream and return it to the device's mempool.\n+ *\n+ * @param dev_id\n+ * Compress device identifier\n+ *\n+ * @param stream\n+ * PMD's private stream data\n+ *\n+ * @return\n+ * - 0 if successful\n+ * - <0 in error cases\n+ * - Returns -EINVAL if input parameters are invalid.\n+ * - Returns -ENOTSUP if comp device does not support STATEFUL operations.\n+ * - Returns -EBUSY if can't free stream as there are inflight operations\n+ */\n+int __rte_experimental\n+rte_compressdev_stream_free(uint8_t dev_id, void *stream);\n+\n /**\n * This should alloc a private_xform from the device's mempool and initialise\n * it. The application should call this API when setting up for stateless\ndiff --git a/lib/librte_compressdev/rte_compressdev_pmd.h b/lib/librte_compressdev/rte_compressdev_pmd.h\nindex 45ab61c25..c08a3ee63 100644\n--- a/lib/librte_compressdev/rte_compressdev_pmd.h\n+++ b/lib/librte_compressdev/rte_compressdev_pmd.h\n@@ -166,6 +166,42 @@ typedef int (*compressdev_queue_pair_release_t)(struct rte_compressdev *dev,\n */\n typedef uint32_t (*compressdev_queue_pair_count_t)(struct rte_compressdev *dev);\n \n+/**\n+ * Create driver private stream data.\n+ *\n+ * @param dev\n+ * Compressdev device\n+ * @param xform\n+ * xform data\n+ * @param stream\n+ * ptr where handle of pmd's private stream data should be stored\n+ * @return\n+ * - Returns 0 if private stream structure has been created successfully.\n+ * - Returns -EINVAL if input parameters are invalid.\n+ * - Returns -ENOTSUP if comp device does not support STATEFUL operations.\n+ * - Returns -ENOTSUP if comp device does not support the comp transform.\n+ * - Returns -ENOMEM if the private stream could not be allocated.\n+ */\n+typedef int (*compressdev_stream_create_t)(struct rte_compressdev *dev,\n+\t\tconst struct rte_comp_xform *xform, void **stream);\n+\n+/**\n+ * Free driver private stream data.\n+ *\n+ * @param dev\n+ * Compressdev device\n+ * @param stream\n+ * handle of pmd's private stream data\n+ * @return\n+ * - 0 if successful\n+ * - <0 in error cases\n+ * - Returns -EINVAL if input parameters are invalid.\n+ * - Returns -ENOTSUP if comp device does not support STATEFUL operations.\n+ * - Returns -EBUSY if can't free stream as there are inflight operations\n+ */\n+typedef int (*compressdev_stream_free_t)(struct rte_compressdev *dev,\n+\t\tvoid *stream);\n+\n /**\n * Create driver private_xform data.\n *\n@@ -216,6 +252,11 @@ struct rte_compressdev_ops {\n \tcompressdev_queue_pair_release_t queue_pair_release;\n \t/**< Release a queue pair. */\n \n+\tcompressdev_stream_create_t stream_create;\n+\t/**< Create a comp stream and initialise its private data. */\n+\tcompressdev_stream_free_t stream_free;\n+\t/**< Free a comp stream's private data. */\n+\n \tcompressdev_private_xform_create_t private_xform_create;\n \t/**< Create a comp private_xform and initialise its private data. */\n \tcompressdev_private_xform_free_t private_xform_free;\ndiff --git a/lib/librte_compressdev/rte_compressdev_version.map b/lib/librte_compressdev/rte_compressdev_version.map\nindex d755bb65e..ca4d9d3d8 100644\n--- a/lib/librte_compressdev/rte_compressdev_version.map\n+++ b/lib/librte_compressdev/rte_compressdev_version.map\n@@ -25,6 +25,8 @@ EXPERIMENTAL {\n \trte_compressdev_socket_id;\n \trte_compressdev_start;\n \trte_compressdev_stop;\n+\trte_compressdev_stream_create;\n+\trte_compressdev_stream_free;\n \trte_comp_op_alloc;\n \trte_comp_op_bulk_alloc;\n \trte_comp_op_free;\n", "prefixes": [ "dpdk-dev", "v6", "07/14" ] }{ "id": 39097, "url": "