NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA PCC Host
Collaboration diagram for DOCA PCC Host:

Typedefs

typedef int(* doca_pcc_trace_callback_t) (void *ctx, struct doca_pcc_bin_report *reps, int reps_size)
 Tracer user callback, to be defined by user and called when traces are sent by DPA. More...
 

Enumerations

enum  doca_pcc_ccmad_custom_header_loc_t { DOCA_PCC_CCMAD_CUSTOM_HEADER_LOCATION_MAD_PAYLOAD = 1 }
 CCMAD custom header location. More...
 
enum  doca_pcc_process_state_t { DOCA_PCC_PS_ACTIVE = 0 , DOCA_PCC_PS_STANDBY = 1 , DOCA_PCC_PS_DEACTIVATED = 2 , DOCA_PCC_PS_ERROR = 3 }
 Process states. More...
 

Functions

DOCA_STABLE doca_error_t doca_devinfo_get_is_pcc_supported (const struct doca_devinfo *devinfo)
 Get whether the DOCA device supports PCC reaction point. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_np_cap_is_supported (const struct doca_devinfo *devinfo)
 Get whether the DOCA device supports PCC notification point. More...
 
DOCA_STABLE doca_error_t doca_pcc_create (struct doca_dev *doca_dev, struct doca_pcc **pcc)
 Create programmable CC Reaction Point context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_np_create (struct doca_dev *doca_dev, struct doca_pcc **pcc)
 Create programmable CC Notification Point context. More...
 
DOCA_STABLE doca_error_t doca_pcc_destroy (struct doca_pcc *pcc)
 Destroy a DOCA PCC context. More...
 
DOCA_STABLE doca_error_t doca_pcc_start (struct doca_pcc *pcc)
 Start a PCC context Register the pcc process in the NIC hw. More...
 
DOCA_STABLE doca_error_t doca_pcc_stop (struct doca_pcc *pcc)
 Stop a PCC context. More...
 
DOCA_STABLE doca_error_t doca_pcc_get_min_num_threads (struct doca_pcc *pcc, uint32_t *min_num_threads)
 Get a minimal required number of threads handling CC events. More...
 
DOCA_STABLE doca_error_t doca_pcc_get_max_num_threads (struct doca_pcc *pcc, uint32_t *max_num_threads)
 Get a maximal allowed number of threads handling CC events. More...
 
DOCA_STABLE doca_error_t doca_pcc_set_app (struct doca_pcc *pcc, struct doca_pcc_app *app)
 Set program app for PCC context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_cap_get_num_probe_format_slots (struct doca_pcc *pcc, uint32_t *num_probe_format_slots)
 Get number of available probe format slots. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ccmad_probe_packet_format (struct doca_pcc *pcc, uint32_t probe_format_slot)
 Set CCMAD probe packet format for the pcc process. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ifa1_probe_packet_format (struct doca_pcc *pcc, uint32_t probe_format_slot)
 Set ifa1 probe packet format for the pcc process. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ifa2_probe_packet_format (struct doca_pcc *pcc, uint32_t probe_format_slot)
 Set ifa2 probe packet format for the pcc process. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ccmad_remote_sw_handler (struct doca_pcc *pcc, uint32_t probe_format_slot, bool sw_handler)
 Set sw remote handler for CCMAD probe type. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_cap_is_ccmad_custom_header_supported (const struct doca_devinfo *devinfo)
 Get whether the DOCA device supports PCC ccmad customized header in reaction point. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ccmad_custom_header_size (struct doca_pcc *pcc, uint32_t probe_format_slot, uint8_t header_size)
 Set customized header of CCMAD probe packet in RP. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ccmad_custom_header_location (struct doca_pcc *pcc, uint32_t probe_format_slot, doca_pcc_ccmad_custom_header_loc_t header_loc)
 Set customized header of CCMAD probe packet in RP. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ifa1_probe_marker (struct doca_pcc *pcc, uint32_t probe_format_slot, uint64_t probe_marker)
 Set probe marker value for IFA1 probe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ifa2_gns (struct doca_pcc *pcc, uint32_t probe_format_slot, uint8_t gns)
 Set GNS value for IFA2 packets. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_np_set_ifa2_gns_ignore (struct doca_pcc *pcc, uint32_t probe_format_slot, uint8_t ignore_mask, uint8_t ignore_value)
 Set GNS ignore for IFA2 packets. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ifa2_hop_limit (struct doca_pcc *pcc, uint32_t probe_format_slot, uint8_t hop_limit)
 Set hop_limit field in the metadata header for IFA2 packets. More...
 
