NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA PCC Device Notification Point
Collaboration diagram for DOCA PCC Device Notification Point:

Data Structures

struct  doca_pcc_np_dev_response_packet
 structure for response packet More...
 

Macros

#define DOCA_DPA_DEVICE
 declares that we are compiling for the DPA Device More...
 

Functions

DOCA_EXPERIMENTAL ALWAYS_INLINE doca_pcc_dev_error_t doca_pcc_dev_np_user_packet_handler (struct doca_pcc_np_dev_request_packet *in, struct doca_pcc_np_dev_response_packet *out)
 Main user function (implemented by the user) Called by the lib upon receiving a packet. The user: More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t * doca_pcc_np_dev_get_raw_packet (const struct doca_pcc_np_dev_request_packet *input)
 Return packet from ethernet header. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_raw_packet_size (const struct doca_pcc_np_dev_request_packet *input)
 Return packet size from ethernet header. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t * doca_pcc_np_dev_get_l4_header (const struct doca_pcc_np_dev_request_packet *input)
 Returns a pointer to the L4/udp header of the packet. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_l4_size (const struct doca_pcc_np_dev_request_packet *input)
 Return packet size from L4/udp header. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t * doca_pcc_np_dev_get_payload (const struct doca_pcc_np_dev_request_packet *input)
 Returns a pointer to the payload of the packet. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_payload_size (const struct doca_pcc_np_dev_request_packet *input)
 Return packet size from payload after mad header. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t doca_pcc_np_dev_get_port_num (const struct doca_pcc_np_dev_request_packet *input)
 Return logical port number on which input packet arrived. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t doca_pcc_np_dev_get_plane_num (const struct doca_pcc_np_dev_request_packet *input)
 Return plane number of logical port on which input packet arrived. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE void doca_pcc_np_dev_get_vlan_tci (const struct doca_pcc_np_dev_request_packet *input, uint8_t *vlan_present, uint16_t *vlan_tci)
 Return the VLAN TCI which was popped from input packet. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_max_response_size (struct doca_pcc_np_dev_response_packet *out)
 Return data buffer size of out. More...
 
DOCA_EXPERIMENTAL ALWAYS_INLINE void doca_pcc_np_dev_set_response_prio (struct doca_pcc_np_dev_response_packet *out, uint32_t prio)
 Set the priority of a specific packet. More...
 
uint8_t doca_pcc_np_dev_get_packet_probe_type_slot (const struct doca_pcc_np_dev_request_packet *input)
 Get the probe type slot of a given probe request packet.  *  *. More...
 

Detailed Description

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

Macro Definition Documentation

◆ DOCA_DPA_DEVICE

#define DOCA_DPA_DEVICE

declares that we are compiling for the DPA Device

Note
Must be defined before the first API use/include of DOCA

Definition at line 31 of file doca_pcc_np_dev.h.

Function Documentation

◆ doca_pcc_dev_np_user_packet_handler()

DOCA_EXPERIMENTAL ALWAYS_INLINE doca_pcc_dev_error_t doca_pcc_dev_np_user_packet_handler ( struct doca_pcc_np_dev_request_packet *  in,
struct doca_pcc_np_dev_response_packet out 
)

Main user function (implemented by the user) Called by the lib upon receiving a packet. The user:

  • Retrieves the relevant fields using doca_pcc_np_dev_get_raw_packet().
  • Prepares the response (currently up to 12 bytes) and sets the response struct. The lib:
  • Sends the response packet out.
Parameters
[in]in- opaque structure that has request packet buffer, size etc.
[in]out- buffer preallocated for response packet that will be returned
Returns
DOCA_PCC_NP_DEV_STATUS_OK on success, DOCA_PCC_NP_DEV_STATUS_FAIL on failure.

Definition at line 68 of file np_nic_telemetry_dev_main.c.

◆ doca_pcc_np_dev_get_l4_header()

DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t* doca_pcc_np_dev_get_l4_header ( const struct doca_pcc_np_dev_request_packet *  input)

Returns a pointer to the L4/udp header of the packet.

The returned buffer starting with the L4/udp header followed by the packet payload.

