1 #ifndef __included_dpdk_replication_h__ 2 #define __included_dpdk_replication_h__ 18 u32 new_buffers_needed = 1;
19 unsigned socket_id = rte_socket_id();
20 struct rte_mempool *rmp = vm->
buffer_main->pktmbuf_pools[socket_id];
21 struct rte_mbuf *rte_mbufs[5];
24 u8 * copy_src, * copy_dst;
36 new_buffers_needed ++;
47 if (rte_mempool_get_bulk (rmp, (
void **)rte_mbufs,
48 new_buffers_needed) < 0)
52 rv = dst_buf = vlib_buffer_from_rte_mbuf(rte_mbufs[0]);
57 for (i = 0; i < new_buffers_needed; i++)
75 if (i < new_buffers_needed - 1)
78 dst_buf = vlib_buffer_from_rte_mbuf(rte_mbufs[i+1]);
80 copy_src = src_buf->
data;
81 copy_dst = dst_buf->
data;
87 if (rte_mempool_get_bulk (rmp, (
void **)rte_mbufs, 1) < 0)
90 rv = vlib_buffer_from_rte_mbuf(rte_mbufs[0]);
sll srl srl sll sra u16x4 i
vlib_buffer_main_t * buffer_main
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define clib_warning(format, args...)
always_inline vlib_buffer_free_list_t * vlib_buffer_get_free_list(vlib_main_t *vm, u32 free_list_index)
#define VLIB_BUFFER_NEXT_PRESENT
u16 current_length
Nbytes between current data and the end of this buffer.
#define clib_memcpy(a, b, c)
#define VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX
u32 next_buffer
Next buffer for this linked-list of buffers.
always_inline void vlib_buffer_init_for_free_list(vlib_buffer_t *_dst, vlib_buffer_free_list_t *fl)
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
static vlib_buffer_t * vlib_dpdk_clone_buffer(vlib_main_t *vm, vlib_buffer_t *b)
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.