|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
27 u32 n_elts,
u32 * stream_index)
45 #define _(field,mask,item,length) \
48 fr->fields_to_send = clib_bitmap_set (fr->fields_to_send, \
74 ip->ip_version_and_header_length = 0x45;
76 ip->protocol = IP_PROTOCOL_UDP;
78 ip->dst_address.as_u32 = collector_address->
as_u32;
79 udp->
src_port = clib_host_to_net_u16 (collector_port);
80 udp->
dst_port = clib_host_to_net_u16 (UDP_DST_PORT_ipfix);
83 h->domain_id = clib_host_to_net_u32 (stream->
domain_id);
89 sizeof (ip6_address_t));
93 destinationIPv6Address,
94 sizeof (ip6_address_t));
98 sourceTransportPort, 2);
102 destinationTransportPort, 2);
105 #define _(field,mask,item,length) \
107 f->e_id_length = ipfix_e_id_length (0 , \
115 ioamNumberOfPaths, 2);
141 ip->length = clib_host_to_net_u16 ((
u8 *)
f - (
u8 *)
ip);
151 ip6_address_t *
src, ip6_address_t *
dst,
160 u16 num_paths_offset;
185 #define _(field,mask,item,length) \
186 if (clib_bitmap_get (fr->fields_to_send, field_index)) \
190 tmp = clib_host_to_net_u32((u32)record->field - (u32)record->chached_data_list->field);\
191 memcpy (b0->data + offset, &tmp, length); \
199 num_paths_offset =
offset;
224 (
u32) ((new_sum - old_sum) / (
trace->pkt_counter -
226 path->mean_delay = clib_host_to_net_u32 (
path->mean_delay);
229 path->mean_delay = 0;
231 path->bytes_counter =
233 path->bytes_counter = clib_host_to_net_u32 (
path->bytes_counter);
236 path->pkt_counter = clib_host_to_net_u32 (
path->pkt_counter);
239 for (j = 0; j <
trace->num_nodes; j++)
241 path->path[j].node_id =
242 clib_host_to_net_u32 (
trace->
path[j].node_id);
243 path->path[j].ingress_if =
244 clib_host_to_net_u16 (
trace->
path[j].ingress_if);
245 path->path[j].egress_if =
246 clib_host_to_net_u16 (
trace->
path[j].egress_if);
255 num_paths = clib_host_to_net_u16 (num_paths);
256 memcpy (b0->
data + num_paths_offset, &num_paths, sizeof (
u16));
279 u32 records_this_buffer;
299 record = aggregated_data +
i;
317 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
327 h->export_time = clib_host_to_net_u32 (((
u32) time (NULL)));
331 h->sequence_number = clib_host_to_net_u32 (
h->sequence_number);
332 next_offset = (
u32) (((
u8 *) (s + 1)) - (
u8 *) tp);
333 records_this_buffer = 0;
339 records_this_buffer++;
342 if (next_offset > (frm->
path_mtu - 250))
349 next_offset - (
sizeof (*
ip) +
353 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
360 new_l0 = clib_host_to_net_u16 ((
u16) next_offset);
417 case VNET_API_ERROR_NO_SUCH_ENTRY:
struct ioam_analyser_data_t_ * chached_data_list
Cache of previously analysed data, useful for export.
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
flow_report_main_t flow_report_main
seqno_rx_info seqno_data
Analysed iOAM seqno data.
static u32 ipfix_e_id_length(int e, u16 id, u16 length)
vl_api_ip_port_and_mask_t dst_port
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_frame_t * ioam_send_flows(flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_index)
#define clib_error_return(e, args...)
u32 pkt_counter
Num of pkts in the flow going over path.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
ioam_analyse_trace_record path_data[IOAM_MAX_PATHS_PER_FLOW]
#define IOAM_TRACE_MAX_NODES
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
struct clib_bihash_value offset
template key/value backing page structure
#define foreach_ioam_ipfix_field
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u16 ip4_tcp_udp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
#define IOAM_MAX_PATHS_PER_FLOW
#define vec_foreach_index(var, v)
Iterate over vector indices.
vnet_flow_data_callback_t * flow_data_callback
vl_api_ip_port_and_mask_t src_port
sll srl srl sll sra u16x4 i
#define IOAM_FLOW_TEMPLATE_ID
static u32 version_length(u16 length)
flow_report_stream_t * streams
#define CLIB_CACHE_LINE_BYTES
u8 * ioam_template_rewrite(flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port, ipfix_report_element_t *elts, u32 n_elts, u32 *stream_index)
u16 current_length
Nbytes between current data and the end of this buffer.
static u32 ipfix_id_count(u16 id, u16 count)
template key/value backing page structure
clib_error_t * ioam_flow_report_init(vlib_main_t *vm)
u16 ioam_analyse_add_ipfix_record(flow_report_t *fr, ioam_analyser_data_t *record, vlib_buffer_t *b0, u16 offset, ip6_address_t *src, ip6_address_t *dst, u16 src_port, u16 dst_port)
clib_spinlock_t writer_lock
Lock to since we use this to export the data in other thread.
#define VLIB_INIT_FUNCTION(x)
clib_error_t * ioam_flow_create(u8 del)
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define ip_csum_update(sum, old, new, type, field)
ioam_analyser_data_t * aggregated_data
This contains the aggregated data from the time VPP started analysing.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u16 ip4_header_checksum(ip4_header_t *i)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
ioam_analyse_trace_data trace_data
Analysed iOAM trace data.
static u32 ipfix_set_id_length(u16 set_id, u16 length)
int vnet_flow_report_add_del(flow_report_main_t *frm, vnet_flow_report_add_del_args_t *a, u16 *template_id)
Analysed iOAM trace data.
vl_api_address_union_t src_address
static u16 ip_csum_fold(ip_csum_t c)
vnet_flow_rewrite_callback_t * rewrite_callback
u32 mean_delay
Average Dealay for the flow.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
u32 bytes_counter
Num of bytes in the flow going over path.
ip6_ioam_analyser_main_t ioam_analyser_main
ipfix_template_packet_t ipfix