DOCA_STABLE doca_error_t doca_pcc_set_thread_affinity (struct doca_pcc *pcc, uint32_t num_threads, uint32_t *affinity_configs)
 Configure affinity of threads handling CC events. More...
 
DOCA_STABLE doca_error_t doca_pcc_set_trace_message (struct doca_pcc *pcc, char **trace_message)
 Set message for trace printing. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_activate_tracer (struct doca_pcc *pcc)
 Enable trace printing. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_deactivate_tracer (struct doca_pcc *pcc)
 Disable trace printing. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_buf_set (struct doca_pcc *pcc, void *buf_addr, uint32_t buf_size)
 Set trace buffer address to write trace into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_buf_get (struct doca_pcc *pcc, void **buf_addr, uint32_t *buf_size)
 Get trace buffer address to write trace into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_file_set (struct doca_pcc *pcc, const char *file_path)
 Set trace file path to write trace into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_file_get (struct doca_pcc *pcc, char **file_path, uint32_t *file_path_len)
 Get trace file path to write trace into. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_register_trace_handler (struct doca_pcc *pcc, doca_pcc_trace_callback_t trace_callback, void *user_ctx)
 Register a user callback that is triggered when traces arrive from the device. More...
 
DOCA_STABLE doca_error_t doca_pcc_set_print_buffer_size (struct doca_pcc *pcc, size_t buffer_size)
 Set buffer size of DPA print message. More...
 
DOCA_STABLE doca_error_t doca_pcc_set_dev_coredump_file (struct doca_pcc *pcc, const char *file_name)
 Set output file to write crash data and coredump in case of unrecoverable error on the device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_mailbox (struct doca_pcc *pcc, uint32_t max_request_size, uint32_t max_response_size)
 Set mailbox attributes to obtain and pass data from and to the device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_mailbox_get_request_buffer (struct doca_pcc *pcc, void **request_buffer)
 Get mailbox request data buffer address to fill and transfer to device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_mailbox_get_response_buffer (struct doca_pcc *pcc, void **response_buffer)
 Get mailbox response data buffer address that contains data transferred from device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_mailbox_send (struct doca_pcc *pcc, uint32_t request_size, uint32_t *response_size, uint32_t *cb_ret_val)
 Send mailbox request data to device. More...
 
DOCA_STABLE doca_error_t doca_pcc_wait (struct doca_pcc *pcc, int wait_time)
 Wait on events or timeout from device for given time in seconds. More...
 
DOCA_STABLE doca_error_t doca_pcc_get_process_state (const struct doca_pcc *pcc, doca_pcc_process_state_t *process_state)
 Return the state of the process. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_dump_debug (const struct doca_pcc *pcc)
 Dump device side debug info. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_pcc_enable_debug (const struct doca_pcc *pcc, bool enable)
 Enable or disable device side debug. More...
 

Detailed Description

DOCA PCC Host library. For more details please refer to the user guide on DOCA devzone.

Typedef Documentation

◆ doca_pcc_trace_callback_t

typedef int(* doca_pcc_trace_callback_t) (void *ctx, struct doca_pcc_bin_report *reps, int reps_size)

Tracer user callback, to be defined by user and called when traces are sent by DPA.

Parameters
[in]ctx- User defined context that will be sent each time for user to update, Optional
[in]reps- Array of trace messages that are received by DPA
[in]reps_size- Number of trace messages received in reps array.
Returns
User can define what the return value means.

Definition at line 619 of file doca_pcc.h.

Enumeration Type Documentation

