NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_pcc_np_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_NP_DEV_H_
24 #define DOCA_PCC_NP_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>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
45  size_t size;
46  uint8_t *data;
47  struct doca_pcc_np_dev_request_packet *in;
48 };
49 
54 struct doca_pcc_np_dev_request_packet;
55 
72 doca_pcc_dev_np_user_packet_handler(struct doca_pcc_np_dev_request_packet *in,
74 
88  const struct doca_pcc_np_dev_request_packet *input);
89 
101 doca_pcc_np_dev_get_raw_packet_size(const struct doca_pcc_np_dev_request_packet *input);
102 
117  const struct doca_pcc_np_dev_request_packet *input);
118 
127 DOCA_EXPERIMENTAL ALWAYS_INLINE size_t doca_pcc_np_dev_get_l4_size(const struct doca_pcc_np_dev_request_packet *input);
128 
141 DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t *doca_pcc_np_dev_get_payload(const struct doca_pcc_np_dev_request_packet *input);
142 
152 doca_pcc_np_dev_get_payload_size(const struct doca_pcc_np_dev_request_packet *input);
153 
162 DOCA_EXPERIMENTAL ALWAYS_INLINE uint8_t doca_pcc_np_dev_get_port_num(const struct doca_pcc_np_dev_request_packet *input);
163 
173 doca_pcc_np_dev_get_plane_num(const struct doca_pcc_np_dev_request_packet *input);
174 
185 DOCA_EXPERIMENTAL ALWAYS_INLINE void doca_pcc_np_dev_get_vlan_tci(const struct doca_pcc_np_dev_request_packet *input,
186  uint8_t *vlan_present,
187  uint16_t *vlan_tci);
188 
199 
210  uint32_t prio);
211 
218 uint8_t doca_pcc_np_dev_get_packet_probe_type_slot(const struct doca_pcc_np_dev_request_packet *input);
219 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif /* DOCA_PCC_NP_DEV_H_ */
225 
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
#define ALWAYS_INLINE
force inline wrapper
doca_pcc_dev_error_t
API functions return status.
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.
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.
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.
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. &#160;* &#160;*.
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.
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.
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....
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.
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.
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.
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.
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.
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.
structure for response packet
struct doca_pcc_np_dev_request_packet * in