Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Classes | Enumerations | Functions
data_fwd.h File Reference
#include <vlib/buffer.h>
#include "pcs.h"
Include dependency graph for data_fwd.h:

Go to the source code of this file.

Classes

struct  hicn_data_fwd_trace_t
 

Enumerations

enum  hicn_data_fwd_next_t {
  HICN_DATA_FWD_NEXT_V4_LOOKUP, HICN_DATA_FWD_NEXT_V6_LOOKUP, HICN_DATA_FWD_NEXT_IFACE4_OUT, HICN_DATA_FWD_NEXT_IFACE6_OUT,
  HICN_DATA_FWD_NEXT_ERROR_DROP, HICN_DATA_FWD_N_NEXT
}
 

Functions

always_inline u16 vlib_buffer_clone_256_2 (vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
 Create a maximum of 256 clones of buffer and store them in the supplied array. Unlike the original function in the vlib library, we don't prevent cloning if n_buffer==1 and if s->current_length <= head_end_offset + CLIB_CACHE_LINE_BYTES * 2. More...
 
always_inline u16 vlib_buffer_clone2 (vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
 Create multiple clones of buffer and store them in the supplied array. Unlike the function in the vlib library, we allow src_buffer to have ref_count != 0. More...
 

Detailed Description

This is the node encoutered by data packets after the hicn-data-pcslookup. This node has two goals: 1) clone/copy the vlib buffer as many time as the number of faces stored in the pit entry, 2) store a clone/copy of the vlib buffer in the CS. Unless there are memory issue (no more vlib buffer available to perform cloning/copy), a single vlib buffer received might results in several vlib buffer sent to the next vlib node (hicn4-iface-output or hicn6-iface-output).

It must be noted that cloning is possible only if the lentgh of the data pointed by the vlib buffer is at least 256 bytes. This is due to an imposition in the vpp source code. In all the other cases the vlib buffer is copied. Cloning is performed by advancing the vlib buffer of 256 bytes and a new vlib buffer is created and chained in from of the received buffer. Additionally, the 256 bytes removed (advanced) from the received vlib buffer are copied in the head vlib buffer. In case of multiple cloning for the same vlib buffer, this mechanism allows us to have a different hICN header for each clone (+ the same additional bytes due to the vpp restriction on cloning).

Function Documentation

◆ vlib_buffer_clone2()

always_inline u16 vlib_buffer_clone2 ( vlib_main_t *  vm,
u32  src_buffer,
u32 *  buffers,
u16  n_buffers,
u16  head_end_offset 
)

Create multiple clones of buffer and store them in the supplied array. Unlike the function in the vlib library, we allow src_buffer to have ref_count != 0.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
src_buffer- (u32) source buffer index
buffers- (u32 * ) buffer index array
n_buffers- (u16) number of buffer clones requested (<=256)
head_end_offset- (u16) offset relative to current position where packet head ends
Returns
- (u16) number of buffers actually cloned, may be less than the number requested or zero

◆ vlib_buffer_clone_256_2()

always_inline u16 vlib_buffer_clone_256_2 ( vlib_main_t *  vm,
u32  src_buffer,
u32 *  buffers,
u16  n_buffers,
u16  head_end_offset 
)

Create a maximum of 256 clones of buffer and store them in the supplied array. Unlike the original function in the vlib library, we don't prevent cloning if n_buffer==1 and if s->current_length <= head_end_offset + CLIB_CACHE_LINE_BYTES * 2.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
src_buffer- (u32) source buffer index
buffers- (u32 * ) buffer index array
n_buffers- (u16) number of buffer clones requested (<=256)
head_end_offset- (u16) offset relative to current position where packet head ends
Returns
- (u16) number of buffers actually cloned, may be less than the number requested or zero