◆ doca_pcc_ccmad_custom_header_loc_t

CCMAD custom header location.

Enumerator
DOCA_PCC_CCMAD_CUSTOM_HEADER_LOCATION_MAD_PAYLOAD 

Custom header will be inserted after MAD payload

Definition at line 350 of file doca_pcc.h.

◆ doca_pcc_process_state_t

Process states.

Enumerator
DOCA_PCC_PS_ACTIVE 

The process handles CC events (only one process is active at a given time)

DOCA_PCC_PS_STANDBY 

The process is in standby mode (another process is already ACTIVE)

DOCA_PCC_PS_DEACTIVATED 

The process was deactivated by NIC FW and should be destroyed

DOCA_PCC_PS_ERROR 

The process is in error state and should be destroyed

Definition at line 766 of file doca_pcc.h.

Function Documentation

◆ doca_devinfo_get_is_pcc_supported()

DOCA_STABLE doca_error_t doca_devinfo_get_is_pcc_supported ( const struct doca_devinfo *  devinfo)

Get whether the DOCA device supports PCC reaction point.

Parameters
[in]devinfo- The device to query
Returns
DOCA_SUCCESS - in case of the DOCA device queried has PCC reaction point support Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device queried does not support PCC reaction point

◆ doca_pcc_activate_tracer()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_activate_tracer ( struct doca_pcc *  pcc)

Enable trace printing.

Note
if not set tracing will be disabled by default
Parameters
[in]pcc- PCC context
Returns
  • DOCA_SUCCESS - in case of success
  • DOCA_ERROR_INVALID_VALUE - received invalid null input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call

◆ doca_pcc_cap_get_num_probe_format_slots()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_cap_get_num_probe_format_slots ( struct doca_pcc *  pcc,
uint32_t *  num_probe_format_slots 
)

Get number of available probe format slots.

The NIC may support multiple probe formats in parallel. This function returns the number of probe formats supported by the device used to open the pcc context.

The caller may set probe_format_slot values of 0 to num_probe_format_slots - 1 in the functions referring to this value.

Parameters
[in]pcc- PCC context
[out]num_probe_format_slots- number of available probe format slots

◆ doca_pcc_cap_is_ccmad_custom_header_supported()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_cap_is_ccmad_custom_header_supported ( const struct doca_devinfo *  devinfo)

Get whether the DOCA device supports PCC ccmad customized header in reaction point.

Parameters
[in]devinfo- The device to query
Returns
DOCA_SUCCESS - in case the DOCA device queried has support for CCMAD custom header Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device queried does not support CCMAD custom header

◆ doca_pcc_create()

DOCA_STABLE doca_error_t doca_pcc_create ( struct doca_dev *  doca_dev,
struct doca_pcc **  pcc 
)

Create programmable CC Reaction Point context.

This function creates a DOCA PCC Reaction Point context to capture and route PCC events to the DPA.

Parameters
[in]doca_dev- DOCA device
[out]pcc- Created PCC context
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support PCC
  • DOCA_ERROR_NO_MEMORY - in case of failure in internal memory allocation

◆ doca_pcc_deactivate_tracer()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_deactivate_tracer ( struct doca_pcc *  pcc)

Disable trace printing.

Note
if not set tracing will be disabled by default
Parameters
[in]pcc- PCC context
Returns
  • DOCA_SUCCESS - in case of success
  • DOCA_ERROR_INVALID_VALUE - received invalid null input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call

◆ doca_pcc_destroy()

DOCA_STABLE doca_error_t doca_pcc_destroy ( struct doca_pcc *  pcc)

Destroy a DOCA PCC context.

This function destroys PCC context created by doca_pcc_create() When the termination is started the process will stop handling PCC events. Issuing a ^c during doca_pcc_wait(...) will also result in the application's termination.

Parameters
[in]pcc- Previously created PCC context
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call

◆ doca_pcc_dump_debug()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_dump_debug ( const struct doca_pcc *  pcc)

Dump device side debug info.

