NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
telem_template.h
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 #ifndef TELEM_TEMPLATE_H
27 #define TELEM_TEMPLATE_H
28 
29 /*
30  * Entry point to telem template (example) user algorithm (reference code)
31  * This function starts the algorithm code of a single event for the telem 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  */
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 telem 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 telem_template_init(uint32_t algo_idx);
54 
55 /*
56  * Entry point to telem 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  */
67  uint32_t param_num,
68  const uint32_t *new_param_values,
69  uint32_t *params);
70 
71 #endif /* TELEM_TEMPLATE_H */
doca_pcc_dev_error_t
API functions return status.
CC algorithm results.
Definition: doca_pcc_dev.h:69
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)
void telem_template_init(uint32_t algo_idx)