NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
ip_frag_dp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 NVIDIA CORPORATION AND AFFILIATES. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are permitted
5  * provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright notice, this list of
9  * conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * * Neither the name of the NVIDIA CORPORATION nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21  * STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  */
25 
26 #ifndef IP_FRAG_DP_H_
27 #define IP_FRAG_DP_H_
28 
29 #include <doca_error.h>
30 #include <doca_flow.h>
31 #include <dpdk_utils.h>
32 
33 #include <stdbool.h>
34 
35 #define UNUSED(x) ((void)(x))
36 
40 };
41 
48 };
49 
54 };
55 
57  enum ip_frag_mode mode; /* Application mode */
58  uint64_t mbuf_flag_outer_modified; /* RTE mbuf outer fragmentation flag mask */
59  uint64_t mbuf_flag_inner_modified; /* RTE mbuf inner fragmentation flag mask */
60  uint16_t mtu; /* MTU */
61  bool mbuf_chain; /* Use chained mbuf optimization */
62  bool hw_cksum; /* Use hardware checksum optimization */
63  uint32_t frag_tbl_timeout; /* Fragmentation table timeout in ms */
64  uint32_t frag_tbl_size; /* Fragmentation table size */
65 };
66 
68  uint16_t port_id; /* Port ID */
69  struct doca_flow_port *port; /* DOCA Flow port */
70  enum doca_flow_pipe_domain domain; /* Domain (RX/TX) */
71  char *name; /* Pipe name */
72  bool is_root; /* Flag to indicate if the pipe is root */
73  uint32_t num_entries; /* Number of entries */
74  struct doca_flow_match *match; /* Match */
75  struct doca_flow_match *match_mask; /* Match mask */
76  struct doca_flow_fwd *fwd; /* Forward hit */
77  struct doca_flow_fwd *fwd_miss; /* Forward miss */
78 };
79 
80 struct ip_frag_ctx {
81  uint16_t num_ports; /* Number of ports */
82  uint16_t num_queues; /* Number of device queues */
83  struct doca_flow_pipe *pipes[IP_FRAG_PORT_NUM][IP_FRAG_RSS_PIPE_NUM]; /* Pipes */
84  struct doca_flow_port *ports[IP_FRAG_PORT_NUM]; /* Ports */
85  struct doca_dev *dev_arr[IP_FRAG_PORT_NUM]; /* Devices array */
86 };
87 
88 extern bool force_stop;
89 
90 /*
91  * IP fragmentation application logic
92  *
93  * @cfg [in]: application config
94  * @dpdk_cfg [in]: application DPDK configuration values
95  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
96  */
98 
99 #endif /* IP_FRAG_DP_H_ */
enum doca_error doca_error_t
DOCA API return codes.
doca_flow_pipe_domain
doca flow pipe domain
Definition: doca_flow.h:240
const struct ip_frag_config * cfg
Definition: ip_frag_dp.c:0
ip_frag_rss_pipe
Definition: ip_frag_dp.h:50
@ IP_FRAG_RSS_PIPE_NUM
Definition: ip_frag_dp.h:53
@ IP_FRAG_RSS_PIPE_IPV6
Definition: ip_frag_dp.h:52
@ IP_FRAG_RSS_PIPE_IPV4
Definition: ip_frag_dp.h:51
doca_error_t ip_frag(struct ip_frag_config *cfg, struct application_dpdk_config *dpdk_cfg)
Definition: ip_frag_dp.c:1243
ip_frag_mode
Definition: ip_frag_dp.h:37
@ IP_FRAG_MODE_MULTIPORT
Definition: ip_frag_dp.h:39
@ IP_FRAG_MODE_BIDIR
Definition: ip_frag_dp.h:38
bool force_stop
Definition: ip_frag_dp.c:71
ip_frag_port
Definition: ip_frag_dp.h:42
@ IP_FRAG_PORT_FRAGMENT_1
Definition: ip_frag_dp.h:46
@ IP_FRAG_PORT_NUM
Definition: ip_frag_dp.h:47
@ IP_FRAG_PORT_REASSEMBLE_0
Definition: ip_frag_dp.h:43
@ IP_FRAG_PORT_REASSEMBLE_1
Definition: ip_frag_dp.h:45
@ IP_FRAG_PORT_FRAGMENT_0
Definition: ip_frag_dp.h:44
forwarding configuration
Definition: doca_flow.h:779
doca flow matcher information
Definition: doca_flow.h:491
uint32_t frag_tbl_size
Definition: ip_frag_dp.h:64
enum ip_frag_mode mode
Definition: ip_frag_dp.h:57
uint64_t mbuf_flag_inner_modified
Definition: ip_frag_dp.h:59
uint32_t frag_tbl_timeout
Definition: ip_frag_dp.h:63
uint16_t mtu
Definition: ip_frag_dp.h:60
uint64_t mbuf_flag_outer_modified
Definition: ip_frag_dp.h:58
uint16_t num_queues
Definition: ip_frag_dp.h:82
struct doca_dev * dev_arr[IP_FRAG_PORT_NUM]
Definition: ip_frag_dp.h:85
struct doca_flow_port * ports[IP_FRAG_PORT_NUM]
Definition: ip_frag_dp.h:84
struct doca_flow_pipe * pipes[IP_FRAG_PORT_NUM][IP_FRAG_RSS_PIPE_NUM]
Definition: ip_frag_dp.h:83
uint16_t num_ports
Definition: ip_frag_dp.h:81
struct doca_flow_match * match_mask
Definition: ip_frag_dp.h:75
struct doca_flow_fwd * fwd_miss
Definition: ip_frag_dp.h:77
uint32_t num_entries
Definition: ip_frag_dp.h:73
struct doca_flow_match * match
Definition: ip_frag_dp.h:74
struct doca_flow_port * port
Definition: ip_frag_dp.h:69
enum doca_flow_pipe_domain domain
Definition: ip_frag_dp.h:70
uint16_t port_id
Definition: ip_frag_dp.h:68
struct doca_flow_fwd * fwd
Definition: ip_frag_dp.h:76