1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (c) 2022 Marvell. 3 */ 4 5 #ifndef RTE_MLDEV_UTILS_H 6 #define RTE_MLDEV_UTILS_H 7 8 /** 9 * @file 10 * 11 * ML Device PMD utility API 12 * 13 * These APIs for the use from ML drivers, user applications shouldn't use them. 14 */ 15 16 #include <rte_compat.h> 17 #include <rte_mldev.h> 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 /** 24 * @internal 25 * 26 * Get the size an ML IO type in bytes. 27 * 28 * @param[in] type 29 * Enumeration of ML IO data type. 30 * 31 * @return 32 * - > 0, Size of the data type in bytes. 33 * - < 0, Error code on failure. 34 */ 35 __rte_internal 36 int 37 rte_ml_io_type_size_get(enum rte_ml_io_type type); 38 39 /** 40 * @internal 41 * 42 * Get the name of an ML IO type. 43 * 44 * @param[in] type 45 * Enumeration of ML IO data type. 46 * @param[in] str 47 * Address of character array. 48 * @param[in] len 49 * Length of character array. 50 */ 51 __rte_internal 52 void 53 rte_ml_io_type_to_str(enum rte_ml_io_type type, char *str, int len); 54 55 #ifdef __cplusplus 56 } 57 #endif 58 59 #endif /* RTE_MLDEV_UTILS_H */ 60