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

Go to the source code of this file.

Macros

#define MAX_UINT   (0xffffffff)
 
#define DEC_FACTOR   ((1 << 16) - param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* Rate decrease factor */
 
#define CNP_DEC_FACTOR   ((1 << 16) - 2 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* CNP rate decrease factor */
 
#define NACK_DEC_FACTOR   ((1 << 16) - 5 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* NACK rate decrease factor */
 
#define ABORT_TIME   (300000) /* The time to abort rtt_req - in nanosec */
 
#define TX_RATE_TH   (52428) /* Threshold to update current rate according to TX rate. 0.8 in 16b fixed point */
 
#define HIGH_UTIL_THRESHOLD   (55704) /* 0.85 in 16b fixed point */
 
#define HIGH_UTIL_DEC_FACTOR    ((1 << 16) - 2 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* Rate decrease factor in high port utilization mode */
 
#define HIGH_UTIL_CNP_DEC_FACTOR
 
#define HIGH_UTIL_NACK_DEC_FACTOR
 

Enumerations

enum  telem_template_params_t {
  TELEM_TEMPLATE_UPDATE_FACTOR = 0 , TELEM_TEMPLATE_AI = 1 , TELEM_TEMPLATE_BASE_QLEN = 2 , TELEM_TEMPLATE_NEW_FLOW_RATE = 3 ,
  TELEM_TEMPLATE_MIN_RATE = 4 , TELEM_TEMPLATE_MAX_DELAY = 5 , TELEM_TEMPLATE_HAI = 6 , TELEM_TEMPLATE_PORT_BW_G = 7 ,
  TELEM_TEMPLATE_PARAM_NUM
}
 
enum  { TELEM_TEMPLATE_COUNTER_TX_EVENT = 0 , TELEM_TEMPLATE_COUNTER_RTT_EVENT = 1 , TELEM_TEMPLATE_COUNTER_NUM }
 

Functions

static uint32_t getBW_GBps (uint32_t *param)
 Get the BW in GBps. More...
 
void telem_template_init (uint32_t algo_idx)
 
static uint32_t algorithm_core (uint32_t norm_tx_rate, uint32_t qlen_256B, uint32_t cur_rate, uint32_t *param)
 
static void telem_template_handle_roce_tx (doca_pcc_dev_event_t *event, uint32_t cur_rate, cc_ctxt_telem_template_t *ccctx, doca_pcc_dev_results_t *results)
 
static void telem_template_handle_roce_rtt (doca_pcc_dev_event_t *event, uint32_t cur_rate, uint32_t *param, cc_ctxt_telem_template_t *ccctx, doca_pcc_dev_results_t *results)
 
static void telem_template_handle_roce_cnp (doca_pcc_dev_event_t *event, uint32_t cur_rate, cc_ctxt_telem_template_t *ccctx, doca_pcc_dev_results_t *results)
 
static void telem_template_handle_roce_nack (doca_pcc_dev_event_t *event, uint32_t cur_rate, cc_ctxt_telem_template_t *ccctx, doca_pcc_dev_results_t *results)
 
static void telem_template_handle_new_flow (doca_pcc_dev_event_t *event, uint32_t cur_rate, uint32_t *param, cc_ctxt_telem_template_t *ccctx, doca_pcc_dev_results_t *results)
 
void telem_template_algo (doca_pcc_dev_event_t *event, uint32_t *param, uint32_t *counter, doca_pcc_dev_algo_ctxt_t *algo_ctxt, doca_pcc_dev_results_t *results)
 
doca_pcc_dev_error_t telem_template_set_algo_params (uint32_t param_id_base, uint32_t param_num, const uint32_t *new_param_values, uint32_t *params)
 

Variables

enum { ... }  telem_template_counter_t
 
const volatile char telem_template_desc [] = "telemetry template v0.1"
 
static const volatile char telem_template_param_update_factor_desc [] = "UPDATE_FACTOR, update factor"
 
static const volatile char telem_template_param_ai_desc [] = "AI, ai"
 
static const volatile char telem_template_param_base_rtt_desc [] = "BASE_RTT, base rtt"
 
