5 #ifndef RTE_MLDEV_INTERNAL_H 6 #define RTE_MLDEV_INTERNAL_H 25 #include <dev_driver.h> 31 #define ML_DEV_DETACHED (0) 32 #define ML_DEV_ATTACHED (1) 53 typedef uint16_t (*mldev_enqueue_t)(
struct rte_ml_dev *dev, uint16_t qp_id,
struct rte_ml_op **ops,
73 typedef uint16_t (*mldev_dequeue_t)(
struct rte_ml_dev *dev, uint16_t qp_id,
struct rte_ml_op **ops,
92 typedef int (*mldev_op_error_get_t)(
struct rte_ml_dev *dev,
struct rte_ml_op *op,
130 typedef int (*mldev_configure_t)(
struct rte_ml_dev *dev,
const struct rte_ml_dev_config *config);
145 typedef int (*mldev_close_t)(
struct rte_ml_dev *dev);
159 typedef int (*mldev_start_t)(
struct rte_ml_dev *dev);
173 typedef int (*mldev_stop_t)(
struct rte_ml_dev *dev);
193 typedef int (*mldev_queue_pair_setup_t)(
struct rte_ml_dev *dev, uint16_t queue_pair_id,
211 typedef int (*mldev_queue_pair_release_t)(
struct rte_ml_dev *dev, uint16_t queue_pair_id);
227 typedef int (*mldev_stats_get_t)(
struct rte_ml_dev *dev,
struct rte_ml_dev_stats *stats);
237 typedef void (*mldev_stats_reset_t)(
struct rte_ml_dev *dev);
282 typedef int (*mldev_xstats_by_name_get_t)(
struct rte_ml_dev *dev,
const char *name,
283 uint16_t *stat_id, uint64_t *value);
308 int32_t model_id,
const uint16_t stat_ids[], uint64_t values[],
332 int32_t model_id,
const uint16_t stat_ids[], uint16_t nb_ids);
349 typedef int (*mldev_dump_t)(
struct rte_ml_dev *dev, FILE *fd);
363 typedef int (*mldev_selftest_t)(
struct rte_ml_dev *dev);
381 typedef int (*mldev_model_load_t)(
struct rte_ml_dev *dev,
struct rte_ml_model_params *params,
398 typedef int (*mldev_model_unload_t)(
struct rte_ml_dev *dev, uint16_t model_id);
414 typedef int (*mldev_model_start_t)(
struct rte_ml_dev *dev, uint16_t model_id);
430 typedef int (*mldev_model_stop_t)(
struct rte_ml_dev *dev, uint16_t model_id);
448 typedef int (*mldev_model_info_get_t)(
struct rte_ml_dev *dev, uint16_t model_id,
467 typedef int (*mldev_model_params_update_t)(
struct rte_ml_dev *dev, uint16_t model_id,
void *buffer);
487 typedef int (*mldev_io_quantize_t)(
struct rte_ml_dev *dev, uint16_t model_id,
509 typedef int (*mldev_io_dequantize_t)(
struct rte_ml_dev *dev, uint16_t model_id,
518 struct rte_ml_dev_ops {
523 mldev_configure_t dev_configure;
526 mldev_close_t dev_close;
529 mldev_start_t dev_start;
532 mldev_stop_t dev_stop;
535 mldev_queue_pair_setup_t dev_queue_pair_setup;
538 mldev_queue_pair_release_t dev_queue_pair_release;
541 mldev_stats_get_t dev_stats_get;
544 mldev_stats_reset_t dev_stats_reset;
547 mldev_xstats_names_get_t dev_xstats_names_get;
550 mldev_xstats_by_name_get_t dev_xstats_by_name_get;
553 mldev_xstats_get_t dev_xstats_get;
556 mldev_xstats_reset_t dev_xstats_reset;
559 mldev_dump_t dev_dump;
562 mldev_selftest_t dev_selftest;
565 mldev_model_load_t model_load;
568 mldev_model_unload_t model_unload;
571 mldev_model_start_t model_start;
574 mldev_model_stop_t model_stop;
577 mldev_model_info_get_t model_info_get;
580 mldev_model_params_update_t model_params_update;
583 mldev_io_quantize_t io_quantize;
586 mldev_io_dequantize_t io_dequantize;
595 struct rte_ml_dev_data {
603 __extension__ uint8_t dev_started : 1;
606 uint16_t nb_queue_pairs;
631 mldev_enqueue_t enqueue_burst;
634 mldev_dequeue_t dequeue_burst;
637 mldev_op_error_get_t op_error_get;
640 struct rte_ml_dev_data *data;
643 struct rte_ml_dev_ops *dev_ops;
646 struct rte_device *device;
649 __extension__ uint8_t attached : 1;
657 struct rte_ml_dev_global {
659 struct rte_ml_dev *devs;
662 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