DPDK patches and discussions
 help / color / mirror / Atom feed
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, Ashish.Gupta@cavium.com,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Shally Verma <shally.verma@caviumnetworks.com>,
	Ashish Gupta <ashish.gupta@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH v5 04/13] compressdev: add enqueue/dequeue functions
Date: Fri, 13 Apr 2018 19:18:23 +0100	[thread overview]
Message-ID: <20180413181832.11335-5-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20180413181832.11335-1-pablo.de.lara.guarch@intel.com>

From: Fiona Trahe <fiona.trahe@intel.com>

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
---
 lib/librte_compressdev/rte_compressdev.c           |  22 +++++
 lib/librte_compressdev/rte_compressdev.h           | 107 +++++++++++++++++++++
 lib/librte_compressdev/rte_compressdev_version.map |   2 +
 3 files changed, 131 insertions(+)

diff --git a/lib/librte_compressdev/rte_compressdev.c b/lib/librte_compressdev/rte_compressdev.c
index 67e7ad12f..5393da6d6 100644
--- a/lib/librte_compressdev/rte_compressdev.c
+++ b/lib/librte_compressdev/rte_compressdev.c
@@ -471,6 +471,28 @@ rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 			max_inflight_ops, socket_id);
 }
 
+uint16_t __rte_experimental
+rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
+		struct rte_comp_op **ops, uint16_t nb_ops)
+{
+	struct rte_compressdev *dev = &rte_compressdevs[dev_id];
+
+	nb_ops = (*dev->dequeue_burst)
+			(dev->data->queue_pairs[qp_id], ops, nb_ops);
+
+	return nb_ops;
+}
+
+uint16_t __rte_experimental
+rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
+		struct rte_comp_op **ops, uint16_t nb_ops)
+{
+	struct rte_compressdev *dev = &rte_compressdevs[dev_id];
+
+	return (*dev->enqueue_burst)(
+			dev->data->queue_pairs[qp_id], ops, nb_ops);
+}
+
 void __rte_experimental
 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info)
 {
diff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h
index 39b4c83cf..0a4f657b0 100644
--- a/lib/librte_compressdev/rte_compressdev.h
+++ b/lib/librte_compressdev/rte_compressdev.h
@@ -19,6 +19,8 @@ extern "C" {
 
 #include <rte_common.h>
 
+#include "rte_comp.h"
+
 /**  comp device information */
 struct rte_compressdev_info {
 	const char *driver_name;		/**< Driver name. */
@@ -203,6 +205,111 @@ rte_compressdev_queue_pair_count(uint8_t dev_id);
 void __rte_experimental
 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
 
+/**
+ *
+ * Dequeue a burst of processed compression operations from a queue on the comp
+ * device. The dequeued operation are stored in *rte_comp_op* structures
+ * whose pointers are supplied in the *ops* array.
+ *
+ * The rte_compressdev_dequeue_burst() function returns the number of ops
+ * actually dequeued, which is the number of *rte_comp_op* data structures
+ * effectively supplied into the *ops* array.
+ *
+ * A return value equal to *nb_ops* indicates that the queue contained
+ * at least *nb_ops* operations, and this is likely to signify that other
+ * processed operations remain in the devices output queue. Applications
+ * implementing a "retrieve as many processed operations as possible" policy
+ * can check this specific case and keep invoking the
+ * rte_compressdev_dequeue_burst() function until a value less than
+ * *nb_ops* is returned.
+ *
+ * The rte_compressdev_dequeue_burst() function does not provide any error
+ * notification to avoid the corresponding overhead.
+ *
+ * @note: operation ordering is not maintained within the queue pair.
+ *
+ * @note: In case op status = OUT_OF_SPACE_TERMINATED, op.consumed=0 and the
+ * op must be resubmitted with the same input data and a larger output buffer.
+ * op.produced is usually 0, but in decompression cases a PMD may return > 0
+ * and the application may find it useful to inspect that data.
+ * This status is only returned on STATELESS ops.
+ *
+ * @note: In case op status = OUT_OF_SPACE_RECOVERABLE, op.produced can be used
+ * and next op in stream should continue on from op.consumed+1 with a fresh
+ * output buffer.
+ * Consumed=0, produced=0 is an unusual but allowed case. There may be useful
+ * state/history stored in the PMD, even though no output was produced yet.
+ *
+ *
+ * @param dev_id
+ *   Compress device identifier
+ * @param qp_id
+ *   The index of the queue pair from which to retrieve
+ *   processed operations. The value must be in the range
+ *   [0, nb_queue_pair - 1] previously supplied to
+ *   rte_compressdev_configure()
+ * @param ops
+ *   The address of an array of pointers to
+ *   *rte_comp_op* structures that must be
+ *   large enough to store *nb_ops* pointers in it
+ * @param nb_ops
+ *   The maximum number of operations to dequeue
+ * @return
+ *   - The number of operations actually dequeued, which is the number
+ *   of pointers to *rte_comp_op* structures effectively supplied to the
+ *   *ops* array.
+ */
+uint16_t __rte_experimental
+rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
+		struct rte_comp_op **ops, uint16_t nb_ops);
+
+/**
+ * Enqueue a burst of operations for processing on a compression device.
+ *
+ * The rte_compressdev_enqueue_burst() function is invoked to place
+ * comp operations on the queue *qp_id* of the device designated by
+ * its *dev_id*.
+ *
+ * The *nb_ops* parameter is the number of operations to process which are
+ * supplied in the *ops* array of *rte_comp_op* structures.
+ *
+ * The rte_compressdev_enqueue_burst() function returns the number of
+ * operations it actually enqueued for processing. A return value equal to
+ * *nb_ops* means that all packets have been enqueued.
+ *
+ * @note All compression operations are Out-of-place (OOP) operations,
+ * as the size of the output data is different to the size of the input data.
+ *
+ * @note The flush flag only applies to operations which return SUCCESS.
+ * In OUT_OF_SPACE cases whether STATEFUL or STATELESS, data in dest buffer
+ * is as if flush flag was FLUSH_NONE.
+ * @note flush flag only applies in compression direction. It has no meaning
+ * for decompression.
+ * @note: operation ordering is not maintained within the queue pair.
+ *
+ * @param dev_id
+ *   Compress device identifier
+ * @param qp_id
+ *   The index of the queue pair on which operations
+ *   are to be enqueued for processing. The value
+ *   must be in the range [0, nb_queue_pairs - 1]
+ *   previously supplied to *rte_compressdev_configure*
+ * @param ops
+ *   The address of an array of *nb_ops* pointers
+ *   to *rte_comp_op* structures which contain
+ *   the operations to be processed
+ * @param nb_ops
+ *   The number of operations to process
+ * @return
+ *   The number of operations actually enqueued on the device. The return
+ *   value can be less than the value of the *nb_ops* parameter when the
+ *   comp devices queue is full or if invalid parameters are specified in
+ *   a *rte_comp_op*.
+ */
+uint16_t __rte_experimental
+rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
+		struct rte_comp_op **ops, uint16_t nb_ops);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_compressdev/rte_compressdev_version.map b/lib/librte_compressdev/rte_compressdev_version.map
index 182a371d8..882395885 100644
--- a/lib/librte_compressdev/rte_compressdev_version.map
+++ b/lib/librte_compressdev/rte_compressdev_version.map
@@ -6,7 +6,9 @@ EXPERIMENTAL {
 	rte_compressdev_close;
 	rte_compressdev_configure;
 	rte_compressdev_count;
+	rte_compressdev_dequeue_burst;
 	rte_compressdev_devices_get;
+	rte_compressdev_enqueue_burst;
 	rte_compressdev_info_get;
 	rte_compressdev_name_get;
 	rte_compressdev_pmd_allocate;
-- 
2.14.3

  parent reply	other threads:[~2018-04-13 18:18 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 18:25 [dpdk-dev] [PATCH] compressdev: implement API Fiona Trahe
2018-02-04 14:18 ` Thomas Monjalon
2018-02-21 19:11   ` Trahe, Fiona
2018-02-24  1:17     ` Ahmed Mansour
2018-02-26 11:24       ` Trahe, Fiona
2018-02-26 19:15         ` Ahmed Mansour
2018-02-27  5:48           ` Verma, Shally
2018-02-26 11:25       ` Verma, Shally
2018-02-26 21:35         ` Ahmed Mansour
2018-02-27  5:53           ` Verma, Shally
2018-02-28 18:39             ` Trahe, Fiona
2018-03-01  6:58               ` Verma, Shally
2018-03-01 14:41                 ` Trahe, Fiona
2018-03-02  0:55                   ` Ahmed Mansour
2018-03-02  9:53                     ` Trahe, Fiona
2018-03-02 19:48                       ` Ahmed Mansour
2018-03-05 14:32                         ` Verma, Shally
2018-03-06 23:33                           ` Ahmed Mansour
2018-03-03  0:52               ` Ahmed Mansour
2018-02-04 14:24 ` Thomas Monjalon
2018-03-23 18:08   ` Trahe, Fiona
2018-03-24  1:02     ` Thomas Monjalon
2018-03-26 11:44       ` Trahe, Fiona
2018-03-27 16:04 ` [dpdk-dev] [PATCH v2 0/3] implement compression API Fiona Trahe
2018-04-06 18:04   ` [dpdk-dev] [PATCH v3 00/13] Implement " Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 01/13] compressdev: add basic device management Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 02/13] compressdev: add queue pair management Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 03/13] compressdev: add compression specific data Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 04/13] compressdev: add enqueue/dequeue functions Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 05/13] compressdev: add operation management Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 06/13] compressdev: support stateless operations Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 07/13] compressdev: support stateful operations Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 08/13] compressdev: support hash operations Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 09/13] compressdev: add device feature flags Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 10/13] compressdev: add compression service " Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 11/13] compressdev: add device stats Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 12/13] compressdev: add device capabilities Pablo de Lara
2018-04-06 18:05     ` [dpdk-dev] [PATCH v3 13/13] compressdev: get device id from name Pablo de Lara
2018-04-08 12:58     ` [dpdk-dev] [PATCH v4 00/13] Implement compression API Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 01/13] compressdev: add basic device management Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 02/13] compressdev: add queue pair management Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 03/13] compressdev: add compression specific data Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 04/13] compressdev: add enqueue/dequeue functions Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 05/13] compressdev: add operation management Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 06/13] compressdev: support stateless operations Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 07/13] compressdev: support stateful operations Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 08/13] compressdev: support hash operations Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 09/13] compressdev: add device feature flags Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 10/13] compressdev: add compression service " Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 11/13] compressdev: add device stats Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 12/13] compressdev: add device capabilities Pablo de Lara
2018-04-08 12:58       ` [dpdk-dev] [PATCH v4 13/13] compressdev: get device id from name Pablo de Lara
2018-03-27 16:04 ` [dpdk-dev] [PATCH v2 1/3] compressdev: add structs and enum for compression service Fiona Trahe
2018-03-27 16:04 ` [dpdk-dev] [PATCH v2 2/3] compressdev: implement API Fiona Trahe
2018-03-27 16:04 ` [dpdk-dev] [PATCH v2 3/3] doc: update doxy and release note for compressdev Fiona Trahe
2018-04-13 18:18 ` [dpdk-dev] [PATCH v5 00/13] Implement compression API Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 01/13] compressdev: add basic device management Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 02/13] compressdev: add queue pair management Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 03/13] compressdev: add compression specific data Pablo de Lara
2018-04-13 18:18   ` Pablo de Lara [this message]
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 05/13] compressdev: add operation management Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 06/13] compressdev: support stateless operations Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 07/13] compressdev: support stateful operations Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 08/13] compressdev: support hash operations Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 09/13] compressdev: add device feature flags Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 10/13] compressdev: add compression service " Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 11/13] compressdev: add device stats Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 12/13] compressdev: add device capabilities Pablo de Lara
2018-04-13 18:18   ` [dpdk-dev] [PATCH v5 13/13] compressdev: get device id from name Pablo de Lara
2018-04-27 13:23 ` [dpdk-dev] [PATCH v6 00/14] Implement compression API Pablo de Lara
2018-04-27 13:23   ` [dpdk-dev] [PATCH v6 01/14] compressdev: add basic device management Pablo de Lara
2018-04-27 13:23   ` [dpdk-dev] [PATCH v6 02/14] compressdev: add queue pair management Pablo de Lara
2018-05-04  2:48     ` Verma, Shally
2018-05-04  8:43       ` Trahe, Fiona
2018-05-14  7:53     ` Verma, Shally
2018-05-14  8:04       ` De Lara Guarch, Pablo
2018-05-14  8:16         ` Verma, Shally
2018-05-14  8:30           ` De Lara Guarch, Pablo
2018-04-27 13:23   ` [dpdk-dev] [PATCH v6 03/14] compressdev: add compression specific data Pablo de Lara
2018-04-27 13:23   ` [dpdk-dev] [PATCH v6 04/14] compressdev: add enqueue/dequeue functions Pablo de Lara
2018-04-27 13:23   ` [dpdk-dev] [PATCH v6 05/14] compressdev: add operation management Pablo de Lara
2018-04-27 13:23   ` [dpdk-dev] [PATCH v6 06/14] compressdev: support stateless operations Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 07/14] compressdev: support stateful operations Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 08/14] compressdev: support hash operations Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 09/14] compressdev: add device feature flags Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 10/14] compressdev: add compression service " Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 11/14] compressdev: add device stats Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 12/14] compressdev: add device capabilities Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 13/14] compressdev: get device id from name Pablo de Lara
2018-04-27 13:24   ` [dpdk-dev] [PATCH v6 14/14] doc: add compressdev library guide Pablo de Lara
2018-05-08 21:25   ` [dpdk-dev] [PATCH v6 00/14] Implement compression API De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180413181832.11335-5-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=Ashish.Gupta@cavium.com \
    --cc=ahmed.mansour@nxp.com \
    --cc=ashish.gupta@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=shally.verma@cavium.com \
    --cc=shally.verma@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).