X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_rawdev%2Frte_rawdev.h;h=14e8eb972f057209358bd31eab330951684d9b5d;hb=3127f99274b679124658afdbfc49210730c50617;hp=2e14919b589657a37c63f695814d37a4da9074ce;hpb=7ae53626e4bc26257970ca9fbb14fd7cae74497d;p=dpdk.git diff --git a/lib/librte_rawdev/rte_rawdev.h b/lib/librte_rawdev/rte_rawdev.h index 2e14919b58..14e8eb972f 100644 --- a/lib/librte_rawdev/rte_rawdev.h +++ b/lib/librte_rawdev/rte_rawdev.h @@ -12,9 +12,6 @@ * * This API allow applications to configure and use generic devices having * no specific type already available in DPDK. - * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice */ #ifdef __cplusplus @@ -25,7 +22,7 @@ extern "C" { #include #include -/* Rawdevice object - essentially a void to be typecasted by implementation */ +/* Rawdevice object - essentially a void to be typecast by implementation */ typedef void *rte_rawdev_obj_t; /** @@ -35,7 +32,7 @@ typedef void *rte_rawdev_obj_t; * @return * The total number of usable raw devices. */ -uint8_t __rte_experimental +uint8_t rte_rawdev_count(void); /** @@ -48,7 +45,7 @@ rte_rawdev_count(void); * Returns raw device identifier on success. * - <0: Failure to find named raw device. */ -uint16_t __rte_experimental +uint16_t rte_rawdev_get_dev_id(const char *name); /** @@ -61,7 +58,7 @@ rte_rawdev_get_dev_id(const char *name); * a default of zero if the socket could not be determined. * -(-EINVAL) dev_id value is out of range. */ -int __rte_experimental +int rte_rawdev_socket_id(uint16_t dev_id); /** @@ -77,15 +74,28 @@ struct rte_rawdev_info; * * @param[out] dev_info * A pointer to a structure of type *rte_rawdev_info* to be filled with the - * contextual information of the device. + * contextual information of the device. The dev_info->dev_private field + * should point to an appropriate buffer space for holding the device- + * specific info for that hardware. + * If the dev_private field is set to NULL, then the device-specific info + * function will not be called and only basic information about the device + * will be returned. This can be used to safely query the type of a rawdev + * instance without needing to know the size of the private data to return. + * + * @param dev_private_size + * The length of the memory space pointed to by dev_private in dev_info. + * This should be set to the size of the expected private structure to be + * returned, and may be checked by drivers to ensure the expected struct + * type is provided. * * @return * - 0: Success, driver updates the contextual information of the raw device * - <0: Error code returned by the driver info get function. * */ -int __rte_experimental -rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info); +int +rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info, + size_t dev_private_size); /** * Configure a raw device. @@ -106,13 +116,19 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info); * driver/implementation can use to configure the device. It is also assumed * that once the configuration is done, a `queue_id` type field can be used * to refer to some arbitrary internal representation of a queue. + * @param dev_private_size + * The length of the memory space pointed to by dev_private in dev_info. + * This should be set to the size of the expected private structure to be + * used by the driver, and may be checked by drivers to ensure the expected + * struct type is provided. * * @return * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int __rte_experimental -rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf); +int +rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf, + size_t dev_private_size); /** @@ -130,6 +146,8 @@ rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf); * previously supplied to rte_rawdev_configure(). * @param[out] queue_conf * The pointer to the default raw queue configuration data. + * @param queue_conf_size + * The size of the structure pointed to by queue_conf * @return * - 0: Success, driver updates the default raw queue configuration data. * - <0: Error code returned by the driver info get function. @@ -137,10 +155,11 @@ rte_rawdev_configure(uint16_t dev_id, struct rte_rawdev_info *dev_conf); * @see rte_raw_queue_setup() * */ -int __rte_experimental +int rte_rawdev_queue_conf_get(uint16_t dev_id, uint16_t queue_id, - rte_rawdev_obj_t queue_conf); + rte_rawdev_obj_t queue_conf, + size_t queue_conf_size); /** * Allocate and set up a raw queue for a raw device. @@ -153,6 +172,8 @@ rte_rawdev_queue_conf_get(uint16_t dev_id, * @param queue_conf * The pointer to the configuration data to be used for the raw queue. * NULL value is allowed, in which case default configuration used. + * @param queue_conf_size + * The size of the structure pointed to by queue_conf * * @see rte_rawdev_queue_conf_get() * @@ -160,10 +181,11 @@ rte_rawdev_queue_conf_get(uint16_t dev_id, * - 0: Success, raw queue correctly set up. * - <0: raw queue configuration failed */ -int __rte_experimental +int rte_rawdev_queue_setup(uint16_t dev_id, uint16_t queue_id, - rte_rawdev_obj_t queue_conf); + rte_rawdev_obj_t queue_conf, + size_t queue_conf_size); /** * Release and deallocate a raw queue from a raw device. @@ -180,8 +202,9 @@ rte_rawdev_queue_setup(uint16_t dev_id, * - 0: Success, raw queue released. * - <0: raw queue configuration failed */ -int __rte_experimental +int rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id); + /** * Get the number of raw queues on a specific raw device * @@ -190,7 +213,7 @@ rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id); * @return * - The number of configured raw queues */ -uint16_t __rte_experimental +uint16_t rte_rawdev_queue_count(uint16_t dev_id); /** @@ -208,7 +231,7 @@ rte_rawdev_queue_count(uint16_t dev_id); * - 0: Success, device started. * < 0: Failure */ -int __rte_experimental +int rte_rawdev_start(uint16_t dev_id); /** @@ -218,7 +241,7 @@ rte_rawdev_start(uint16_t dev_id); * @param dev_id * Raw device identifier. */ -void __rte_experimental +void rte_rawdev_stop(uint16_t dev_id); /** @@ -232,7 +255,7 @@ rte_rawdev_stop(uint16_t dev_id); * - <0 on failure to close device * - (-EAGAIN) if device is busy */ -int __rte_experimental +int rte_rawdev_close(uint16_t dev_id); /** @@ -243,10 +266,10 @@ rte_rawdev_close(uint16_t dev_id); * @param dev_id * Raw device identifiers * @return - * 0 for sucessful reset, + * 0 for successful reset, * !0 for failure in resetting */ -int __rte_experimental +int rte_rawdev_reset(uint16_t dev_id); #define RTE_RAWDEV_NAME_MAX_LEN (64) @@ -316,7 +339,7 @@ struct rte_rawdev_buf { * - 0: on success * - <0: on failure. */ -int __rte_experimental +int rte_rawdev_dump(uint16_t dev_id, FILE *f); /** @@ -338,7 +361,7 @@ rte_rawdev_dump(uint16_t dev_id, FILE *f); * 0 for success * !0 Error; attr_value remains untouched in case of error. */ -int __rte_experimental +int rte_rawdev_get_attr(uint16_t dev_id, const char *attr_name, uint64_t *attr_value); @@ -357,7 +380,7 @@ rte_rawdev_get_attr(uint16_t dev_id, * 0 for success * !0 Error */ -int __rte_experimental +int rte_rawdev_set_attr(uint16_t dev_id, const char *attr_name, const uint64_t attr_value); @@ -372,7 +395,7 @@ rte_rawdev_set_attr(uint16_t dev_id, * @param dev_id * The identifier of the device to configure. * @param buffers - * Collection of buffers for enqueueing + * Collection of buffers for enqueuing * @param count * Count of buffers to enqueue * @param context @@ -383,7 +406,7 @@ rte_rawdev_set_attr(uint16_t dev_id, * Whether partial enqueue is failure or success is defined between app * and driver implementation. */ -int __rte_experimental +int rte_rawdev_enqueue_buffers(uint16_t dev_id, struct rte_rawdev_buf **buffers, unsigned int count, @@ -414,7 +437,7 @@ rte_rawdev_enqueue_buffers(uint16_t dev_id, * Whether partial enqueue is failure or success is defined between app * and driver implementation. */ -int __rte_experimental +int rte_rawdev_dequeue_buffers(uint16_t dev_id, struct rte_rawdev_buf **buffers, unsigned int count, @@ -454,7 +477,7 @@ struct rte_rawdev_xstats_name { * -ENODEV for invalid *dev_id* * -ENOTSUP if the device doesn't support this function. */ -int __rte_experimental +int rte_rawdev_xstats_names_get(uint16_t dev_id, struct rte_rawdev_xstats_name *xstats_names, unsigned int size); @@ -478,7 +501,7 @@ rte_rawdev_xstats_names_get(uint16_t dev_id, * -ENODEV for invalid *dev_id* * -ENOTSUP if the device doesn't support this function. */ -int __rte_experimental +int rte_rawdev_xstats_get(uint16_t dev_id, const unsigned int ids[], uint64_t values[], @@ -500,7 +523,7 @@ rte_rawdev_xstats_get(uint16_t dev_id, * - positive value or zero: the stat value * - negative value: -EINVAL if stat not found, -ENOTSUP if not supported. */ -uint64_t __rte_experimental +uint64_t rte_rawdev_xstats_by_name_get(uint16_t dev_id, const char *name, unsigned int *id); @@ -520,7 +543,7 @@ rte_rawdev_xstats_by_name_get(uint16_t dev_id, * - zero: successfully reset the statistics to zero * - negative value: -EINVAL invalid parameters, -ENOTSUP if not supported. */ -int __rte_experimental +int rte_rawdev_xstats_reset(uint16_t dev_id, const uint32_t ids[], uint32_t nb_ids); @@ -539,7 +562,7 @@ rte_rawdev_xstats_reset(uint16_t dev_id, * 0 for success, * !0 for failure, `status_info` argument state is undefined */ -int __rte_experimental +int rte_rawdev_firmware_status_get(uint16_t dev_id, rte_rawdev_obj_t status_info); @@ -557,7 +580,7 @@ rte_rawdev_firmware_status_get(uint16_t dev_id, * 0 for success, * !0 for failure, `version_info` argument state is undefined */ -int __rte_experimental +int rte_rawdev_firmware_version_get(uint16_t dev_id, rte_rawdev_obj_t version_info); @@ -574,7 +597,7 @@ rte_rawdev_firmware_version_get(uint16_t dev_id, * 0 for successful load * !0 for failure to load the provided image, or image incorrect. */ -int __rte_experimental +int rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image); /** @@ -586,7 +609,7 @@ rte_rawdev_firmware_load(uint16_t dev_id, rte_rawdev_obj_t firmware_image); * 0 for successful Unload * !0 for failure in unloading */ -int __rte_experimental +int rte_rawdev_firmware_unload(uint16_t dev_id); /** @@ -599,7 +622,7 @@ rte_rawdev_firmware_unload(uint16_t dev_id); * - -ENOTSUP if the device doesn't support selftest * - other values < 0 on failure. */ -int __rte_experimental +int rte_rawdev_selftest(uint16_t dev_id); #ifdef __cplusplus