Must call doca_pcc_enable_debug(pcc, true) to enable debug first; Otherwise no debug info will be dumped.

Parameters
[in]pcc- PCC context
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - in case pcc is not started
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call

◆ doca_pcc_enable_debug()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_enable_debug ( const struct doca_pcc *  pcc,
bool  enable 
)

Enable or disable device side debug.

When issues arize, device side debugging can be enabled during runtime. Subsequently, calling doca_pcc_dump_debug(pcc) will output the debugging info. This debug info can assist in pinpointing the source of the issues. The same function can be used to disable device side debugging during runtime.

Parameters
[in]pcc- PCC context
[in]enable- enable debug if true; disable debug if false.
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - in case pcc is not started
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call

◆ doca_pcc_get_max_num_threads()

DOCA_STABLE doca_error_t doca_pcc_get_max_num_threads ( struct doca_pcc *  pcc,
uint32_t *  max_num_threads 
)

Get a maximal allowed number of threads handling CC events.

Parameters
[in]pcc- PCC context
[in]max_num_threads- maximal number of threads used by pcc
Returns
DOCA_SUCCESS - in case of success Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input

◆ doca_pcc_get_min_num_threads()

DOCA_STABLE doca_error_t doca_pcc_get_min_num_threads ( struct doca_pcc *  pcc,
uint32_t *  min_num_threads 
)

Get a minimal required number of threads handling CC events.

Parameters
[in]pcc- PCC context
[in]min_num_threads- minimal number of threads used by pcc
Returns
DOCA_SUCCESS - in case of success Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input

◆ doca_pcc_get_process_state()

DOCA_STABLE doca_error_t doca_pcc_get_process_state ( const struct doca_pcc *  pcc,
doca_pcc_process_state_t process_state 
)

Return the state of the process.

Parameters
[in]pcc- PCC context
[out]process_state- state of the PCC process. In case positive wait_time is specified and expired, DEACTIVATED state will be returned.
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - in case pcc is not started

◆ doca_pcc_mailbox_get_request_buffer()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_mailbox_get_request_buffer ( struct doca_pcc *  pcc,
void **  request_buffer 
)

Get mailbox request data buffer address to fill and transfer to device.

Parameters
[in]pcc- PCC context
[out]request_buffer- pointer to request data buffer
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - in case pcc is not started
  • DOCA_ERROR_INITIALIZATION - mailbox was not set for PCC context

◆ doca_pcc_mailbox_get_response_buffer()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_mailbox_get_response_buffer ( struct doca_pcc *  pcc,
void **  response_buffer 
)

Get mailbox response data buffer address that contains data transferred from device.

Parameters
[in]pcc- PCC context
[out]response_buffer- pointer to response data buffer
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - in case pcc is not started
  • DOCA_ERROR_INITIALIZATION - mailbox was not set for PCC context

◆ doca_pcc_mailbox_send()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_mailbox_send ( struct doca_pcc *  pcc,
uint32_t  request_size,
uint32_t *  response_size,
uint32_t *  cb_ret_val 
)

Send mailbox request data to device.

Parameters
[in]pcc- PCC context
[in]request_size- size of request data to send to device
[out]response_size- size of response data received from device
[out]cb_ret_val- return value of device user callback doca_pcc_dev_user_mailbox_handle()
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call
  • DOCA_ERROR_BAD_STATE - in case pcc is not started
  • DOCA_ERROR_INITIALIZATION - mailbox was not set for PCC context

◆ doca_pcc_np_cap_is_supported()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_np_cap_is_supported ( const struct doca_devinfo *  devinfo)

Get whether the DOCA device supports PCC notification point.

Parameters
[in]devinfo- The device to query
Returns
DOCA_SUCCESS - in case of the DOCA device queried has PCC notification point support Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device queried does not support PCC notification point

◆ doca_pcc_np_create()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_np_create ( struct doca_dev *  doca_dev,
struct doca_pcc **  pcc 
)

Create programmable CC Notification Point context.

This function creates a DOCA PCC Notification Point context given a DOCA device

