NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_pcc_dev.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
23 #ifndef DOCA_PCC_DEV_H_
24 #define DOCA_PCC_DEV_H_
25 
31 #define DOCA_DPA_DEVICE
32 
33 #include <doca_pcc_dev_common.h>
34 #include <doca_pcc_dev_utils.h>
35 #include <doca_pcc_dev_services.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
45 typedef enum {
55 
59 typedef enum {
65 
69 typedef struct doca_pcc_dev_results {
70  uint32_t rate;
71  union {
72  uint32_t rtt_req;
73  uint32_t probe_req;
74  };
75  uint32_t probe_type_slot;
76  uint32_t credits;
77  uint32_t reload_credits;
79 
80 #if __NV_DPA >= __NV_DPA_CX8
81 #define DOCA_PCC_DEV_ACK_NACK_TX_EVENT_DISABLED_SUPPORTED (1)
82 #else
83 #define DOCA_PCC_DEV_ACK_NACK_TX_EVENT_DISABLED_SUPPORTED (0)
84 #endif
85 
89 #define DOCA_PCC_DEV_TX_FLAG_ACK_EXPECTED (1 << 0)
90 
94 #define DOCA_PCC_DEV_TX_FLAG_OVERLOADED (1 << 1)
95 
99 #define DOCA_PCC_DEV_TX_FLAG_RTT_REQ_SENT (1 << 2)
100 
104 #define DOCA_PCC_DEV_LOG_MAX_RATE (20) /* rate format in fixed point 20 */
105 
109 #define DOCA_PCC_DEV_MAX_RATE (1U << DOCA_PCC_DEV_LOG_MAX_RATE)
110 
114 #define DOCA_PCC_DEV_DEFAULT_RATE ((DOCA_PCC_DEV_MAX_RATE >> 8) > (1) ? (DOCA_PCC_DEV_MAX_RATE >> 8) : (1))
115 
119 #define DOCA_PCC_DEV_MAX_NUM_USER_SLOTS (8)
120 
124 #define DOCA_PCC_DEV_MAX_NUM_ALGOS (8)
125 
129 #define DOCA_PCC_DEV_MAX_NUM_PARAMS_PER_ALGO (0x26)
130 
134 #define DOCA_PCC_DEV_MAX_NUM_COUNTERS_PER_ALGO (0x3F)
135 
139 #define DOCA_PCC_DEV_ALGO_SLOT_INTERNAL (0xF)
140 
144 #define DOCA_PCC_DEV_ALGO_INDEX_INTERNAL (0xF)
145 
160  doca_pcc_dev_event_t *event,
161  const doca_pcc_dev_attr_t *attr,
162  doca_pcc_dev_results_t *results);
163 
182  doca_pcc_dev_event_t *event,
183  const doca_pcc_dev_attr_t *attr,
184  doca_pcc_dev_results_t *results);
185 
196 void doca_pcc_dev_user_init(uint32_t *disable_event_bitmask);
197 
221  uint32_t algo_slot,
222  uint32_t param_id_base,
223  uint32_t param_num,
224  const uint32_t *new_param_values,
225  uint32_t *params);
226 
246  doca_pcc_dev_event_t *event,
247  uint32_t *header,
248  uint32_t header_size,
249  uint32_t wait_completed);
250 
251 #ifdef __cplusplus
252 }
253 #endif
254 
255 #endif /* DOCA_PCC_DEV_H_ */
256 
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
#define DOCA_STABLE
To set a Symbol (or specifically a function) as stable API, i.e. it won't be changed.
Definition: doca_compat.h:96
doca_pcc_dev_error_t
API functions return status.
DOCA_EXPERIMENTAL doca_pcc_dev_error_t doca_pcc_dev_custom_header_set(doca_pcc_dev_algo_ctxt_t *algo_ctxt, doca_pcc_dev_event_t *event, uint32_t *header, uint32_t header_size, uint32_t wait_completed)
User callback executed to set custom header in CCMAD probe packet.
DOCA_STABLE 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.
DOCA_STABLE void doca_pcc_dev_user_init(uint32_t *disable_event_bitmask)
Entry point to the user one time initialization code.
DOCA_STABLE void doca_pcc_dev_default_internal_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)
Implements the internal CC algorithm provided by the lib.
doca_pcc_dev_event_type_enum
CC event type.
Definition: doca_pcc_dev.h:45
DOCA_STABLE 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.
doca_pcc_dev_nack_event_sub_type_enum
CC Nack event subtypes.
Definition: doca_pcc_dev.h:59
struct doca_pcc_dev_results doca_pcc_dev_results_t
CC algorithm results.
@ DOCA_PCC_DEV_EVNT_ROCE_TX
Definition: doca_pcc_dev.h:49
@ DOCA_PCC_DEV_EVNT_NULL
Definition: doca_pcc_dev.h:46
@ DOCA_PCC_DEV_EVNT_ROCE_ACK
Definition: doca_pcc_dev.h:50
@ 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_FW
Definition: doca_pcc_dev.h:47
@ DOCA_PCC_DEV_EVNT_RTT
Definition: doca_pcc_dev.h:52
@ DOCA_PCC_DEV_EVNT_ROCE_TX_FOR_ACK_NACK
Definition: doca_pcc_dev.h:53
@ DOCA_PCC_DEV_NACK_EVNT_DUP_READ
Definition: doca_pcc_dev.h:63
@ DOCA_PCC_DEV_NACK_EVNT_OOS
Definition: doca_pcc_dev.h:62
@ DOCA_PCC_DEV_NACK_EVNT_NULL
Definition: doca_pcc_dev.h:60
@ DOCA_PCC_DEV_NACK_EVNT_RNR
Definition: doca_pcc_dev.h:61
CC algorithm results.
Definition: doca_pcc_dev.h:69
uint32_t probe_type_slot
Definition: doca_pcc_dev.h:75