X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_compressdev%2Frte_compressdev.h;h=2840c27c6cfb893f2ea2b8f76f055a4181021bae;hb=d9a8bc6570ef088e573ff3b47977ec2030887db6;hp=5b4fca4dcb1bfb32bd65ddbf7e1df4921ffd07fe;hpb=7385d1c4b4bfdd1f276f088d4b40f2aee4f8d042;p=dpdk.git diff --git a/lib/librte_compressdev/rte_compressdev.h b/lib/librte_compressdev/rte_compressdev.h index 5b4fca4dcb..2840c27c6c 100644 --- a/lib/librte_compressdev/rte_compressdev.h +++ b/lib/librte_compressdev/rte_compressdev.h @@ -8,7 +8,11 @@ /** * @file rte_compressdev.h * - * RTE Compression Device APIs + * RTE Compression Device APIs. + * + * @warning + * @b EXPERIMENTAL: + * All functions in this file may be changed or removed without prior notice. * * Defines comp device APIs for the provisioning of compression operations. */ @@ -50,7 +54,8 @@ struct rte_compressdev_capabilities { #define RTE_COMP_END_OF_CAPABILITIES_LIST() \ { RTE_COMP_ALGO_UNSPECIFIED } -const struct rte_compressdev_capabilities * __rte_experimental +__rte_experimental +const struct rte_compressdev_capabilities * rte_compressdev_capability_get(uint8_t dev_id, enum rte_comp_algorithm algo); @@ -73,6 +78,12 @@ rte_compressdev_capability_get(uint8_t dev_id, /**< Utilises CPU SIMD AVX512 instructions */ #define RTE_COMPDEV_FF_CPU_NEON (1ULL << 5) /**< Utilises CPU NEON instructions */ +#define RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE (1ULL << 6) +/**< A PMD should set this if the bulk of the + * processing is done during the dequeue. It should leave it + * cleared if the processing is done during the enqueue (default). + * Applications can use this as a hint for tuning. + */ /** * Get the name of a compress device feature flag. @@ -83,7 +94,8 @@ rte_compressdev_capability_get(uint8_t dev_id, * @return * The name of this flag, or NULL if it's not a valid feature flag. */ -const char * __rte_experimental +__rte_experimental +const char * rte_compressdev_get_feature_name(uint64_t flag); /** comp device information */ @@ -121,7 +133,8 @@ struct rte_compressdev_stats { * - Returns compress device identifier on success. * - Return -1 on failure to find named compress device. */ -int __rte_experimental +__rte_experimental +int rte_compressdev_get_dev_id(const char *name); /** @@ -133,7 +146,8 @@ rte_compressdev_get_dev_id(const char *name); * - Returns compress device name. * - Returns NULL if compress device is not present. */ -const char * __rte_experimental +__rte_experimental +const char * rte_compressdev_name_get(uint8_t dev_id); /** @@ -143,7 +157,8 @@ rte_compressdev_name_get(uint8_t dev_id); * @return * - The total number of usable compress devices. */ -uint8_t __rte_experimental +__rte_experimental +uint8_t rte_compressdev_count(void); /** @@ -160,7 +175,8 @@ rte_compressdev_count(void); * @return * Returns number of attached compress devices. */ -uint8_t __rte_experimental +__rte_experimental +uint8_t rte_compressdev_devices_get(const char *driver_name, uint8_t *devices, uint8_t nb_devices); @@ -174,7 +190,8 @@ rte_compressdev_devices_get(const char *driver_name, uint8_t *devices, * a default of zero if the socket could not be determined. * -1 if returned is the dev_id value is out of range. */ -int __rte_experimental +__rte_experimental +int rte_compressdev_socket_id(uint8_t dev_id); /** Compress device configuration structure */ @@ -204,7 +221,8 @@ struct rte_compressdev_config { * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int __rte_experimental +__rte_experimental +int rte_compressdev_configure(uint8_t dev_id, struct rte_compressdev_config *config); @@ -222,7 +240,8 @@ rte_compressdev_configure(uint8_t dev_id, * - 0: Success, device started. * - <0: Error code of the driver device start function. */ -int __rte_experimental +__rte_experimental +int rte_compressdev_start(uint8_t dev_id); /** @@ -232,7 +251,8 @@ rte_compressdev_start(uint8_t dev_id); * @param dev_id * Compress device identifier */ -void __rte_experimental +__rte_experimental +void rte_compressdev_stop(uint8_t dev_id); /** @@ -249,7 +269,8 @@ rte_compressdev_stop(uint8_t dev_id); * - 0 on successfully closing device * - <0 on failure to close device */ -int __rte_experimental +__rte_experimental +int rte_compressdev_close(uint8_t dev_id); /** @@ -275,7 +296,8 @@ rte_compressdev_close(uint8_t dev_id); * - 0: Success, queue pair correctly set up. * - <0: Queue pair configuration failed */ -int __rte_experimental +__rte_experimental +int rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, uint32_t max_inflight_ops, int socket_id); @@ -287,7 +309,8 @@ rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, * @return * - The number of configured queue pairs. */ -uint16_t __rte_experimental +__rte_experimental +uint16_t rte_compressdev_queue_pair_count(uint8_t dev_id); @@ -304,7 +327,8 @@ rte_compressdev_queue_pair_count(uint8_t dev_id); * - Zero if successful. * - Non-zero otherwise. */ -int __rte_experimental +__rte_experimental +int rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats); /** @@ -313,7 +337,8 @@ rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats); * @param dev_id * The identifier of the device. */ -void __rte_experimental +__rte_experimental +void rte_compressdev_stats_reset(uint8_t dev_id); /** @@ -330,7 +355,8 @@ rte_compressdev_stats_reset(uint8_t dev_id); * The element after the last valid element has it's op field set to * RTE_COMP_ALGO_LIST_END. */ -void __rte_experimental +__rte_experimental +void rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info); /** @@ -387,7 +413,8 @@ rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info); * of pointers to *rte_comp_op* structures effectively supplied to the * *ops* array. */ -uint16_t __rte_experimental +__rte_experimental +uint16_t rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops); @@ -408,6 +435,13 @@ rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, * @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 rte_comp_op contains both input and output parameters and is the + * vehicle for the application to pass data into and out of the PMD. While an + * op is inflight, i.e. once it has been enqueued, the private_xform or stream + * attached to it and any mbufs or memory referenced by it should not be altered + * or freed by the application. The PMD may use or change some of this data at + * any time until it has been returned in a dequeue operation. + * * @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. @@ -434,7 +468,8 @@ rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, * comp devices queue is full or if invalid parameters are specified in * a *rte_comp_op*. */ -uint16_t __rte_experimental +__rte_experimental +uint16_t rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops); @@ -462,7 +497,8 @@ rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, * - Returns -ENOMEM if the private stream could not be allocated. * */ -int __rte_experimental +__rte_experimental +int rte_compressdev_stream_create(uint8_t dev_id, const struct rte_comp_xform *xform, void **stream); @@ -483,7 +519,8 @@ rte_compressdev_stream_create(uint8_t dev_id, * - Returns -ENOTSUP if comp device does not support STATEFUL operations. * - Returns -EBUSY if can't free stream as there are inflight operations */ -int __rte_experimental +__rte_experimental +int rte_compressdev_stream_free(uint8_t dev_id, void *stream); /** @@ -509,7 +546,8 @@ rte_compressdev_stream_free(uint8_t dev_id, void *stream); * - Returns -ENOTSUP if comp device does not support the comp transform. * - Returns -ENOMEM if the private_xform could not be allocated. */ -int __rte_experimental +__rte_experimental +int rte_compressdev_private_xform_create(uint8_t dev_id, const struct rte_comp_xform *xform, void **private_xform); @@ -530,7 +568,8 @@ rte_compressdev_private_xform_create(uint8_t dev_id, * - <0 in error cases * - Returns -EINVAL if input parameters are invalid. */ -int __rte_experimental +__rte_experimental +int rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform); #ifdef __cplusplus