bus/vmbus: add devargs support
[dpdk.git] / lib / librte_compressdev / rte_compressdev.h
index 5ad9269..5b4fca4 100644 (file)
@@ -21,6 +21,39 @@ extern "C" {
 
 #include "rte_comp.h"
 
+/**
+ * Parameter log base 2 range description.
+ * Final value will be 2^value.
+ */
+struct rte_param_log2_range {
+       uint8_t min;    /**< Minimum log2 value */
+       uint8_t max;    /**< Maximum log2 value */
+       uint8_t increment;
+       /**< If a range of sizes are supported,
+        * this parameter is used to indicate
+        * increments in base 2 log byte value
+        * that are supported between the minimum and maximum
+        */
+};
+
+/** Structure used to capture a capability of a comp device */
+struct rte_compressdev_capabilities {
+       enum rte_comp_algorithm algo;
+       /* Compression algorithm */
+       uint64_t comp_feature_flags;
+       /**< Bitmask of flags for compression service features */
+       struct rte_param_log2_range window_size;
+       /**< Window size range in base two log byte values */
+};
+
+/** Macro used at end of comp PMD list */
+#define RTE_COMP_END_OF_CAPABILITIES_LIST() \
+       { RTE_COMP_ALGO_UNSPECIFIED }
+
+const struct rte_compressdev_capabilities * __rte_experimental
+rte_compressdev_capability_get(uint8_t dev_id,
+                       enum rte_comp_algorithm algo);
+
 /**
  * compression device supported feature flags
  *
@@ -57,6 +90,8 @@ rte_compressdev_get_feature_name(uint64_t flag);
 struct rte_compressdev_info {
        const char *driver_name;                /**< Driver name. */
        uint64_t feature_flags;                 /**< Feature flags */
+       const struct rte_compressdev_capabilities *capabilities;
+       /**< Array of devices supported capabilities */
        uint16_t max_nb_queue_pairs;
        /**< Maximum number of queues pairs supported by device.
         * (If 0, there is no limit in maximum number of queue pairs)
@@ -76,6 +111,19 @@ struct rte_compressdev_stats {
        /**< Total error count on operations dequeued */
 };
 
+
+/**
+ * Get the device identifier for the named compress device.
+ *
+ * @param name
+ *   Device name to select the device structure
+ * @return
+ *   - Returns compress device identifier on success.
+ *   - Return -1 on failure to find named compress device.
+ */
+int __rte_experimental
+rte_compressdev_get_dev_id(const char *name);
+
 /**
  * Get the compress device name given a device identifier.
  *
@@ -468,6 +516,8 @@ rte_compressdev_private_xform_create(uint8_t dev_id,
 
 /**
  * This should clear the private_xform and return it to the device's mempool.
+ * It is the application's responsibility to ensure that private_xform data
+ * is not cleared while there are still in-flight operations using it.
  *
  * @param dev_id
  *   Compress device identifier
@@ -479,7 +529,6 @@ rte_compressdev_private_xform_create(uint8_t dev_id,
  *  - 0 if successful
  *  - <0 in error cases
  *  - Returns -EINVAL if input parameters are invalid.
- *  - Returns -EBUSY if can't free private_xform due to inflight operations
  */
 int __rte_experimental
 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);