Parameters
[in]doca_dev- DOCA device
[out]pcc- Created PCC context
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support PCC
  • DOCA_ERROR_NO_MEMORY - in case of failure in internal memory allocation

◆ doca_pcc_np_set_ifa2_gns_ignore()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_np_set_ifa2_gns_ignore ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot,
uint8_t  ignore_mask,
uint8_t  ignore_value 
)

Set GNS ignore for IFA2 packets.

Applicable to: NP role when probe packet format is set to IFA2

When (ignore_mask != 0), if: (packet.GNS & ignore_mask) == (ignore_value & ignore_mask) the packet will not be sent to the NP process, and will be delivered to SW as a standard eth packet.

By default all IFA2 packets are sent to the NP process (ignore_mask = 0)

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Parameters
[in]ignore_mask- GNS ignore mask - limited to 4 bits
[in]ignore_value- GNS ignore value - limited to 4 bits
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support setting probe packet format
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_register_trace_handler()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_register_trace_handler ( struct doca_pcc *  pcc,
doca_pcc_trace_callback_t  trace_callback,
void *  user_ctx 
)

Register a user callback that is triggered when traces arrive from the device.

See also
doca_pcc_trace_callback_t
Parameters
[in]pcc- PCC context
[in]trace_callback- pointer to user-implemented callback
[in]user_ctx- pointer to user-defined context, This is optional parameter, can be NULL.
Returns
  • DOCA_SUCCESS - in case of success
  • DOCA_ERROR_INVALID_VALUE - received invalid null input

◆ doca_pcc_rp_set_ccmad_custom_header_location()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ccmad_custom_header_location ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot,
doca_pcc_ccmad_custom_header_loc_t  header_loc 
)

Set customized header of CCMAD probe packet in RP.

Applicable to: RP role when probe packet format is set to ccmad

Set the custom header location in CCMAD probe packet in RP. 1: MAD_PAYLOAD - custom bytes inserted after the MAD payload

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Parameters
[in]header_loc- custom header location.
See also
doca_pcc_ccmad_custom_header_loc_t
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_rp_set_ccmad_custom_header_size()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ccmad_custom_header_size ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot,
uint8_t  header_size 
)

Set customized header of CCMAD probe packet in RP.

Applicable to: RP role when probe packet format is set to ccmad

Set the custom header size for CCMAD probe packet in RP.

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Parameters
[in]header_size- custom header size, unit is 4 Bytes
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_rp_set_ccmad_remote_sw_handler()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ccmad_remote_sw_handler ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot,
bool  sw_handler 
)

Set sw remote handler for CCMAD probe type.

When a CCMAD probe packet is received by the remote RX NP port, it can be sent either to the HW CC handler (for rtt probes) or to NP process for any probe format.

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Parameters
[in]sw_handler- When set, packets generated by the RP are handled by the NP PCC process. When cleared, packets generated by the RP are handled by the NP HW handler
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_rp_set_ifa2_gns()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ifa2_gns ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot,
uint8_t  gns 
)

Set GNS value for IFA2 packets.

Applicable to: RP role when probe packet format is set to IFA2

By default IFA2 gns value is set to 0xF

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots
Parameters
[in]gns- global namespace - limited to 4 bits
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support setting probe packet format
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_rp_set_ifa2_hop_limit()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_rp_set_ifa2_hop_limit ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot,
uint8_t  hop_limit 
)

Set hop_limit field in the metadata header for IFA2 packets.

Applicable to: RP role when probe packet format is set to IFA2

By default IFA2 hop_limit value is set to 0xFE

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots
Parameters
[in]hop_limit- hop limit value to set
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support setting probe packet format
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_app()

DOCA_STABLE doca_error_t doca_pcc_set_app ( struct doca_pcc *  pcc,
struct doca_pcc_app *  app 
)

Set program app for PCC context.

The context represents a program on the DPA that is referenced by the host process that called the context creation API. Must be set before calling doca_pcc_start()

Parameters
[in]pcc- PCC context
[in]app- PCC application generated by DPACC
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_ccmad_probe_packet_format()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ccmad_probe_packet_format ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot 
)

