NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
switch_core.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-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 #include <rte_ethdev.h>
27 
28 #include <doca_log.h>
29 
30 #include "utils.h"
31 #include "dpdk_utils.h"
32 #include "flow_pipes_manager.h"
33 #include "switch_core.h"
34 #include "flow_common.h"
35 
36 DOCA_LOG_REGISTER(SWITCH::Core);
37 
38 #define MAX_PORT_STR_LEN 128 /* Maximal length of port name */
39 #define DEFAULT_TIMEOUT_US (10000) /* Timeout for processing pipe entries */
40 
42 static struct doca_flow_port *ports[FLOW_SWITCH_PORTS_MAX];
44 static int nb_ports;
45 
46 /*
47  * Create DOCA Flow pipe
48  *
49  * @cfg [in]: DOCA Flow pipe configuration
50  * @port_id [in]: Not being used
51  * @fwd [in]: DOCA Flow forward
52  * @fw_pipe_id [in]: Pipe ID to forward
53  * @fwd_miss [in]: DOCA Flow forward miss
54  * @fw_miss_pipe_id [in]: Pipe ID to forward miss
55  */
56 static void pipe_create(struct doca_flow_pipe_cfg *cfg,
57  uint16_t port_id,
58  struct doca_flow_fwd *fwd,
59  uint64_t fw_pipe_id,
60  struct doca_flow_fwd *fwd_miss,
61  uint64_t fw_miss_pipe_id)
62 {
63  (void)port_id;
64 
65  struct doca_flow_pipe *pipe;
66  uint64_t pipe_id;
67  uint16_t switch_mode_port_id = 0;
69 
70  DOCA_LOG_DBG("Create pipe is being called");
71 
72  if (fwd != NULL && fwd->type == DOCA_FLOW_FWD_PIPE) {
74  if (result != DOCA_SUCCESS) {
75  DOCA_LOG_ERR("Failed to find relevant fwd pipe id=%" PRIu64, fw_pipe_id);
76  return;
77  }
78  }
79 
82  if (result != DOCA_SUCCESS) {
83  DOCA_LOG_ERR("Failed to find relevant fwd_miss pipe id=%" PRIu64, fw_miss_pipe_id);
84  return;
85  }
86  }
87 
89  if (result != DOCA_SUCCESS) {
90  DOCA_LOG_ERR("Pipe creation failed: %s", doca_error_get_descr(result));
91  return;
92  }
93 
94  if (pipes_manager_pipe_create(pipes_manager, pipe, switch_mode_port_id, &pipe_id) != DOCA_SUCCESS) {
95  DOCA_LOG_ERR("Flow Pipes Manager failed to add pipe");
97  return;
98  }
99 
100  DOCA_LOG_INFO("Pipe created successfully with id: %" PRIu64, pipe_id);
101 }
102 
103 /*
104  * Add DOCA Flow entry
105  *
106  * @pipe_queue [in]: Queue identifier
107  * @pipe_id [in]: Pipe ID
108  * @match [in]: DOCA Flow match
109  * @actions [in]: Pipe ID to actions
110  * @monitor [in]: DOCA Flow monitor
111  * @fwd [in]: DOCA Flow forward
112  * @fw_pipe_id [in]: Pipe ID to forward
113  * @flags [in]: Hardware steering flag, current implementation supports DOCA_FLOW_NO_WAIT only
114  */
115 static void pipe_add_entry(uint16_t pipe_queue,
116  uint64_t pipe_id,
117  struct doca_flow_match *match,
118  struct doca_flow_actions *actions,
119  struct doca_flow_monitor *monitor,
120  struct doca_flow_fwd *fwd,
121  uint64_t fw_pipe_id,
122  uint32_t flags)
123 {
124  (void)pipe_queue;
125 
126  struct doca_flow_pipe *pipe;
127  struct doca_flow_pipe_entry *entry;
128  uint64_t entry_id;
130  struct entries_status status = {0};
131  int num_of_entries = 1;
132  uint32_t hws_flag = flags;
133 
134  DOCA_LOG_DBG("Add entry is being called");
135 
136  if (fwd != NULL && fwd->type == DOCA_FLOW_FWD_PIPE) {
138  if (result != DOCA_SUCCESS) {
139  DOCA_LOG_ERR("Failed to find relevant fwd pipe with id %" PRIu64, fw_pipe_id);
140  return;
141  }
142  }
143 
144  result = pipes_manager_get_pipe(pipes_manager, pipe_id, &pipe);
145  if (result != DOCA_SUCCESS) {
146  DOCA_LOG_ERR("Failed to find pipe with id %" PRIu64 " to add entry into", pipe_id);
147  return;
148  }
149 
150  if (hws_flag != DOCA_FLOW_NO_WAIT) {
151  DOCA_LOG_DBG("Batch insertion of pipe entries is not supported");
152  hws_flag = DOCA_FLOW_NO_WAIT;
153  }
154 
155  result = doca_flow_pipe_add_entry(0, pipe, match, actions, monitor, fwd, hws_flag, &status, &entry);
156  if (result != DOCA_SUCCESS) {
157  DOCA_LOG_ERR("Entry creation failed: %s", doca_error_get_descr(result));
158  return;
159  }
160 
162  if (result != DOCA_SUCCESS) {
163  DOCA_LOG_ERR("Entry creation FAILED: %s", doca_error_get_descr(result));
164  return;
165  }
166 
167  if (status.nb_processed != num_of_entries || status.failure) {
168  DOCA_LOG_ERR("Entry creation failed");
169  return;
170  }
171 
172  if (pipes_manager_pipe_add_entry(pipes_manager, entry, pipe_id, &entry_id) != DOCA_SUCCESS) {
173  DOCA_LOG_ERR("Flow Pipes Manager failed to add entry");
175  return;
176  }
177 
178  DOCA_LOG_INFO("Entry created successfully with id: %" PRIu64, entry_id);
179 }
180 
181 /*
182  * Add DOCA Flow control pipe entry
183  *
184  * @pipe_queue [in]: Queue identifier
185  * @priority [in]: Entry priority
186  * @pipe_id [in]: Pipe ID
187  * @match [in]: DOCA Flow match
188  * @match_mask [in]: DOCA Flow match mask
189  * @fwd [in]: DOCA Flow forward
190  * @fw_pipe_id [in]: Pipe ID to forward
191  */
192 static void pipe_control_add_entry(uint16_t pipe_queue,
193  uint8_t priority,
194  uint64_t pipe_id,
195  struct doca_flow_match *match,
196  struct doca_flow_match *match_mask,
197  struct doca_flow_fwd *fwd,
198  uint64_t fw_pipe_id)
199 {
200  (void)pipe_queue;
201 
202  struct doca_flow_pipe *pipe;
203  struct doca_flow_pipe_entry *entry;
204  uint64_t entry_id;
206 
207  DOCA_LOG_DBG("Add control pipe entry is being called");
208 
209  if (fwd != NULL && fwd->type == DOCA_FLOW_FWD_PIPE) {
211  if (result != DOCA_SUCCESS) {
212  DOCA_LOG_ERR("Failed to find relevant fwd pipe id=%" PRIu64, fw_pipe_id);
213  return;
214  }
215  }
216 
217  result = pipes_manager_get_pipe(pipes_manager, pipe_id, &pipe);
218  if (result != DOCA_SUCCESS) {
219  DOCA_LOG_ERR("Failed to find relevant pipe id=%" PRIu64 " to add entry into", pipe_id);
220  return;
221  }
222 
224  priority,
225  pipe,
226  match,
227  match_mask,
228  NULL,
229  NULL,
230  NULL,
231  NULL,
232  NULL,
233  fwd,
234  NULL,
235  &entry);
236  if (result != DOCA_SUCCESS) {
237  DOCA_LOG_ERR("Entry creation for control pipe failed: %s", doca_error_get_descr(result));
238  return;
239  }
240 
241  if (pipes_manager_pipe_add_entry(pipes_manager, entry, pipe_id, &entry_id) != DOCA_SUCCESS) {
242  DOCA_LOG_ERR("Flow Pipes Manager failed to add control pipe entry");
244  return;
245  }
246 
247  DOCA_LOG_INFO("Control pipe entry created successfully with id: %" PRIu64, entry_id);
248 }
249 
250 /*
251  * Destroy DOCA Flow pipe
252  *
253  * @pipe_id [in]: Pipe ID to destroy
254  */
255 static void pipe_destroy(uint64_t pipe_id)
256 {
257  struct doca_flow_pipe *pipe;
258 
259  DOCA_LOG_DBG("Destroy pipe is being called");
260 
261  if (pipes_manager_get_pipe(pipes_manager, pipe_id, &pipe) != DOCA_SUCCESS) {
262  DOCA_LOG_ERR("Failed to find pipe id %" PRIu64 " to destroy", pipe_id);
263  return;
264  }
265 
268 }
269 
270 /*
271  * Remove DOCA Flow entry
272  *
273  * @pipe_queue [in]: Queue identifier
274  * @entry_id [in]: Entry ID to remove
275  * @flags [in]: Hardware steering flag, current implementation supports DOCA_FLOW_NO_WAIT only
276  */
277 static void pipe_rm_entry(uint16_t pipe_queue, uint64_t entry_id, uint32_t flags)
278 {
279  (void)pipe_queue;
280 
281  struct doca_flow_pipe_entry *entry;
283  uint32_t hws_flag = flags;
284 
285  DOCA_LOG_DBG("Remove entry is being called");
286 
288  DOCA_LOG_ERR("Failed to find entry id %" PRIu64 " to remove", entry_id);
289  return;
290  }
291 
292  if (hws_flag != DOCA_FLOW_NO_WAIT) {
293  DOCA_LOG_DBG("Batch insertion of pipe entries is not supported");
294  hws_flag = DOCA_FLOW_NO_WAIT;
295  }
296 
298  result = doca_flow_pipe_remove_entry(0, hws_flag, entry);
299  if (result != DOCA_SUCCESS)
300  DOCA_LOG_ERR("Failed to remove entry");
301  }
302 }
303 
304 /*
305  * DOCA Flow port pipes flush
306  *
307  * @port_id [in]: Port ID to flush
308  */
309 static void port_pipes_flush(uint16_t port_id)
310 {
311  uint16_t switch_mode_port_id = 0;
312 
313  DOCA_LOG_DBG("Pipes flush is being called");
314 
315  if (port_id != switch_mode_port_id) {
316  DOCA_LOG_ERR("Switch mode port id is 0 only");
317  return;
318  }
319 
320  if (pipes_manager_pipes_flush(pipes_manager, switch_mode_port_id) == DOCA_SUCCESS)
322 }
323 
324 /*
325  * DOCA Flow query
326  *
327  * @entry_id [in]: Entry to query
328  * @stats [in]: Query statistics
329  */
330 static void flow_query(uint64_t entry_id, struct doca_flow_resource_query *stats)
331 {
332  struct doca_flow_pipe_entry *entry;
334 
335  DOCA_LOG_DBG("Query is being called");
336 
338  DOCA_LOG_ERR("Failed to find entry id %" PRIu64 " to query on", entry_id);
339  return;
340  }
341 
343  if (result != DOCA_SUCCESS)
344  DOCA_LOG_ERR("Query on entry failed");
345 }
346 
347 /*
348  * DOCA Flow port pipes dump
349  *
350  * @port_id [in]: Port ID to dump
351  * @fd [in]: File to dump information into
352  */
353 static void port_pipes_dump(uint16_t port_id, FILE *fd)
354 {
355  uint16_t switch_mode_port_id = 0;
356 
357  DOCA_LOG_DBG("Pipes dump is being called");
358 
359  if (port_id != switch_mode_port_id) {
360  DOCA_LOG_ERR("Switch mode port id is 0 only");
361  return;
362  }
363 
365 }
366 
367 /*
368  * Register all application's relevant function to flow parser module
369  */
371 {
380 }
381 
383 {
384  uint32_t nr_shared_resources[SHARED_RESOURCE_NUM_VALUES] = {0};
385  struct flow_resources resource = {0};
386  int nr_switch_manager_ports = 1;
387  int nr_entries = 10000;
388  const char *start_str;
390 
391  memset(&ports, 0, sizeof(ports));
392  memset(&actions_mem_size, 0, sizeof(actions_mem_size));
393 
394  if (ctx->nb_ports != nr_switch_manager_ports) {
395  DOCA_LOG_ERR("Switch is allowed to run with one PF only");
397  }
398 
399  nb_ports = app_dpdk_config->port_config.nb_ports;
400 
401  if (ctx->is_expert)
402  start_str = "switch,isolated,hws,expert";
403  else
404  start_str = "switch,isolated,hws";
405 
406  result = init_doca_flow(app_dpdk_config->port_config.nb_queues, start_str, &resource, nr_shared_resources);
407  if (result != DOCA_SUCCESS) {
408  DOCA_LOG_ERR("Failed to init DOCA Flow: %s", doca_error_get_descr(result));
409  return result;
410  }
411 
412  /* Doca_dev is opened for proxy_port only */
413  ARRAY_INIT(actions_mem_size, ACTIONS_MEM_SIZE(app_dpdk_config->port_config.nb_queues, nr_entries));
414  result = init_doca_flow_ports(nb_ports, ports, false /* is_hairpin */, ctx->doca_dev, actions_mem_size);
415  if (result != DOCA_SUCCESS) {
416  DOCA_LOG_ERR("Failed to init DOCA ports: %s", doca_error_get_descr(result));
418  return result;
419  }
420 
422  if (result != DOCA_SUCCESS) {
425  DOCA_LOG_ERR("Failed to create pipes manager: %s", doca_error_get_descr(result));
427  }
428 
430  return DOCA_SUCCESS;
431 }
432 
433 void switch_destroy(void)
434 {
438 }
#define NULL
Definition: __stddef_null.h:26
int32_t result
struct doca_flow_port * init_doca_flow(uint16_t port_id, uint8_t rxq_num)
Definition: flow.c:37
static struct eth_l2_fwd_stats stats
static struct doca_flow_fwd fwd_miss
Definition: flow_parser.c:110
void set_pipe_control_add_entry(void(*action)(uint16_t, uint8_t, uint64_t, struct doca_flow_match *, struct doca_flow_match *, struct doca_flow_fwd *, uint64_t))
Definition: flow_parser.c:213
void set_pipe_destroy(void(*action)(uint64_t))
Definition: flow_parser.c:224
void set_query(void(*action)(uint64_t, struct doca_flow_resource_query *))
Definition: flow_parser.c:244
void set_pipe_add_entry(void(*action)(uint16_t, uint64_t, struct doca_flow_match *, struct doca_flow_actions *, struct doca_flow_monitor *, struct doca_flow_fwd *, uint64_t, uint32_t))
Definition: flow_parser.c:196
static struct doca_flow_actions actions
Definition: flow_parser.c:107
void set_port_pipes_flush(void(*action)(uint16_t))
Definition: flow_parser.c:239
void set_pipe_rm_entry(void(*action)(uint16_t, uint64_t, uint32_t))
Definition: flow_parser.c:229
void set_port_pipes_dump(void(*action)(uint16_t, FILE *))
Definition: flow_parser.c:249
void set_pipe_create(void(*action)(struct doca_flow_pipe_cfg *, uint16_t, struct doca_flow_fwd *, uint64_t, struct doca_flow_fwd *, uint64_t))
Definition: flow_parser.c:186
static struct doca_flow_monitor monitor
Definition: flow_parser.c:108
static struct doca_flow_fwd fwd
Definition: flow_parser.c:109
static struct doca_flow_match match_mask
Definition: flow_parser.c:106
static struct doca_flow_pipe_entry * entry[MAX_ENTRIES]
doca_error_t pipes_manager_pipe_add_entry(struct flow_pipes_manager *manager, struct doca_flow_pipe_entry *entry, uint64_t pipe_id, uint64_t *entry_id)
doca_error_t pipes_manager_pipe_destroy(struct flow_pipes_manager *manager, uint64_t pipe_id)
doca_error_t pipes_manager_get_pipe(struct flow_pipes_manager *manager, uint64_t pipe_id, struct doca_flow_pipe **pipe)
doca_error_t create_pipes_manager(struct flow_pipes_manager **pipes_manager)
void destroy_pipes_manager(struct flow_pipes_manager *manager)
doca_error_t pipes_manager_pipe_create(struct flow_pipes_manager *manager, struct doca_flow_pipe *pipe, uint16_t port_id, uint64_t *pipe_id)
doca_error_t pipes_manager_get_entry(struct flow_pipes_manager *manager, uint64_t entry_id, struct doca_flow_pipe_entry **entry)
doca_error_t pipes_manager_pipe_rm_entry(struct flow_pipes_manager *manager, uint64_t entry_id)
doca_error_t pipes_manager_pipes_flush(struct flow_pipes_manager *manager, uint16_t port_id)
#define FLOW_SWITCH_PORTS_MAX
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_INVALID_VALUE
Definition: doca_error.h:44
@ DOCA_ERROR_INITIALIZATION
Definition: doca_error.h:46
@ DOCA_SUCCESS
Definition: doca_error.h:38
DOCA_STABLE doca_error_t doca_flow_entries_process(struct doca_flow_port *port, uint16_t pipe_queue, uint64_t timeout, uint32_t max_processed_entries)
Process entries in queue.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_control_add_entry(uint16_t pipe_queue, uint32_t priority, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_match *match_mask, const struct doca_flow_match_condition *condition, const struct doca_flow_actions *actions, const struct doca_flow_actions *actions_mask, const struct doca_flow_action_descs *action_descs, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, void *usr_ctx, struct doca_flow_pipe_entry **entry)
Add one new entry to a control pipe.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_create(const struct doca_flow_pipe_cfg *cfg, const struct doca_flow_fwd *fwd, const struct doca_flow_fwd *fwd_miss, struct doca_flow_pipe **pipe)
Create one new pipe.
DOCA_STABLE void doca_flow_port_pipes_flush(struct doca_flow_port *port)
Flush pipes of one port.
DOCA_STABLE void doca_flow_pipe_destroy(struct doca_flow_pipe *pipe)
Destroy one pipe.
DOCA_EXPERIMENTAL void doca_flow_port_pipes_dump(struct doca_flow_port *port, FILE *f)
Dump pipes of one port.
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_add_entry(uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_actions *actions, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, uint32_t flags, void *usr_ctx, struct doca_flow_pipe_entry **entry)
Add one new entry to a pipe.
DOCA_STABLE doca_error_t doca_flow_pipe_remove_entry(uint16_t pipe_queue, uint32_t flags, struct doca_flow_pipe_entry *entry)
Free one pipe entry.
DOCA_STABLE void doca_flow_destroy(void)
Destroy the doca flow.
DOCA_STABLE struct doca_flow_port * doca_flow_port_switch_get(const struct doca_flow_port *port)
Get doca flow switch port.
DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_entry(struct doca_flow_pipe_entry *entry, struct doca_flow_resource_query *query_stats)
Extract information about specific entry.
@ DOCA_FLOW_NO_WAIT
Definition: doca_flow.h:115
@ DOCA_FLOW_FWD_PIPE
Definition: doca_flow.h:746
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
Definition: doca_log.h:466
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
Definition: doca_log.h:486
#define DOCA_LOG_DBG(format,...)
Generates a DEBUG application log message.
Definition: doca_log.h:496
const struct ip_frag_config * cfg
Definition: ip_frag_dp.c:0
doca_error_t stop_doca_flow_ports(int nb_ports, struct doca_flow_port *ports[])
Definition: flow_common.c:240
doca_error_t init_doca_flow_ports(int nb_ports, struct doca_flow_port *ports[], bool is_hairpin, struct doca_dev *dev_arr[], uint32_t actions_mem_size[])
Definition: flow_common.c:296
#define SHARED_RESOURCE_NUM_VALUES
Definition: flow_common.h:59
#define ACTIONS_MEM_SIZE(nr_queues, entries)
Definition: flow_common.h:66
#define ARRAY_INIT(array, val)
Definition: flow_common.h:71
struct application_port_config port_config
Definition: dpdk_utils.h:70
doca flow actions information
Definition: doca_flow.h:684
forwarding configuration
Definition: doca_flow.h:779
struct doca_flow_pipe * next_pipe
Definition: doca_flow.h:800
enum doca_flow_fwd_type type
Definition: doca_flow.h:780
doca flow matcher information
Definition: doca_flow.h:491
doca monitor action configuration
Definition: doca_flow.h:968
flow resource query
Definition: doca_flow.h:1101
user context struct that will be used in entries process callback
Definition: flow_common.h:78
static void pipe_rm_entry(uint16_t pipe_queue, uint64_t entry_id, uint32_t flags)
Definition: switch_core.c:277
static struct flow_pipes_manager * pipes_manager
Definition: switch_core.c:41
static void pipe_add_entry(uint16_t pipe_queue, uint64_t pipe_id, struct doca_flow_match *match, struct doca_flow_actions *actions, struct doca_flow_monitor *monitor, struct doca_flow_fwd *fwd, uint64_t fw_pipe_id, uint32_t flags)
Definition: switch_core.c:115
static int nb_ports
Definition: switch_core.c:44
static void flow_query(uint64_t entry_id, struct doca_flow_resource_query *stats)
Definition: switch_core.c:330
doca_error_t switch_init(struct application_dpdk_config *app_dpdk_config, struct flow_switch_ctx *ctx)
Definition: switch_core.c:382
static uint32_t actions_mem_size[FLOW_SWITCH_PORTS_MAX]
Definition: switch_core.c:43
static void pipe_control_add_entry(uint16_t pipe_queue, uint8_t priority, uint64_t pipe_id, struct doca_flow_match *match, struct doca_flow_match *match_mask, struct doca_flow_fwd *fwd, uint64_t fw_pipe_id)
Definition: switch_core.c:192
static void port_pipes_flush(uint16_t port_id)
Definition: switch_core.c:309
static void pipe_create(struct doca_flow_pipe_cfg *cfg, uint16_t port_id, struct doca_flow_fwd *fwd, uint64_t fw_pipe_id, struct doca_flow_fwd *fwd_miss, uint64_t fw_miss_pipe_id)
Definition: switch_core.c:56
#define DEFAULT_TIMEOUT_US
Definition: switch_core.c:39
void switch_destroy(void)
Definition: switch_core.c:433
static struct doca_flow_port * ports[FLOW_SWITCH_PORTS_MAX]
Definition: switch_core.c:42
static void pipe_destroy(uint64_t pipe_id)
Definition: switch_core.c:255
DOCA_LOG_REGISTER(SWITCH::Core)
static void register_actions_on_flow_parser(void)
Definition: switch_core.c:370
static void port_pipes_dump(uint16_t port_id, FILE *fd)
Definition: switch_core.c:353
struct upf_accel_ctx * ctx