Note
that no endianness swap is performed by the function.
Parameters
[in]input- probe packet context
Returns
A pointer to the L4/udp header of the request packet

◆ doca_pcc_np_dev_get_l4_size()

DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_l4_size ( const struct doca_pcc_np_dev_request_packet *  input)

Return packet size from L4/udp header.

Parameters
[in]input- probe packet context
Returns
packet size in bytes from the L4/udp header

◆ doca_pcc_np_dev_get_max_response_size()

DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_max_response_size ( struct doca_pcc_np_dev_response_packet out)

Return data buffer size of out.

Parameters
[in]out- a buffer storing the part user filled in response packet
Returns
data buffer size of out

◆ doca_pcc_np_dev_get_packet_probe_type_slot()

uint8_t doca_pcc_np_dev_get_packet_probe_type_slot ( const struct doca_pcc_np_dev_request_packet *  input)

Get the probe type slot of a given probe request packet.  *  *.

 *

Parameters
[in]inputPointer to the request packet structure.  *
Returns
The slot number corresponding to the packet format.  

◆ doca_pcc_np_dev_get_payload()

DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t* doca_pcc_np_dev_get_payload ( const struct doca_pcc_np_dev_request_packet *  input)

Returns a pointer to the payload of the packet.

The returned buffer starting at payload after mad header.

Note
that no endianness swap is performed by the function.
Parameters
[in]input- probe packet context
Returns
A pointer to the payload of the request packet

◆ doca_pcc_np_dev_get_payload_size()

DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_payload_size ( const struct doca_pcc_np_dev_request_packet *  input)

Return packet size from payload after mad header.

Parameters
[in]input- probe packet context
Returns
packet size in bytes from payload

◆ doca_pcc_np_dev_get_plane_num()

DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t doca_pcc_np_dev_get_plane_num ( const struct doca_pcc_np_dev_request_packet *  input)

Return plane number of logical port on which input packet arrived.

Parameters
[in]input- probe packet context
Returns
plane number

◆ doca_pcc_np_dev_get_port_num()

DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t doca_pcc_np_dev_get_port_num ( const struct doca_pcc_np_dev_request_packet *  input)

Return logical port number on which input packet arrived.

Parameters
[in]input- probe packet context
Returns
logical port number

◆ doca_pcc_np_dev_get_raw_packet()

DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t* doca_pcc_np_dev_get_raw_packet ( const struct doca_pcc_np_dev_request_packet *  input)

Return packet from ethernet header.

This function is to get packet from ethernet header of input

Note
that no endianness swap is performed by the function.
Parameters
[in]input- a buffer storing the request packet and size of the packet
Returns
pointer pointed to ethernet header of the request packet

◆ doca_pcc_np_dev_get_raw_packet_size()

DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_raw_packet_size ( const struct doca_pcc_np_dev_request_packet *  input)

Return packet size from ethernet header.

This function is to get packet size of input

Parameters
[in]input- a buffer storing the request packet and size of the packet
Returns
packet size from ethernet header

◆ doca_pcc_np_dev_get_vlan_tci()

DOCA_EXPERIMENTAL ALWAYS_INLINE void doca_pcc_np_dev_get_vlan_tci ( const struct doca_pcc_np_dev_request_packet *  input,
uint8_t *  vlan_present,
uint16_t *  vlan_tci 
)

Return the VLAN TCI which was popped from input packet.

Parameters
[in]input- probe packet context
[out]vlan_present- indicates a VLAN tag as found and removed
[out]vlan_tci- the 16-bit VLAN TCI (PCP, DEI, VID) in big-endian format
Returns
plane number

◆ doca_pcc_np_dev_set_response_prio()

DOCA_EXPERIMENTAL ALWAYS_INLINE void doca_pcc_np_dev_set_response_prio ( struct doca_pcc_np_dev_response_packet out,
uint32_t  prio 
)

Set the priority of a specific packet.

Parameters
[in]out- The response probe packet context
[in]prio- The DSCP value to set for the out packet
Note
The priority value chosen should be a legal DSCP value i.e. 0-63
Returns