32 #define DOCA_PCC_DEV_EVNT_ROCE_ACK_MASK (1 << DOCA_PCC_DEV_EVNT_ROCE_ACK)
33 #define SAMPLER_THREAD_RANK (0)
34 #define COUNTERS_SAMPLE_WINDOW_IN_MICROSEC (10)
53 #ifdef DOCA_PCC_SAMPLE_TX_BYTES
69 for (uint32_t i = 0; i <
ports_num; i++) {
111 FORCE_INLINE void tx_counters_sampling_init(uint32_t portid)
136 tx_counters_sampling_init(portid);
162 #ifdef DOCA_PCC_SAMPLE_TX_BYTES
163 thread0_calc_ports_utilization();
190 uint32_t algo_idx = 0, algo_slot = 0, algo_en = 1;
201 #ifdef DOCA_PCC_SAMPLE_TX_BYTES
235 uint32_t param_id_base,
237 const uint32_t *new_param_values,
DOCA_STABLE uint32_t * doca_pcc_dev_get_algo_params(uint32_t port_num, uint32_t algo_slot)
Get pointer to param array of a specific algo and specific port.
DOCA_STABLE uint32_t * doca_pcc_dev_get_counters(uint32_t port_num, uint32_t algo_slot)
Get pointer to counter array of a specific algo and specific port.
DOCA_STABLE doca_pcc_dev_error_t doca_pcc_dev_init_algo_slot(uint32_t portid, uint32_t algo_slot, uint32_t algo_idx, uint32_t algo_en)
Initialize the algo per port database.
DOCA_STABLE uint32_t doca_pcc_dev_get_algo_index(uint32_t port_num, uint32_t algo_slot)
Get identifier of a specific algo and specific port.
DOCA_EXPERIMENTAL ALWAYS_INLINE void doca_pcc_dev_nic_counters_sample(void)
Sample counters according to the prior configuration call.
DOCA_EXPERIMENTAL uint32_t doca_pcc_dev_get_port_speed(uint32_t portid)
Get speed in Gbps units per a given port.
DOCA_EXPERIMENTAL void doca_pcc_dev_nic_counters_config(uint32_t *counter_ids, uint32_t num_counters, uint32_t *values)
Prepare a list of counters to read.
#define DOCA_PCC_DEV_GET_PORT_COUNTER_ID(port, type, plane)
Generates a unique ID using the logical port number, counter type, and plane parameters for identifyi...
#define DOCA_PCC_DEV_MAX_NUM_PORTS
Max number of NIC ports supported by the lib.
#define FORCE_INLINE
static inline wrapper
void doca_pcc_dev_user_port_info_changed(uint32_t portid)
User callback triggered on a port state change.
doca_pcc_dev_error_t
API functions return status.
DOCA_EXPERIMENTAL uint32_t doca_pcc_dev_get_logical_ports(void)
Get mask of initiated logical ports.
@ DOCA_PCC_DEV_NIC_COUNTER_TYPE_TX_BYTES
@ DOCA_PCC_DEV_STATUS_FAIL
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_EXPERIMENTAL unsigned int doca_pcc_dev_thread_rank(void)
Obtains the thread rank.
DOCA_STABLE void doca_pcc_dev_trace_flush(void)
Flush the trace message buffer to Host.
DOCA_STABLE void DOCA_STABLE void doca_pcc_dev_trace_5(int format_id, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5)
Creates trace message entry with 5 arguments.
DOCA_STABLE void doca_pcc_dev_printf(const char *format,...) __attribute__((format(printf
Print to Host.
#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_fls(a)
32b find last set
DOCA_STABLE FORCE_INLINE uint32_t doca_pcc_dev_get_timer_lo(void)
Core timer access (elapsed time in uSec) function 32 bits.
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.
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.
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.
#define DOCA_PCC_DEV_ACK_NACK_TX_EVENT_DISABLED_SUPPORTED
@ DOCA_PCC_DEV_EVNT_ROCE_TX_FOR_ACK_NACK
FORCE_INLINE uint32_t count_ports(uint32_t ports_mask)
Count the number of available logical ports from queried mask.
ALWAYS_INLINE uint32_t diff_with_wrap32(uint32_t greater_num, uint32_t smaller_num)
uint32_t previous_sampled_tx_bytes[DOCA_PCC_DEV_MAX_NUM_PORTS]
#define COUNTERS_SAMPLE_WINDOW_IN_MICROSEC
uint32_t g_utilized_bw[DOCA_PCC_DEV_MAX_NUM_PORTS]
uint32_t counter_ids[DOCA_PCC_DEV_MAX_NUM_PORTS]
#define DOCA_PCC_DEV_EVNT_ROCE_ACK_MASK
uint32_t counters_started
uint32_t ports_bw[DOCA_PCC_DEV_MAX_NUM_PORTS]
#define SAMPLER_THREAD_RANK
uint32_t current_sampled_tx_bytes[DOCA_PCC_DEV_MAX_NUM_PORTS]
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)
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)
void rtt_template_init(uint32_t algo_idx)