Set CCMAD probe packet format for the pcc process.

For RP: Sets the packet type to send to CCMAD when an rtt probe is requested. For NP: defines CCMAD packet type to identify and send to the NP device side code

Note
CCMAD is default value for PCC context probe packet format
Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support setting probe packet format
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_dev_coredump_file()

DOCA_STABLE doca_error_t doca_pcc_set_dev_coredump_file ( struct doca_pcc *  pcc,
const char *  file_name 
)

Set output file to write crash data and coredump in case of unrecoverable error on the device.

Must be set before calling doca_pcc_start()

Parameters
[in]pcc- PCC context
[in]file_name- pathname to the output file to write coredump data into
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started
  • DOCA_ERROR_NO_MEMORY - memory allocation error

◆ doca_pcc_set_ifa1_probe_marker()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ifa1_probe_marker ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot,
uint64_t  probe_marker 
)

Set probe marker value for IFA1 probe.

Applicable to: RP/NP role when probe packet format is set to IFA1

Set the probe marker field value in the generated IFA1 packets. Note: the the most significant bit of the probe parameter must be set.

By default the probe marker is set to 0xAAAAAAAABBBBBBBB

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Parameters
[in]probe_marker- probe marker value
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support setting probe packet format
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_ifa1_probe_packet_format()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ifa1_probe_packet_format ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot 
)

Set ifa1 probe packet format for the pcc process.

For RP: Sets the packet type to send to ifa1 when an rtt probe is requested. For NP: defines ifa1 packet type to identify and send to the NP device side code

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support setting probe packet format
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_ifa2_probe_packet_format()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_ifa2_probe_packet_format ( struct doca_pcc *  pcc,
uint32_t  probe_format_slot 
)

Set ifa2 probe packet format for the pcc process.

For RP: Sets the packet type to send to ifa2 when an rtt probe is requested. For NP: defines ifa2 packet type to identify and send to the NP device side code

Parameters
[in]pcc- PCC context
[in]probe_format_slot- format slot to configure.
See also
doca_pcc_cap_get_num_probe_format_slots()
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support setting probe packet format
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_mailbox()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_set_mailbox ( struct doca_pcc *  pcc,
uint32_t  max_request_size,
uint32_t  max_response_size 
)

Set mailbox attributes to obtain and pass data from and to the device.

Must be set before calling doca_pcc_start()

Parameters
[in]pcc- PCC context
[in]max_request_size- max size of request data passed to device
[in]max_response_size- max size of response data passed from device
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_print_buffer_size()

DOCA_STABLE doca_error_t doca_pcc_set_print_buffer_size ( struct doca_pcc *  pcc,
size_t  buffer_size 
)

Set buffer size of DPA print message.

Must be set before calling doca_pcc_start()

Parameters
[in]pcc- PCC context
[in]buffer_size- size of print buffer from the DPA
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_thread_affinity()

DOCA_STABLE doca_error_t doca_pcc_set_thread_affinity ( struct doca_pcc *  pcc,
uint32_t  num_threads,
uint32_t *  affinity_configs 
)

Configure affinity of threads handling CC events.

Must be set before calling doca_pcc_start()

Parameters
[in]pcc- PCC context
[in]num_threads- number of threads used by pcc. Should be constrained by minimum and maximum allowed number
See also
doca_pcc_get_min_num_threads() and doca_pcc_get_max_num_threads()
Parameters
[in]affinity_configs- array of indexes to assign to threads
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input or invalid number of threads
  • DOCA_ERROR_BAD_STATE - PCC context is already started

◆ doca_pcc_set_trace_message()

DOCA_STABLE doca_error_t doca_pcc_set_trace_message ( struct doca_pcc *  pcc,
char **  trace_message 
)

Set message for trace printing.

Must be set before calling doca_pcc_start()

Parameters
[in]pcc- PCC context
[in]trace_message- message to be printed from trace
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - PCC context is already started
  • DOCA_ERROR_NO_MEMORY - in case of failure in internal memory allocation

