API References for DOCA 3.2.0

2. Modules

FlexIO SDK host API for DPA programs. Mostly used for DPA resource management and invocation of DPA programs.

Classes

struct dtrace_tp_report
struct flexio_affinity
struct flexio_app_select_attr
struct flexio_cmdq_attr
struct flexio_cq_attr
struct flexio_event_handler_attr
struct flexio_heap_mem_info
struct flexio_mem
struct flexio_mkey_attr
struct flexio_msg_stream_attr_t
struct flexio_outbox_attr
struct flexio_process_attr
struct flexio_qmem
struct flexio_qp_attr
struct flexio_qp_attr_opt_param_mask
struct flexio_rpc_attr
struct flexio_wq_attr
struct flexio_wq_rq_attr
struct flexio_wq_sq_attr
struct flexio_wq_sq_ext_attr
struct msg_bin_report

Defines

#define FLEXIO_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
#define FLEXIO_MAX_NAME_LEN (256)

Typedefs

typedef int(  ( *dtrace_user_cb_t )( void*  ctx, dtrace_tp_report*  reps,  int cnt )
typedef void(  flexio_func_arg_pack_fn_t
Callback function to pack the arguments for a function.
typedef void(  flexio_func_t
typedef uint32_t  flexio_uar_device_id
typedef uint64_t  flexio_uintptr_t

Enumerations

enum flexio_affinity_type
enum flexio_cmdq_state
enum flexio_cq_period_mode
enum flexio_cqe_comp_type
enum flexio_dtrace_output_mode
enum flexio_dtrace_transport_type
enum flexio_hw_model_id
enum flexio_log_lvl_t
enum flexio_memtype
enum flexio_msg_dev_sync_mode
enum flexio_msg_transport
enum flexio_qp_op_types
enum flexio_qp_qpc_mtu
enum flexio_qp_state
enum flexio_qp_transport_type
enum flexio_status
enum flexio_wq_end_pad_mode
enum flexio_wq_ts_format
enum flexio_wq_type

Functions

flexio_status flexio_app_extract_symbol ( flexio_app* app, const char* symbol_name, void* symbol_data, size_t* sym_data_size )
Extract symbol data from ELF binary associated with DPA application.
flexio_status flexio_app_get ( flexio_app_select_attr* fattr, flexio_app** app )
Gets a FlexIO app from app list.
flexio_status flexio_app_get_elf ( flexio_app* app, uint64_t* bin_buff, size_t bin_size )
Retrieve ELF binary associated with application.
FLEXIO_EXPERIMENTAL size_t flexio_app_get_elf_size ( flexio_app* app )
Gets a FlexIO application size.
flexio_status flexio_app_get_list ( flexio_app*** app_list, uint32_t* num_apps )
Get a list of FlexIO Apps that are available.
const FLEXIO_EXPERIMENTAL char* flexio_app_get_name ( flexio_app* app )
Gets a FlexIO application name.
flexio_status flexio_app_list_free ( flexio_app** apps_list )
Free the list of flexio apps.
flexio_status flexio_buf_dev_alloc ( flexio_process* process, size_t buff_bsize, flexio_uintptr_t* dest_daddr_p )
Allocates a buffer on FlexIO heap memory.
flexio_status flexio_buf_dev_free ( flexio_process* process, flexio_uintptr_t daddr )
Free FlexIO heap memory buffer.
flexio_status flexio_buf_dev_memalign ( flexio_process* process, size_t alignment, size_t buff_bsize, flexio_uintptr_t* dest_daddr_p )
Allocates a buffer on FlexIO heap memory.
flexio_status flexio_buf_dev_memset ( flexio_process* process, int  value, size_t buff_bsize, flexio_uintptr_t dest_daddr )
Sets DPA heap memory buffer to a given value.
flexio_status flexio_cmdq_create ( flexio_process* process, flexio_cmdq_attr* fattr, flexio_cmdq** cmdq )
Create asynchronous rpc command queue.
flexio_status flexio_cmdq_destroy ( flexio_cmdq* cmdq )
Destroy the command queue infrastructure.
FLEXIO_EXPERIMENTAL int flexio_cmdq_is_empty ( flexio_cmdq* cmdq )
Check if command queue is empty.
flexio_status flexio_cmdq_state_running ( flexio_cmdq* cmdq )
Move command queue to running state.
flexio_status flexio_cmdq_task_add ( flexio_cmdq* cmdq, flexio_func_t* host_func, uint64_t arg )
Add a task to the asynchronous rpc command queue.
flexio_status flexio_copy_from_host ( flexio_process* process, void* src_haddr, size_t buff_bsize, flexio_uintptr_t* dest_daddr_p )
Copy from host memory to FlexIO heap memory buffer.
flexio_status flexio_coredump_create ( flexio_process* process, const char* outfile )
Create a DPA core dump of the process.
flexio_status flexio_cq_create ( flexio_process* process, ibv_context* ibv_ctx, const flexio_cq_attr* fattr, flexio_cq** cq )
Creates a FlexIO CQ.
flexio_status flexio_cq_destroy ( flexio_cq* cq )
Destroys a FlexIO CQ.
FLEXIO_EXPERIMENTAL uint32_t flexio_cq_get_cq_num ( flexio_cq* cq )
Gets the FlexIO CQ number.
mlx5dv_devx_obj* flexio_cq_get_obj ( flexio_cq* cq )
Get the FlexIO CQ object.
flexio_status flexio_cq_modify_moderation ( flexio_cq* cq, uint16_t max_count, uint16_t period, uint16_t mode )
Modifies a FlexIO CQ moderation configuration.
flexio_status flexio_cq_query_moderation ( flexio_cq* cq, uint16_t* max_count, uint16_t* period, uint16_t* mode )
Queries a FlexIO CQ moderation configuration.
flexio_status flexio_crash_data ( flexio_process* process, const char* outfile )
Provide crash info in textual form.
flexio_status flexio_device_mkey_create ( flexio_process* process, flexio_mkey_attr* fattr, flexio_mkey** mkey )
Creates an Mkey to the process device UMEM.
flexio_status flexio_device_mkey_destroy ( flexio_mkey* mkey )
destroys an MKey object containing the given ID
flexio_status flexio_dtrace_create ( flexio_process* process )
Create a DPA tracer for FlexIO process.
flexio_status flexio_dtrace_destroy ( flexio_process* process )
Destroys existing DPA tracer.
flexio_status flexio_dtrace_init ( flexio_process* process )
Initiates process of creating a DPA tracer for FlexIO process.
flexio_status flexio_dtrace_ll_start ( flexio_process* process )
Start DPA tracer in lossless mode.
flexio_status flexio_dtrace_set_batch_depth ( flexio_process* process, size_t po2sz )
Set a DPA tracer batch depth.
flexio_status flexio_dtrace_set_cli_mgmt ( flexio_process* process, const char* mgmt_fname )
Enable a DPA tracer management from console.
flexio_status flexio_dtrace_set_dev_mem_limit ( flexio_process* process, size_t po2sz )
Set a DPA tracer DEV memory limit (in bytes).
flexio_status flexio_dtrace_set_diskspace_limit ( flexio_process* process, size_t size )
Set a DPA tracer disk space limit (in bytes).
flexio_status flexio_dtrace_set_host_mem_limit ( flexio_process* process, size_t po2sz )
Set a DPA tracer host memory limit (in bytes).
flexio_status flexio_dtrace_set_out_filename ( flexio_process* process, const char* out_filename )
Set a DPA tracer output file name.
flexio_status flexio_dtrace_set_output_mode ( flexio_process* process, flexio_dtrace_output_mode mode )
Set a DPA tracer output mode.
flexio_status flexio_dtrace_set_transport_type ( flexio_process* process, flexio_dtrace_transport_type type )
Set a DPA tracer transport type.
flexio_status flexio_dtrace_set_umem ( flexio_process* process, flexio_uintptr_t daddr, size_t po2sz )
Provides user memory to use by DPA tracer for report saving.
flexio_status flexio_dtrace_set_user_cb ( flexio_process* process, dtrace_user_cb_t user_cb, void* ctx )
Set user callback for a DPA tracer.
flexio_status flexio_dtrace_start ( flexio_process* process )
Start previously created DPA tracer.
flexio_status flexio_dtrace_stop ( flexio_process* process )
Stop the running DPA tracer.
FLEXIO_EXPERIMENTAL int flexio_err_handler_fd ( flexio_process* process )
Get file descriptor for error handler.
FLEXIO_EXPERIMENTAL int flexio_err_status_get ( flexio_process* process )
Check if unrecoverable error occurred.
flexio_status flexio_event_handler_create ( flexio_process* process, flexio_event_handler_attr* fattr, flexio_event_handler** event_handler_ptr )
Creates a FlexIO event handler.
flexio_status flexio_event_handler_destroy ( flexio_event_handler* event_handler )
Destroys a FlexIO event handler.
FLEXIO_EXPERIMENTAL uint32_t flexio_event_handler_get_activation_id ( flexio_event_handler* event_handler )
Query the FlexIO event handler activation id.
FLEXIO_EXPERIMENTAL uint32_t flexio_event_handler_get_id ( flexio_event_handler* event_handler )
Gets the ID from a FlexIO event handler's thread metadata.
FLEXIO_EXPERIMENTAL uint32_t flexio_event_handler_get_obj_id ( flexio_event_handler* event_handler )
Gets the object ID of a FlexIO event handler.
FLEXIO_EXPERIMENTAL flexio_thread* flexio_event_handler_get_thread ( flexio_event_handler* event_handler )
Gets a FlexIO thread object from a FlexIO event handler.
FLEXIO_EXPERIMENTAL mlx5dv_devx_obj* flexio_event_handler_get_thread_obj ( flexio_event_handler* event_handler )
Gets the thread object of a FlexIO event handler.
flexio_status flexio_event_handler_run ( flexio_event_handler* event_handler, uint64_t user_arg )
Run a FlexIO event handler.
flexio_status flexio_func_get_register_info ( flexio_app* app, flexio_func_t* dev_func_host_key, uint32_t* pup, char* dev_func_name, char* dev_unpack_func_name, size_t func_name_size, size_t* argbuf_size, flexio_func_arg_pack_fn_t** host_pack_func, flexio_uintptr_t* dev_func_addr, flexio_uintptr_t* dev_unpack_func_addr )
Obtain info for previously registered function.
flexio_status flexio_host2dev_memcpy ( flexio_process* process, void* src_haddr, size_t buff_bsize, flexio_uintptr_t dest_daddr )
Copy from host memory to a pre-allocated FlexIO heap memory buffer.
flexio_hw_model_id flexio_hw_model_id_get ( ibv_context* ibv_ctx )
Get FlexIO HW model ID.
flexio_status flexio_log_dev_destroy ( flexio_process* process )
Deprecated function. Use flexio_msg_stream_destroy() instead.
flexio_status flexio_log_dev_flush ( flexio_process* process )
Deprecated function. Use flexio_msg_stream_flush() instead.
flexio_status flexio_log_dev_init ( flexio_process* process, flexio_msg_stream_attr_t* stream_fattr, FILE* out, pthread_t* ppthread )
Deprecated function. Use flexio_msg_stream_create() instead.
FLEXIO_EXPERIMENTAL enum flexio_log_lvl flexio_log_lvl_set ( enum flexio_log_lvl lvl )
Sets host SDK logging level.
flexio_status flexio_memcpy ( flexio_process* process, flexio_mem* src, flexio_mem* dst, size_t buff_bsize )
Memory copy.
FLEXIO_EXPERIMENTAL uint32_t flexio_mkey_get_id ( flexio_mkey* mkey )
Gets the FlexIO MKey ID.
flexio_status flexio_msg_stream_create ( flexio_process* process, flexio_msg_stream_attr_t* stream_fattr, FILE* out, pthread_t* ppthread, flexio_msg_stream** stream )
Create a FlexIO msg stream that can contain output messages sent from the DPA.
flexio_status flexio_msg_stream_destroy ( flexio_msg_stream* stream )
Destroys a FlexIO msg stream.
flexio_status flexio_msg_stream_flush ( flexio_msg_stream* stream )
Flush a msg stream's buffer in case of asynchronous messaging mode.
FLEXIO_EXPERIMENTAL int flexio_msg_stream_get_id ( flexio_msg_stream* stream )
Gets the FlexIO device message stream's ID (aka file descriptor).
flexio_status flexio_msg_stream_level_set ( flexio_msg_stream* stream, flexio_msg_dev_level level )
Change the provided device message stream's level.
flexio_status flexio_msg_stream_qp_numbers_get ( flexio_msg_stream* stream, uint32_t* host_qp_number, uint32_t* dev_qp_number )
Gets the FlexIO device message stream's QPs numbers.
flexio_status flexio_outbox_create ( flexio_process* process, flexio_outbox_attr* fattr, flexio_outbox** outbox )
Creates a FlexIO outbox.
flexio_status flexio_outbox_destroy ( flexio_outbox* outbox )
Destroys a FlexIO outbox.
FLEXIO_EXPERIMENTAL uint32_t flexio_outbox_get_id ( flexio_outbox* outbox )
Gets the FlexIO outbox ID.
FLEXIO_EXPERIMENTAL flexio_uar* flexio_outbox_get_uar ( flexio_outbox* outbox )
Gets a FlexIO UAR object from a FlexIO outbox.
flexio_status flexio_process_call ( flexio_process* process, flexio_func_t* dev_func, uint64_t* func_ret, ... )
Calls a FlexIO process device function.
flexio_status flexio_process_call_with_attr ( flexio_process* process, flexio_rpc_attr* fattr, uint64_t* func_ret, ... )
Calls a FlexIO process device function with RPC attributes.
flexio_status flexio_process_create ( ibv_context* ibv_ctx, flexio_app* app, const flexio_process_attr* process_attr, flexio_process** process_ptr )
Create a new FlexIO process.
flexio_status flexio_process_destroy ( flexio_process* process )
Destroys a FlexIO process.
flexio_status flexio_process_error_handler_set ( flexio_process* process, flexio_func_t* error_handler )
Set the Flexio process error handler.
flexio_status flexio_process_extract_symbol ( flexio_process* process, const char* symbol_name, void* symbol_data, size_t* sym_data_size )
Extract symbol data from ELF binary associated with DPA process.
FLEXIO_EXPERIMENTAL uint32_t flexio_process_get_dumem_id ( flexio_process* process )
Gets the FlexIO process DUMEM ID.
FLEXIO_EXPERIMENTAL ibv_pd* flexio_process_get_pd ( flexio_process* process )
Gets a FlexIO IBV PD object from a FlexIO process.
FLEXIO_EXPERIMENTAL flexio_uar* flexio_process_get_uar ( flexio_process* process )
Gets a FlexIO UAR object from a FlexIO process.
flexio_status flexio_process_mem_info_get ( const flexio_process* process, flexio_heap_mem_info* info )
Get process memory info.
FLEXIO_EXPERIMENTAL uint64_t flexio_process_udbg_token_get ( flexio_process* process )
Get token for FlexIO process debug access.
flexio_status flexio_qp_create ( flexio_process* process, ibv_context* ibv_ctx, flexio_qp_attr* qp_fattr, flexio_qp** qp_ptr )
Creates a FlexIO QP.
flexio_status flexio_qp_destroy ( flexio_qp* qp )
Destroys a FlexIO QP.
FLEXIO_EXPERIMENTAL uint32_t flexio_qp_get_qp_num ( flexio_qp* qp )
Gets the FlexIO QP number.
flexio_status flexio_qp_modify ( flexio_qp* qp, flexio_qp_attr* fattr, flexio_qp_attr_opt_param_mask* mask )
Modify FlexIO QP.
flexio_qp_state flexio_qp_state_get ( flexio_qp* qp )
retrieve the device QP state.
flexio_status flexio_recoverable_buf_dev_alloc ( flexio_process* process, size_t buff_bsize, uint32_t mkey, flexio_uintptr_t* dest_daddr_p )
Allocates a recoverable buffer on FlexIO heap memory.
flexio_status flexio_resources_create ( const char* key, const void* buf, size_t buf_bsize, flexio_resource** res )
Create a FlexIO resources struct.
flexio_status flexio_resources_destroy ( flexio_resource* res )
Destroy a FlexIO resources struct.
FLEXIO_EXPERIMENTAL char* flexio_resources_get_app_name ( flexio_resource* res )
Get application name from a FlexIO resources struct.
FLEXIO_EXPERIMENTAL uint32_t* flexio_resources_get_eugs ( flexio_resource* res )
Get execution unit groups list from a FlexIO resources struct.
FLEXIO_EXPERIMENTAL int flexio_resources_get_eugs_num ( flexio_resource* res )
Get number of execution groups from a FlexIO resources struct.
FLEXIO_EXPERIMENTAL uint32_t* flexio_resources_get_eus ( flexio_resource* res )
Get execution units list from a FlexIO resources struct.
FLEXIO_EXPERIMENTAL int flexio_resources_get_eus_num ( flexio_resource* res )
Get execution units number from a FlexIO resources struct.
flexio_status flexio_rmp_create ( flexio_process* process, ibv_context* ibv_ctx, const flexio_wq_attr* fattr, flexio_rmp** flexio_rmp_ptr )
Creates a FlexIO RMP.
flexio_status flexio_rmp_destroy ( flexio_rmp* flexio_rmp )
Destroys a FlexIO RMP.
FLEXIO_EXPERIMENTAL uint32_t flexio_rmp_get_wq_num ( flexio_rmp* rmp )
Gets the FlexIO RMP number.
flexio_status flexio_rq_create ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_rq** flexio_rq_ptr )
Creates a FlexIO RQ.
flexio_status flexio_rq_create_cross_dev ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_rq** flexio_rq_ptr )
Creates a FlexIO RQ assuming cross device.
flexio_status flexio_rq_destroy ( flexio_rq* flexio_rq )
Destroys a FlexIO RQ.
FLEXIO_EXPERIMENTAL mlx5dv_devx_obj* flexio_rq_get_object ( flexio_rq* rq )
Get the FlexIO RQ object.
FLEXIO_EXPERIMENTAL mlx5dv_devx_obj* flexio_rq_get_tir ( flexio_rq* rq )
Gets the FlexIO RQ TIR object.
FLEXIO_EXPERIMENTAL uint32_t flexio_rq_get_wq_num ( flexio_rq* rq )
Gets the FlexIO RQ number.
flexio_status flexio_rq_set_err_state ( flexio_rq* rq )
Sets a FlexIO RQ to error state.
flexio_status flexio_sq_create ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_sq** flexio_sq_ptr )
Creates a FlexIO SQ.
flexio_status flexio_sq_create_cross_dev ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_sq** flexio_sq_ptr )
Creates a FlexIO SQ assuming cross device.
flexio_status flexio_sq_destroy ( flexio_sq* flexio_sq )
Destroys a FlexIO SQ.
FLEXIO_EXPERIMENTAL uint32_t flexio_sq_get_wq_num ( flexio_sq* sq )
Gets the FlexIO SQ number.
flexio_status flexio_sq_tis_create ( ibv_context* ibv_ctx, flexio_transport_domain* td, flexio_sq_tis** tis )
Creates a FlexIO SQ transport interface send (TIS) object.
flexio_status flexio_sq_tis_destroy ( flexio_sq_tis* tis )
Destroys a FlexIO SQ TIS.
flexio_status flexio_transport_domain_create ( ibv_context* ibv_ctx, flexio_transport_domain** td )
Create a FlexIO transport domain (TD).
flexio_status flexio_transport_domain_destroy ( flexio_transport_domain* td )
Destroy a FlexIO transport domain (TD).
flexio_status flexio_uar_create ( flexio_process* process, flexio_uar** flexio_uar )
Creates a FlexIO UAR object.
flexio_status flexio_uar_destroy ( flexio_uar* uar )
destroys a FlexIO UAR object
flexio_status flexio_uar_extend ( flexio_uar* in_uar, ibv_context* to_extend, flexio_uar** extended )
Extend UAR to an ibv context.
flexio_uar_device_id flexio_uar_get_extended_id ( flexio_uar* uar )
Gets the FlexIO extended UAR ID.
FLEXIO_EXPERIMENTAL uint32_t flexio_uar_get_id ( flexio_uar* uar )
Gets the FlexIO UAR ID.
flexio_status flexio_version_set ( uint64_t version )
Set version for flexio.
flexio_status flexio_window_create ( flexio_process* process, ibv_pd* pd, flexio_window** window )
Creates a FlexIO window.
flexio_status flexio_window_destroy ( flexio_window* window )
Destroys a FlexIO window.
FLEXIO_EXPERIMENTAL uint32_t flexio_window_get_id ( flexio_window* window )
Gets the FlexIO window ID.

