blob: ee4990d005825b82bfda895614c0dbf4672ab723 [file] [log] [blame]
Neale Ranns0bfe5d82016-08-25 15:29:12 +01001/*
2 * Copyright (c) 2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15/**
16 * @brief
17 * A Data-Path Object is an object that represents actions that are
18 * applied to packets are they are switched through VPP's data-path.
Dave Barach26d890e2020-06-05 09:42:50 -040019 *
Neale Ranns0bfe5d82016-08-25 15:29:12 +010020 * The DPO can be considered to be like is a base class that is specialised
21 * by other objects to provide concreate actions
22 *
23 * The VLIB graph nodes are graph of DPO types, the DPO graph is a graph of
24 * instances.
25 */
26
27#ifndef __DPO_H__
28#define __DPO_H__
29
30#include <vnet/vnet.h>
31
32/**
33 * @brief An index for adjacencies.
34 * Alas 'C' is not typesafe enough to b0rk when a u32 is used instead of
35 * an index_t. However, for us humans, we can glean much more intent
36 * from the declaration
37 * foo barindex_t t);
38 * than we can from
39 * foo bar(u32 t);
40 */
41typedef u32 index_t;
42
43/**
44 * @brief Invalid index - used when no index is known
45 * blazoned capitals INVALID speak volumes where ~0 does not.
46 */
47#define INDEX_INVALID ((index_t)(~0))
48
49/**
50 * @brief Data path protocol.
51 * Actions performed on packets in the data-plane can be described and represented
52 * by protocol independent objects, i.e. ADJACENCY, but the spceifics actions
53 * required during ADJACENCY processing can be protocol dependent. For example,
54 * the adjacency rewrite node performs a ip4 checksum calculation, ip6 and MPLS
55 * do not, all 3 perform a TTL decrement. The VLIB graph nodes are thus protocol
56 * dependent, and thus each graph edge/arc is too.
57 * When programming a DPO's next node arc from child to parent it is thus required
58 * to know the parent's data-path protocol so the correct arc index can be used.
59 */
60typedef enum dpo_proto_t_
61{
Neale Ranns0bfe5d82016-08-25 15:29:12 +010062 DPO_PROTO_IP4 = 0,
Neale Ranns0bfe5d82016-08-25 15:29:12 +010063 DPO_PROTO_IP6,
64 DPO_PROTO_MPLS,
Neale Rannsda78f952017-05-24 09:15:43 -070065 DPO_PROTO_ETHERNET,
Neale Rannsd792d9c2017-10-21 10:53:20 -070066 DPO_PROTO_BIER,
Florin Corasce1b4c72017-01-26 14:25:34 -080067 DPO_PROTO_NSH,
Neale Ranns0bfe5d82016-08-25 15:29:12 +010068} __attribute__((packed)) dpo_proto_t;
69
Florin Corasce1b4c72017-01-26 14:25:34 -080070#define DPO_PROTO_NUM ((dpo_proto_t)(DPO_PROTO_NSH+1))
Neale Ranns450cd302016-11-09 17:49:42 +000071#define DPO_PROTO_NONE ((dpo_proto_t)(DPO_PROTO_NUM+1))
Neale Ranns0bfe5d82016-08-25 15:29:12 +010072
73#define DPO_PROTOS { \
74 [DPO_PROTO_IP4] = "ip4", \
75 [DPO_PROTO_IP6] = "ip6", \
Neale Ranns5e575b12016-10-03 09:40:25 +010076 [DPO_PROTO_ETHERNET] = "ethernet", \
Neale Ranns0bfe5d82016-08-25 15:29:12 +010077 [DPO_PROTO_MPLS] = "mpls", \
Florin Corasce1b4c72017-01-26 14:25:34 -080078 [DPO_PROTO_NSH] = "nsh", \
Neale Rannsd792d9c2017-10-21 10:53:20 -070079 [DPO_PROTO_BIER] = "bier", \
Neale Ranns0bfe5d82016-08-25 15:29:12 +010080}
81
Neale Ranns5e575b12016-10-03 09:40:25 +010082#define FOR_EACH_DPO_PROTO(_proto) \
83 for (_proto = DPO_PROTO_IP4; \
Florin Corasce1b4c72017-01-26 14:25:34 -080084 _proto <= DPO_PROTO_NSH; \
Neale Ranns5e575b12016-10-03 09:40:25 +010085 _proto++)
86
Neale Ranns0bfe5d82016-08-25 15:29:12 +010087/**
88 * @brief Common types of data-path objects
89 * New types can be dynamically added using dpo_register_new_type()
90 */
91typedef enum dpo_type_t_ {
92 /**
93 * A non-zero value first so we can spot unitialisation errors
94 */
95 DPO_FIRST,
96 DPO_DROP,
Neale Ranns948e00f2016-10-20 13:39:34 +010097 DPO_IP_NULL,
Neale Ranns0bfe5d82016-08-25 15:29:12 +010098 DPO_PUNT,
99 /**
100 * @brief load-balancing over a choice of [un]equal cost paths
101 */
102 DPO_LOAD_BALANCE,
Neale Ranns32e1c012016-11-22 17:07:28 +0000103 DPO_REPLICATE,
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100104 DPO_ADJACENCY,
105 DPO_ADJACENCY_INCOMPLETE,
106 DPO_ADJACENCY_MIDCHAIN,
107 DPO_ADJACENCY_GLEAN,
Neale Ranns32e1c012016-11-22 17:07:28 +0000108 DPO_ADJACENCY_MCAST,
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800109 DPO_ADJACENCY_MCAST_MIDCHAIN,
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100110 DPO_RECEIVE,
111 DPO_LOOKUP,
112 DPO_LISP_CP,
113 DPO_CLASSIFY,
Neale Ranns31ed7442018-02-23 05:29:09 -0800114 DPO_MPLS_DISPOSITION_PIPE,
115 DPO_MPLS_DISPOSITION_UNIFORM,
Neale Ranns32e1c012016-11-22 17:07:28 +0000116 DPO_MFIB_ENTRY,
Neale Ranns43161a82017-08-12 02:12:00 -0700117 DPO_INTERFACE_RX,
118 DPO_INTERFACE_TX,
Neale Rannsf068c3e2018-01-03 04:18:48 -0800119 DPO_DVR,
Andrew Yourtchenko5f3fcb92017-10-25 05:50:37 -0700120 DPO_L3_PROXY,
Neale Rannsd792d9c2017-10-21 10:53:20 -0700121 DPO_BIER_TABLE,
122 DPO_BIER_FMASK,
123 DPO_BIER_IMP,
124 DPO_BIER_DISP_TABLE,
125 DPO_BIER_DISP_ENTRY,
Neale Ranns53da2212018-02-24 02:11:19 -0800126 DPO_IP6_LL,
Neale Ranns1dbcf302019-07-19 11:44:53 +0000127 DPO_PW_CW,
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100128 DPO_LAST,
129} __attribute__((packed)) dpo_type_t;
130
131#define DPO_TYPE_NUM DPO_LAST
132
133#define DPO_TYPES { \
134 [DPO_FIRST] = "dpo-invalid", \
135 [DPO_DROP] = "dpo-drop", \
Neale Ranns948e00f2016-10-20 13:39:34 +0100136 [DPO_IP_NULL] = "dpo-ip-null", \
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100137 [DPO_PUNT] = "dpo-punt", \
138 [DPO_ADJACENCY] = "dpo-adjacency", \
139 [DPO_ADJACENCY_INCOMPLETE] = "dpo-adjacency-incomplete", \
140 [DPO_ADJACENCY_MIDCHAIN] = "dpo-adjacency-midcahin", \
141 [DPO_ADJACENCY_GLEAN] = "dpo-glean", \
Neale Ranns32e1c012016-11-22 17:07:28 +0000142 [DPO_ADJACENCY_MCAST] = "dpo-adj-mcast", \
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800143 [DPO_ADJACENCY_MCAST_MIDCHAIN] = "dpo-adj-mcast-midchain", \
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100144 [DPO_RECEIVE] = "dpo-receive", \
145 [DPO_LOOKUP] = "dpo-lookup", \
146 [DPO_LOAD_BALANCE] = "dpo-load-balance", \
Neale Ranns32e1c012016-11-22 17:07:28 +0000147 [DPO_REPLICATE] = "dpo-replicate", \
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100148 [DPO_LISP_CP] = "dpo-lisp-cp", \
149 [DPO_CLASSIFY] = "dpo-classify", \
Neale Ranns31ed7442018-02-23 05:29:09 -0800150 [DPO_MPLS_DISPOSITION_PIPE] = "dpo-mpls-diposition-pipe", \
151 [DPO_MPLS_DISPOSITION_UNIFORM] = "dpo-mpls-diposition-uniform", \
Neale Rannsf068c3e2018-01-03 04:18:48 -0800152 [DPO_MFIB_ENTRY] = "dpo-mfib-entry", \
Neale Ranns43161a82017-08-12 02:12:00 -0700153 [DPO_INTERFACE_RX] = "dpo-interface-rx", \
Neale Ranns6f631152017-10-03 08:20:21 -0700154 [DPO_INTERFACE_TX] = "dpo-interface-tx", \
Neale Rannsf068c3e2018-01-03 04:18:48 -0800155 [DPO_DVR] = "dpo-dvr", \
Andrew Yourtchenko5f3fcb92017-10-25 05:50:37 -0700156 [DPO_L3_PROXY] = "dpo-l3-proxy", \
Neale Rannsd792d9c2017-10-21 10:53:20 -0700157 [DPO_BIER_TABLE] = "bier-table", \
158 [DPO_BIER_FMASK] = "bier-fmask", \
159 [DPO_BIER_IMP] = "bier-imposition", \
160 [DPO_BIER_DISP_ENTRY] = "bier-disp-entry", \
161 [DPO_BIER_DISP_TABLE] = "bier-disp-table", \
Neale Ranns53da2212018-02-24 02:11:19 -0800162 [DPO_IP6_LL] = "ip6-link-local", \
Neale Ranns1dbcf302019-07-19 11:44:53 +0000163 [DPO_PW_CW] = "PW-CW", \
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100164}
165
166/**
167 * @brief The identity of a DPO is a combination of its type and its
168 * instance number/index of objects of that type
169 */
170typedef struct dpo_id_t_ {
Neale Rannsab4fbed2020-11-26 09:41:01 +0000171 union {
172 struct {
173 /**
174 * the type
175 */
176 dpo_type_t dpoi_type;
177 /**
178 * the data-path protocol of the type.
179 */
180 dpo_proto_t dpoi_proto;
181 /**
182 * The next VLIB node to follow.
183 */
184 u16 dpoi_next_node;
185 /**
186 * the index of objects of that type
187 */
188 index_t dpoi_index;
189 };
190 u64 as_u64;
191 };
192} dpo_id_t;
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100193
Damjan Marioncf478942016-11-07 14:57:50 +0100194STATIC_ASSERT(sizeof(dpo_id_t) <= sizeof(u64),
195 "DPO ID is greater than sizeof u64 "
196 "atomic updates need to be revisited");
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100197
198/**
Neale Rannsad95b5d2016-11-10 20:35:14 +0000199 * @brief An initialiser for DPOs declared on the stack.
200 * Thenext node is set to 0 since VLIB graph nodes should set 0 index to drop.
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100201 */
Neale Rannsad95b5d2016-11-10 20:35:14 +0000202#define DPO_INVALID \
203{ \
204 .dpoi_type = DPO_FIRST, \
205 .dpoi_proto = DPO_PROTO_NONE, \
206 .dpoi_index = INDEX_INVALID, \
207 .dpoi_next_node = 0, \
208}
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100209
210/**
211 * @brief Return true if the DPO object is valid, i.e. has been initialised.
212 */
213static inline int
214dpo_id_is_valid (const dpo_id_t *dpoi)
215{
216 return (dpoi->dpoi_type != DPO_FIRST &&
217 dpoi->dpoi_index != INDEX_INVALID);
218}
219
Neale Rannsad95b5d2016-11-10 20:35:14 +0000220extern dpo_proto_t vnet_link_to_dpo_proto(vnet_link_t linkt);
221
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100222/**
223 * @brief
224 * Take a reference counting lock on the DPO
225 */
226extern void dpo_lock(dpo_id_t *dpo);
227
228/**
229 * @brief
230 * Release a reference counting lock on the DPO
231 */
232extern void dpo_unlock(dpo_id_t *dpo);
233
234/**
Neale Ranns2303cb12018-02-21 04:57:17 -0800235 * @brief
236 * Make an interpose DPO from an original
237 */
238extern void dpo_mk_interpose(const dpo_id_t *original,
239 const dpo_id_t *parent,
240 dpo_id_t *clone);
241
242/**
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100243 * @brief Set/create a DPO ID
244 * The DPO will be locked.
245 *
246 * @param dpo
247 * The DPO object to configure
248 *
249 * @param type
250 * The dpo_type_t of the DPO
251 *
252 * @param proto
253 * The dpo_proto_t of the DPO
254 *
255 * @param index
256 * The type specific index of the DPO
257 */
258extern void dpo_set(dpo_id_t *dpo,
259 dpo_type_t type,
260 dpo_proto_t proto,
261 index_t index);
262
263/**
264 * @brief reset a DPO ID
265 * The DPO will be unlocked.
266 *
267 * @param dpo
268 * The DPO object to reset
269 */
270extern void dpo_reset(dpo_id_t *dpo);
271
272/**
273 * @brief compare two DPOs for equality
274 */
275extern int dpo_cmp(const dpo_id_t *dpo1,
276 const dpo_id_t *dpo2);
277
278/**
279 * @brief
280 * atomic copy a data-plane object.
281 * This is safe to use when the dst DPO is currently switching packets
282 */
283extern void dpo_copy(dpo_id_t *dst,
284 const dpo_id_t *src);
285
286/**
287 * @brief Return TRUE is the DPO is any type of adjacency
288 */
289extern int dpo_is_adj(const dpo_id_t *dpo);
290
291/**
Paul Vinciguerrab5a575b2019-11-01 13:00:58 -0400292 * @brief Format a DPO_id_t oject
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100293 */
294extern u8 *format_dpo_id(u8 * s, va_list * args);
295
296/**
Paul Vinciguerrab5a575b2019-11-01 13:00:58 -0400297 * @brief format a DPO type
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100298 */
299extern u8 *format_dpo_type(u8 * s, va_list * args);
300
301/**
302 * @brief format a DPO protocol
303 */
304extern u8 *format_dpo_proto(u8 * s, va_list * args);
305
306/**
Neale Rannsda78f952017-05-24 09:15:43 -0700307 * @brief format a DPO protocol
308 */
309extern vnet_link_t dpo_proto_to_link(dpo_proto_t dp);
310
311/**
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100312 * @brief
313 * Set and stack a DPO.
314 * The DPO passed is set to the parent DPO and the necessary
315 * VLIB graph arcs are created. The child_type and child_proto
316 * are used to get the VLID nodes from which the arcs are added.
317 *
318 * @param child_type
319 * Child DPO type.
320 *
321 * @param child_proto
322 * Child DPO proto
323 *
324 * @parem dpo
325 * This is the DPO to stack and set.
326 *
327 * @paren parent_dpo
328 * The parent DPO to stack onto.
329 */
330extern void dpo_stack(dpo_type_t child_type,
331 dpo_proto_t child_proto,
332 dpo_id_t *dpo,
333 const dpo_id_t *parent_dpo);
334
335/**
Dave Barach26d890e2020-06-05 09:42:50 -0400336 * @brief
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100337 * Set and stack a DPO.
338 * The DPO passed is set to the parent DPO and the necessary
339 * VLIB graph arcs are created, from the child_node passed.
340 *
341 * @param child_node
Lijian.Zhang33af8c12019-09-16 16:22:36 +0800342 * The VLIB graph node index to create an arc from to the parent
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100343 *
Andrew Yourtchenko5f3fcb92017-10-25 05:50:37 -0700344 * @param dpo
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100345 * This is the DPO to stack and set.
346 *
Andrew Yourtchenko5f3fcb92017-10-25 05:50:37 -0700347 * @param parent_dpo
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100348 * The parent DPO to stack onto.
Dave Barach26d890e2020-06-05 09:42:50 -0400349 */
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100350extern void dpo_stack_from_node(u32 child_node,
351 dpo_id_t *dpo,
352 const dpo_id_t *parent);
353
354/**
Andrew Yourtchenko5f3fcb92017-10-25 05:50:37 -0700355 * Get a uRPF interface for the DPO
356 *
357 * @param dpo
358 * The DPO from which to get the uRPF interface
359 *
360 * @return valid SW interface index or ~0
361 */
362extern u32 dpo_get_urpf(const dpo_id_t *dpo);
363
364/**
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100365 * @brief A lock function registered for a DPO type
366 */
367typedef void (*dpo_lock_fn_t)(dpo_id_t *dpo);
368
369/**
370 * @brief An unlock function registered for a DPO type
371 */
372typedef void (*dpo_unlock_fn_t)(dpo_id_t *dpo);
373
374/**
Neale Ranns6c3ebcc2016-10-02 21:20:15 +0100375 * @brief An memory usage show command
376 */
377typedef void (*dpo_mem_show_t)(void);
378
379/**
Neale Ranns43161a82017-08-12 02:12:00 -0700380 * @brief Given a DPO instance return a vector of node indices that
381 * the type/instance will use.
382 */
383typedef u32* (*dpo_get_next_node_t)(const dpo_id_t *dpo);
384
385/**
Andrew Yourtchenko5f3fcb92017-10-25 05:50:37 -0700386 * @brief Given a DPO instance return an interface that can
387 * be used in an uRPF check
388 */
389typedef u32 (*dpo_get_urpf_t)(const dpo_id_t *dpo);
390
391/**
Neale Ranns2303cb12018-02-21 04:57:17 -0800392 * @brief Called during FIB interposition when the originally
393 * registered DPO is used to 'clone' an instance for interposition
394 * at a particular location in the FIB graph.
395 * The parent is the next DPO in the chain that the clone will
396 * be used instead of. The clone may then choose to stack itself
397 * on the parent.
398 */
399typedef void (*dpo_mk_interpose_t)(const dpo_id_t *original,
400 const dpo_id_t *parent,
401 dpo_id_t *clone);
402
403/**
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100404 * @brief A virtual function table regisitered for a DPO type
405 */
406typedef struct dpo_vft_t_
407{
408 /**
409 * A reference counting lock function
410 */
411 dpo_lock_fn_t dv_lock;
412 /**
413 * A reference counting unlock function
414 */
415 dpo_lock_fn_t dv_unlock;
416 /**
417 * A format function
418 */
419 format_function_t *dv_format;
Neale Ranns6c3ebcc2016-10-02 21:20:15 +0100420 /**
421 * A show memory usage function
422 */
423 dpo_mem_show_t dv_mem_show;
Neale Ranns43161a82017-08-12 02:12:00 -0700424 /**
425 * A function to get the next VLIB node given an instance
426 * of the DPO. If this is null, then the node's name MUST be
427 * retreiveable from the nodes names array passed in the register
428 * function
429 */
430 dpo_get_next_node_t dv_get_next_node;
Andrew Yourtchenko5f3fcb92017-10-25 05:50:37 -0700431 /**
432 * Get uRPF interface
433 */
434 dpo_get_urpf_t dv_get_urpf;
Neale Ranns2303cb12018-02-21 04:57:17 -0800435 /**
436 * Signal on an interposed child that the parent has changed
437 */
438 dpo_mk_interpose_t dv_mk_interpose;
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100439} dpo_vft_t;
440
441
442/**
443 * @brief For a given DPO type Register:
444 * - a virtual function table
445 * - a NULL terminated array of graph nodes from which that object type
446 * will originate packets, i.e. the nodes in which the object type will be
447 * the parent DPO in the DP graph. The ndoes are per-data-path protocol
448 * (see above).
449 *
450 * @param type
Dave Barach26d890e2020-06-05 09:42:50 -0400451 * The type being registered.
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100452 *
453 * @param vft
454 * The virtual function table to register for the type.
455 *
456 * @param nodes
457 * The string description of the per-protocol VLIB graph nodes.
458 */
Neale Ranns6c3ebcc2016-10-02 21:20:15 +0100459extern void dpo_register(dpo_type_t type,
460 const dpo_vft_t *vft,
461 const char * const * const * nodes);
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100462
463/**
464 * @brief Create and register a new DPO type.
465 *
466 * This can be used by plugins to create new DPO types that are not listed
467 * in dpo_type_t enum
468 *
469 * @param vft
470 * The virtual function table to register for the type.
471 *
472 * @param nodes
473 * The string description of the per-protocol VLIB graph nodes.
474 *
475 * @return The new dpo_type_t
476 */
Neale Ranns6c3ebcc2016-10-02 21:20:15 +0100477extern dpo_type_t dpo_register_new_type(const dpo_vft_t *vft,
478 const char * const * const * nodes);
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100479
Vijayabhaskar Katamreddyb9ca61b2018-03-14 14:04:27 -0700480/**
481 * @brief Return already stacked up next node index for a given
482 * child_type/child_proto and parent_type/patent_proto.
483 * The VLIB graph arc used is taken from the parent and child types
484 * passed.
485 *
486 * @param child_type
487 * Child DPO type.
488 *
489 * @param child_proto
490 * Child DPO proto
491 *
492 * @param parent_type
493 * Parent DPO type.
494 *
495 * @param parent_proto
496 * Parent DPO proto
497 *
498 * @return The VLIB Graph node index
499 */
500extern u32
501dpo_get_next_node_by_type_and_proto (dpo_type_t child_type,
502 dpo_proto_t child_proto,
503 dpo_type_t parent_type,
504 dpo_proto_t parent_proto);
Dave Barach26d890e2020-06-05 09:42:50 -0400505
506
507/**
508 * @brief Barrier sync if a dpo pool is about to expand
509 *
510 * @param VM (output)
511 * vlib_main_t *, invariably &vlib_global_main
512 *
513 * @param P
514 * pool pointer
515 *
516 * @param YESNO (output)
517 * typically a u8, 1 => expand will occur, worker barrier held
518 * 0 => no expand, barrier not held
519 *
520 * @return YESNO set
521 */
522
523#define dpo_pool_barrier_sync(VM,P,YESNO) \
524do { \
525 pool_get_aligned_will_expand ((P), YESNO, CLIB_CACHE_LINE_BYTES); \
526 \
527 if (YESNO) \
528 { \
529 VM = vlib_get_main(); \
530 ASSERT ((VM)->thread_index == 0); \
531 vlib_worker_thread_barrier_sync((VM)); \
532 } \
533} while(0);
534
535/**
536 * @brief Release barrier sync after dpo pool expansion
537 *
538 * @param VM
539 * vlib_main_t pointer, must be &vlib_global_main
540 *
541 * @param YESNO
542 * typically a u8, 1 => release required
543 * 0 => no release required
544 * @return none
545 */
546
547#define dpo_pool_barrier_release(VM,YESNO) \
548 if ((YESNO)) vlib_worker_thread_barrier_release((VM));
549
Neale Ranns0bfe5d82016-08-25 15:29:12 +0100550#endif