◆ doca_pcc_start()

DOCA_STABLE doca_error_t doca_pcc_start ( struct doca_pcc *  pcc)

Start a PCC context Register the pcc process in the NIC hw.

Parameters
[in]pcc- PCC context
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call
  • DOCA_ERROR_NO_MEMORY - in case of failure in internal memory allocation
  • DOCA_ERROR_NOT_SUPPORTED - the device does not support the PCC role

◆ doca_pcc_stop()

DOCA_STABLE doca_error_t doca_pcc_stop ( struct doca_pcc *  pcc)

Stop a PCC context.

Parameters
[in]pcc- PCC context
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_DRIVER - in case of error in a DOCA driver call

◆ doca_pcc_trace_buf_get()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_buf_get ( struct doca_pcc *  pcc,
void **  buf_addr,
uint32_t *  buf_size 
)

Get trace buffer address to write trace into.

Parameters
[in]pcc- PCC context
[out]buf_addr- Address to the user allocated buffer used to write device trace into
[out]buf_size- Size of the user allocated buffer to write device trace into
Returns
  • DOCA_SUCCESS - in case of success
  • DOCA_ERROR_INVALID_VALUE - received invalid null input

◆ doca_pcc_trace_buf_set()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_buf_set ( struct doca_pcc *  pcc,
void *  buf_addr,
uint32_t  buf_size 
)

Set trace buffer address to write trace into.

Must be set before calling doca_pcc_start()

Note
if not set by this function or doca_pcc_trace_file_set() then stdout will be used by default
Parameters
[in]pcc- PCC context
[in]buf_addr- Address to the user allocated buffer to write device trace into
[in]buf_size- Size of the user allocated buffer to write device trace into
Returns
  • DOCA_SUCCESS - in case of success
  • DOCA_ERROR_INVALID_VALUE - received invalid null input
  • DOCA_ERROR_BAD_STATE - PCC context is already started
  • DOCA_ERROR_OPERATING_SYSTEM - error occurred in opening the file

◆ doca_pcc_trace_file_get()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_file_get ( struct doca_pcc *  pcc,
char **  file_path,
uint32_t *  file_path_len 
)

Get trace file path to write trace into.

Parameters
[in]pcc- PCC context
[out]file_path- pathname to the trace file to write device trace into
[out]file_path_len- file_path length. Output is actual number of bytes written

The file_path buffer is allocated by the caller along with setting file_path_len indicating the length that was allocated. Upon return the file_path_len field is set to the actual length of the file_path

Returns
  • DOCA_SUCCESS - in case of success
  • DOCA_ERROR_NO_MEMORY - memory allocation error
  • DOCA_ERROR_INVALID_VALUE - received invalid null input

◆ doca_pcc_trace_file_set()

DOCA_EXPERIMENTAL doca_error_t doca_pcc_trace_file_set ( struct doca_pcc *  pcc,
const char *  file_path 
)

Set trace file path to write trace into.

Must be set before calling doca_pcc_start()

Note
if not set by this function or doca_pcc_trace_buf_set() then stdout will be used by default
Parameters
[in]pcc- PCC context
[in]file_path- pathname to the trace file to write device trace into
Returns
  • DOCA_SUCCESS - in case of success
  • DOCA_ERROR_INVALID_VALUE - received invalid null input
  • DOCA_ERROR_BAD_STATE - PCC context is already started
  • DOCA_ERROR_NO_MEMORY - memory allocation error
  • DOCA_ERROR_OPERATING_SYSTEM - error occurred in opening the file

◆ doca_pcc_wait()

DOCA_STABLE doca_error_t doca_pcc_wait ( struct doca_pcc *  pcc,
int  wait_time 
)

Wait on events or timeout from device for given time in seconds.

Providing a negative value for wait time will cause the context to wait on events until the user terminates it.

Parameters
[in]pcc- PCC context
[in]wait_time- time in seconds to wait
Returns
DOCA_SUCCESS - in case of success doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input
  • DOCA_ERROR_BAD_STATE - in case pcc is not started