NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
telem_template.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 NVIDIA CORPORATION AND AFFILIATES. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are permitted
5  * provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright notice, this list of
9  * conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * * Neither the name of the NVIDIA CORPORATION nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21  * STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  */
25 
26 #include <doca_pcc_dev.h>
27 #include <doca_pcc_dev_event.h>
29 
30 #include "utils.h"
31 #include "telem_template_ctxt.h"
33 #include "telem_template.h"
34 
35 /* Algorithm parameters are defined in telem_template_algo_params.h */
36 
37 /* Define the constants */
38 #define MAX_UINT (0xffffffff)
39 #define DEC_FACTOR ((1 << 16) - param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* Rate decrease factor */
40 #define CNP_DEC_FACTOR ((1 << 16) - 2 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* CNP rate decrease factor */
41 #define NACK_DEC_FACTOR ((1 << 16) - 5 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* NACK rate decrease factor */
42 #define ABORT_TIME (300000) /* The time to abort rtt_req - in nanosec */
43 #define TX_RATE_TH (52428) /* Threshold to update current rate according to TX rate. 0.8 in 16b fixed point */
44 #define HIGH_UTIL_THRESHOLD (55704) /* 0.85 in 16b fixed point */
45 #define HIGH_UTIL_DEC_FACTOR \
46  ((1 << 16) - 2 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* Rate decrease factor in high port utilization mode */
47 #define HIGH_UTIL_CNP_DEC_FACTOR \
48  ((1 << 16) - 4 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* CNP rate decrease factor in high port utilization \
49  * mode \
50  */
51 #define HIGH_UTIL_NACK_DEC_FACTOR \
52  ((1 << 16) - 10 * param[TELEM_TEMPLATE_UPDATE_FACTOR]) /* NACK rate decrease factor in high port utilization \
53  mode */
54 
55 typedef enum {
56  TELEM_TEMPLATE_UPDATE_FACTOR = 0, /* configurable parameter of update factor */
57  TELEM_TEMPLATE_AI = 1, /* configurable parameter of AI */
58  TELEM_TEMPLATE_BASE_QLEN = 2, /* configurable parameter of base qlen */
59  TELEM_TEMPLATE_NEW_FLOW_RATE = 3, /* configurable parameter of new flow rate */
60  TELEM_TEMPLATE_MIN_RATE = 4, /* configurable parameter of min rate */
61  TELEM_TEMPLATE_MAX_DELAY = 5, /* configurable parameter of max delay */
62  TELEM_TEMPLATE_HAI = 6, /* configurable parameter of HAI*/
63  TELEM_TEMPLATE_PORT_BW_G = 7, /* configurable parameter of port BW (in Gbps)*/
64  TELEM_TEMPLATE_PARAM_NUM /* Maximal number of configurable parameters */
66 
67 enum {
68  TELEM_TEMPLATE_COUNTER_TX_EVENT = 0, /* tx event for telemetry template user algorithm */
69  TELEM_TEMPLATE_COUNTER_RTT_EVENT = 1, /* rtt event for telemetry template user algorithm */
70  TELEM_TEMPLATE_COUNTER_NUM /* Maximal number of counters */
72 
73 const volatile char telem_template_desc[] = "telemetry template v0.1";
74 static const volatile char telem_template_param_update_factor_desc[] = "UPDATE_FACTOR, update factor";
75 static const volatile char telem_template_param_ai_desc[] = "AI, ai";
76 static const volatile char telem_template_param_base_rtt_desc[] = "BASE_RTT, base rtt";
77 static const volatile char telem_template_param_new_flow_rate_desc[] = "NEW_FLOW_RATE, new flow rate";
78 static const volatile char telem_template_param_min_rate_desc[] = "MIN_RATE, min rate";
79 static const volatile char telem_template_param_max_delay_desc[] = "MAX_DELAY, max delay";
80 static const volatile char telem_template_counter_tx_desc[] = "COUNTER_TX_EVENT, number of tx events handled";
81 static const volatile char telem_template_counter_rtt_desc[] = "COUNTER_RTT_EVENT, number of rtt events handled";
82 
89 static inline uint32_t getBW_GBps(uint32_t *param)
90 {
91  return param[TELEM_TEMPLATE_PORT_BW_G] >> 3;
92 }
93 
94 void telem_template_init(uint32_t algo_idx)
95 {
96  struct doca_pcc_dev_algo_meta_data algo_def = {0};
97 
98  algo_def.algo_id = 0xBFFF;
99  algo_def.algo_major_version = 0x00;
100  algo_def.algo_minor_version = 0x01;
101  algo_def.algo_desc_size = sizeof(telem_template_desc);
102  algo_def.algo_desc_addr = (uint64_t)telem_template_desc;
103 
104  uint32_t total_param_num = TELEM_TEMPLATE_PARAM_NUM;
105  uint32_t total_counter_num = TELEM_TEMPLATE_COUNTER_NUM;
106  uint32_t param_num = 0;
107  uint32_t counter_num = 0;
108 
109  doca_pcc_dev_algo_init_metadata(algo_idx, &algo_def, total_param_num, total_counter_num);
110 
112  param_num++,
115  1,
116  1,
120  param_num++,
121  AI,
122  AI_MAX,
123  1,
124  1,
126  (uint64_t)telem_template_param_ai_desc);
128  param_num++,
129  BASE_RTT,
130  UINT32_MAX,
131  1,
132  1,
136  param_num++,
138  RATE_MAX,
139  1,
140  1,
144  param_num++,
145  MIN_RATE,
146  RATE_MAX,
147  1,
148  1,
152  param_num++,
153  MAX_DELAY,
154  UINT32_MAX,
155  1,
156  1,
159 
161  counter_num++,
162  UINT32_MAX,
163  2,
167  counter_num++,
168  UINT32_MAX,
169  2,
172 }
173 
174 /*
175  * Entry point to core function of algorithm (reference code)
176  * This function adjusts rate based on CC events.
177  * It calculates the new rate parameters based on flow context data, rtt info and current rate.
178  *
179  * @norm_tx_rate [in]: The value of normalized switch TX rate
180  * @qlen_256B [in]: Current switch queue occupancy in 256B units
181  * @cur_rate [in]: Current rate value
182  * @param [in]: A pointer to an array of parameters that are used to control algo behavior
183  * @return: The new calculated rate value
184  */
185 static inline uint32_t algorithm_core(uint32_t norm_tx_rate, uint32_t qlen_256B, uint32_t cur_rate, uint32_t *param)
186 {
188 
190  if ((qlen_256B << 8) > param[TELEM_TEMPLATE_BASE_QLEN]) {
191  cur_rate = doca_pcc_dev_fxp_mult(DEC_FACTOR, cur_rate);
192  } else if (norm_tx_rate < TX_RATE_TH) {
193  cur_rate += param[TELEM_TEMPLATE_HAI];
194  } else {
195  cur_rate += param[TELEM_TEMPLATE_AI];
196  }
197 
198  if (cur_rate > DOCA_PCC_DEV_MAX_RATE)
199  cur_rate = DOCA_PCC_DEV_MAX_RATE;
200 
201  if (cur_rate < param[TELEM_TEMPLATE_MIN_RATE])
202  cur_rate = param[TELEM_TEMPLATE_MIN_RATE];
203 
204  return cur_rate;
205 }
206 
207 /*
208  * Entry point to telemetry template to handle roce tx event (reference code)
209  * This function updates flags for rtt measurement or re-send rtt_req if needed.
210  * It calculates the new rate parameters based on flow context data, event info and current rate.
211  *
212  * @event [in]: A pointer to an event data structure to be passed to extractor functions
213  * @cur_rate [in]: Current rate value
214  * @ccctx [in/out]: A pointer to a flow context data retrieved by libpcc.
215  * @results [out]: A pointer to result struct to update rate in HW.
216  */
217 static inline void telem_template_handle_roce_tx(doca_pcc_dev_event_t *event,
218  uint32_t cur_rate,
220  doca_pcc_dev_results_t *results)
221 {
222  uint8_t rtt_req = 0;
223  uint32_t rtt_meas_psn = ccctx->rtt_meas_psn;
224  uint32_t timestamp = doca_pcc_dev_get_timestamp(event);
226 
227  if (unlikely((ev_attr.flags & DOCA_PCC_DEV_TX_FLAG_RTT_REQ_SENT) && (rtt_meas_psn == 0))) {
228  ccctx->rtt_meas_psn = 1;
229  ccctx->flags.rtt_req_to_rtt_sent = 0;
230  ccctx->start_delay = timestamp;
231  } else {
232  /* Calculate rtt_till_now */
233  uint32_t rtt_till_now = (timestamp - ccctx->start_delay);
234 
235  if (unlikely(ccctx->start_delay > timestamp))
236  rtt_till_now += UINT32_MAX;
237  /* Abort RTT request flow - for cases event or packet was dropped */
238  if (rtt_meas_psn == 0) {
239  rtt_till_now = 0;
240  ccctx->flags.rtt_req_to_rtt_sent += 1;
241  }
242  if (unlikely((rtt_till_now > ((uint32_t)ABORT_TIME << ccctx->abort_cnt)) ||
243  (ccctx->flags.rtt_req_to_rtt_sent > 2))) {
244  rtt_req = 1;
245  if (rtt_till_now > ((uint32_t)ABORT_TIME << ccctx->abort_cnt))
246  ccctx->abort_cnt += 1;
247  ccctx->flags.rtt_req_to_rtt_sent = 1;
248  }
249  }
250 
251  /* Update results buffer and context */
252  ccctx->cur_rate = cur_rate;
253  results->rate = cur_rate;
254  results->rtt_req = rtt_req;
255 }
256 
257 /*
258  * Entry point to telemetry template to handle roce rtt event (reference code)
259  * This function calculates the rtt and calls core function to adjust rate.
260  * It calculates the new rate parameters based on flow context data, event info and current rate.
261  *
262  * @event [in]: A pointer to an event data structure to be passed to extractor functions
263  * @cur_rate [in]: Current rate value
264  * @param [in]: A pointer to an array of parameters that are used to control algo behavior
265  * @ccctx [in/out]: A pointer to a flow context data retrieved by libpcc.
266  * @results [out]: A pointer to result struct to update rate in HW.
267  */
268 static inline void telem_template_handle_roce_rtt(doca_pcc_dev_event_t *event,
269  uint32_t cur_rate,
270  uint32_t *param,
272  doca_pcc_dev_results_t *results)
273 {
274  /*
275  * Check that this RTT event is the one we are waiting for.
276  * For cases we re-send RTT request by mistake due to abort flow for example.
277  */
278  uint32_t rtt_meas_psn = ccctx->rtt_meas_psn;
279 
280  if (unlikely(((rtt_meas_psn == 0) && (ccctx->flags.rtt_req_to_rtt_sent == 0)))) {
281  results->rate = cur_rate;
282  results->rtt_req = 0;
283  return;
284  }
285 
286  /* We got RTT measurement */
287  /* Reset variables */
288  ccctx->rtt_meas_psn = 0;
289  ccctx->abort_cnt = 0;
290 
291  unsigned char *rtt_raw_data = doca_pcc_dev_get_rtt_raw_data(event);
292  doca_pcc_dev_switch_telem_extra_t telem_extra = *((doca_pcc_dev_switch_telem_extra_t *)(rtt_raw_data));
293  uint32_t switch_tx_bytes = *((uint32_t *)(rtt_raw_data + 4));
294  uint32_t switch_tx_timestamp = *((uint32_t *)(rtt_raw_data + 8));
295  uint32_t qlen_256B = telem_extra.qlen;
296 
297  uint32_t last_switch_tx_timestamp = ccctx->last_switch_tx_timestamp;
298  uint32_t last_tx_bytes = ccctx->last_tx_bytes;
299  ccctx->last_tx_bytes = switch_tx_bytes;
300  ccctx->last_switch_tx_timestamp = switch_tx_timestamp;
301 
302  /* Call to the core of the CC algorithm */
303 
304  uint32_t delta_timestamp_ns = switch_tx_timestamp - last_switch_tx_timestamp;
305  // handle wraparound
306  if (unlikely(switch_tx_timestamp < last_switch_tx_timestamp))
307  delta_timestamp_ns += MAX_UINT;
308  uint32_t delta_tx = switch_tx_bytes - last_tx_bytes;
309  // handle wraparound
310  if (unlikely(switch_tx_bytes < last_tx_bytes))
311  delta_tx += MAX_UINT;
312  uint32_t delta_tx_256bytes = delta_tx >> 8;
313  uint32_t tx_rate_GBps = doca_pcc_dev_fxp_mult(delta_tx_256bytes, doca_pcc_dev_fxp_recip(delta_timestamp_ns))
314  << 8; // fxp16
315  uint32_t norm_tx_rate = doca_pcc_dev_mult(tx_rate_GBps, doca_pcc_dev_fxp_recip(getBW_GBps(param))) >> 32;
316  if (norm_tx_rate > (1 << 16))
317  norm_tx_rate = (1 << 16);
318  cur_rate = algorithm_core(norm_tx_rate, qlen_256B, cur_rate, param);
319 
320  ccctx->flags.rtt_req_to_rtt_sent = 1;
321  ccctx->cur_rate = cur_rate;
322  results->rate = cur_rate;
323  results->rtt_req = 1;
324 }
325 
326 /*
327  * Entry point to telemetry template to handle roce cnp events (reference code)
328  * This function puts the code for immediate reaction to CNPs.
329  * It calculates the new rate parameters based on flow context data, event info and current rate.
330  *
331  * @event [in]: A pointer to an event data structure to be passed to extractor functions
332  * @cur_rate [in]: Current rate value
333  * @ccctx [in/out]: A pointer to a flow context data retrieved by libpcc.
334  * @results [out]: A pointer to result struct to update rate in HW.
335  */
336 static inline void telem_template_handle_roce_cnp(doca_pcc_dev_event_t *event,
337  uint32_t cur_rate,
339  doca_pcc_dev_results_t *results)
340 {
341  (void)(event);
342  ccctx->flags.was_cnp = 1;
343 
344  /* ###### You can put the code for immediate reaction to CNPs ####### */
345  /*
346  * e.g:
347  * cur_rate =
348  */
349  results->rtt_req = 0;
350  results->rate = cur_rate;
351  ccctx->cur_rate = cur_rate;
352 }
353 
354 /*
355  * Entry point to telemetry template to handle roce nack events (reference code)
356  * This function puts the code for immediate reaction to NACKs.
357  * It calculates the new rate parameters based on flow context data, event info and current rate.
358  *
359  * @event [in]: A pointer to an event data structure to be passed to extractor functions
360  * @cur_rate [in]: Current rate value
361  * @ccctx [in]: A pointer to a flow context data retrieved by libpcc.
362  * @results [out]: A pointer to result struct to update rate in HW.
363  */
364 static inline void telem_template_handle_roce_nack(doca_pcc_dev_event_t *event,
365  uint32_t cur_rate,
367  doca_pcc_dev_results_t *results)
368 {
369  (void)(event);
370  ccctx->flags.was_nack = 1;
371  results->rate = cur_rate;
372  ccctx->cur_rate = cur_rate;
373 }
374 
375 /*
376  * Entry point to telemetry template to handle new flow (reference code)
377  * This function initializes the flow context.
378  * It calculates the new rate parameters based on flow context data, event info and current rate.
379  *
380  * @event [in]: A pointer to an event data structure to be passed to extractor functions
381  * @cur_rate [in]: Current rate value
382  * @param [in]: A pointer to an array of parameters that are used to control algo behavior
383  * @ccctx [in/out]: A pointer to a flow context data retrieved by libpcc.
384  * @results [out]: A pointer to result struct to update rate in HW.
385  */
386 static inline void telem_template_handle_new_flow(doca_pcc_dev_event_t *event,
387  uint32_t cur_rate,
388  uint32_t *param,
390  doca_pcc_dev_results_t *results)
391 {
392  (void)(cur_rate);
393  ccctx->cur_rate = param[TELEM_TEMPLATE_NEW_FLOW_RATE];
394  ccctx->start_delay = doca_pcc_dev_get_timestamp(event);
395  ccctx->rtt_meas_psn = 0;
396  ccctx->flags.rtt_req_to_rtt_sent = 1;
397  ccctx->abort_cnt = 0;
398  ccctx->flags.was_nack = 0;
399  results->rate = param[TELEM_TEMPLATE_NEW_FLOW_RATE];
400  results->rtt_req = 1;
401 }
402 
404  uint32_t *param,
405  uint32_t *counter,
406  doca_pcc_dev_algo_ctxt_t *algo_ctxt,
407  doca_pcc_dev_results_t *results)
408 {
409  cc_ctxt_telem_template_t *telem_template_ctx = (cc_ctxt_telem_template_t *)algo_ctxt;
411  uint32_t ev_type = ev_attr.ev_type;
412  uint32_t cur_rate = telem_template_ctx->cur_rate;
413 
414  if (unlikely(cur_rate == 0)) {
415  telem_template_handle_new_flow(event, cur_rate, param, telem_template_ctx, results);
416  } else if (ev_type == DOCA_PCC_DEV_EVNT_ROCE_TX) {
417  telem_template_handle_roce_tx(event, cur_rate, telem_template_ctx, results);
418  /* Example code to update counter */
419  if (counter != NULL)
421  } else if (ev_type == DOCA_PCC_DEV_EVNT_RTT) {
422  telem_template_handle_roce_rtt(event, cur_rate, param, telem_template_ctx, results);
423  /* Example code to update counter */
424  if (counter != NULL)
426  } else if (ev_type == DOCA_PCC_DEV_EVNT_ROCE_CNP) {
427  telem_template_handle_roce_cnp(event, cur_rate, telem_template_ctx, results);
428  } else if (ev_type == DOCA_PCC_DEV_EVNT_ROCE_NACK) {
429  telem_template_handle_roce_nack(event, cur_rate, telem_template_ctx, results);
430  } else {
431  results->rate = cur_rate;
432  results->rtt_req = 0;
433  }
434 }
435 
437  uint32_t param_num,
438  const uint32_t *new_param_values,
439  uint32_t *params)
440 {
441  if ((param_num > TELEM_TEMPLATE_PARAM_NUM) || (param_id_base >= TELEM_TEMPLATE_PARAM_NUM))
443 
444  if ((new_param_values == NULL) || (params == NULL))
446 
447  return DOCA_PCC_DEV_STATUS_OK;
448 }
#define NULL
Definition: __stddef_null.h:26
doca_telemetry_exporter_timestamp_t timestamp
#define unlikely(x)
Definition: utils.h:42
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.
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.
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.
doca_pcc_dev_error_t
API functions return status.
@ DOCA_PCC_DEV_STATUS_OK
@ DOCA_PCC_DEV_STATUS_FAIL
DOCA_EXPERIMENTAL FORCE_INLINE unsigned char * doca_pcc_dev_get_rtt_raw_data(doca_pcc_dev_event_t *event)
Returns the user defined event data.
DOCA_STABLE FORCE_INLINE doca_pcc_dev_event_general_attr_t doca_pcc_dev_get_ev_attr(doca_pcc_dev_event_t *event)
For all events, return structure with general information such as event type, subtype,...
DOCA_STABLE FORCE_INLINE uint32_t doca_pcc_dev_get_timestamp(doca_pcc_dev_event_t *event)
For all events, timestamp of this event.
#define doca_pcc_dev_mult(a, b)
mult wrapper
#define doca_pcc_dev_fxp_recip(a_fp)
fixed point 16b reciprocal
#define doca_pcc_dev_fxp_mult(a, b)
fixed point 16b mult
#define DOCA_PCC_DEV_TX_FLAG_RTT_REQ_SENT
TX Flag: RTT packet sent.
Definition: doca_pcc_dev.h:99
#define DOCA_PCC_DEV_MAX_RATE
Max rate in rate limiter fixed point.
Definition: doca_pcc_dev.h:109
@ DOCA_PCC_DEV_EVNT_ROCE_TX
Definition: doca_pcc_dev.h:49
@ DOCA_PCC_DEV_EVNT_ROCE_CNP
Definition: doca_pcc_dev.h:48
@ DOCA_PCC_DEV_EVNT_ROCE_NACK
Definition: doca_pcc_dev.h:51
@ DOCA_PCC_DEV_EVNT_RTT
Definition: doca_pcc_dev.h:52
#define MAX_DELAY
#define MIN_RATE
#define UPDATE_FACTOR_MAX
#define NEW_FLOW_RATE
#define BASE_RTT
#define UPDATE_FACTOR
#define AI
#define RATE_MAX
#define AI_MAX
telem_template_flags_t flags
This struct provides meta data for a pcc user algo.
CC algorithm results.
Definition: doca_pcc_dev.h:69
static const volatile char telem_template_param_new_flow_rate_desc[]
static uint32_t algorithm_core(uint32_t norm_tx_rate, uint32_t qlen_256B, uint32_t cur_rate, uint32_t *param)
#define ABORT_TIME
static const volatile char telem_template_param_max_delay_desc[]
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_nack(doca_pcc_dev_event_t *event, uint32_t cur_rate, cc_ctxt_telem_template_t *ccctx, doca_pcc_dev_results_t *results)
static const volatile char telem_template_counter_tx_desc[]
#define DEC_FACTOR
@ TELEM_TEMPLATE_COUNTER_NUM
@ TELEM_TEMPLATE_COUNTER_RTT_EVENT
@ TELEM_TEMPLATE_COUNTER_TX_EVENT
enum @32 telem_template_counter_t
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 const volatile char telem_template_param_ai_desc[]
telem_template_params_t
@ TELEM_TEMPLATE_BASE_QLEN
@ TELEM_TEMPLATE_UPDATE_FACTOR
@ TELEM_TEMPLATE_AI
@ TELEM_TEMPLATE_MAX_DELAY
@ TELEM_TEMPLATE_MIN_RATE
@ TELEM_TEMPLATE_PORT_BW_G
@ TELEM_TEMPLATE_HAI
@ TELEM_TEMPLATE_PARAM_NUM
@ TELEM_TEMPLATE_NEW_FLOW_RATE
static const volatile char telem_template_param_update_factor_desc[]
static const volatile char telem_template_param_min_rate_desc[]
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)
static const volatile char telem_template_counter_rtt_desc[]
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)
#define MAX_UINT
#define TX_RATE_TH
static uint32_t getBW_GBps(uint32_t *param)
Get the BW in GBps.
const volatile char telem_template_desc[]
static const volatile char telem_template_param_base_rtt_desc[]
void telem_template_init(uint32_t algo_idx)
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)