NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA PCC Device Algorithm Access
Collaboration diagram for DOCA PCC Device Algorithm Access:

Data Structures

struct  doca_pcc_dev_algo_meta_data
 This struct provides meta data for a pcc user algo. More...
 

Macros

#define DOCA_PCC_DEV_TARGET_APP_RP   (0)
 Reaction Point target app. More...
 
#define DOCA_PCC_DEV_TARGET_APP_NP   (1)
 Notification Point target app. More...
 
#define DOCA_PCC_DEV_ALGO_SLOT(target_app, ppcc_algo_slot)   ((target_app << 16) | (ppcc_algo_slot & 0xffff))
 wrapper to define algorithm slot per target device More...
 

Functions

DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_algo_init_metadata (uint32_t algo_idx, const struct doca_pcc_dev_algo_meta_data *user_def, uint32_t param_num, uint32_t counter_num)
 Initialize the algo database. More...
 
DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_algo_init_param (uint32_t algo_idx, uint32_t param_id, uint32_t default_value, uint32_t max_value, uint32_t min_value, uint32_t permissions, uint32_t param_desc_size, uint64_t param_desc_addr)
 Initialize a single parameter for an algo. More...
 
DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_algo_init_counter (uint32_t algo_idx, uint32_t counter_id, uint32_t max_value, uint32_t permissions, uint32_t counter_desc_size, uint64_t counter_desc_addr)
 Initialize a single counter for an algo. More...
 
DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_init_algo_slot (uint32_t portid, uint32_t algo_slot, uint32_t algo_idx, uint32_t algo_en)
 Initialize the algo per port database. More...
 
DOCA_STABLE uint32_t doca_pcc_dev_get_counters_num (uint32_t port_num, uint32_t algo_slot)
 Get number of counters supported per algo on the port. More...
 
DOCA_STABLE uint32_t * doca_pcc_dev_get_counters (uint32_t port_num, uint32_t algo_slot)
 Get pointer to counter array of a specific algo and specific port. More...
 
DOCA_STABLE uint32_t doca_pcc_dev_get_algo_params_num (uint32_t port_num, uint32_t algo_slot)
 Get number of params supported per algo on the port. More...
 
DOCA_STABLE uint32_t * doca_pcc_dev_get_algo_params (uint32_t port_num, uint32_t algo_slot)
 Get pointer to param array of a specific algo and specific port. More...
 
DOCA_STABLE uint32_t doca_pcc_dev_get_algo_index (uint32_t port_num, uint32_t algo_slot)
 Get identifier of a specific algo and specific port. More...
 

Detailed Description

Macro Definition Documentation

◆ DOCA_PCC_DEV_ALGO_SLOT

#define DOCA_PCC_DEV_ALGO_SLOT (   target_app,
  ppcc_algo_slot 
)    ((target_app << 16) | (ppcc_algo_slot & 0xffff))

wrapper to define algorithm slot per target device

Note
use for algo access API

Definition at line 49 of file doca_pcc_dev_algo_access.h.

◆ DOCA_PCC_DEV_TARGET_APP_NP

#define DOCA_PCC_DEV_TARGET_APP_NP   (1)

Notification Point target app.

To be used as an extension for the algo access API.

See also
DOCA_PCC_DEV_ALGO_SLOT

Definition at line 42 of file doca_pcc_dev_algo_access.h.

◆ DOCA_PCC_DEV_TARGET_APP_RP

#define DOCA_PCC_DEV_TARGET_APP_RP   (0)

Reaction Point target app.

To be used as an extension for the algo access API.

See also
DOCA_PCC_DEV_ALGO_SLOT

Definition at line 35 of file doca_pcc_dev_algo_access.h.

Function Documentation

◆ doca_pcc_dev_algo_init_counter()

DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_algo_init_counter ( uint32_t  algo_idx,
uint32_t  counter_id,
uint32_t  max_value,
uint32_t  permissions,
uint32_t  counter_desc_size,
uint64_t  counter_desc_addr 
)

Initialize a single counter for an algo.

This function initializes a single counter (counterid) for a specific algo (algo_idx) The counter_id should be in the bounds declared by doca_pcc_dev_algo_init_metadata(...) The counter info (e.g. description) is "global" to the algo on all ports.

Parameters
[in]algo_idx- Algo identifier.
[in]counter_id- counter id (from 0 to doca_pcc_dev_algo_init_metadata(...).counter_num)
[in]max_value- max value that allowed for the counter.
[in]permissions- If 1 allows value update, if 0 update is disabled.
[in]counter_desc_size- The size in bytes for the counter descriptor string field
[in]counter_desc_addr- A pointer to the counter descriptor string field.
Returns
DOCA_PCC_DEV_STATUS_FAIL if input parameters are out of range.

◆ doca_pcc_dev_algo_init_metadata()

DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_algo_init_metadata ( uint32_t  algo_idx,
const struct doca_pcc_dev_algo_meta_data user_def,
uint32_t  param_num,
uint32_t  counter_num 
)

Initialize the algo database.

