55 want_enabled = want_enabled != 0;
91 VLIB_NODE_STATE_DISABLED : VLIB_NODE_STATE_POLLING));
105 s =
format (s,
"%Ubuffer 0x%x: %U",
120 u32 if_index = va_arg (*args,
u32);
203 .name =
"Packet generator",
234 u32 gso_size,
u8 coalesce_enabled)
258 rnd = (
u32) (now * 1e6);
273 if (coalesce_enabled)
341 if (i1 != 0 && n_bits_left > 0)
349 ASSERT ((v[i] & ~mask) == 0);
351 s[i0] |= v[
i] &
mask;
360 while (n_bits_left >= 8)
380 ASSERT ((v[i] & ~mask) == 0);
382 s[i0] |= v[
i] &
mask;
394 void *packet_data_mask)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static int pg_stream_is_enabled(pg_stream_t *s)
static int pg_mac_address_cmp(const mac_address_t *m1, const mac_address_t *m2)
#define hash_set(h, key, value)
vl_api_wireguard_peer_flags_t flags
mac_address_t * allowed_mcast_macs
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
vnet_main_t * vnet_get_main(void)
pg_edit_group_t * edit_groups
#define clib_memcpy_fast(a, b, c)
static f64 vlib_time_now(vlib_main_t *vm)
uword * stream_index_by_name
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
VNET_DEVICE_CLASS(pg_dev_class)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static clib_error_t * pg_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
#define hash_set_mem(h, key, value)
#define pool_is_free(P, E)
Use free bitmap to query whether given element is free.
pg_buffer_index_t * buffer_indices
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
pg_edit_type_t packet_size_edit_type
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
VNET_HW_INTERFACE_CLASS(pg_interface_class, static)
void pg_stream_change(pg_main_t *pg, pg_stream_t *s)
u8 * fixed_packet_data_mask
static pg_edit_group_t * pg_stream_get_group(pg_stream_t *s, u32 group_index)
gro_flow_table_t * flow_table
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
static u8 * format_pg_interface_name(u8 *s, va_list *args)
static uword pow2_mask(uword x)
u8 * fixed_packet_data_mask
static uword clib_bitmap_is_zero(uword *ai)
predicate function; is an entire bitmap empty?
description fragment has unexpected format
vnet_hw_interface_flags_t flags
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
uword * if_id_by_sw_if_index
void pg_stream_del(pg_main_t *pg, uword index)
#define PG_STREAM_FLAGS_IS_ENABLED
uword * if_index_by_if_id
static u32 pg_eth_flag_change(vnet_main_t *vnm, vnet_hw_interface_t *hi, u32 flags)
u32 last_increment_packet_size
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_unset_mem(h, key)
format_function_t format_vnet_buffer
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)
pg_edit_t * non_fixed_edits
static u64 pg_edit_get_value(pg_edit_t *e, int hi_or_lo)
static void pg_stream_free(pg_stream_t *s)
#define pool_put(P, E)
Free an object E in pool P.
#define vec_dup(V)
Return copy of vector (no header, no alignment)
vlib_node_function_t pg_output
#define vec_del1(v, i)
Delete the element at index I.
static_always_inline u32 vlib_buffer_get_default_data_size(vlib_main_t *vm)
static uword ethernet_address_cast(const u8 *a)
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
static u8 * pg_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
static_always_inline void gro_flow_table_free(gro_flow_table_t *flow_table)
static_always_inline u32 gro_flow_table_init(gro_flow_table_t **flow_table, u8 is_l2, u32 node_index)
void pg_edit_group_get_fixed_packet_data(pg_stream_t *s, u32 group_index, void *packet_data, void *packet_data_mask)
#define vec_search_with_function(v, E, fn)
Search a vector for the index of the entry that matches.
void pg_interface_enable_disable_coalesce(pg_interface_t *pi, u8 enable, u32 tx_node_index)
pg_edit_t * non_fixed_edits
u8 ** replay_packet_templates
vlib_main_t vlib_node_runtime_t * node
static void perform_fixed_edits(pg_stream_t *s)
manual_print typedef address
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
void pg_stream_enable_disable(pg_main_t *pg, pg_stream_t *s, int want_enabled)
u32 pg_interface_add_or_get(pg_main_t *pg, uword if_id, u8 gso_enabled, u32 gso_size, u8 coalesce_enabled)
void pg_stream_add(pg_main_t *pg, pg_stream_t *s_init)
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
#define clib_fifo_free(f)
static vlib_main_t * vlib_get_main(void)
vnet_l3_packet_type_t vnet_link_to_l3_proto(vnet_link_t link)
Convert a link to to an Ethertype.
static uword pg_edit_n_alloc_bytes(pg_edit_t *e)
static u8 * format_pg_output_trace(u8 *s, va_list *va)
u32 sw_if_index[VLIB_N_RX_TX]
#define hash_create_vec(elts, key_bytes, value_bytes)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * ethernet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, const u8 *address, u32 *hw_if_index_return, ethernet_flag_change_function_t flag_change)
static clib_error_t * pg_add_del_mac_address(vnet_hw_interface_t *hi, const u8 *address, u8 is_add)
#define hash_get_mem(h, key)
static void * clib_mem_alloc_aligned(uword size, uword align)
static void do_edit(pg_stream_t *stream, pg_edit_group_t *g, pg_edit_t *e, uword want_commit)
static u32 random_u32(u32 *seed)
32-bit random number generator
static u32 vlib_num_workers()
#define vec_foreach(var, vec)
Vector iterator.
static void pg_edit_free(pg_edit_t *e)
vnet_device_class_t pg_dev_class
static_always_inline int mac_address_cmp(const mac_address_t *a, const mac_address_t *b)
#define CLIB_CACHE_LINE_BYTES
pg_interface_t * interfaces
vl_api_interface_index_t sw_if_index
vlib_node_registration_t device_input_node
(constructor) VLIB_REGISTER_NODE (device_input_node)
static vlib_main_t * vlib_get_worker_vlib_main(u32 worker_index)