20 #include <vnet/devices/pci/ixgev.h> 21 #include <vnet/devices/pci/ixge.h> 22 #include <vnet/devices/pci/ige.h> 34 #define foreach_l2t_l2_error \ 35 _(NETWORK_TO_USER, "L2 network to user (ip6) pkts") 38 #define _(sym,string) string, 44 #define _(sym,str) L2T_L2_ERROR_##sym, 83 uword vlan_and_sw_if_index_key;
101 p =
hash_get (lm->session_by_vlan_and_rx_sw_if_index,
102 vlan_and_sw_if_index_key);
109 session_index = p[0];
130 l2tpv3_header_t * l2t;
135 u16 payload_ethertype;
136 u8 dst_mac_address[6];
137 u8 src_mac_address[6];
147 em->
counters[node_counter_base_index + L2T_L2_ERROR_NETWORK_TO_USER] += 1;
162 #define _(i) dst_mac_address[i] = eh->dst_address[i]; 163 _(0) _(1) _(2) _(3) _(4) _(5);
165 #define _(i) src_mac_address[i] = eh->src_address[i]; 166 _(0) _(1) _(2) _(3) _(4) _(5);
169 payload_ethertype = vh->
type;
176 #define _(i) eh->dst_address[i] = dst_mac_address[i]; 177 _(0) _(1) _(2) _(3) _(4) _(5);
179 #define _(i) eh->src_address[i] = src_mac_address[i]; 180 _(0) _(1) _(2) _(3) _(4) _(5);
182 eh->
type = payload_ethertype;
185 backup =
sizeof(*l2t);
199 l2t->l2_specific_sublayer = 0;
207 clib_host_to_net_u32 (0x6<<28);
211 payload_length -=
sizeof (*ip6);
230 return dispatch_pipeline (vm, node, frame);
235 .name =
"l2t-l2-input",
236 .vector_size =
sizeof (
u32),
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
always_inline vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
ip6_address_t our_address
struct _vlib_node_registration vlib_node_registration_t
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
static u32 session_index_to_counter_index(u32 session_index, u32 counter_id)
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static char * l2t_l2_error_strings[]
ip6_address_t client_address
static void stage0(vlib_main_t *vm, vlib_node_runtime_t *node, u32 buffer_index)
always_inline void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
always_inline uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
vlib_node_registration_t l2t_l2_node
(constructor) VLIB_REGISTER_NODE (l2t_l2_node)
#define foreach_l2t_l2_error
#define pool_elt_at_index(p, i)
vlib_error_main_t error_main
u8 * format_l2t_trace(u8 *s, va_list *args)
always_inline void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
#define CLIB_PREFETCH(addr, size, type)
vlib_combined_counter_main_t counter_main
always_inline void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static uword l2t_l2_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
#define CLIB_CACHE_LINE_BYTES
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
always_inline u32 counter_index(vlib_main_t *vm, vlib_error_t e)