DOCA Flow Tune Server
This guide provides an overview and configuration instructions for DOCA Flow Tune Server API.
DOCA Flow Tune Server (TS) is a DOCA Flow subcomponent that collects predefined internal key performance indicators (KPIs) and pipeline information from a running DOCA Flow application. All information is transferred via an inter-process communication channel (Unix domain socket) to the DOCA Flow Tune Tool for further analysis and monitoring.
TS can run in either two modes:
Basic: TS uses an internal thread to handle the communication channel.
Expert: Server socket polling and thread management are the user's responsibility. The TS API must be invoked whenever the communication channel socket is ready to process a message.
DOCA Flow Tune Server API is only available when using the DOCA Flow and DOCA Flow Tune Server trace libraries.
For more detailed information, refer to section "Debug and Trace Features" under DOCA Flow.
DOCA Flow Tune Server has a configuration file that allows customizing various settings. The configuration file is divided into different sections so to ease its use.
Config File Default Values
If a configuration file was not provided, DOCA Flow Tune Server uses default values for its mandatory fields. List of all default values can be seen in section "Configuration File Example".
Custom Config File
Instead of using the default configuration values, users may create a file of their own and provide a file path using the doca_flow_tune_server_cfg_set_cfg_file_path() API call.
Once used, DOCA Flow Tune Server loads all provided values directly from the file, while the rest of the fields (if any) use their respective default values.
Configuration File Example
flow_tune_cfg.json
{
"network": {
"uds_path": "/tmp/tune_server.sock"
}
}
networkuds_path– Unix Domain Socket (AF_UNIX) path for the tune server to bind to. This socket is used for the inter-process-communication (IPC) channel between DOCA Flow Tune Server and DOCA Flow Tune Tool. Default value is/tmp/tune_server.sock.
For more detailed information on DOCA Flow API, refer to DOCA Library APIs.
The following subsections provide additional details about the library API.
enum doca_flow_tune_server_mode
Enum to be used to set the running mode.
struct doca_flow_tune_server_cfg
Opaque configuration struct to use on configuration API calls.
doca_flow_tune_server_cfg_create
Allocates and creates DOCA Flow Tune Server configuration structure.
doca_error_t doca_flow_tune_server_cfg_create(struct doca_flow_tune_server_cfg **cfg);
doca_flow_tune_server_cfg_set_cfg_file_path
Sets the local configuration file path in the opaque configuration struct, for DOCA Flow Tune Server to use when searching for the JSON configuration file.
Providing a JSON configuration file is optional. If a file is not provided, DOCA Flow Tune Server uses internal defaults.
doca_error_t doca_flow_tune_server_cfg_set_bind_path(struct doca_flow_tune_server_cfg *cfg, const char *path);
doca_flow_tune_server_cfg_set_mode
Sets the running mode in the opaque configuration struct.
Using this API call is optional. Without the call, DOCA Flow Tune Server runs in Basic mode.
doca_error_t doca_flow_tune_server_cfg_set_mode(struct doca_flow_tune_server_cfg *cfg, enum doca_flow_tune_server_mode mode);
doca_flow_tune_server_cfg_set_fd
Sets the user Unix Domain Socket in the opaque configuration struct. This socket is used by DOCA Flow Tune Server to receive messages on the communication channel.
Using this API call is mandatory on Expert mode.
doca_error_t doca_flow_tune_server_cfg_set_fd(struct doca_flow_tune_server_cfg *cfg, int fd);
doca_flow_tune_server_cfg_destroy
Destroys and deallocates DOCA Flow Tune Server opaque configuration structure.
Should be called after calling doca_flow_tune_server_init().
doca_error_t doca_flow_tune_server_cfg_destroy(struct doca_flow_tune_server_cfg *cfg);
doca_flow_tune_server_init
Starts DOCA Flow Tune Server main thread.
doca_error_t doca_flow_tune_server_init(struct doca_flow_tune_server_cfg *cfg);
doca_flow_tune_server_destroy
Stops DOCA Flow Tune Server main thread.
void doca_flow_tune_server_destroy(void);
doca_flow_tune_server_process_msg
Process communication channel message from the provided Unix Domain Socket. This API call should be used with Expert mode only.
doca_error_t doca_flow_tune_server_process_msg(void);