static const volatile char telem_template_param_new_flow_rate_desc [] = "NEW_FLOW_RATE, new flow rate"
 
static const volatile char telem_template_param_min_rate_desc [] = "MIN_RATE, min rate"
 
static const volatile char telem_template_param_max_delay_desc [] = "MAX_DELAY, max delay"
 
static const volatile char telem_template_counter_tx_desc [] = "COUNTER_TX_EVENT, number of tx events handled"
 
static const volatile char telem_template_counter_rtt_desc [] = "COUNTER_RTT_EVENT, number of rtt events handled"
 

Macro Definition Documentation

◆ ABORT_TIME

#define ABORT_TIME   (300000) /* The time to abort rtt_req - in nanosec */

Definition at line 42 of file telem_template.c.

◆ CNP_DEC_FACTOR

#define CNP_DEC_FACTOR   ((1 << 16) - 2 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* CNP rate decrease factor */

Definition at line 40 of file telem_template.c.

◆ DEC_FACTOR

#define DEC_FACTOR   ((1 << 16) - param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* Rate decrease factor */

Definition at line 39 of file telem_template.c.

◆ HIGH_UTIL_CNP_DEC_FACTOR

#define HIGH_UTIL_CNP_DEC_FACTOR
Value:
((1 << 16) - 4 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* CNP rate decrease factor in high port utilization \
* mode \
*/
@ TELEM_TEMPLATE_UPDATE_FACTOR

Definition at line 47 of file telem_template.c.

◆ HIGH_UTIL_DEC_FACTOR

#define HIGH_UTIL_DEC_FACTOR    ((1 << 16) - 2 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* Rate decrease factor in high port utilization mode */

Definition at line 45 of file telem_template.c.

◆ HIGH_UTIL_NACK_DEC_FACTOR

#define HIGH_UTIL_NACK_DEC_FACTOR
Value:
((1 << 16) - 10 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* NACK rate decrease factor in high port utilization \
mode */

Definition at line 49 of file telem_template.c.

◆ HIGH_UTIL_THRESHOLD

#define HIGH_UTIL_THRESHOLD   (55704) /* 0.85 in 16b fixed point */

Definition at line 44 of file telem_template.c.

◆ MAX_UINT

#define MAX_UINT   (0xffffffff)

Definition at line 38 of file telem_template.c.

◆ NACK_DEC_FACTOR

#define NACK_DEC_FACTOR   ((1 << 16) - 5 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* NACK rate decrease factor */

Definition at line 41 of file telem_template.c.

◆ TX_RATE_TH

#define TX_RATE_TH   (52428) /* Threshold to update current rate according to TX rate. 0.8 in 16b fixed point */

Definition at line 43 of file telem_template.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TELEM_TEMPLATE_COUNTER_TX_EVENT 
TELEM_TEMPLATE_COUNTER_RTT_EVENT 
TELEM_TEMPLATE_COUNTER_NUM 

Definition at line 64 of file telem_template.c.

◆ telem_template_params_t

Enumerator
TELEM_TEMPLATE_UPDATE_FACTOR 
TELEM_TEMPLATE_AI 
TELEM_TEMPLATE_BASE_QLEN 
TELEM_TEMPLATE_NEW_FLOW_RATE 
TELEM_TEMPLATE_MIN_RATE 
TELEM_TEMPLATE_MAX_DELAY 
TELEM_TEMPLATE_HAI 
TELEM_TEMPLATE_PORT_BW_G 
TELEM_TEMPLATE_PARAM_NUM 

Definition at line 52 of file telem_template.c.

Function Documentation

◆ algorithm_core()

static uint32_t algorithm_core ( uint32_t  norm_tx_rate,
uint32_t  qlen_256B,
uint32_t  cur_rate,
uint32_t *  param 
)
inlinestatic

Example ////

Definition at line 182 of file telem_template.c.

◆ getBW_GBps()

static uint32_t getBW_GBps ( uint32_t *  param)
inlinestatic

Get the BW in GBps.

Parameters
[in]

Definition at line 86 of file telem_template.c.

◆ telem_template_algo()

void telem_template_algo ( doca_pcc_dev_event_t event,
uint32_t *  param,
uint32_t *  counter,
doca_pcc_dev_algo_ctxt_t algo_ctxt,
doca_pcc_dev_results_t results 
)

Definition at line 400 of file telem_template.c.

◆ telem_template_handle_new_flow()

static void telem_template_handle_new_flow ( doca_pcc_dev_event_t event,
uint32_t  cur_rate,
uint32_t *  param,
cc_ctxt_telem_template_t ccctx,
doca_pcc_dev_results_t results 
)
inlinestatic

Definition at line 383 of file telem_template.c.

◆ telem_template_handle_roce_cnp()

static void telem_template_handle_roce_cnp ( doca_pcc_dev_event_t event,
uint32_t  cur_rate,
cc_ctxt_telem_template_t ccctx,
doca_pcc_dev_results_t results 
)
inlinestatic

Definition at line 333 of file telem_template.c.

◆ telem_template_handle_roce_nack()

static void telem_template_handle_roce_nack ( doca_pcc_dev_event_t event,
uint32_t  cur_rate,
cc_ctxt_telem_template_t ccctx,
doca_pcc_dev_results_t results 
)
inlinestatic

Definition at line 361 of file telem_template.c.

◆ telem_template_handle_roce_rtt()

static void telem_template_handle_roce_rtt ( doca_pcc_dev_event_t event,
uint32_t  cur_rate,
uint32_t *  param,
cc_ctxt_telem_template_t ccctx,
doca_pcc_dev_results_t results 
)
inlinestatic

Definition at line 265 of file telem_template.c.

◆ telem_template_handle_roce_tx()

static void telem_template_handle_roce_tx ( doca_pcc_dev_event_t event,
uint32_t  cur_rate,
cc_ctxt_telem_template_t ccctx,
doca_pcc_dev_results_t results 
)
inlinestatic

Definition at line 214 of file telem_template.c.

◆ telem_template_init()

void telem_template_init ( uint32_t  algo_idx)

Definition at line 91 of file telem_template.c.

◆ telem_template_set_algo_params()

doca_pcc_dev_error_t telem_template_set_algo_params ( uint32_t  param_id_base,
uint32_t  param_num,
const uint32_t *  new_param_values,
uint32_t *  params 
)

Definition at line 433 of file telem_template.c.

Variable Documentation

◆ telem_template_counter_rtt_desc

const volatile char telem_template_counter_rtt_desc[] = "COUNTER_RTT_EVENT, number of rtt events handled"
static

Definition at line 78 of file telem_template.c.

◆ 

enum { ... } telem_template_counter_t

◆ telem_template_counter_tx_desc

const volatile char telem_template_counter_tx_desc[] = "COUNTER_TX_EVENT, number of tx events handled"
static

Definition at line 77 of file telem_template.c.

◆ telem_template_desc

const volatile char telem_template_desc[] = "telemetry template v0.1"

Definition at line 70 of file telem_template.c.

◆ telem_template_param_ai_desc

const volatile char telem_template_param_ai_desc[] = "AI, ai"
static

Definition at line 72 of file telem_template.c.

◆ telem_template_param_base_rtt_desc

const volatile char telem_template_param_base_rtt_desc[] = "BASE_RTT, base rtt"
static

Definition at line 73 of file telem_template.c.

◆ telem_template_param_max_delay_desc

const volatile char telem_template_param_max_delay_desc[] = "MAX_DELAY, max delay"
static

Definition at line 76 of file telem_template.c.

◆ telem_template_param_min_rate_desc

const volatile char telem_template_param_min_rate_desc[] = "MIN_RATE, min rate"
static

Definition at line 75 of file telem_template.c.

◆ telem_template_param_new_flow_rate_desc

const volatile char telem_template_param_new_flow_rate_desc[] = "NEW_FLOW_RATE, new flow rate"
static

Definition at line 74 of file telem_template.c.

◆ telem_template_param_update_factor_desc

const volatile char telem_template_param_update_factor_desc[] = "UPDATE_FACTOR, update factor"
static

Definition at line 71 of file telem_template.c.