return (*dev->dev_ops->firmware_unload)(dev);
}
+int __rte_experimental
+rte_rawdev_selftest(uint16_t dev_id)
+{
+ RTE_RAWDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+ struct rte_rawdev *dev = &rte_rawdevs[dev_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_selftest, -ENOTSUP);
+ return (*dev->dev_ops->dev_selftest)();
+}
+
int __rte_experimental
rte_rawdev_start(uint16_t dev_id)
{
int __rte_experimental
rte_rawdev_firmware_unload(uint16_t dev_id);
+/**
+ * Trigger the rawdev self test.
+ *
+ * @param dev_id
+ * The identifier of the device
+ * @return
+ * - 0: Selftest successful
+ * - -ENOTSUP if the device doesn't support selftest
+ * - other values < 0 on failure.
+ */
+int __rte_experimental
+rte_rawdev_selftest(uint16_t dev_id);
+
#ifdef __cplusplus
}
#endif
*/
typedef int (*rawdev_firmware_unload_t)(struct rte_rawdev *dev);
+/**
+ * Start rawdev selftest
+ *
+ * @return
+ * Return 0 on success
+ */
+typedef int (*rawdev_selftest_t)(void);
+
/** Rawdevice operations function pointer table */
struct rte_rawdev_ops {
/**< Get device info. */
rawdev_firmware_load_t firmware_load;
/**< Unload firmware */
rawdev_firmware_unload_t firmware_unload;
+
+ /**< Device selftest function */
+ rawdev_selftest_t dev_selftest;
};
/**
rte_rawdev_queue_setup;
rte_rawdev_queue_release;
rte_rawdev_reset;
+ rte_rawdev_selftest;
rte_rawdev_set_attr;
rte_rawdev_socket_id;
rte_rawdev_start;