TAPI for RTE EAL API remote calls
Overview
// typedefs typedef struct lcore_mask_t lcore_mask_t; // structs struct lcore_mask_t; // global functions te_errno tapi_rte_lcore_mask_set_bit(lcore_mask_t* mask, unsigned int bit); int rpc_rte_eal_init(rcf_rpc_server* rpcs, int argc, char** argv); te_errno tapi_rte_make_eal_args(tapi_env* env, rcf_rpc_server* rpcs, const char* program_name, const lcore_mask_t* lcore_mask_override, int argc, const char** argv, int* out_argc, char*** out_argv); te_errno tapi_rte_eal_init(tapi_env* env, rcf_rpc_server* rpcs, int argc, const char** argv); te_errno tapi_rte_eal_fini(tapi_env* env, rcf_rpc_server* rpcs); const char* tarpc_rte_proc_type_t2str(enum tarpc_rte_proc_type_t val); enum tarpc_rte_proc_type_t rpc_rte_eal_process_type(rcf_rpc_server* rpcs); int rpc_dpdk_get_version(rcf_rpc_server* rpcs); int rpc_rte_eal_hotplug_add(rcf_rpc_server* rpcs, const char* busname, const char* devname, const char* devargs); te_errno tapi_rte_eal_hotplug_add(rcf_rpc_server* rpcs, const char* busname, const char* devname, const char* devargs); int rpc_rte_eal_hotplug_remove(rcf_rpc_server* rpcs, const char* busname, const char* devname); te_errno tapi_rte_eal_hotplug_remove(rcf_rpc_server* rpcs, const char* busname, const char* devname); int rpc_rte_epoll_wait(rcf_rpc_server* rpcs, int epfd, struct tarpc_rte_epoll_event* events, int maxevents, int timeout); te_errno tapi_rte_get_dev_args(const char* ta, const char* vendor, const char* device, char** arg_list); te_errno tapi_rte_get_nb_required_service_cores(const char* ta, const char* vendor, const char* device, unsigned int* nb_cores); te_errno tapi_eal_get_nb_required_service_cores_rpcs(tapi_env* env, rcf_rpc_server* rpcs, unsigned int* nb_cores); te_errno tapi_rte_get_dev_args_by_pci_addr(const char* ta, const char* pci_addr, char** arg_list); te_errno tapi_rte_get_numa_node(tapi_env* env, rcf_rpc_server* rpcs, int* numa_node);
Detailed Documentation
Global Functions
te_errno tapi_rte_lcore_mask_set_bit(lcore_mask_t* mask, unsigned int bit)
Set bit in a lcore mask
Parameters:
mask |
lcore mask |
bit |
Bit number (0 is lsb) |
Returns:
Status code.
int rpc_rte_eal_init(rcf_rpc_server* rpcs, int argc, char** argv)
rte_eal_init() RPC.
If error is not expected using RPC_AWAIT_IUT_ERROR(), the function jumps out in the case of failure.
te_errno tapi_rte_make_eal_args(tapi_env* env, rcf_rpc_server* rpcs, const char* program_name, const lcore_mask_t* lcore_mask_override, int argc, const char** argv, int* out_argc, char*** out_argv)
Allocate EAL argument vector in accordance with environment binding.
Parameters:
env |
Environment binding |
rpcs |
RPC server handle |
program_name |
Name of a program ( |
lcore_mask_override |
Lcore mask to use ( |
argc |
Number of additional EAL arguments |
argv |
Additional EAL arguments |
Returns:
Status code.
te_errno tapi_rte_eal_init(tapi_env* env, rcf_rpc_server* rpcs, int argc, const char** argv)
Initialize EAL library in accordance with environment binding.
Parameters:
env |
Environment binding |
rpcs |
RPC server handle |
argc |
Number of additional EAL arguments |
argv |
Additional EAL arguments |
Returns:
Status code.
te_errno tapi_rte_eal_fini(tapi_env* env, rcf_rpc_server* rpcs)
Deinitialize resources allocated on tapi_rte_eal_init().
WARNING: In order to deinitialize EAL completely, RPC server is restarted by the function (if it is required).
Parameters:
env |
Environment binding |
rpcs |
RPC server handle |
Returns:
Status code.
const char* tarpc_rte_proc_type_t2str(enum tarpc_rte_proc_type_t val)
Map RTE EAL process type to string.
enum tarpc_rte_proc_type_t rpc_rte_eal_process_type(rcf_rpc_server* rpcs)
rte_eal_process_type() RPC.
If error is not expected using RPC_AWAIT_IUT_ERROR(), the function jumps out in the case of unknown process type returned.
int rpc_dpdk_get_version(rcf_rpc_server* rpcs)
Get DPDK version (4 components combined in a single number).
WARNING: This RPC is a compelled elaboration to cope with drastic differences amongst DPDK versions. The engineer has to think meticulously before attempting to use this RPC for any new code.
Returns:
DPDK version.
int rpc_rte_eal_hotplug_add(rcf_rpc_server* rpcs, const char* busname, const char* devname, const char* devargs)
rte_eal_hotplug_add() RPC
Parameters:
busname |
Bus name for the device to be added to |
devname |
Device name to undergo identification and probing |
devargs |
Device arguments to be passed to the driver |
Returns:
0
on success; jumps out on error (negative value).
te_errno tapi_rte_eal_hotplug_add(rcf_rpc_server* rpcs, const char* busname, const char* devname, const char* devargs)
Wrapper for rpc_rte_eal_hotplug_add() that also resets cached value of EAL arguments in the configurator. The reset is almost always required since hotplug changes the EAL configuration and it interferes with dpdk_reuse_rpcs().
int rpc_rte_eal_hotplug_remove(rcf_rpc_server* rpcs, const char* busname, const char* devname)
rte_eal_hotplug_remove() RPC
Parameters:
busname |
Bus name for the device to be removed from |
devname |
Device name |
Returns:
0
on success; jumps out on error (negative value).
te_errno tapi_rte_eal_hotplug_remove(rcf_rpc_server* rpcs, const char* busname, const char* devname)
Wrapper for rpc_rte_eal_hotplug_remove() that also resets cached value of EAL arguments in the configurator. The reset is almost always required since hotplug changes the EAL configuration and it interferes with dpdk_reuse_rpcs().
int rpc_rte_epoll_wait(rcf_rpc_server* rpcs, int epfd, struct tarpc_rte_epoll_event* events, int maxevents, int timeout)
rte_epoll_wait() RPC
If error is not expected using RPC_AWAIT_IUT_ERROR(), the function jumps out in the case of failure.
te_errno tapi_rte_get_dev_args(const char* ta, const char* vendor, const char* device, char** arg_list)
Get device arguments of a PCI device.
Parameters:
ta |
Test Agent name |
vendor |
PCI vendor identifier |
device |
PCI device identifier |
arg_list |
Device arguments, must not be |
Returns:
Status code
te_errno tapi_rte_get_nb_required_service_cores(const char* ta, const char* vendor, const char* device, unsigned int* nb_cores)
Get required number of service cores for a PCI device.
Parameters:
ta |
Test Agent name |
vendor |
PCI vendor identifier |
device |
PCI device identifier |
nb_cores |
Required number of service cores |
Returns:
Status code
te_errno tapi_eal_get_nb_required_service_cores_rpcs(tapi_env* env, rcf_rpc_server* rpcs, unsigned int* nb_cores)
Get required number of service cores for PCI devices specified in an environment for an RPC server.
Parameters:
env |
Test environment |
rpcs |
RPC server |
nb_cores |
Required number of service cores |
Returns:
Status code
te_errno tapi_rte_get_dev_args_by_pci_addr(const char* ta, const char* pci_addr, char** arg_list)
Wrapper for tapi_rte_get_dev_args() that accepts PCI address (BDF notation)
Parameters:
ta |
Test Agent name |
pci_addr |
PCI address of a device |
arg_list |
Device arguments, must not be |
Returns:
Status code
te_errno tapi_rte_get_numa_node(tapi_env* env, rcf_rpc_server* rpcs, int* numa_node)
Get NUMA node assigned to the PCI devices specified in the environment for an RPC server. If there is multiple devices, the common to all devices NUMA node is returned or -1
.
Parameters:
env |
Test environment |
rpcs |
RPC server |
numa_node |
Assigned NUMA node |
Returns:
Status code