* @note
* Driver facing APIs for a raw device. These are not to be called directly by
* any application.
- *
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
*/
#ifdef __cplusplus
uint16_t nb_devs;
};
-extern struct rte_rawdev_global *rte_rawdev_globals;
-/** Pointer to global raw devices data structure. */
extern struct rte_rawdev *rte_rawdevs;
/** The pool of rte_rawdev structures. */
typedef int (*rawdev_queue_release_t)(struct rte_rawdev *dev,
uint16_t queue_id);
+/**
+ * Get the count of number of queues configured on this device.
+ *
+ * Another way to fetch this information is to fetch the device configuration.
+ * But, that assumes that the device configuration managed by the driver has
+ * that kind of information.
+ *
+ * This function helps in getting queue count supported, independently. It
+ * can help in cases where iterator needs to be implemented.
+ *
+ * @param
+ * Raw device pointer
+ * @return
+ * Number of queues; 0 is assumed to be a valid response.
+ *
+ */
+typedef uint16_t (*rawdev_queue_count_t)(struct rte_rawdev *dev);
+
/**
* Enqueue an array of raw buffers to the device.
*
* an opaque object representing context of the call; for example, an
* application can pass information about the queues on which enqueue needs
* to be done. Or, the enqueue operation might be passed reference to an
- * object containing a callback (agreed upon between applicatio and driver).
+ * object containing a callback (agreed upon between application and driver).
*
* @return
* >=0 Count of buffers successfully enqueued (0: no buffers enqueued)
rte_rawdev_obj_t version_info);
/**
- * Load firwmare from a buffer (DMA'able)
+ * Load firmware from a buffer (DMA'able)
*
* @param dev
* Raw device pointer
rte_rawdev_obj_t firmware_buf);
/**
- * Unload firwmare
+ * Unload firmware
*
* @param dev
* Raw device pointer
* @return
* Return 0 on success
*/
-typedef int (*rawdev_selftest_t)(void);
+typedef int (*rawdev_selftest_t)(uint16_t dev_id);
/** Rawdevice operations function pointer table */
struct rte_rawdev_ops {
rawdev_queue_setup_t queue_setup;
/**< Release an raw queue. */
rawdev_queue_release_t queue_release;
+ /**< Get the number of queues attached to the device */
+ rawdev_queue_count_t queue_count;
/**< Enqueue an array of raw buffers to device. */
rawdev_enqueue_bufs_t enqueue_bufs;
/**< Reset the statistics values in xstats. */
rawdev_xstats_reset_t xstats_reset;
- /**< Obtainer firmware status */
+ /**< Obtain firmware status */
rawdev_firmware_status_get_t firmware_status_get;
/**< Obtain firmware version information */
rawdev_firmware_version_get_t firmware_version_get;
* @param name
* Unique identifier name for each device
* @param dev_private_size
- * Private data allocated within rte_rawdev object.
+ * Size of private data memory allocated within rte_rawdev object.
+ * Set to 0 to disable internal memory allocation and allow for
+ * self-allocation.
* @param socket_id
* Socket to allocate resources on.
* @return