This function initializes an algo data-structure. Each algorithm has in index (not to be confused with the doca_pcc_dev_algo_meta_data::algo_id) Algo database includes a metadata area containing basic algo information, and a params and counters metadata area. The number of parameters and counters is configurable at init time. The space allocated for the algo data-structure using this function is visible to the PCC infrastructure. This is required to allow the infrastructure to read/update param / counter information directly when handling PPCC MADs or commands. The user can use additional memory by allocating global variables

This function should be called once per algo during init.

Parameters
[in]algo_idx- algo index.
[in]user_def- basic version info + pointer and size of algo description string
[in]param_num- max number of params (will be used to reserve param space)
[in]counter_num- max number of counters (will be used to reserve counter space)
Returns
DOCA_PCC_DEV_STATUS_FAIL if input parameters are out of range.

◆ doca_pcc_dev_algo_init_param()

DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_algo_init_param ( uint32_t  algo_idx,
uint32_t  param_id,
uint32_t  default_value,
uint32_t  max_value,
uint32_t  min_value,
uint32_t  permissions,
uint32_t  param_desc_size,
uint64_t  param_desc_addr 
)

Initialize a single parameter for an algo.

This function initializes a single parameter (param_id) for a specific algo (algo_idx) The param_id should be in the bounds declared by doca_pcc_dev_algo_init_metadata(...) The param info is "global" to the algo on all ports. The current value of the param that is initialized to the "default" value can be modified at the port level.

Parameters
[in]algo_idx- Algo index.
[in]param_id- parameter id (from 0 to doca_pcc_dev_algo_init_metadata(...).param_num)
[in]default_value- base value.
[in]max_value- max value that is enforced by set function.
[in]min_value- min value that is enforced by set function..
[in]permissions- If 1 allows value update, if 0 update is disabled.
[in]param_desc_size- The size in bytes for the parameter descriptor string field
[in]param_desc_addr- A pointer to the parameter descriptor string field.
Returns
DOCA_PCC_DEV_STATUS_FAIL if input parameters are out of range.

◆ doca_pcc_dev_get_algo_index()

DOCA_STABLE uint32_t doca_pcc_dev_get_algo_index ( uint32_t  port_num,
uint32_t  algo_slot 
)

Get identifier of a specific algo and specific port.

Parameters
[in]port_num
[in]algo_slot- Algo slot identifier as referred to in the PPCC command field "algo_slot"
Returns
Algo identifier.

◆ doca_pcc_dev_get_algo_params()

DOCA_STABLE uint32_t* doca_pcc_dev_get_algo_params ( uint32_t  port_num,
uint32_t  algo_slot 
)

Get pointer to param array of a specific algo and specific port.

This retrieves the pointer to an array of param (current value) of up to doca_pcc_dev_get_algo_params_num() params used by algo_slot on the port

Parameters
[in]port_num
[in]algo_slot- Algo slot identifier as referred to in the PPCC command field "algo_slot"
Returns
array of 32b parameters

◆ doca_pcc_dev_get_algo_params_num()

DOCA_STABLE uint32_t doca_pcc_dev_get_algo_params_num ( uint32_t  port_num,
uint32_t  algo_slot 
)

Get number of params supported per algo on the port.

Parameters
[in]port_num
[in]algo_slot- Algo slot identifier as referred to in the PPCC command field "algo_slot"
Returns
number of supported params

◆ doca_pcc_dev_get_counters()

DOCA_STABLE uint32_t* doca_pcc_dev_get_counters ( uint32_t  port_num,
uint32_t  algo_slot 
)

Get pointer to counter array of a specific algo and specific port.

This retrieves the pointer to an array of counters (up to doca_pcc_dev_get_counters_num(...) counters) used by algo_slot on the port

Parameters
[in]port_num
[in]algo_slot- Algo slot identifier as referred to in the PPCC command field "algo_slot"
Returns
array of 32b counters

◆ doca_pcc_dev_get_counters_num()

DOCA_STABLE uint32_t doca_pcc_dev_get_counters_num ( uint32_t  port_num,
uint32_t  algo_slot 
)

Get number of counters supported per algo on the port.

Parameters
[in]port_num
[in]algo_slot- Algo slot identifier as referred to in the PPCC command field "algo_slot"
Returns
number of supported counters

◆ doca_pcc_dev_init_algo_slot()

DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_init_algo_slot ( uint32_t  portid,
uint32_t  algo_slot,
uint32_t  algo_idx,
uint32_t  algo_en 
)

Initialize the algo per port database.

This function initializes the algo per port parameter database, and maps an algo_idx (global algo index) to a specific slot per port. This function allocates parameters and counters per port. The default parameters values are taken from the algo metadata set by doca_pcc_dev_algo_init_param() . The counters and parameters can be get/set by the infrastructure based on MAD and access register PPCC command Function MUST be called after calls to doca_pcc_dev_algo_init_param for this algo type

Parameters
[in]portid- port to be initialized
[in]algo_slot- Algo slot identifier as referred to in the PPCC command field "algo_slot" if possible it should be equal to the algo_idx
[in]algo_idx- Algo identifier.
[in]algo_en- 1 mark algo as enabled, if 0 algo will not be reported if queried
Returns
DOCA_PCC_DEV_STATUS_FAIL if input parameters are out of range.