5 #ifndef RTE_MLDEV_INTERNAL_H 6 #define RTE_MLDEV_INTERNAL_H 21 #include <dev_driver.h> 27 #define ML_DEV_DETACHED (0) 28 #define ML_DEV_ATTACHED (1) 49 typedef uint16_t (*mldev_enqueue_t)(
struct rte_ml_dev *dev, uint16_t qp_id,
struct rte_ml_op **ops,
69 typedef uint16_t (*mldev_dequeue_t)(
struct rte_ml_dev *dev, uint16_t qp_id,
struct rte_ml_op **ops,
88 typedef int (*mldev_op_error_get_t)(
struct rte_ml_dev *dev,
struct rte_ml_op *op,
126 typedef int (*mldev_configure_t)(
struct rte_ml_dev *dev,
const struct rte_ml_dev_config *config);
141 typedef int (*mldev_close_t)(
struct rte_ml_dev *dev);
155 typedef int (*mldev_start_t)(
struct rte_ml_dev *dev);
169 typedef int (*mldev_stop_t)(
struct rte_ml_dev *dev);
189 typedef int (*mldev_queue_pair_setup_t)(
struct rte_ml_dev *dev, uint16_t queue_pair_id,
207 typedef int (*mldev_queue_pair_release_t)(
struct rte_ml_dev *dev, uint16_t queue_pair_id);
223 typedef int (*mldev_stats_get_t)(
struct rte_ml_dev *dev,
struct rte_ml_dev_stats *stats);
233 typedef void (*mldev_stats_reset_t)(
struct rte_ml_dev *dev);
278 typedef int (*mldev_xstats_by_name_get_t)(
struct rte_ml_dev *dev,
const char *name,
279 uint16_t *stat_id, uint64_t *value);
304 int32_t model_id,
const uint16_t stat_ids[], uint64_t values[],
328 int32_t model_id,
const uint16_t stat_ids[], uint16_t nb_ids);
345 typedef int (*mldev_dump_t)(
struct rte_ml_dev *dev, FILE *fd);
359 typedef int (*mldev_selftest_t)(
struct rte_ml_dev *dev);
377 typedef int (*mldev_model_load_t)(
struct rte_ml_dev *dev,
struct rte_ml_model_params *params,
394 typedef int (*mldev_model_unload_t)(
struct rte_ml_dev *dev, uint16_t model_id);
410 typedef int (*mldev_model_start_t)(
struct rte_ml_dev *dev, uint16_t model_id);
426 typedef int (*mldev_model_stop_t)(
struct rte_ml_dev *dev, uint16_t model_id);
444 typedef int (*mldev_model_info_get_t)(
struct rte_ml_dev *dev, uint16_t model_id,
463 typedef int (*mldev_model_params_update_t)(
struct rte_ml_dev *dev, uint16_t model_id,
void *buffer);
483 typedef int (*mldev_io_quantize_t)(
struct rte_ml_dev *dev, uint16_t model_id,
505 typedef int (*mldev_io_dequantize_t)(
struct rte_ml_dev *dev, uint16_t model_id,
514 struct rte_ml_dev_ops {
519 mldev_configure_t dev_configure;
522 mldev_close_t dev_close;
525 mldev_start_t dev_start;
528 mldev_stop_t dev_stop;
531 mldev_queue_pair_setup_t dev_queue_pair_setup;
534 mldev_queue_pair_release_t dev_queue_pair_release;
537 mldev_stats_get_t dev_stats_get;
540 mldev_stats_reset_t dev_stats_reset;
543 mldev_xstats_names_get_t dev_xstats_names_get;
546 mldev_xstats_by_name_get_t dev_xstats_by_name_get;
549 mldev_xstats_get_t dev_xstats_get;
552 mldev_xstats_reset_t dev_xstats_reset;
555 mldev_dump_t dev_dump;
558 mldev_selftest_t dev_selftest;
561 mldev_model_load_t model_load;
564 mldev_model_unload_t model_unload;
567 mldev_model_start_t model_start;
570 mldev_model_stop_t model_stop;
573 mldev_model_info_get_t model_info_get;
576 mldev_model_params_update_t model_params_update;
579 mldev_io_quantize_t io_quantize;
582 mldev_io_dequantize_t io_dequantize;
591 struct rte_ml_dev_data {
599 __extension__ uint8_t dev_started : 1;
602 uint16_t nb_queue_pairs;
627 mldev_enqueue_t enqueue_burst;
630 mldev_dequeue_t dequeue_burst;
633 mldev_op_error_get_t op_error_get;
636 struct rte_ml_dev_data *data;
639 struct rte_ml_dev_ops *dev_ops;
642 struct rte_device *device;
645 __extension__ uint8_t attached : 1;
653 struct rte_ml_dev_global {
655 struct rte_ml_dev *devs;
658 struct rte_ml_dev_data **data;
int(* mldev_info_get_t)(struct rte_ml_dev *dev, struct rte_ml_dev_info *dev_info)
#define __rte_cache_aligned