NVIDIA DOCA SDK
Data Center on a Chip Framework Documentation
rtt_template.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 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
#ifndef RTT_TEMPLATE_H
27
#define RTT_TEMPLATE_H
28
29
/*
30
* Entry point to rtt template (example) user algorithm (reference code)
31
* This function starts the algorithm code of a single event for the rtt template example algorithm
32
* It calculates the new rate parameters based on flow context data and event info.
33
*
34
* @event [in]: A pointer to an event data structure to be passed to extractor functions
35
* @param [in]: A pointer to an array of parameters that are used to control algo behavior (see PPCC access register)
36
* @counter [in/out]: A pointer to an array of counters that are incremented by algo (see PPCC access register)
37
* @algo_ctxt [in/out]: A pointer to a flow context data retrieved by libpcc.
38
* @results [out]: A pointer to result struct to update rate in HW.
39
*/
40
void
rtt_template_algo
(
doca_pcc_dev_event_t
*event,
41
uint32_t *param,
42
uint32_t *counter,
43
doca_pcc_dev_algo_ctxt_t
*algo_ctxt,
44
doca_pcc_dev_results_t
*results);
45
46
/*
47
* Entry point to rtt template (example) user algorithm initialization (reference code)
48
* This function starts the user algorithm initialization code
49
* The function will be called once per process load and should init all ports
50
*
51
* @algo_idx [in]: Algo identifier. To be passed on to initialization APIs
52
*/
53
void
rtt_template_init
(uint32_t algo_idx);
54
55
/*
56
* Entry point to rtt template (example) user algorithm setting parameters (reference code)
57
* This function starts the user algorithm setting parameters code
58
* The function will be called to update algorithm parameters
59
*
60
* @param_id_base [in]: id of the first parameter that was changed.
61
* @param_num [in]: number of all parameters that were changed
62
* @new_param_values [in]: pointer to an array which holds param_num number of new values for parameters
63
* @params [in]: pointer to an array which holds beginning of the current parameters to be changed
64
* @return: DOCA_PCC_DEV_STATUS_FAIL if input parameters (one or more) are not legal.
65
*/
66
doca_pcc_dev_error_t
rtt_template_set_algo_params
(uint32_t param_id_base,
67
uint32_t param_num,
68
const
uint32_t *new_param_values,
69
uint32_t *params);
70
71
#ifdef DOCA_PCC_SAMPLE_TX_BYTES
78
FORCE_INLINE
uint32_t rtt_get_last_tx_port_util(uint32_t port)
79
{
80
extern
uint32_t
g_utilized_bw
[];
81
return
g_utilized_bw
[port];
82
}
83
#endif
84
85
#endif
/* RTT_TEMPLATE_H */
FORCE_INLINE
#define FORCE_INLINE
static inline wrapper
Definition:
doca_pcc_dev_common.h:49
doca_pcc_dev_error_t
doca_pcc_dev_error_t
API functions return status.
Definition:
doca_pcc_dev_common.h:54
g_utilized_bw
uint32_t g_utilized_bw[DOCA_PCC_DEV_MAX_NUM_PORTS]
Definition:
rp_rtt_template_dev_main.c:49
rtt_template_algo
void rtt_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:
rtt_template.c:441
rtt_template_set_algo_params
doca_pcc_dev_error_t rtt_template_set_algo_params(uint32_t param_id_base, uint32_t param_num, const uint32_t *new_param_values, uint32_t *params)
Definition:
rtt_template.c:474
rtt_template_init
void rtt_template_init(uint32_t algo_idx)
Definition:
rtt_template.c:81
doca_pcc_dev_results
CC algorithm results.
Definition:
doca_pcc_dev.h:69
mlnx_cc_algo_ctxt_t
Definition:
doca_pcc_dev_data_structure_le_bf3.h:125
mlnx_cc_event_t
Definition:
doca_pcc_dev_data_structure_le_bf3.h:137
applications
pcc
device
rp
rtt_template
algo
rtt_template.h
Generated on Wed Aug 13 2025 09:23:36 for NVIDIA DOCA SDK by
1.9.1