NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
pcc_core.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <ctype.h>
#include <doca_argp.h>
#include "pcc_core.h"
#include "libflexio/flexio_ver.h"
#include "libflexio/flexio.h"
Include dependency graph for pcc_core.c:

Go to the source code of this file.

Macros

#define PCC_FLEXIO_MAJOR_VERSION   (25)
 
#define PCC_FLEXIO_MINOR_VERSION   (4)
 
#define PCC_FLEXIO_PATCH_VERSION   (0)
 
#define FLEXIO_VER_USED   FLEXIO_VER(PCC_FLEXIO_MAJOR_VERSION, PCC_FLEXIO_MINOR_VERSION, PCC_FLEXIO_PATCH_VERSION)
 

Functions

static doca_error_t get_file_size (const char *path, size_t *file_size)
 Get the size of a file. More...
 
static doca_error_t read_file_into_buffer (const char *path, char *buffer, size_t *bytes_read)
 Read file content into a pre-allocated buffer. More...
 
static bool pcc_device_exists_check (const char *device_name)
 
static doca_error_t open_pcc_device (const char *device_name, pcc_role_t role, struct doca_dev **doca_device)
 
doca_error_t pcc_init (struct pcc_config *cfg, struct pcc_resources *resources)
 
doca_error_t pcc_mailbox_send (struct pcc_config *cfg, struct pcc_resources *resources)
 
doca_error_t pcc_destroy (struct pcc_resources *resources)
 
static doca_error_t device_name_callback (void *param, void *config)
 
static doca_error_t np_nic_telemetry_callback (void *param, void *config)
 
static doca_error_t rp_switch_telemetry_callback (void *param, void *config)
 
static doca_error_t np_switch_telemetry_callback (void *param, void *config)
 
static doca_error_t threads_list_callback (void *param, void *config)
 
static doca_error_t wait_time_callback (void *param, void *config)
 
static doca_error_t ccmad_remote_sw_handler_callback (void *param, void *config)
 
static doca_error_t ifa2_hop_limit_callback (void *param, void *config)
 
static doca_error_t ifa2_gns_callback (void *param, void *config)
 
static doca_error_t ifa2_gns_ignore_mask_callback (void *param, void *config)
 
static doca_error_t ifa2_gns_ignore_value_callback (void *param, void *config)
 
static doca_error_t coredump_file_callback (void *param, void *config)
 
static doca_error_t dpa_resources_file_callback (void *param, void *config)
 
static doca_error_t dpa_application_key_callback (void *param, void *config)
 
doca_error_t register_pcc_params (void)
 

Variables

static char * trace_message_formats []
 
const uint32_t default_pcc_rp_threads_list [PCC_RP_THREADS_NUM_DEFAULT_VALUE]
 
const uint32_t default_pcc_np_threads_list [PCC_NP_THREADS_NUM_DEFAULT_VALUE]
 
static bool use_threads_list = false
 
static bool use_dpa_resources = false
 
static bool user_set_app = false
 

Macro Definition Documentation

◆ FLEXIO_VER_USED

Definition at line 41 of file pcc_core.c.

◆ PCC_FLEXIO_MAJOR_VERSION

#define PCC_FLEXIO_MAJOR_VERSION   (25)

Definition at line 38 of file pcc_core.c.

◆ PCC_FLEXIO_MINOR_VERSION

#define PCC_FLEXIO_MINOR_VERSION   (4)

Definition at line 39 of file pcc_core.c.

◆ PCC_FLEXIO_PATCH_VERSION

#define PCC_FLEXIO_PATCH_VERSION   (0)

Definition at line 40 of file pcc_core.c.

Function Documentation

◆ ccmad_remote_sw_handler_callback()

static doca_error_t ccmad_remote_sw_handler_callback ( void *  param,
void *  config 
)
static

Definition at line 744 of file pcc_core.c.

◆ coredump_file_callback()

static doca_error_t coredump_file_callback ( void *  param,
void *  config 
)
static

Definition at line 824 of file pcc_core.c.

◆ device_name_callback()

static doca_error_t device_name_callback ( void *  param,
void *  config 
)
static

Definition at line 549 of file pcc_core.c.

◆ dpa_application_key_callback()

static doca_error_t dpa_application_key_callback ( void *  param,
void *  config 
)
static

Definition at line 882 of file pcc_core.c.

◆ dpa_resources_file_callback()

static doca_error_t dpa_resources_file_callback ( void *  param,
void *  config 
)
static

Definition at line 848 of file pcc_core.c.

◆ get_file_size()

static doca_error_t get_file_size ( const char *  path,
size_t file_size 
)
static

Get the size of a file.

Parameters
[in]path- Path to the file
[out]file_size- Size of the file in bytes
Returns
DOCA_SUCCESS on success and DOCA_ERROR otherwise

Definition at line 87 of file pcc_core.c.

◆ ifa2_gns_callback()

static doca_error_t ifa2_gns_callback ( void *  param,
void *  config 
)
static

Definition at line 776 of file pcc_core.c.

◆ ifa2_gns_ignore_mask_callback()

