summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/bonding/node.c2
-rw-r--r--src/vnet/dhcp/dhcp_client_detect.c15
-rw-r--r--src/vnet/dpo/dvr_dpo.c9
-rw-r--r--src/vnet/ethernet/p2p_ethernet_input.c6
-rw-r--r--src/vnet/feature/feature.h8
-rw-r--r--src/vnet/geneve/decap.c9
-rw-r--r--src/vnet/interface_stats.c2
-rw-r--r--src/vnet/ip/ip4_reassembly.c3
-rw-r--r--src/vnet/ip/ip4_source_and_port_range_check.c3
-rw-r--r--src/vnet/ip/ip4_source_check.c15
-rw-r--r--src/vnet/ip/ip6_reassembly.c3
-rw-r--r--src/vnet/ipsec/ipsec.h3
-rw-r--r--src/vnet/ipsec/ipsec_input.c10
-rw-r--r--src/vnet/l2tp/decap.c2
-rw-r--r--src/vnet/qos/qos_mark.c2
-rw-r--r--src/vnet/qos/qos_record.c5
-rw-r--r--src/vnet/span/node.c6
-rw-r--r--src/vnet/vxlan-gpe/decap.c9
-rw-r--r--src/vnet/vxlan/decap.c6
19 files changed, 42 insertions, 76 deletions
diff --git a/src/vnet/bonding/node.c b/src/vnet/bonding/node.c
index 7abd7b0de32..ba3e8e32a36 100644
--- a/src/vnet/bonding/node.c
+++ b/src/vnet/bonding/node.c
@@ -169,7 +169,7 @@ bond_update_next (vlib_main_t * vm, vlib_node_runtime_t * node,
*bond_sw_if_index = bif->sw_if_index;
*error = 0;
- vnet_feature_next ( /* not used */ 0, next_index, b);
+ vnet_feature_next (next_index, b);
}
VLIB_NODE_FN (bond_input_node) (vlib_main_t * vm,
diff --git a/src/vnet/dhcp/dhcp_client_detect.c b/src/vnet/dhcp/dhcp_client_detect.c
index f9ba4fee4d2..de2702df398 100644
--- a/src/vnet/dhcp/dhcp_client_detect.c
+++ b/src/vnet/dhcp/dhcp_client_detect.c
@@ -131,14 +131,10 @@ dhcp_client_detect_node_fn (vlib_main_t * vm,
ip2 = vlib_buffer_get_current (b2);
ip3 = vlib_buffer_get_current (b2);
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_TX],
- &next0, b0);
- vnet_feature_next (vnet_buffer (b1)->sw_if_index[VLIB_TX],
- &next1, b1);
- vnet_feature_next (vnet_buffer (b2)->sw_if_index[VLIB_TX],
- &next2, b2);
- vnet_feature_next (vnet_buffer (b3)->sw_if_index[VLIB_TX],
- &next3, b3);
+ vnet_feature_next (&next0, b0);
+ vnet_feature_next (&next1, b1);
+ vnet_feature_next (&next2, b2);
+ vnet_feature_next (&next3, b3);
if (ip0->protocol == IP_PROTOCOL_UDP)
{
@@ -237,8 +233,7 @@ dhcp_client_detect_node_fn (vlib_main_t * vm,
* assigned) we are looking for the preverbial needle in the haystack
* so assume the packet is not the one we are looking for.
*/
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_TX],
- &next0, b0);
+ vnet_feature_next (&next0, b0);
/*
* all we are looking for here is DHCP/BOOTP packet-to-client
diff --git a/src/vnet/dpo/dvr_dpo.c b/src/vnet/dpo/dvr_dpo.c
index 39a8a631ebd..4b440f81c59 100644
--- a/src/vnet/dpo/dvr_dpo.c
+++ b/src/vnet/dpo/dvr_dpo.c
@@ -473,14 +473,12 @@ dvr_reinject_inline (vlib_main_t * vm,
if (b0->flags & VNET_BUFFER_F_IS_DVR)
next0 = DVR_REINJECT_OUTPUT;
else
- vnet_feature_next(vnet_buffer(b0)->sw_if_index[VLIB_TX],
- &next0, b0);
+ vnet_feature_next( &next0, b0);
if (b1->flags & VNET_BUFFER_F_IS_DVR)
next1 = DVR_REINJECT_OUTPUT;
else
- vnet_feature_next(vnet_buffer(b1)->sw_if_index[VLIB_TX],
- &next1, b1);
+ vnet_feature_next( &next1, b1);
if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
{
@@ -520,8 +518,7 @@ dvr_reinject_inline (vlib_main_t * vm,
if (b0->flags & VNET_BUFFER_F_IS_DVR)
next0 = DVR_REINJECT_OUTPUT;
else
- vnet_feature_next(vnet_buffer(b0)->sw_if_index[VLIB_TX],
- &next0, b0);
+ vnet_feature_next( &next0, b0);
if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
{
diff --git a/src/vnet/ethernet/p2p_ethernet_input.c b/src/vnet/ethernet/p2p_ethernet_input.c
index 74e3bb883cf..2cae97d7ba9 100644
--- a/src/vnet/ethernet/p2p_ethernet_input.c
+++ b/src/vnet/ethernet/p2p_ethernet_input.c
@@ -107,8 +107,8 @@ p2p_ethernet_input_node_fn (vlib_main_t * vm,
en1 = vlib_buffer_get_current (b1);
sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_RX];
- vnet_feature_next (sw_if_index0, &next0, b0);
- vnet_feature_next (sw_if_index1, &next1, b1);
+ vnet_feature_next (&next0, b0);
+ vnet_feature_next (&next1, b1);
rx0 = p2p_ethernet_lookup (sw_if_index0, en0->src_address);
rx1 = p2p_ethernet_lookup (sw_if_index1, en1->src_address);
@@ -186,7 +186,7 @@ p2p_ethernet_input_node_fn (vlib_main_t * vm,
en0 = vlib_buffer_get_current (b0);
sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
- vnet_feature_next (sw_if_index0, &next0, b0);
+ vnet_feature_next (&next0, b0);
rx0 = p2p_ethernet_lookup (sw_if_index0, en0->src_address);
if (rx0 != ~0)
diff --git a/src/vnet/feature/feature.h b/src/vnet/feature/feature.h
index 66ee97c87d6..88a919f083a 100644
--- a/src/vnet/feature/feature.h
+++ b/src/vnet/feature/feature.h
@@ -221,8 +221,8 @@ vnet_feature_arc_start (u8 arc, u32 sw_if_index, u32 * next0,
}
static_always_inline void *
-vnet_feature_next_with_data (u32 sw_if_index, u32 * next0,
- vlib_buffer_t * b0, u32 n_data_bytes)
+vnet_feature_next_with_data (u32 * next0, vlib_buffer_t * b0,
+ u32 n_data_bytes)
{
vnet_feature_main_t *fm = &feature_main;
u8 arc = vnet_buffer (b0)->feature_arc_index;
@@ -234,9 +234,9 @@ vnet_feature_next_with_data (u32 sw_if_index, u32 * next0,
}
static_always_inline void
-vnet_feature_next (u32 sw_if_index, u32 * next0, vlib_buffer_t * b0)
+vnet_feature_next (u32 * next0, vlib_buffer_t * b0)
{
- vnet_feature_next_with_data (sw_if_index, next0, b0, 0);
+ vnet_feature_next_with_data (next0, b0, 0);
}
static_always_inline int
diff --git a/src/vnet/geneve/decap.c b/src/vnet/geneve/decap.c
index b17c6da07ae..f525fa323a6 100644
--- a/src/vnet/geneve/decap.c
+++ b/src/vnet/geneve/decap.c
@@ -943,10 +943,8 @@ ip_geneve_bypass_inline (vlib_main_t * vm,
}
/* Setup packet for next IP feature */
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_RX], &next0,
- b0);
- vnet_feature_next (vnet_buffer (b1)->sw_if_index[VLIB_RX], &next1,
- b1);
+ vnet_feature_next (&next0, b0);
+ vnet_feature_next (&next1, b1);
if (is_ip4)
{
@@ -1161,8 +1159,7 @@ ip_geneve_bypass_inline (vlib_main_t * vm,
ip60 = vlib_buffer_get_current (b0);
/* Setup packet for next IP feature */
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_RX], &next0,
- b0);
+ vnet_feature_next (&next0, b0);
if (is_ip4)
/* Treat IP4 frag packets as "experimental" protocol for now
diff --git a/src/vnet/interface_stats.c b/src/vnet/interface_stats.c
index 1b07552727c..969f8930350 100644
--- a/src/vnet/interface_stats.c
+++ b/src/vnet/interface_stats.c
@@ -121,7 +121,7 @@ stats_collect_inline (vlib_main_t * vm,
stats_n_bytes[b0_ctype] += vlib_buffer_length_in_chain (vm, b0);
stats_n_packets[b0_ctype] += 1;
- vnet_feature_next (sw_if_index, &next0, b0);
+ vnet_feature_next (&next0, b0);
vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
n_left_to_next, bi0, next0);
diff --git a/src/vnet/ip/ip4_reassembly.c b/src/vnet/ip/ip4_reassembly.c
index 2c9aabd20ac..a88ee2f3e84 100644
--- a/src/vnet/ip/ip4_reassembly.c
+++ b/src/vnet/ip/ip4_reassembly.c
@@ -961,8 +961,7 @@ ip4_reassembly_inline (vlib_main_t * vm,
n_left_to_next -= 1;
if (is_feature && IP4_ERROR_NONE == error0)
{
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_RX],
- &next0, b0);
+ vnet_feature_next (&next0, b0);
}
vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
n_left_to_next, bi0, next0);
diff --git a/src/vnet/ip/ip4_source_and_port_range_check.c b/src/vnet/ip/ip4_source_and_port_range_check.c
index 2889a899678..1f9a32ea108 100644
--- a/src/vnet/ip/ip4_source_and_port_range_check.c
+++ b/src/vnet/ip/ip4_source_and_port_range_check.c
@@ -449,8 +449,7 @@ ip4_source_and_port_range_check_inline (vlib_main_t * vm,
ip0 = vlib_buffer_get_current (b0);
- c0 = vnet_feature_next_with_data (sw_if_index0, &next0,
- b0, sizeof (c0[0]));
+ c0 = vnet_feature_next_with_data (&next0, b0, sizeof (c0[0]));
/* we can't use the default VRF here... */
for (i = 0; i < IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS; i++)
diff --git a/src/vnet/ip/ip4_source_check.c b/src/vnet/ip/ip4_source_check.c
index 25c51275920..2e4226f2108 100644
--- a/src/vnet/ip/ip4_source_check.c
+++ b/src/vnet/ip/ip4_source_check.c
@@ -150,14 +150,8 @@ ip4_source_check_inline (vlib_main_t * vm,
ip0 = vlib_buffer_get_current (p0);
ip1 = vlib_buffer_get_current (p1);
- c0 =
- vnet_feature_next_with_data (vnet_buffer (p0)->sw_if_index
- [VLIB_RX], &next0, p0,
- sizeof (c0[0]));
- c1 =
- vnet_feature_next_with_data (vnet_buffer (p1)->sw_if_index
- [VLIB_RX], &next1, p1,
- sizeof (c1[0]));
+ c0 = vnet_feature_next_with_data (&next0, p0, sizeof (c0[0]));
+ c1 = vnet_feature_next_with_data (&next1, p1, sizeof (c1[0]));
mtrie0 = &ip4_fib_get (c0->fib_index)->mtrie;
mtrie1 = &ip4_fib_get (c1->fib_index)->mtrie;
@@ -234,10 +228,7 @@ ip4_source_check_inline (vlib_main_t * vm,
p0 = vlib_get_buffer (vm, pi0);
ip0 = vlib_buffer_get_current (p0);
- c0 =
- vnet_feature_next_with_data (vnet_buffer (p0)->sw_if_index
- [VLIB_RX], &next0, p0,
- sizeof (c0[0]));
+ c0 = vnet_feature_next_with_data (&next0, p0, sizeof (c0[0]));
mtrie0 = &ip4_fib_get (c0->fib_index)->mtrie;
diff --git a/src/vnet/ip/ip6_reassembly.c b/src/vnet/ip/ip6_reassembly.c
index e84daf6a21c..72df29c361d 100644
--- a/src/vnet/ip/ip6_reassembly.c
+++ b/src/vnet/ip/ip6_reassembly.c
@@ -990,8 +990,7 @@ ip6_reassembly_inline (vlib_main_t * vm,
n_left_to_next -= 1;
if (is_feature && IP6_ERROR_NONE == error0)
{
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_RX],
- &next0, b0);
+ vnet_feature_next (&next0, b0);
}
vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
n_left_to_next, bi0, next0);
diff --git a/src/vnet/ipsec/ipsec.h b/src/vnet/ipsec/ipsec.h
index d1aedb1af9d..4d066c381ba 100644
--- a/src/vnet/ipsec/ipsec.h
+++ b/src/vnet/ipsec/ipsec.h
@@ -378,11 +378,10 @@ get_next_output_feature_node_index (vlib_buffer_t * b,
vlib_node_runtime_t * nr)
{
u32 next;
- u32 sw_if_index = vnet_buffer (b)->sw_if_index[VLIB_TX];
vlib_main_t *vm = vlib_get_main ();
vlib_node_t *node = vlib_get_node (vm, nr->node_index);
- vnet_feature_next (sw_if_index, &next, b);
+ vnet_feature_next (&next, b);
return node->next_nodes[next];
}
diff --git a/src/vnet/ipsec/ipsec_input.c b/src/vnet/ipsec/ipsec_input.c
index d61755597ba..b7bb07bf051 100644
--- a/src/vnet/ipsec/ipsec_input.c
+++ b/src/vnet/ipsec/ipsec_input.c
@@ -209,10 +209,7 @@ ipsec_input_ip4_node_fn (vlib_main_t * vm,
b0 = vlib_get_buffer (vm, bi0);
b0->flags |= VNET_BUFFER_F_IS_IP4;
b0->flags &= ~VNET_BUFFER_F_IS_IP6;
- c0 =
- vnet_feature_next_with_data (vnet_buffer (b0)->sw_if_index
- [VLIB_RX], &next0, b0,
- sizeof (c0[0]));
+ c0 = vnet_feature_next_with_data (&next0, b0, sizeof (c0[0]));
spd0 = pool_elt_at_index (im->spds, c0->spd_index);
@@ -393,10 +390,7 @@ VLIB_NODE_FUNCTION_MULTIARCH (ipsec_input_ip4_node, ipsec_input_ip4_node_fn)
b0 = vlib_get_buffer (vm, bi0);
b0->flags |= VNET_BUFFER_F_IS_IP6;
b0->flags &= ~VNET_BUFFER_F_IS_IP4;
- c0 =
- vnet_feature_next_with_data (vnet_buffer (b0)->sw_if_index
- [VLIB_RX], &next0, b0,
- sizeof (c0[0]));
+ c0 = vnet_feature_next_with_data (&next0, b0, sizeof (c0[0]));
spd0 = pool_elt_at_index (im->spds, c0->spd_index);
diff --git a/src/vnet/l2tp/decap.c b/src/vnet/l2tp/decap.c
index 4610412954d..304862b5ee6 100644
--- a/src/vnet/l2tp/decap.c
+++ b/src/vnet/l2tp/decap.c
@@ -219,7 +219,7 @@ done:
{
/* Go to next node on the ip6 configuration chain */
if (PREDICT_TRUE (session != 0))
- vnet_feature_next (session->sw_if_index, &next_index, b);
+ vnet_feature_next (&next_index, b);
}
}
diff --git a/src/vnet/qos/qos_mark.c b/src/vnet/qos/qos_mark.c
index 5dc87e8ef81..38c66cba40c 100644
--- a/src/vnet/qos/qos_mark.c
+++ b/src/vnet/qos/qos_mark.c
@@ -180,7 +180,7 @@ qos_mark_inline (vlib_main_t * vm,
ethernet_vlan_header_set_priority_net_order (vlan0, qos0);
}
}
- vnet_feature_next (sw_if_index0, &next0, b0);
+ vnet_feature_next (&next0, b0);
if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
{
diff --git a/src/vnet/qos/qos_record.c b/src/vnet/qos/qos_record.c
index b05cfe670b5..fb235e09735 100644
--- a/src/vnet/qos/qos_record.c
+++ b/src/vnet/qos/qos_record.c
@@ -138,7 +138,7 @@ qos_record_inline (vlib_main_t * vm,
ip4_header_t *ip4_0;
ip6_header_t *ip6_0;
vlib_buffer_t *b0;
- u32 sw_if_index0, next0, bi0;
+ u32 next0, bi0;
qos_bits_t qos0;
u8 l2_len;
@@ -184,7 +184,6 @@ qos_record_inline (vlib_main_t * vm,
vnet_buffer2 (b0)->qos.bits = qos0;
vnet_buffer2 (b0)->qos.source = QOS_SOURCE_IP;
b0->flags |= VNET_BUFFER_F_QOS_DATA_VALID;
- sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) &&
(b0->flags & VLIB_BUFFER_IS_TRACED)))
@@ -203,7 +202,7 @@ qos_record_inline (vlib_main_t * vm,
L2INPUT_FEAT_L2_IP_QOS_RECORD);
}
else
- vnet_feature_next (sw_if_index0, &next0, b0);
+ vnet_feature_next (&next0, b0);
/* verify speculative enqueue, maybe switch current next frame */
vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
diff --git a/src/vnet/span/node.c b/src/vnet/span/node.c
index 13e92abd5eb..4ac3a1db496 100644
--- a/src/vnet/span/node.c
+++ b/src/vnet/span/node.c
@@ -201,8 +201,8 @@ span_node_inline_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
break;
case SPAN_FEAT_DEVICE:
default:
- vnet_feature_next (sw_if_index0, &next0, b0);
- vnet_feature_next (sw_if_index1, &next1, b1);
+ vnet_feature_next (&next0, b0);
+ vnet_feature_next (&next1, b1);
break;
}
@@ -242,7 +242,7 @@ span_node_inline_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
break;
case SPAN_FEAT_DEVICE:
default:
- vnet_feature_next (sw_if_index0, &next0, b0);
+ vnet_feature_next (&next0, b0);
break;
}
diff --git a/src/vnet/vxlan-gpe/decap.c b/src/vnet/vxlan-gpe/decap.c
index 29a043fe9d4..975323df5da 100644
--- a/src/vnet/vxlan-gpe/decap.c
+++ b/src/vnet/vxlan-gpe/decap.c
@@ -857,10 +857,8 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
}
/* Setup packet for next IP feature */
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_RX], &next0,
- b0);
- vnet_feature_next (vnet_buffer (b1)->sw_if_index[VLIB_RX], &next1,
- b1);
+ vnet_feature_next (&next0, b0);
+ vnet_feature_next (&next1, b1);
if (is_ip4)
{
@@ -1073,8 +1071,7 @@ ip_vxlan_gpe_bypass_inline (vlib_main_t * vm,
ip60 = vlib_buffer_get_current (b0);
/* Setup packet for next IP feature */
- vnet_feature_next (vnet_buffer (b0)->sw_if_index[VLIB_RX], &next0,
- b0);
+ vnet_feature_next (&next0, b0);
if (is_ip4)
proto0 = ip40->protocol;
diff --git a/src/vnet/vxlan/decap.c b/src/vnet/vxlan/decap.c
index f91180128d1..20df5e2c131 100644
--- a/src/vnet/vxlan/decap.c
+++ b/src/vnet/vxlan/decap.c
@@ -578,8 +578,8 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
}
/* Setup packet for next IP feature */
- vnet_feature_next(vnet_buffer(b0)->sw_if_index[VLIB_RX], &next0, b0);
- vnet_feature_next(vnet_buffer(b1)->sw_if_index[VLIB_RX], &next1, b1);
+ vnet_feature_next(&next0, b0);
+ vnet_feature_next(&next1, b1);
if (is_ip4)
{
@@ -786,7 +786,7 @@ ip_vxlan_bypass_inline (vlib_main_t * vm,
ip60 = vlib_buffer_get_current (b0);
/* Setup packet for next IP feature */
- vnet_feature_next(vnet_buffer(b0)->sw_if_index[VLIB_RX], &next0, b0);
+ vnet_feature_next(&next0, b0);
if (is_ip4)
/* Treat IP4 frag packets as "experimental" protocol for now