|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
30 if (
fm->flows_used == 0)
33 *start =
fm->flows_used;
38 r->owner =
format (0,
"%s%c", owner, 0);
49 *flow_index =
f -
fm->global_flow_pool;
52 f->index = *flow_index;
75 return VNET_FLOW_ERROR_NO_SUCH_ENTRY;
80 vnet_flow_disable (vnm, flow_index, hw_if_index);
100 return VNET_FLOW_ERROR_NO_SUCH_ENTRY;
103 return VNET_FLOW_ERROR_NO_SUCH_INTERFACE;
106 if (
hash_get (
f->private_data, hw_if_index) != 0)
107 return VNET_FLOW_ERROR_ALREADY_DONE;
112 if (dev_class->flow_ops_function == 0)
113 return VNET_FLOW_ERROR_NOT_SUPPORTED;
115 if (
f->actions & VNET_FLOW_ACTION_REDIRECT_TO_NODE)
118 f->redirect_device_input_next_index =
120 f->redirect_node_index);
124 hi->dev_instance, flow_index,
130 hash_set (
f->private_data, hw_if_index, private_data);
144 return VNET_FLOW_ERROR_NO_SUCH_ENTRY;
147 return VNET_FLOW_ERROR_NO_SUCH_INTERFACE;
150 if ((p =
hash_get (
f->private_data, hw_if_index)) == 0)
151 return VNET_FLOW_ERROR_ALREADY_DONE;
157 hi->dev_instance, flow_index, p);
int vnet_flow_enable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
int vnet_flow_del(vnet_main_t *vnm, u32 flow_index)
#define hash_set(h, key, value)
struct _vnet_device_class vnet_device_class_t
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
vnet_flow_main_t flow_main
vnet_flow_t * vnet_get_flow(u32 flow_index)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_foreach(key_var, value_var, h, body)
#define pool_put(P, E)
Free an object E in pool P.
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
vnet_hw_if_output_node_runtime_t * r
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define hash_unset(h, key)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
static uword vnet_hw_interface_is_valid(vnet_main_t *vnm, u32 hw_if_index)
int vnet_flow_disable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
@ VNET_FLOW_DEV_OP_DEL_FLOW
@ VNET_FLOW_DEV_OP_ADD_FLOW
description fragment has unexpected format
int vnet_flow_get_range(vnet_main_t *vnm, char *owner, u32 count, u32 *start)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
int vnet_flow_add(vnet_main_t *vnm, vnet_flow_t *flow, u32 *flow_index)