Defines

#define FLEXIO_EXPERIMENTAL

Value

__attribute__((deprecated("Symbol is defined as experimental"), \ section(".text.experimental"))) \ FLEXIO_STABLE

#define FLEXIO_MAX_NAME_LEN (256)

Maximum length of application and device function names

Typedefs

int( ( *dtrace_user_cb_t )( void*  ctx, dtrace_tp_report*  reps,  int cnt )

DPA Tracer user callback type definition. ctx - value, given by user as a context for this callback reps - pointer to array of TP reports cnt - amount of elements it the array from the previous argument return value - positive - amount of processed elements from the array (constantly null will cause deadlock) negative - error case. Caused error message printing on the console

typedef void( flexio_func_arg_pack_fn_t

Callback function to pack the arguments for a function. This function is called internally from the FlexIO runtime upon user making a call (e.g., flexio_process_call). It packs the arguments for a user function into the argument buffer provided in `argbuf`. The argument list can be arbitrarily long and is represented by `ap`. The correct usage of this function requires the caller to initialize the list using `va_start`.

Relevant for hostful applications only.

typedef void( flexio_func_t

FlexIO application function prototype.

typedef uint32_t flexio_uar_device_id

FlexIO UAR extension ID prototype.

typedef uint64_t flexio_uintptr_t

FlexIO address type.

Enumerations

enum flexio_affinity_type

FlexIO thread affinity types.

Values
FLEXIO_AFFINITY_NONE = 0
FLEXIO_AFFINITY_STRICT
FLEXIO_AFFINITY_GROUP

enum flexio_cmdq_state

FlexIO command queue states. Relevant for hostful applications only.

Values
FLEXIO_CMDQ_STATE_PENDING = 0
FLEXIO_CMDQ_STATE_RUNNING = 1

enum flexio_cq_period_mode

FlexIO CQ CQE compression period modes.

Values
FLEXIO_CQ_PERIOD_MODE_EVENT = 0x0
FLEXIO_CQ_PERIOD_MODE_CQE = 0x1

enum flexio_cqe_comp_type

FlexIO CQ CQE compression modes.

Values
FLEXIO_CQE_COMP_NONE = 0x0
FLEXIO_CQE_COMP_ENABLE = 0x2

enum flexio_dtrace_output_mode

DPA Tracer supported output modes. Relevant for hostful applications only.

Values
FLEXIO_DTRACE_OUTPUT_MODE_BIN = 0
FLEXIO_DTRACE_OUTPUT_MODE_CSV = 1
FLEXIO_DTRACE_OUTPUT_MODE_CB = 2

enum flexio_dtrace_transport_type

DPA Tracer supported transportation types.

Values
FLEXIO_DTRACE_TRANSPORT_TYPE_QP_UC = 0
FLEXIO_DTRACE_TRANSPORT_TYPE_WINDOW = 1
FLEXIO_DTRACE_TRANSPORT_TYPE_DBUF = 2
FLEXIO_DTRACE_TRANSPORT_TYPE_UMEM = 3

enum flexio_hw_model_id

FlexIO HW model ID. Relevant for hostful applications only.

Values
FLEXIO_HW_MODEL_DEF = 0
FLEXIO_HW_MODEL_CX7 = 1
FLEXIO_HW_MODEL_BF3 = 2
FLEXIO_HW_MODEL_CX8 = 3
FLEXIO_HW_MODEL_CX9 = 4
FLEXIO_HW_MODEL_NA = 0xFFFF

enum flexio_log_lvl_t

FlexIO SDK host logging levels. Relevant for hostful applications only.

Values
FLEXIO_LOG_LVL_ERR = 0
FLEXIO_LOG_LVL_WARN = 1
FLEXIO_LOG_LVL_INFO = 2
FLEXIO_LOG_LVL_DBG = 3

enum flexio_memtype

FlexIO memory types.

Values
FLEXIO_MEMTYPE_DPA = 0
FLEXIO_MEMTYPE_HOST = 1

enum flexio_msg_dev_sync_mode

FlexIO device messaging synchronization modes.

Values
FLEXIO_MSG_DEV_SYNC_MODE_SYNC = 0
FLEXIO_MSG_DEV_SYNC_MODE_ASYNC = 1
FLEXIO_MSG_DEV_SYNC_MODE_BATCH = 2
FLEXIO_MSG_DEV_SYNC_MODE_TRACER = 3
FLEXIO_LOG_DEV_SYNC_MODE_SYNC = 0
FLEXIO_LOG_DEV_SYNC_MODE_ASYNC = 1
FLEXIO_LOG_DEV_SYNC_MODE_BATCH = 2
FLEXIO_LOG_DEV_SYNC_MODE_TRACER = 3

enum flexio_msg_transport

FlexIO device messaging transport modes.

Values
FLEXIO_MSG_TRANSPORT_QP_RC = 0
FLEXIO_MSG_TRANSPORT_WINDOW = 1
FLEXIO_MSG_TRANSPORT_QP_UC = 2
FLEXIO_MSG_TRANSPORT_QP_UD = 3
FLEXIO_TRACER_TRANSPORT_QP = 0
FLEXIO_TRACER_TRANSPORT_WINDOW = 1

enum flexio_qp_op_types

FlexIO QP operation types.

Values
FLEXIO_QP_WR_RDMA_WRITE = 0x4
FLEXIO_QP_WR_RDMA_READ = 0x8
FLEXIO_QP_WR_ATOMIC_CMP_AND_SWAP = 0x10

enum flexio_qp_qpc_mtu

FlexIO QP possible MTU values.

Values
FLEXIO_QP_QPC_MTU_BYTES_256 = 0x1
FLEXIO_QP_QPC_MTU_BYTES_512 = 0x2
FLEXIO_QP_QPC_MTU_BYTES_1K = 0x3
FLEXIO_QP_QPC_MTU_BYTES_2K = 0x4
FLEXIO_QP_QPC_MTU_BYTES_4K = 0x5

enum flexio_qp_state

FlexIO QP states.

Values
FLEXIO_QP_STATE_RST = 0x0
FLEXIO_QP_STATE_INIT = 0x1
FLEXIO_QP_STATE_RTR = 0x2
FLEXIO_QP_STATE_RTS = 0x3
FLEXIO_QP_STATE_ERR = 0x6

enum flexio_qp_transport_type

FlexIO QP transport service type.

Values
FLEXIO_QPC_ST_RC = 0x0
FLEXIO_QPC_ST_UC = 0x1
FLEXIO_QPC_ST_UD = 0x2
FLEXIO_QPC_ST_XRC = 0x3
FLEXIO_QPC_ST_IBL2 = 0x4
FLEXIO_QPC_ST_DCI = 0x5
FLEXIO_QPC_ST_QP0 = 0x7
FLEXIO_QPC_ST_QP1 = 0x8
FLEXIO_QPC_ST_RAW_DATAGRAM = 0x9
FLEXIO_QPC_ST_REG_UMR = 0xc
FLEXIO_QPC_ST_DC_CNAK = 0x10

enum flexio_status

FlexIO API function return codes.

Values
FLEXIO_STATUS_SUCCESS = 0
FLEXIO_STATUS_FAILED = 1
FLEXIO_STATUS_TIMEOUT = 2
FLEXIO_STATUS_FATAL_ERR = 3

enum flexio_wq_end_pad_mode

FlexIO supported WQ types.

Values
FLEXIO_WQ_END_PAD_NONE = 0x0
FLEXIO_WQ_END_PAD_ALIGN = 0x1

enum flexio_wq_ts_format

FlexIO supported WQ timestamp formats.

Values
FLEXIO_WQC_TS_FORMAT_FREE_RUNNING_TS = 0x0
Free running timestamp format.
FLEXIO_WQC_TS_FORMAT_DEFAULT_TS = 0x1
Default timestamp format that is selected by the device.
FLEXIO_WQC_TS_FORMAT_REAL_TIME_TS = 0x2
Real time timestamp format.

enum flexio_wq_type

FlexIO supported WQ types.

Values
FLEXIO_WQ_TYPE_LINKED_LIST = 0x0
FLEXIO_WQ_TYPE_CYCLIC = 0x1

Functions

flexio_status flexio_app_extract_symbol ( flexio_app* app, const char* symbol_name, void* symbol_data, size_t* sym_data_size )
Extract symbol data from ELF binary associated with DPA application.
Parameters
app
- App that created before.
symbol_name
- Symbol name for which data should be retrieved for.
symbol_data
- Buffer to copy into it the data associated with symbol.
sym_data_size
- Input is the size of the buffer for data associated with symbol. Output is the size of the actual data that was copied. Set to zero if symbol was not found in ELF.

Returns

flexio status value.

Description

This function extracts data associated with the input symbol from the DPA application ELF. The type of the data is unknown to the FlexIO, and should be defined by the user. No data is copied if symbol is not found in ELF or size in ELF is zero.

Relevant for hostful applications only.

flexio_status flexio_app_get ( flexio_app_select_attr* fattr, flexio_app** app )
Gets a FlexIO app from app list.
Parameters
fattr
- A pointer to the application selection attributes struct.
app
- Selected app (NULL on failure).

Returns

flexio status value.

Description

This function gets a FlexIO app by name and HW model from the app list. The user may use this function in run time for dynamically select the application to run over the current HW model. Specifying FLEXIO_HW_MODEL_DEF as HW model ID will automatically select the best suited HW model. In case user program doesn't reference an entry point from the device program, flexio_app_get() will return NULL.

Relevant for hostful applications only.

flexio_status flexio_app_get_elf ( flexio_app* app, uint64_t* bin_buff, size_t bin_size )
Retrieve ELF binary associated with application.
Parameters
app
- App that created before.
bin_buff
- Pointer to buffer to copy ELF binary.
bin_size
- Size of buffer pointed by bin_buff. If parameter is smaller than ELF binary size function will fail.

Returns

flexio status value.

Description

This function registers the function name, stub address with the runtime. Compiler calls this from within the constructor.

Relevant for hostful applications only.

Note: FlexIO user should never call this function.

FLEXIO_EXPERIMENTAL size_t flexio_app_get_elf_size ( flexio_app* app )
Gets a FlexIO application size.
Parameters
app
- A pointer to a FlexIO application.

Returns

the application's size (bytes) or NULL on error.

Description

Relevant for hostful applications only.

flexio_status flexio_app_get_list ( flexio_app*** app_list, uint32_t* num_apps )
Get a list of FlexIO Apps that are available.
Parameters
app_list
- A list of apps that are available.
num_apps
- number of apps to obtain / obtained.

Returns

flexio status value.

Description

This function returns a list of FlexIO apps that are loaded.

Relevant for hostful applications only.

const FLEXIO_EXPERIMENTAL char* flexio_app_get_name ( flexio_app* app )
Gets a FlexIO application name.
Parameters
app
- A pointer to a FlexIO application.

Returns

the application's name or NULL on error.

Description

Relevant for hostful applications only.

flexio_status flexio_app_list_free ( flexio_app** apps_list )
Free the list of flexio apps.
Parameters
apps_list
- list obtained previously.

Returns

flexio status value.

Description

This function frees the list of apps obtained from `flexio_app_get_list`.

Relevant for hostful applications only.

flexio_status flexio_buf_dev_alloc ( flexio_process* process, size_t buff_bsize, flexio_uintptr_t* dest_daddr_p )
Allocates a buffer on FlexIO heap memory.
Parameters
process
- A pointer to the FlexIO process context.
buff_bsize
- The size of the buffer to allocate. Zero value is valid argument.
dest_daddr_p
- A pointer to the FlexIO address, where the buffer was allocated. If buff_bsize is 0, then address is either 0, or a correct value that must later be passed to flexio_buf_dev_free().

Returns

flexio status value.

Description

This function allocates a buffer with the requested size on the FlexIO heap memory. On success - sets dest_daddr_p to the start address of the allocated buffer. On Failure - sets dest_daddr_p to 0x0.

flexio_status flexio_buf_dev_free ( flexio_process* process, flexio_uintptr_t daddr )
Free FlexIO heap memory buffer.
Parameters
process
- A pointer to the FlexIO process context.
daddr
- A pointer to an address of allocated memory on the FlexIO heap. Zero value is valid argument.

Returns

flexio status value.

Description

This function frees FlexIO heap memory buffer by address.

flexio_status flexio_buf_dev_memalign ( flexio_process* process, size_t alignment, size_t buff_bsize, flexio_uintptr_t* dest_daddr_p )
Allocates a buffer on FlexIO heap memory.
Parameters
process
- A pointer to the FlexIO process context.
alignment
- The alignment argument. Must be a power of two and a multiple of 64.
buff_bsize
- The size of the buffer to allocate. Zero value is valid argument.
dest_daddr_p
- A pointer to the FlexIO address, where the buffer was allocated. If buff_bsize is 0, then address is either 0, or a correct value that must later be passed to flexio_buf_dev_free().

Returns

flexio status value.

Description

This function allocates a buffer with the requested size on the FlexIO heap memory. The address of the allocated memory will be a multiple of alignment, which must be a power of two and a multiple of 64.

On success - sets dest_daddr_p to the start address of the allocated buffer. On Failure - sets dest_daddr_p to 0x0.

flexio_status flexio_buf_dev_memset ( flexio_process* process, int  value, size_t buff_bsize, flexio_uintptr_t dest_daddr )
Sets DPA heap memory buffer to a given value.
Parameters
process
- A pointer to the FlexIO process context.
value
- A value to set the DPA heap memory buffer to.
buff_bsize
- The size of the FlexIO heap memory buffer.
dest_daddr
- FlexIO heap memory buffer address to set.

Returns

flexio status value.

Description

Relevant for hostful applications only.

flexio_status flexio_cmdq_create ( flexio_process* process, flexio_cmdq_attr* fattr, flexio_cmdq** cmdq )
Create asynchronous rpc command queue.
Parameters
process
- A pointer to the process context.
fattr
- A pointer to the command queue attributes struct.
cmdq
- A pointer to the created command queue context pointer.

Returns

flexio status value.

Description

This function creates the asynchronous rpc command queue infrastructure allowing background tasks execution.

Relevant for hostful applications only.

flexio_status flexio_cmdq_destroy ( flexio_cmdq* cmdq )
Destroy the command queue infrastructure.
Parameters
cmdq
- A pointer to the command queue context.

Returns

flexio status value.

Description

This function destroy the command queue infrastructure and release all its resources.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL int flexio_cmdq_is_empty ( flexio_cmdq* cmdq )
Check if command queue is empty.
Parameters
cmdq
- A pointer to the command queue context.

Returns

boolean.

Description

This function checks if the command queue is empty and all jobs up to this point where performed.

Relevant for hostful applications only.

flexio_status flexio_cmdq_state_running ( flexio_cmdq* cmdq )
Move command queue to running state.
Parameters
cmdq
- A pointer to the command queue context.

Returns

flexio status value.

Description

This function moves the command queue to running state in the case the queue was create in pending state. Otherwise has no affect.

Relevant for hostful applications only.

flexio_status flexio_cmdq_task_add ( flexio_cmdq* cmdq, flexio_func_t* host_func, uint64_t arg )
Add a task to the asynchronous rpc command queue.
Parameters
cmdq
- A pointer to the command queue context.
host_func
- host stub function for DPA function to execute.
arg
- user argument to function.

Returns

flexio status value.

Description

This function adds a task to the asynchronous rpc command queue to be executed by DPA in background. allowing background jobs execution.

Relevant for hostful applications only.

flexio_status flexio_copy_from_host ( flexio_process* process, void* src_haddr, size_t buff_bsize, flexio_uintptr_t* dest_daddr_p )
Copy from host memory to FlexIO heap memory buffer.
Parameters
process
- A pointer to the FlexIO process context.
src_haddr
- An address of the buffer on the host memory.
buff_bsize
- The size of the buffer to copy.
dest_daddr_p
- A pointer to the FlexIO address, where the buffer was copied to.

Returns

flexio status value.

Description

This function copies data from a buffer on the host memory to the FlexIO memory. The function allocates memory on the device heap which dest_address points to. It is the caller responsibility to deallocate this memory when it is no longer used.

Relevant for hostful applications only.

flexio_status flexio_coredump_create ( flexio_process* process, const char* outfile )
Create a DPA core dump of the process.
Parameters
process
- A pointer to a flexio_process
outfile
- pathname to write ELF formatted core dump data too. If NULL - filename will be generated in form flexio_dev.NNN.core, where NNN is the process id. If outfile is not NULL - suffix .NNN.core will be added. If outfile starts from slash (/pathname) - it will be passed with suffix described above to fopen() otherwise outfile will be created in the current directory or (if failed) in /tmp directory

Returns

flexio status value.

Description

This function creates a core dump image of a process and all it's threads, and is intended to be used after a fatal error or abnormal termination to allow the user to debug DPA application code.

There must be sufficient free memory to allocate 2-3 times the maximum core file size for intermediate processing before the elf file is written.

Memory windows that may be referenced by DPA code are *not* dumped by this code and must be handled separately if the data is desired.

Relevant for hostful applications only.

flexio_status flexio_cq_create ( flexio_process* process, ibv_context* ibv_ctx, const flexio_cq_attr* fattr, flexio_cq** cq )
Creates a FlexIO CQ.
Parameters
process
- A pointer to the FlexIO process.
ibv_ctx
- A pointer to an IBV device context (might be different than process'). If NULL - process' will be used.
fattr
- A pointer to the CQ attributes struct.
cq
- A pointer to the created CQ context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO CQ.

flexio_status flexio_cq_destroy ( flexio_cq* cq )
Destroys a FlexIO CQ.
Parameters
cq
- A pointer to a CQ context.

Returns

flexio status value.

Description

This function destroys a FlexIO CQ.

FLEXIO_EXPERIMENTAL uint32_t flexio_cq_get_cq_num ( flexio_cq* cq )
Gets the FlexIO CQ number.
Parameters
cq
- A pointer to a FlexIO CQ.

Returns

the CQ number or UINT32_MAX on error.

Description

mlx5dv_devx_obj* flexio_cq_get_obj ( flexio_cq* cq )
Get the FlexIO CQ object.
Parameters
cq
- A pointer to the CQ context.

Returns

the CQ devx object.

Description

This function returns the FlexIO CQ object.

Relevant for hostful applications only.

flexio_status flexio_cq_modify_moderation ( flexio_cq* cq, uint16_t max_count, uint16_t period, uint16_t mode )
Modifies a FlexIO CQ moderation configuration.
Parameters
cq
- A pointer to a CQ context.
max_count
- CQ moderation max count value.
period
- CQ moderation period value.
mode
- CQ moderation mode value.

Returns

flexio status value.

Description

Relevant for hostful applications only.

flexio_status flexio_cq_query_moderation ( flexio_cq* cq, uint16_t* max_count, uint16_t* period, uint16_t* mode )
Queries a FlexIO CQ moderation configuration.
Parameters
cq
- A pointer to a CQ context.
max_count
- A pointer to the CQ moderation max count value.
period
- A pointer to the CQ moderation period value.
mode
- A pointer to the CQ moderation mode value.

Returns

flexio status value.

Description

Relevant for hostful applications only.

flexio_status flexio_crash_data ( flexio_process* process, const char* outfile )
Provide crash info in textual form.
Parameters
process
- A pointer to a flexio_process
outfile
- pathname to write ELF formatted core dump data too. If NULL - filename will be generated in form flexio_dev.NNN.crash, where NNN is the process id. If outfile is not NULL - suffix .NNN.crash will be added. If outfile starts from slash (/pathname) - it will be passed with suffix described above to fopen() otherwise outfile will be created in the current directory or (if failed) in /tmp directory

Returns

flexio status value.

Description

This function displays useful crash info in textual form. Info will be printed on console and duplicated to outfile

Relevant for hostful applications only.

flexio_status flexio_device_mkey_create ( flexio_process* process, flexio_mkey_attr* fattr, flexio_mkey** mkey )
Creates an Mkey to the process device UMEM.
Parameters
process
- A pointer to the FlexIO process context.
fattr
- A pointer to a FlexIO MKey attribute struct.
mkey
- A pointer to a pointer to the created MKey struct.

Returns

flexio status value.

Description

This function creates an MKey over the provided PD for the provided process device UMEM. The mkey_id will point to the field in the containing flexio_mkey object.

flexio_status flexio_device_mkey_destroy ( flexio_mkey* mkey )
destroys an MKey object containing the given ID
Parameters
mkey
- A pointer to the FlexIO MKey to destroy. NULL is a valid value.

Returns

flexio status value.

Description

This function destroys an Mkey object containing the given ID.

flexio_status flexio_dtrace_create ( flexio_process* process )
Create a DPA tracer for FlexIO process.
Parameters
process
- A pointer to a FlexIO process.

Returns

flexio status value.

Description

Finishes process of creating a tracer with currently set parameters. No modifications of parameters are allowed after calling this function. Use flexio_dtrace_destroy() to destroy.

Use flexio_dtrace_start()/flexio_dtrace_ll_start()/flexio_dtrace_stop() or CLI commands (see flexio_dtrace_set_cli_mgmt()) to actually start tracing.

flexio_status flexio_dtrace_destroy ( flexio_process* process )
Destroys existing DPA tracer.
Parameters
process
- A pointer to a FlexIO process.

Returns

flexio status value.

Description

This function destroys the existing FlexIO process tracer and free its resources. Should be called prior to calling the FlexIO process destroy API. Once called, if needed, a new tracer instance can be initialized for further tracing.

flexio_status flexio_dtrace_init ( flexio_process* process )
Initiates process of creating a DPA tracer for FlexIO process.
Parameters
process
- A pointer to a FlexIO process.

Returns

flexio status value.

Description

Initiates a tracer for FlexIO process with default parameters. Tracer parameters can be modified later using flexio_dtrace_set_XXX functions.

flexio_status flexio_dtrace_ll_start ( flexio_process* process )
Start DPA tracer in lossless mode.
Parameters
process
- A pointer to a FlexIO process.

Returns

flexio status value.

Description

Set tracing to start in lossless mode. Similar to flexio_dtrace_start(). In lossless mode tracing works only until DEV side memory (see flexio_dtrace_set_dev_mem_limit()) fully filled.

NOTE: Despite its apparent attractiveness, lossless mode is not native for tracers. If you think about usage this mode - possible you have to use regular print (_msg_stream_) mechanism instead.

flexio_status flexio_dtrace_set_batch_depth ( flexio_process* process, size_t po2sz )
Set a DPA tracer batch depth.
Parameters
process
- A pointer to a FlexIO process.
po2sz
- set value (in TP reports). Must be a power of two. default - 64. max - flexio_dtrace_set_dev_mem_limit/4/sizeof(struct dtrace_tp_report)

Returns

flexio status value.

Description

DPA tracer sends TP reports by batches. Size of batch may influence throughput, latency and other usability parameters.

flexio_status flexio_dtrace_set_cli_mgmt ( flexio_process* process, const char* mgmt_fname )
Enable a DPA tracer management from console.
Parameters
process
- A pointer to a FlexIO process.
mgmt_fname
- pathname to the FIFO pipe, used for the management. NULL means usage of default name /tmp/flexio_dtrace_cli.fifo

Returns

flexio status value.

Description

When enabled, tracer can only be activated by a CLI command given from Shell console. Usage: $> echo time_in_sec > cli_mgmt_file_name For example: $> echo 10 > /tmp/flexio_dtrace_cli.fifo for activating the tracer for 10 seconds See DTrace documentation for list of all supported commands.

Relevant for hostful applications only.

flexio_status flexio_dtrace_set_dev_mem_limit ( flexio_process* process, size_t po2sz )
Set a DPA tracer DEV memory limit (in bytes).
Parameters
process
- A pointer to a FlexIO process.
po2sz
- set value in bytes. Must be a power of two. default - 512K, (16K for FLEXIO_DTRACE_TRANSPORT_TYPE_DBUF)) minimum 1K Can't exceed host memory usage limit

Returns

flexio status value.

Description

This function set the device memory size to be used by the tracer for collect TP reports. Given value must be a power of two. Can't exceed host memory usage limit, set by function flexio_dtrace_set_host_mem_limit()

flexio_status flexio_dtrace_set_diskspace_limit ( flexio_process* process, size_t size )
Set a DPA tracer disk space limit (in bytes).
Parameters
process
- A pointer to a FlexIO process.
size
- set value (in bytes) default - 1GB minimum - 1MB

Returns

flexio status value.

Description

The tracer can run continuously for life time period. Disk space limitation prevents disk abuse. Output files totally can't exceed given limit.

Relevant for hostful applications only.

flexio_status flexio_dtrace_set_host_mem_limit ( flexio_process* process, size_t po2sz )
Set a DPA tracer host memory limit (in bytes).
Parameters
process
- A pointer to a FlexIO process.
po2sz
- set value in bytes. Must be a power of two. default - 512K minimum 1K

Returns

flexio status value.

Description

This function set the host memory size to be used by the tracer for receiving traced data. Given value must be a power of two.

Relevant for hostful applications only.

flexio_status flexio_dtrace_set_out_filename ( flexio_process* process, const char* out_filename )
Set a DPA tracer output file name.
Parameters
process
- A pointer to a FlexIO process.
out_filename
- string that contains the name of file (without suffix). Defaults: /tmp/flexio_dtrace.bin for FLEXIO_DTRACE_OUTPUT_MODE_BIN mode /tmp/flexio_dtrace.csv for FLEXIO_DTRACE_OUTPUT_MODE_CSV mode

Returns

flexio status value.

Description

Suffix will be added to the given name. Not relevant for FLEXIO_DTRACE_OUTPUT_MODE_CB mode.

Relevant for hostful applications only.

flexio_status flexio_dtrace_set_output_mode ( flexio_process* process, flexio_dtrace_output_mode mode )
Set a DPA tracer output mode.
Parameters
process
- A pointer to a FlexIO process.
mode
- set mode. default FLEXIO_DTRACE_OUTPUT_MODE_CSV. (FLEXIO_DTRACE_OUTPUT_MODE_CB if flexio_dtrace_set_user_cb() has been called)

Returns

flexio status value.

Description

Default output mode is FLEXIO_DTRACE_OUTPUT_MODE_CSV.Output mode will be changed to FLEXIO_DTRACE_OUTPUT_MODE_CB automatically if user callback is provided.

Relevant for hostful applications only.

flexio_status flexio_dtrace_set_transport_type ( flexio_process* process, flexio_dtrace_transport_type type )
Set a DPA tracer transport type.
Parameters
process
- A pointer to a FlexIO process.
type
- transportation type default TYPE_QP_UC for hostful, TYPE_DBUF0 for hostless

Returns

flexio status value.

Description

flexio_status flexio_dtrace_set_umem ( flexio_process* process, flexio_uintptr_t daddr, size_t po2sz )
Provides user memory to use by DPA tracer for report saving.
Parameters
process
- A pointer to a FlexIO process.
daddr
- A pointer to an address of given memory to save TP reports. Given value must be aligned to size of struct dtrace_tp_report
po2sz
- set size of given memory in bytes. Must be a power of two.

Returns

flexio status value.

Description

Calling of this function should be accompanied with flexio_dtrace_set_user_cb().

flexio_status flexio_dtrace_set_user_cb ( flexio_process* process, dtrace_user_cb_t user_cb, void* ctx )
Set user callback for a DPA tracer.
Parameters
process
- A pointer to a FlexIO process.
user_cb
- pointer to user's callback function
ctx
- a value - will be sent to the callback as a first argument

Returns

flexio status value.

Description

This callback will be called for every batch of TP reports. Calling of this function set output mode to FLEXIO_DTRACE_OUTPUT_MODE_CB.

Must be provided, if transport mode is FLEXIO_DTRACE_TRANSPORT_TYPE_UMEM.

flexio_status flexio_dtrace_start ( flexio_process* process )
Start previously created DPA tracer.
Parameters
process
- A pointer to a FlexIO process.

Returns

flexio status value.

Description

Set tracing to start. Tracing from DPA side will go through. All output files (if needed) will be reset.

flexio_status flexio_dtrace_stop ( flexio_process* process )
Stop the running DPA tracer.
Parameters
process
- A pointer to a FlexIO process.

Returns

flexio status value.

Description

Stops a previously started tracer. All incomplete collected data will be flushed. Output file (if exists) will be closed

FLEXIO_EXPERIMENTAL int flexio_err_handler_fd ( flexio_process* process )
Get file descriptor for error handler.
Parameters
process
- A pointer to the FlexIO process.

Returns

- file descriptor.

Description

User should get fd in order to monitor for nonrecoverable errors

User can poll all created processes, using select/poll/epoll functions family.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL int flexio_err_status_get ( flexio_process* process )
Check if unrecoverable error occurred.
Parameters
process
- A pointer to the FlexIO process. NULL is a valid value.

Returns

- nonzero value if error happen. See explanation of function flexio_dev_error() for agreement regarding error codes ranges (FW errors, FlexIO errors, User errors)

Description

It is suggested to check error status if file from flexio_err_handler_fd() reports about existence data to read.

Check error status before finishing process as well.

Relevant for hostful applications only.

flexio_status flexio_event_handler_create ( flexio_process* process, flexio_event_handler_attr* fattr, flexio_event_handler** event_handler_ptr )
Creates a FlexIO event handler.
Parameters
process
- A pointer to the FlexIO process.
fattr
- A pointer to the event handler attributes struct.
event_handler_ptr
- A pointer to the created event handler context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO event handler for an existing FlexIO process.

flexio_status flexio_event_handler_destroy ( flexio_event_handler* event_handler )
Destroys a FlexIO event handler.
Parameters
event_handler
- A pointer to an event handler context.

Returns

flexio status value.

Description

This function destroys a FlexIO event handler.

FLEXIO_EXPERIMENTAL uint32_t flexio_event_handler_get_activation_id ( flexio_event_handler* event_handler )
Query the FlexIO event handler activation id.
Parameters
event_handler
- A pointer to an event handler context.

Returns

the activation id or UINT32_MAX in case of error.

Description

This function returns the needed activation id in order to activate this event handler by another thread of the same process.

FLEXIO_EXPERIMENTAL uint32_t flexio_event_handler_get_id ( flexio_event_handler* event_handler )
Gets the ID from a FlexIO event handler's thread metadata.
Parameters
event_handler
- A pointer to a FlexIO event handler.

Returns

the event handler's thread ID or UINT32_MAX on error.

Description

FLEXIO_EXPERIMENTAL uint32_t flexio_event_handler_get_obj_id ( flexio_event_handler* event_handler )
Gets the object ID of a FlexIO event handler.
Parameters
event_handler
- A pointer to a FlexIO event handler.

Returns

the event handler's thread object ID or UINT32_MAX on error.

Description

FLEXIO_EXPERIMENTAL flexio_thread* flexio_event_handler_get_thread ( flexio_event_handler* event_handler )
Gets a FlexIO thread object from a FlexIO event handler.
Parameters
event_handler
- A pointer to a FlexIO event handler.

Returns

the event handler's thread or NULL on error.

Description

FLEXIO_EXPERIMENTAL mlx5dv_devx_obj* flexio_event_handler_get_thread_obj ( flexio_event_handler* event_handler )
Gets the thread object of a FlexIO event handler.
Parameters
event_handler
- A pointer to a FlexIO event handler.

Returns

the event handler's thread object or null on error.

Description

Relevant for hostful applications only.

flexio_status flexio_event_handler_run ( flexio_event_handler* event_handler, uint64_t user_arg )
Run a FlexIO event handler.
Parameters
event_handler
- A pointer to an event handler context.
user_arg
- A 64 bit argument for the event handler's thread.

Returns

flexio status value.

Description

This function makes a FlexIO event handler start running.

flexio_status flexio_func_get_register_info ( flexio_app* app, flexio_func_t* dev_func_host_key, uint32_t* pup, char* dev_func_name, char* dev_unpack_func_name, size_t func_name_size, size_t* argbuf_size, flexio_func_arg_pack_fn_t** host_pack_func, flexio_uintptr_t* dev_func_addr, flexio_uintptr_t* dev_unpack_func_addr )
Obtain info for previously registered function.
Parameters
app
- FlexIO app.
dev_func_host_key
- Unique key for device function identification on host side.
pup
- Whether function has been registered with pack/unpack support (0: No, 1:Yes).
dev_func_name
- Name of device function.
dev_unpack_func_name
- Name of unpack routine on device, NA if pup == 0.
func_name_size
- Size of function name len allocated.
argbuf_size
- Size of argument buffer, NA if pup == 0.
host_pack_func
- Function pointer to host packing routine, NA if pup == 0.
dev_func_addr
- address of device function.
dev_unpack_func_addr
- address of device unpack function.

Returns

flexio status value.

Description

This function is used to obtain info about a previously registered function. It is used to compose higher-level libraries on top of DPACC / FlexIO interface. It is not intended to be used directly by the user.

The caller must ensure that the string pointers have been allocated and are at least `FLEXIO_MAX_NAME_LEN + 1` long to ensure that the call doesn’t fail to copy full function name.

Relevant for hostful applications only.

flexio_status flexio_host2dev_memcpy ( flexio_process* process, void* src_haddr, size_t buff_bsize, flexio_uintptr_t dest_daddr )
Copy from host memory to a pre-allocated FlexIO heap memory buffer.
Parameters
process
- A pointer to the FlexIO process context.
src_haddr
- An address of the buffer on the host memory.
buff_bsize
- The size of the buffer to copy.
dest_daddr
- FlexIO heap memory buffer address to copy to.

Returns

flexio status value.

Description

This function copies data from a buffer on the host memory to a buffer on the FlexIO heap memory.

Relevant for hostful applications only.

flexio_hw_model_id flexio_hw_model_id_get ( ibv_context* ibv_ctx )
Get FlexIO HW model ID.
Returns

flexio HW model ID value.

Description

This function gets the FlexIO HW model ID for the given IBV device.

Relevant for hostful applications only.

flexio_status flexio_log_dev_destroy ( flexio_process* process )
Deprecated function. Use flexio_msg_stream_destroy() instead.
Description

flexio_status flexio_log_dev_flush ( flexio_process* process )
Deprecated function. Use flexio_msg_stream_flush() instead.
Description

flexio_status flexio_log_dev_init ( flexio_process* process, flexio_msg_stream_attr_t* stream_fattr, FILE* out, pthread_t* ppthread )
Deprecated function. Use flexio_msg_stream_create() instead.
Description

FLEXIO_EXPERIMENTAL enum flexio_log_lvl flexio_log_lvl_set ( enum flexio_log_lvl lvl )
Sets host SDK logging level.
Parameters
lvl
- logging level to set. All entries with this or higher priority level will be printed.

Returns

the previous host logging level.

Description

This function sets the host logging level. Changing the logging level may change the visibility of some logging entries in the SDK code.

Relevant for hostful applications only.

flexio_status flexio_memcpy ( flexio_process* process, flexio_mem* src, flexio_mem* dst, size_t buff_bsize )
Memory copy.
Parameters
process
- A pointer to the FlexIO process context.
src
- A pointer to source memory structure.
dst
- A pointer to destination memory structure.
buff_bsize
- The size of the buffer to copy.

Returns

flexio status value.

Description

This function copies data from source buffer to destination buffer. Source and destination addresses are allowed to be host or device buffers.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL uint32_t flexio_mkey_get_id ( flexio_mkey* mkey )
Gets the FlexIO MKey ID.
Parameters
mkey
- A pointer to a FlexIO MKey.

Returns

the FlexIO mkey ID or UINT32_MAX on error.

Description

flexio_status flexio_msg_stream_create ( flexio_process* process, flexio_msg_stream_attr_t* stream_fattr, FILE* out, pthread_t* ppthread, flexio_msg_stream** stream )
Create a FlexIO msg stream that can contain output messages sent from the DPA.
Parameters
process
- A pointer to the FlexIO process.
stream_fattr
- A pointer to the flexio_msg_stream attributes struct.
out
- file to save data from FlexIO. Use stdout if you want receive data on HOST's console
ppthread
- A pointer to receive pthread ID of created thread. May be NULL if user doesn't need it.
stream
- A pointer to the created stream context pointer.

Returns

flexio status value.

Description

This function can create a flexio_msg_stream that could have device messages directed to it. Directing messages from the device to the host, could be done to any and all open streams, including the default stream.

The function creates the same resources for any new stream. It can also create the default stream. It creates it with the FLEXIO_MSG_DEV_INFO stream level, and that could be modified using flexio_msg_stream_level_set.

Relevant for hostful applications only.

flexio_status flexio_msg_stream_destroy ( flexio_msg_stream* stream )
Destroys a FlexIO msg stream.
Parameters
stream
- A pointer to the stream context.

Returns

flexio status value.

Description

This function destroys any FlexIO msg stream.

Relevant for hostful applications only.

flexio_status flexio_msg_stream_flush ( flexio_msg_stream* stream )
Flush a msg stream's buffer in case of asynchronous messaging mode.
Parameters
stream
- A pointer to the FlexIO msg stream.

Returns

flexio status value.

Description

All data from the msg stream buffer will be flushed to the file defined in flexio_msg_stream_create().

In case of synchronous device messaging this functions does nothing. This function allocates resources to support messaging from FlexIO to HOST.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL int flexio_msg_stream_get_id ( flexio_msg_stream* stream )
Gets the FlexIO device message stream's ID (aka file descriptor).
Parameters
stream
- A pointer to a FlexIO message stream.

Returns

the stream_id or -1 in case of error.

Description

Using this function on a destroyed stream will result in unpredictable behavior.

Relevant for hostful applications only.

flexio_status flexio_msg_stream_level_set ( flexio_msg_stream* stream, flexio_msg_dev_level level )
Change the provided device message stream's level.
Parameters
stream
- A pointer to a FlexIO message stream.
level
- The new desired level, ranges between FLEXIO_MSG_DEV_NO_PRINT FLEXIO_MSG_DEV_DEBUG. FLEXIO_MSG_DEV_ALWAYS_PRINT cannot be used here.

Returns

flexio status value.

Description

The default stream's level cannot be altered. Note that modifying the stream's level while messages are being sent may result in missing or unwanted messages.

Relevant for hostful applications only.

flexio_status flexio_msg_stream_qp_numbers_get ( flexio_msg_stream* stream, uint32_t* host_qp_number, uint32_t* dev_qp_number )
Gets the FlexIO device message stream's QPs numbers.
Parameters
stream
- A pointer to a FlexIO message stream.
host_qp_number
- A pointer to the returned value. NULL is permitted.
dev_qp_number
- A pointer to the returned value. NULL is permitted.

Returns

flexio status value.

Description

Messaging system uses QPs for internal needs (data transportation). Knowing what QPs are used is important in some cases.

Relevant for hostful applications only.

flexio_status flexio_outbox_create ( flexio_process* process, flexio_outbox_attr* fattr, flexio_outbox** outbox )
Creates a FlexIO outbox.
Parameters
process
- A pointer to the FlexIO process.
fattr
- A pointer to the outbox attributes struct.
outbox
- A pointer to the created outbox context pointer.

Returns

flexio status value.

Description

This function Creates a FlexIO outbox for the given process.

flexio_status flexio_outbox_destroy ( flexio_outbox* outbox )
Destroys a FlexIO outbox.
Parameters
outbox
- A pointer to a outbox context.

Returns

flexio status value.

Description

This function destroys a FlexIO outbox.

FLEXIO_EXPERIMENTAL uint32_t flexio_outbox_get_id ( flexio_outbox* outbox )
Gets the FlexIO outbox ID.
Parameters
outbox
- A pointer to a FlexIO outbox.

Returns

the FlexIO outbox ID or UINT32_MAX on error.

Description

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL flexio_uar* flexio_outbox_get_uar ( flexio_outbox* outbox )
Gets a FlexIO UAR object from a FlexIO outbox.
Parameters
outbox
- A pointer to a FlexIO outbox.

Returns

the FlexIO outbox UAR object or NULL on error.

Description

Relevant for hostful applications only.

flexio_status flexio_process_call ( flexio_process* process, flexio_func_t* dev_func, uint64_t* func_ret, ... )
Calls a FlexIO process device function.
Parameters
process
- A pointer to the FlexIO process to run.
dev_func
- A pointer (direct in hostless and aliased in hostful) to the called device function.
func_ret
- A pointer to the called function return value.

Returns

flexio status value.

Description

Currently for hostless application one and only one argument in Arguments list must be provided.

flexio_status flexio_process_call_with_attr ( flexio_process* process, flexio_rpc_attr* fattr, uint64_t* func_ret, ... )
Calls a FlexIO process device function with RPC attributes.
Parameters
process
- A pointer to the FlexIO process to run.
fattr
- A pointer to the RPC attribute struct.
func_ret
- A pointer to the called function return value.

Returns

flexio status value.

Description

Calling RPC with attributes may be used for setting the RPC internal thread local storage.

Currently for hostless application one and only one argument in Arguments list must be provided.

flexio_status flexio_process_create ( ibv_context* ibv_ctx, flexio_app* app, const flexio_process_attr* process_attr, flexio_process** process_ptr )
Create a new FlexIO process.
Parameters
ibv_ctx
- A pointer to a device context.
app
- Device side application handle.
process_attr
- Optional, process attributes for create. Can be NULL.
process_ptr
- A pointer to the created process pointer.

Returns

flexio status value.

Description

This function creates a new FlexIO process with requested image.

Relevant for hostful applications only.

flexio_status flexio_process_destroy ( flexio_process* process )
Destroys a FlexIO process.
Parameters
process
- A pointer to a process. NULL is a valid value.

Returns

flexio status value.

Description

This function destroys a FlexIO process.

Relevant for hostful applications only.

flexio_status flexio_process_error_handler_set ( flexio_process* process, flexio_func_t* error_handler )
Set the Flexio process error handler.
Parameters
process
- A pointer to a process
error_handler
- The host stub function that is used as a reference to the error handler function.

Returns

flexio status value.

Description

This function sets the FlexIO process error handler. The error handler must be set after the process is created, and before the first thread is created. The function registered for error handler should be annotated with __dpa_global__.

flexio_status flexio_process_extract_symbol ( flexio_process* process, const char* symbol_name, void* symbol_data, size_t* sym_data_size )
Extract symbol data from ELF binary associated with DPA process.
Parameters
process
- A pointer to a FlexIO process.
symbol_name
- Symbol name for which data should be retrieved for.
symbol_data
- Buffer to copy symbol data into.
sym_data_size
- Size of the symbol data. Given as an input for the maximum data size to be copied. Returns the actual data that was copied.

Returns

flexio status value.

Description

See description of flexio_app_extract_symbol.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL uint32_t flexio_process_get_dumem_id ( flexio_process* process )
Gets the FlexIO process DUMEM ID.
Parameters
process
- A pointer to a FlexIO process.

Returns

the FlexIO process DUMEM ID or UINT32_MAX on error.

Description

FLEXIO_EXPERIMENTAL ibv_pd* flexio_process_get_pd ( flexio_process* process )
Gets a FlexIO IBV PD object from a FlexIO process.
Parameters
process
- A pointer to a FlexIO process.

Returns

the process's PD object or NULL on error.

Description

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL flexio_uar* flexio_process_get_uar ( flexio_process* process )
Gets a FlexIO UAR object from a FlexIO process.
Parameters
process
- A pointer to a FlexIO process.

Returns

the FlexIO process UAR object or NULL on error.

Description

flexio_status flexio_process_mem_info_get ( const flexio_process* process, flexio_heap_mem_info* info )
Get process memory info.
Parameters
process
- A pointer to the FlexIO process context.
info
- A pointer to flexio_heap_mem_info struct to fill info.

Returns

flexio status value.

Description

This function returns the process heap memory base address and its available size.

FLEXIO_EXPERIMENTAL uint64_t flexio_process_udbg_token_get ( flexio_process* process )
Get token for FlexIO process debug access.
Parameters
process
- A pointer to the FlexIO process context.

Returns

the requested token. Zero value means - User Debug access for the process is not allowed.

Description

This function returns the token, needed for user debug syscalls access.

Relevant for hostful applications only.

flexio_status flexio_qp_create ( flexio_process* process, ibv_context* ibv_ctx, flexio_qp_attr* qp_fattr, flexio_qp** qp_ptr )
Creates a FlexIO QP.
Parameters
process
- A pointer to the FlexIO process.
ibv_ctx
- A pointer to an IBV device context (might be different than process'). If NULL - process' will be used.
qp_fattr
- A pointer to the QP attributes struct.
qp_ptr
- A pointer to the created QP context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO QP.

flexio_status flexio_qp_destroy ( flexio_qp* qp )
Destroys a FlexIO QP.
Parameters
qp
- A pointer to the QP context.

Returns

flexio status value.

Description

This function destroys a FlexIO QP.

FLEXIO_EXPERIMENTAL uint32_t flexio_qp_get_qp_num ( flexio_qp* qp )
Gets the FlexIO QP number.
Parameters
qp
- A pointer to a FlexIO QP.

Returns

the QP number or UINT32_MAX on error.

Description

flexio_status flexio_qp_modify ( flexio_qp* qp, flexio_qp_attr* fattr, flexio_qp_attr_opt_param_mask* mask )
Modify FlexIO QP.
Parameters
qp
- A pointer to the QP context.
fattr
- A pointer to the QP attributes struct that will also define the QP connection.
mask
- A pointer to the optional QP attributes mask.

Returns

flexio status value.

Description

This function modifies FlexIO QP and transition it between states. At the end of the procedure FlexIO QP would have moved from it's current state to to next state, given in the fattr, if the move is a legal transition in the QP's state machine.

flexio_qp_state flexio_qp_state_get ( flexio_qp* qp )
retrieve the device QP state.
Parameters
qp
- A pointer to a FlexIO QP.

Returns

enum flexio_qp_state.

Description

This function return the device QP state it is currently in.

flexio_status flexio_recoverable_buf_dev_alloc ( flexio_process* process, size_t buff_bsize, uint32_t mkey, flexio_uintptr_t* dest_daddr_p )
Allocates a recoverable buffer on FlexIO heap memory.
Parameters
process
- A pointer to the FlexIO process context.
buff_bsize
- The size of the buffer to allocate. (see Note 1 above)
mkey
- An MKey ID to the user buffer for memory dump on object destroy.
dest_daddr_p
- A pointer to the FlexIO address, where the buffer was allocated.

Returns

flexio status value.

Description

This function allocates a recoverable buffer with the requested size on the FlexIO heap memory. This buffer will force a memory object to be created and on object destroy will dump its content to the user supplied buffer (i.e. address, used for memory key registration).

Use flexio_buf_dev_free() for release the allocated memory.

Relevant for hostful applications only.

Notes: (1) The requested memory size must contain power of two DPA memory blocks. If no - error returned. (2) MKey size must match the buffer size.

On success - sets dest_daddr_p to the start address of the allocated buffer. On Failure - sets dest_daddr_p to 0x0.

flexio_status flexio_resources_create ( const char* key, const void* buf, size_t buf_bsize, flexio_resource** res )
Create a FlexIO resources struct.
Parameters
key
- Key value to generate resources struct for.
buf
- A buffer of resources information.
buf_bsize
- Size of buf in bytes.
res
- A pointer to the created FlexIO resources struct pointer.

Returns

flexio status value.

Description

This function creates a FlexIO resources struct for a given key from the information given in buf. Buf is assumed to be created from a YAML file generated by SPRD tool.

For hostless applications, params buf and buf_bsize are ignored.

flexio_status flexio_resources_destroy ( flexio_resource* res )
Destroy a FlexIO resources struct.
Parameters
res
- A pointer to the FlexIO resources struct to destroy.

Returns

flexio status value.

Description

This function destroys a FlexIO resources struct.

FLEXIO_EXPERIMENTAL char* flexio_resources_get_app_name ( flexio_resource* res )
Get application name from a FlexIO resources struct.
Parameters
res
- A pointer to a FlexIO resources struct.

Returns

application name.

Description

This function gets the application name from a FlexIO resources struct.

For hostless applications, this function returns key parameter used to create the resources.

FLEXIO_EXPERIMENTAL uint32_t* flexio_resources_get_eugs ( flexio_resource* res )
Get execution unit groups list from a FlexIO resources struct.
Parameters
res
- A pointer to a FlexIO resources struct.

Returns

execution unit groups list.

Description

This function gets the execution unit groups list from a FlexIO resources struct.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL int flexio_resources_get_eugs_num ( flexio_resource* res )
Get number of execution groups from a FlexIO resources struct.
Parameters
res
- A pointer to a FlexIO resources struct.

Returns

number of execution groups.

Description

This function gets the number of execution groups from a FlexIO resources struct.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL uint32_t* flexio_resources_get_eus ( flexio_resource* res )
Get execution units list from a FlexIO resources struct.
Parameters
res
- A pointer to a FlexIO resources struct.

Returns

execution units list.

Description

This function gets the execution units list from a FlexIO resources struct.

FLEXIO_EXPERIMENTAL int flexio_resources_get_eus_num ( flexio_resource* res )
Get execution units number from a FlexIO resources struct.
Parameters
res
- A pointer to a FlexIO resources struct.

Returns

execution units number.

Description

This function gets the execution units number from a FlexIO resources struct.

flexio_status flexio_rmp_create ( flexio_process* process, ibv_context* ibv_ctx, const flexio_wq_attr* fattr, flexio_rmp** flexio_rmp_ptr )
Creates a FlexIO RMP.
Parameters
process
- A pointer to the FlexIO process.
ibv_ctx
- A pointer to an IBV device context (might be different than process'). If NULL - process' will be used.
fattr
- A pointer to the WQ attributes struct.
flexio_rmp_ptr
- A pointer to the created RMP context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO RMP.

Relevant for hostful applications only.

flexio_status flexio_rmp_destroy ( flexio_rmp* flexio_rmp )
Destroys a FlexIO RMP.
Parameters
flexio_rmp
- A pointer to an RMP context.

Returns

flexio status value.

Description

This function destroys a FlexIO RMP.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL uint32_t flexio_rmp_get_wq_num ( flexio_rmp* rmp )
Gets the FlexIO RMP number.
Parameters
rmp
- A pointer to a FlexIO RMP.

Returns

the RQ number or UINT32_MAX on error.

Description

Relevant for hostful applications only.

flexio_status flexio_rq_create ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_rq** flexio_rq_ptr )
Creates a FlexIO RQ.
Parameters
process
- A pointer to the FlexIO process.
ibv_ctx
- A pointer to an IBV device context (might be different than process'). If NULL - process' will be used.
cq_num
- A CQ number.
fattr
- A pointer to the RQ WQ attributes struct.
flexio_rq_ptr
- A pointer to the created RQ context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO RQ.

flexio_status flexio_rq_create_cross_dev ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_rq** flexio_rq_ptr )
Creates a FlexIO RQ assuming cross device.
Parameters
process
- A pointer to the FlexIO process.
ibv_ctx
- A pointer to an IBV device context (should be different than process'). If NULL or same as process - will result in an error.
cq_num
- A CQ number.
fattr
- A pointer to the RQ WQ attributes struct.
flexio_rq_ptr
- A pointer to the created RQ context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO RQ assuming cross VHCA_ID without checking.

Relevant for hostful applications only.

flexio_status flexio_rq_destroy ( flexio_rq* flexio_rq )
Destroys a FlexIO RQ.
Parameters
flexio_rq
- A pointer to an RQ context.

Returns

flexio status value.

Description

This function destroys a FlexIO RQ.

FLEXIO_EXPERIMENTAL mlx5dv_devx_obj* flexio_rq_get_object ( flexio_rq* rq )
Get the FlexIO RQ object.
Parameters
rq
- A pointer to the RQ context.

Returns

the RQ devx object.

Description

This function returns the FlexIO RQ object.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL mlx5dv_devx_obj* flexio_rq_get_tir ( flexio_rq* rq )
Gets the FlexIO RQ TIR object.
Parameters
rq
- A pointer to a FlexIO RQ.

Returns

the RQ TIR object or NULL on error.

Description

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL uint32_t flexio_rq_get_wq_num ( flexio_rq* rq )
Gets the FlexIO RQ number.
Parameters
rq
- A pointer to a FlexIO RQ.

Returns

the RQ number or UINT32_MAX on error.

Description

flexio_status flexio_rq_set_err_state ( flexio_rq* rq )
Sets a FlexIO RQ to error state.
Parameters
rq
- A pointer to the RQ context to move to error state.

Returns

flexio status value.

Description

This function sets a FlexIO RQ to error state.

flexio_status flexio_sq_create ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_sq** flexio_sq_ptr )
Creates a FlexIO SQ.
Parameters
process
- A pointer to the FlexIO process.
ibv_ctx
- A pointer to an IBV device context (might be different than process'). If NULL - process' will be used.
cq_num
- A CQ number (can be FlexIO or host CQ).
fattr
- A pointer to the SQ attributes struct.
flexio_sq_ptr
- A pointer to the created SQ context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO SQ.

flexio_status flexio_sq_create_cross_dev ( flexio_process* process, ibv_context* ibv_ctx, uint32_t cq_num, const flexio_wq_attr* fattr, flexio_sq** flexio_sq_ptr )
Creates a FlexIO SQ assuming cross device.
Parameters
process
- A pointer to the FlexIO process.
ibv_ctx
- A pointer to an IBV device context (should be different than process'). If NULL or same as process - will result in an error.
cq_num
- A CQ number (can be FlexIO or host CQ).
fattr
- A pointer to the SQ attributes struct.
flexio_sq_ptr
- A pointer to the created SQ context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO SQ assuming cross VHCA_ID without checking.

Relevant for hostful applications only.

flexio_status flexio_sq_destroy ( flexio_sq* flexio_sq )
Destroys a FlexIO SQ.
Parameters
flexio_sq
- A pointer to an SQ context.

Returns

flexio status value.

Description

This function destroys a FlexIO SQ.

FLEXIO_EXPERIMENTAL uint32_t flexio_sq_get_wq_num ( flexio_sq* sq )
Gets the FlexIO SQ number.
Parameters
sq
- A pointer to a FlexIO SQ.

Returns

the SQ number or UINT32_MAX on error.

Description

flexio_status flexio_sq_tis_create ( ibv_context* ibv_ctx, flexio_transport_domain* td, flexio_sq_tis** tis )
Creates a FlexIO SQ transport interface send (TIS) object.
Parameters
ibv_ctx
- A pointer to an IBV device context. must be the same as the SQ's that will use this TIS.
td
- A pointer to a FlexIO transport domain struct. TD must be created for the same IBV device context provided for TIS creation.
tis
- A pointer to the created SQ TIS context pointer.

Returns

flexio status value.

Description

This function creates a FlexIO SQ TIS for allowing steering from an SQ.

Relevant for hostful applications only.

flexio_status flexio_sq_tis_destroy ( flexio_sq_tis* tis )
Destroys a FlexIO SQ TIS.
Parameters
tis
- A pointer to an SQ TIS context.

Returns

flexio status value.

Description

This function destroys a FlexIO TIS.

Relevant for hostful applications only.

flexio_status flexio_transport_domain_create ( ibv_context* ibv_ctx, flexio_transport_domain** td )
Create a FlexIO transport domain (TD).
Parameters
ibv_ctx
- A pointer to an IBV device context.
td
- A pointer to the created TD context pointer.

Returns

flexio status value.

Description

This function creates a TD for the given IBV device context.

Relevant for hostful applications only.

flexio_status flexio_transport_domain_destroy ( flexio_transport_domain* td )
Destroy a FlexIO transport domain (TD).
Parameters
td
- A pointer to a TD context.

Returns

flexio status value.

Description

This function destroys a FlexIO TD.

Relevant for hostful applications only.

flexio_status flexio_uar_create ( flexio_process* process, flexio_uar** flexio_uar )
Creates a FlexIO UAR object.
Parameters
process
- A pointer to the FlexIO process context.
flexio_uar
- A pointer to a pointer to the created FlexIO UAR struct.

Returns

flexio status value.

Description

This function creates a FlexIO UAR object.

Relevant for hostful applications only.

flexio_status flexio_uar_destroy ( flexio_uar* uar )
destroys a FlexIO UAR object
Parameters
uar
- A pointer to the FlexIO UAR to destroy.

Returns

flexio status value.

Description

This function destroys a FlexIO UAR object.

Relevant for hostful applications only.

flexio_status flexio_uar_extend ( flexio_uar* in_uar, ibv_context* to_extend, flexio_uar** extended )
Extend UAR to an ibv context.
Parameters
in_uar
- A pointer to the FlexIO uar.
to_extend
- A pointer to an IBV device context to be extended to.
extended
- A pointer to the UAR context pointer.

Returns

flexio status value.

Description

Relevant for hostful applications only.

This function extend the UAR to an ibv context to allow handling its queues.

flexio_uar_device_id flexio_uar_get_extended_id ( flexio_uar* uar )
Gets the FlexIO extended UAR ID.
Parameters
uar
- A pointer to a FlexIO extended UAR.

Returns

the FlexIO UAR extended ID or UINT32_MAX on error.

Description

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL uint32_t flexio_uar_get_id ( flexio_uar* uar )
Gets the FlexIO UAR ID.
Parameters
uar
- A pointer to a FlexIO UAR.

Returns

the FlexIO UAR ID or UINT32_MAX on error.

Description

flexio_status flexio_version_set ( uint64_t version )
Set version for flexio.
Parameters
version
- version to set in format FLEXIO_VER(major, minor, 0).

Returns

flexio status value.

Description

This function allows the library to determine which version it should work with. The function is called without error only once; if called again with a different version, it returns an error. The function also returns an error if it is called with a version greater than the FLEXIO_CURRENT_VERSION.

Relevant for hostful applications only.

flexio_status flexio_window_create ( flexio_process* process, ibv_pd* pd, flexio_window** window )
Creates a FlexIO window.
Parameters
process
- A pointer to the FlexIO process.
pd
- A pointer to a protection domain struct to the memory the window should access.
window
- A pointer to the created window context pointer.

Returns

flexio status value.

Description

This function Creates a FlexIO window for the given process.

Relevant for hostful applications only.

flexio_status flexio_window_destroy ( flexio_window* window )
Destroys a FlexIO window.
Parameters
window
- A pointer to a window context.

Returns

flexio status value.

Description

This function destroys a FlexIO window.

Relevant for hostful applications only.

FLEXIO_EXPERIMENTAL uint32_t flexio_window_get_id ( flexio_window* window )
Gets the FlexIO window ID.
Parameters
window
- A pointer to a FlexIO window.

Returns

the FlexIO window ID or UINT32_MAX on error.

Description

Relevant for hostful applications only.

© Copyright 2025, NVIDIA. Last updated on Nov 3, 2025