NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
rp_rtt_template_dev_main.c File Reference
#include <doca_pcc_dev.h>
#include <doca_pcc_dev_event.h>
#include <doca_pcc_dev_algo_access.h>
#include "pcc_common_dev.h"
#include "rtt_template.h"
Include dependency graph for rp_rtt_template_dev_main.c:

Go to the source code of this file.

Macros

#define DOCA_PCC_DEV_EVNT_ROCE_ACK_MASK   (1 << DOCA_PCC_DEV_EVNT_ROCE_ACK)
 
#define SAMPLER_THREAD_RANK   (0)
 
#define COUNTERS_SAMPLE_WINDOW_IN_MICROSEC   (10)
 

Functions

void doca_pcc_dev_user_algo (doca_pcc_dev_algo_ctxt_t *algo_ctxt, doca_pcc_dev_event_t *event, const doca_pcc_dev_attr_t *attr, doca_pcc_dev_results_t *results)
 Entry point to the user algorithm handling code. More...
 
void doca_pcc_dev_user_init (uint32_t *disable_event_bitmask)
 Entry point to the user one time initialization code. More...
 
doca_pcc_dev_error_t doca_pcc_dev_user_set_algo_params (uint32_t port_num, uint32_t algo_slot, uint32_t param_id_base, uint32_t param_num, const uint32_t *new_param_values, uint32_t *params)
 User callback executed then parameters are set. More...
 

Variables

uint32_t counter_ids [DOCA_PCC_DEV_MAX_NUM_PORTS] = {0}
 
uint32_t current_sampled_tx_bytes [DOCA_PCC_DEV_MAX_NUM_PORTS] = {0}
 
uint32_t previous_sampled_tx_bytes [DOCA_PCC_DEV_MAX_NUM_PORTS] = {0}
 
uint32_t last_sample_ts
 
uint32_t ports_bw [DOCA_PCC_DEV_MAX_NUM_PORTS]
 
uint32_t ports_num = 0
 
uint32_t g_utilized_bw [DOCA_PCC_DEV_MAX_NUM_PORTS]
 
uint32_t counters_started = 0
 

Macro Definition Documentation

◆ COUNTERS_SAMPLE_WINDOW_IN_MICROSEC

#define COUNTERS_SAMPLE_WINDOW_IN_MICROSEC   (10)

Counters IDs to configure and read from

Definition at line 36 of file rp_rtt_template_dev_main.c.

◆ DOCA_PCC_DEV_EVNT_ROCE_ACK_MASK

#define DOCA_PCC_DEV_EVNT_ROCE_ACK_MASK   (1 << DOCA_PCC_DEV_EVNT_ROCE_ACK)

Definition at line 32 of file rp_rtt_template_dev_main.c.

◆ SAMPLER_THREAD_RANK

#define SAMPLER_THREAD_RANK   (0)

Definition at line 33 of file rp_rtt_template_dev_main.c.

Variable Documentation

◆ counter_ids

uint32_t counter_ids[DOCA_PCC_DEV_MAX_NUM_PORTS] = {0}

Table of TX bytes counters to sample to

Definition at line 37 of file rp_rtt_template_dev_main.c.

◆ counters_started

uint32_t counters_started = 0

Definition at line 51 of file rp_rtt_template_dev_main.c.

◆ current_sampled_tx_bytes

uint32_t current_sampled_tx_bytes[DOCA_PCC_DEV_MAX_NUM_PORTS] = {0}

Table of TX bytes counters that was last sampled

Definition at line 39 of file rp_rtt_template_dev_main.c.

◆ g_utilized_bw

uint32_t g_utilized_bw[DOCA_PCC_DEV_MAX_NUM_PORTS]

Flag to indicate that the counters have been initiated

Definition at line 49 of file rp_rtt_template_dev_main.c.

◆ last_sample_ts

uint32_t last_sample_ts

Ports active bandwidth. Units of MB/s

Definition at line 43 of file rp_rtt_template_dev_main.c.

◆ ports_bw

uint32_t ports_bw[DOCA_PCC_DEV_MAX_NUM_PORTS]

Number of available and initiated logical ports

Definition at line 45 of file rp_rtt_template_dev_main.c.

◆ ports_num

uint32_t ports_num = 0

Percentage of the current active ports utilized bandwidth. Saved in FXP 16 format

Definition at line 47 of file rp_rtt_template_dev_main.c.

◆ previous_sampled_tx_bytes

uint32_t previous_sampled_tx_bytes[DOCA_PCC_DEV_MAX_NUM_PORTS] = {0}

Last timestamp of sampled counters

Definition at line 41 of file rp_rtt_template_dev_main.c.