static doca_error_t ifa2_gns_ignore_mask_callback ( void *  param,
void *  config 
)
static

Definition at line 792 of file pcc_core.c.

◆ ifa2_gns_ignore_value_callback()

static doca_error_t ifa2_gns_ignore_value_callback ( void *  param,
void *  config 
)
static

Definition at line 808 of file pcc_core.c.

◆ ifa2_hop_limit_callback()

static doca_error_t ifa2_hop_limit_callback ( void *  param,
void *  config 
)
static

Definition at line 760 of file pcc_core.c.

◆ np_nic_telemetry_callback()

static doca_error_t np_nic_telemetry_callback ( void *  param,
void *  config 
)
static

Definition at line 578 of file pcc_core.c.

◆ np_switch_telemetry_callback()

static doca_error_t np_switch_telemetry_callback ( void *  param,
void *  config 
)
static

Definition at line 632 of file pcc_core.c.

◆ open_pcc_device()

static doca_error_t open_pcc_device ( const char *  device_name,
pcc_role_t  role,
struct doca_dev **  doca_device 
)
static

Definition at line 189 of file pcc_core.c.

◆ pcc_destroy()

doca_error_t pcc_destroy ( struct pcc_resources resources)

Definition at line 525 of file pcc_core.c.

◆ pcc_device_exists_check()

static bool pcc_device_exists_check ( const char *  device_name)
static

Definition at line 148 of file pcc_core.c.

◆ pcc_init()

doca_error_t pcc_init ( struct pcc_config cfg,
struct pcc_resources resources 
)

Definition at line 246 of file pcc_core.c.

◆ pcc_mailbox_send()

doca_error_t pcc_mailbox_send ( struct pcc_config cfg,
struct pcc_resources resources 
)

Definition at line 491 of file pcc_core.c.

◆ read_file_into_buffer()

static doca_error_t read_file_into_buffer ( const char *  path,
char *  buffer,
size_t bytes_read 
)
static

Read file content into a pre-allocated buffer.

Parameters
[in]path- Path to the file
[out]buffer- Pre-allocated buffer to store file content
[out]bytes_read- Number of bytes read from the file
Returns
DOCA_SUCCESS on success and DOCA_ERROR otherwise

Definition at line 122 of file pcc_core.c.

◆ register_pcc_params()

doca_error_t register_pcc_params ( void  )

Definition at line 898 of file pcc_core.c.

◆ rp_switch_telemetry_callback()

static doca_error_t rp_switch_telemetry_callback ( void *  param,
void *  config 
)
static

Definition at line 605 of file pcc_core.c.

◆ threads_list_callback()

static doca_error_t threads_list_callback ( void *  param,
void *  config 
)
static

Definition at line 660 of file pcc_core.c.

◆ wait_time_callback()

static doca_error_t wait_time_callback ( void *  param,
void *  config 
)
static

Definition at line 720 of file pcc_core.c.

Variable Documentation

◆ default_pcc_np_threads_list

const uint32_t default_pcc_np_threads_list[PCC_NP_THREADS_NUM_DEFAULT_VALUE]
Initial value:
=
{16, 17, 18, 19, 20, 21, 22, 23, 32, 33, 34, 35, 36, 37, 38, 39}

Definition at line 62 of file pcc_core.c.

◆ default_pcc_rp_threads_list

const uint32_t default_pcc_rp_threads_list[PCC_RP_THREADS_NUM_DEFAULT_VALUE]
Initial value:
= {
176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 192, 193, 194, 195, 196,
197, 198, 199, 200, 201, 202, 203, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
218, 219, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 240}

Definition at line 57 of file pcc_core.c.

◆ trace_message_formats

char* trace_message_formats[]
static
Initial value:
= {
"format 0 - user init: port num = %#lx, algo index = %#lx, algo slot = %#lx, algo enable = %#lx, disable event bitmask = %#lx\n",
"format 1 - user algo: algo slot = %#lx, result rate = %#lx, result rtt req = %#lx, port num = %#lx, timestamp = %#lx\n",
"format 2 - pcc_np dev: thread_idx = %#lx, debug_init = %#lx, cnt_enter = %#lx, cnt_arm = %#lx. end %u\n",
"format 3 - pcc_np dev: thread_idx = %#lx, cnt_recv_packet = %#lx, cnt_sent_packet = %#lx, cnt_user_func_err = %#lx. end %u\n",
"format 4 - pcc_np dev: thread_idx = %#lx, rq = %#lx, rq_pi = %#lx, rqcq = %#lx, rqcq_ci = %#lx\n",
"format 5 - pcc_np dev: thread_idx = %#lx, sq = %#lx, sq_pi = %#lx, sqcq = %#lx. end %u\n",
#define NULL
Definition: __stddef_null.h:26

Definition at line 47 of file pcc_core.c.

◆ use_dpa_resources

bool use_dpa_resources = false
static

Definition at line 73 of file pcc_core.c.

◆ use_threads_list

bool use_threads_list = false
static

Definition at line 68 of file pcc_core.c.

◆ user_set_app

bool user_set_app = false
static

Definition at line 78 of file pcc_core.c.