summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorBilly McFall <bmcfall@redhat.com>2016-10-14 09:51:49 -0400
committerChris Luke <chris_luke@comcast.com>2016-10-15 15:30:55 +0000
commitcfcf1e2c45d1f5da99f416e47c33031e573fecb6 (patch)
treeabe91379cb3df09d44d61356a282c2b769a93de1 /vnet
parent46529cda4bf08ca6cad46cce26eb83ede4e3d4d9 (diff)
VPP-488: Fix build errors, which uncovered IPv6 load balance lookup bug.
Change-Id: Id17fcb9154c5337908f29b7ce3a282b6a4b72d64 Signed-off-by: Billy McFall <bmcfall@redhat.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/adj/adj_glean.c4
-rw-r--r--vnet/vnet/adj/adj_midchain.c4
-rw-r--r--vnet/vnet/adj/adj_nbr.c8
-rw-r--r--vnet/vnet/dpo/drop_dpo.c4
-rw-r--r--vnet/vnet/dpo/load_balance.c8
-rw-r--r--vnet/vnet/dpo/lookup_dpo.c42
-rw-r--r--vnet/vnet/dpo/punt_dpo.c4
-rw-r--r--vnet/vnet/dpo/receive_dpo.c4
-rw-r--r--vnet/vnet/fib/fib_entry_src.c17
-rw-r--r--vnet/vnet/ip/ip4_source_and_port_range_check.c4
-rw-r--r--vnet/vnet/lisp-gpe/lisp_gpe_adjacency.c2
-rw-r--r--vnet/vnet/mpls/interface.c8
12 files changed, 74 insertions, 35 deletions
diff --git a/vnet/vnet/adj/adj_glean.c b/vnet/vnet/adj/adj_glean.c
index 290af1fddc8..d48cf21d24b 100644
--- a/vnet/vnet/adj/adj_glean.c
+++ b/vnet/vnet/adj/adj_glean.c
@@ -183,8 +183,8 @@ VNET_SW_INTERFACE_ADD_DEL_FUNCTION(adj_glean_interface_delete);
u8*
format_adj_glean (u8* s, va_list *ap)
{
- index_t index = va_arg(ap, index_t);
- CLIB_UNUSED(u32 indent) = va_arg(ap, u32);
+ index_t index = va_arg(*ap, index_t);
+ CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
vnet_main_t * vnm = vnet_get_main();
ip_adjacency_t * adj = adj_get(index);
diff --git a/vnet/vnet/adj/adj_midchain.c b/vnet/vnet/adj/adj_midchain.c
index f42e3a9072a..2fbedae2220 100644
--- a/vnet/vnet/adj/adj_midchain.c
+++ b/vnet/vnet/adj/adj_midchain.c
@@ -423,8 +423,8 @@ adj_nbr_midchain_stack (adj_index_t adj_index,
u8*
format_adj_midchain (u8* s, va_list *ap)
{
- index_t index = va_arg(ap, index_t);
- u32 indent = va_arg(ap, u32);
+ index_t index = va_arg(*ap, index_t);
+ u32 indent = va_arg(*ap, u32);
vnet_main_t * vnm = vnet_get_main();
ip_adjacency_t * adj = adj_get(index);
diff --git a/vnet/vnet/adj/adj_nbr.c b/vnet/vnet/adj/adj_nbr.c
index 5351520e7ed..7bc5310ed7a 100644
--- a/vnet/vnet/adj/adj_nbr.c
+++ b/vnet/vnet/adj/adj_nbr.c
@@ -782,8 +782,8 @@ adj_proto_to_46 (fib_protocol_t proto)
u8*
format_adj_nbr_incomplete (u8* s, va_list *ap)
{
- index_t index = va_arg(ap, index_t);
- CLIB_UNUSED(u32 indent) = va_arg(ap, u32);
+ index_t index = va_arg(*ap, index_t);
+ CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
vnet_main_t * vnm = vnet_get_main();
ip_adjacency_t * adj = adj_get(index);
@@ -803,8 +803,8 @@ format_adj_nbr_incomplete (u8* s, va_list *ap)
u8*
format_adj_nbr (u8* s, va_list *ap)
{
- index_t index = va_arg(ap, index_t);
- CLIB_UNUSED(u32 indent) = va_arg(ap, u32);
+ index_t index = va_arg(*ap, index_t);
+ CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
vnet_main_t * vnm = vnet_get_main();
ip_adjacency_t * adj = adj_get(index);
diff --git a/vnet/vnet/dpo/drop_dpo.c b/vnet/vnet/dpo/drop_dpo.c
index 048518c918b..26c3e8a06f2 100644
--- a/vnet/vnet/dpo/drop_dpo.c
+++ b/vnet/vnet/dpo/drop_dpo.c
@@ -52,8 +52,8 @@ drop_dpo_unlock (dpo_id_t *dpo)
static u8*
format_drop_dpo (u8 *s, va_list *ap)
{
- CLIB_UNUSED(index_t index) = va_arg(ap, index_t);
- CLIB_UNUSED(u32 indent) = va_arg(ap, u32);
+ CLIB_UNUSED(index_t index) = va_arg(*ap, index_t);
+ CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
return (format(s, "dpo-drop %U", format_dpo_proto, index));
}
diff --git a/vnet/vnet/dpo/load_balance.c b/vnet/vnet/dpo/load_balance.c
index 6badb0e7c38..8abfc436d67 100644
--- a/vnet/vnet/dpo/load_balance.c
+++ b/vnet/vnet/dpo/load_balance.c
@@ -148,16 +148,16 @@ load_balance_format (index_t lbi,
u8*
format_load_balance (u8 * s, va_list * args)
{
- index_t lbi = va_arg(args, index_t);
- load_balance_format_flags_t flags = va_arg(args, load_balance_format_flags_t);
+ index_t lbi = va_arg(*args, index_t);
+ load_balance_format_flags_t flags = va_arg(*args, load_balance_format_flags_t);
return (load_balance_format(lbi, flags, 0, s));
}
static u8*
format_load_balance_dpo (u8 * s, va_list * args)
{
- index_t lbi = va_arg(args, index_t);
- u32 indent = va_arg(args, u32);
+ index_t lbi = va_arg(*args, index_t);
+ u32 indent = va_arg(*args, u32);
return (load_balance_format(lbi, LOAD_BALANCE_FORMAT_DETAIL, indent, s));
}
diff --git a/vnet/vnet/dpo/lookup_dpo.c b/vnet/vnet/dpo/lookup_dpo.c
index f775417287c..ab3a7b905e4 100644
--- a/vnet/vnet/dpo/lookup_dpo.c
+++ b/vnet/vnet/dpo/lookup_dpo.c
@@ -456,7 +456,8 @@ always_inline uword
lookup_dpo_ip6_inline (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame,
- int input_src_addr)
+ int input_src_addr,
+ int table_from_interface)
{
vlib_combined_counter_main_t * cm = &load_balance_main.lbm_to_counters;
u32 n_left_from, next_index, * from, * to_next;
@@ -497,7 +498,21 @@ lookup_dpo_ip6_inline (vlib_main_t * vm,
/* dst lookup was done by ip6 lookup */
lkdi0 = vnet_buffer(b0)->ip.adj_index[VLIB_TX];
lkd0 = lookup_dpo_get(lkdi0);
- fib_index0 = lkd0->lkd_fib_index;
+
+ /*
+ * choose between a lookup using the fib index in the DPO
+ * or getting the FIB index from the interface.
+ */
+ if (table_from_interface)
+ {
+ fib_index0 =
+ ip4_fib_table_get_index_for_sw_if_index(
+ vnet_buffer(b0)->sw_if_index[VLIB_RX]);
+ }
+ else
+ {
+ fib_index0 = lkd0->lkd_fib_index;
+ }
/*
* choose between a source or destination address lookup in the table
@@ -559,7 +574,7 @@ lookup_ip6_dst (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{
- return (lookup_dpo_ip6_inline(vm, node, from_frame, 0 /*use src*/));
+ return (lookup_dpo_ip6_inline(vm, node, from_frame, 0 /*use src*/, 0));
}
VLIB_REGISTER_NODE (lookup_ip6_dst_node) = {
@@ -572,11 +587,28 @@ VLIB_REGISTER_NODE (lookup_ip6_dst_node) = {
VLIB_NODE_FUNCTION_MULTIARCH (lookup_ip6_dst_node, lookup_ip6_dst)
always_inline uword
+lookup_ip6_dst_itf (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
+{
+ return (lookup_dpo_ip6_inline(vm, node, from_frame, 0 /*use src*/, 1));
+}
+
+VLIB_REGISTER_NODE (lookup_ip6_dst_itf_node) = {
+ .function = lookup_ip6_dst_itf,
+ .name = "lookup-ip6-dst-itf",
+ .vector_size = sizeof (u32),
+ .format_trace = format_lookup_trace,
+ .sibling_of = "ip6-lookup",
+};
+VLIB_NODE_FUNCTION_MULTIARCH (lookup_ip6_dst_itf_node, lookup_ip6_dst_itf)
+
+always_inline uword
lookup_ip6_src (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{
- return (lookup_dpo_ip6_inline(vm, node, from_frame, 1 /*use src*/));
+ return (lookup_dpo_ip6_inline(vm, node, from_frame, 1, 0));
}
VLIB_REGISTER_NODE (lookup_ip6_src_node) = {
@@ -834,5 +866,5 @@ lookup_dpo_module_init (void)
lookup_dpo_sub_types[LOOKUP_SUB_TYPE_DST] =
dpo_register_new_type(&lkd_vft, lookup_dst_nodes);
lookup_dpo_sub_types[LOOKUP_SUB_TYPE_DST_TABLE_FROM_INTERFACE] =
- dpo_register_new_type(&lkd_vft, lookup_dst_nodes);
+ dpo_register_new_type(&lkd_vft, lookup_dst_from_interface_nodes);
}
diff --git a/vnet/vnet/dpo/punt_dpo.c b/vnet/vnet/dpo/punt_dpo.c
index e27a8ff3018..d1661dcc8e0 100644
--- a/vnet/vnet/dpo/punt_dpo.c
+++ b/vnet/vnet/dpo/punt_dpo.c
@@ -52,8 +52,8 @@ punt_dpo_unlock (dpo_id_t *dpo)
static u8*
format_punt_dpo (u8 *s, va_list *ap)
{
- CLIB_UNUSED(index_t index) = va_arg(ap, index_t);
- CLIB_UNUSED(u32 indent) = va_arg(ap, u32);
+ CLIB_UNUSED(index_t index) = va_arg(*ap, index_t);
+ CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
return (format(s, "dpo-punt"));
}
diff --git a/vnet/vnet/dpo/receive_dpo.c b/vnet/vnet/dpo/receive_dpo.c
index ad78850daf3..2b2571c6c83 100644
--- a/vnet/vnet/dpo/receive_dpo.c
+++ b/vnet/vnet/dpo/receive_dpo.c
@@ -97,8 +97,8 @@ receive_dpo_unlock (dpo_id_t *dpo)
static u8*
format_receive_dpo (u8 *s, va_list *ap)
{
- CLIB_UNUSED(index_t index) = va_arg(ap, index_t);
- CLIB_UNUSED(u32 indent) = va_arg(ap, u32);
+ CLIB_UNUSED(index_t index) = va_arg(*ap, index_t);
+ CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
vnet_main_t * vnm = vnet_get_main();
receive_dpo_t *rd;
diff --git a/vnet/vnet/fib/fib_entry_src.c b/vnet/vnet/fib/fib_entry_src.c
index 6ee966bd85f..99ac09e7978 100644
--- a/vnet/vnet/fib/fib_entry_src.c
+++ b/vnet/vnet/fib/fib_entry_src.c
@@ -34,6 +34,21 @@ fib_entry_get_proto (const fib_entry_t * fib_entry)
return (fib_entry->fe_prefix.fp_proto);
}
+static dpo_proto_t
+fib_entry_get_payload_proto (const fib_entry_t * fib_entry)
+{
+ switch (fib_entry->fe_prefix.fp_proto)
+ {
+ case FIB_PROTOCOL_IP4:
+ case FIB_PROTOCOL_IP6:
+ return fib_proto_to_dpo(fib_entry->fe_prefix.fp_proto);
+ case FIB_PROTOCOL_MPLS:
+ return fib_entry->fe_prefix.fp_payload_proto;
+ }
+
+ return (fib_entry->fe_prefix.fp_proto);
+}
+
void
fib_entry_src_register (fib_source_t source,
const fib_entry_src_vft_t *vft)
@@ -329,7 +344,7 @@ fib_entry_src_mk_lb (fib_entry_t *fib_entry,
.fct = fct,
};
- lb_proto = fib_proto_to_dpo(fib_entry_get_proto(fib_entry));
+ lb_proto = fib_entry_get_payload_proto(fib_entry);
fib_path_list_walk(esrc->fes_pl,
fib_entry_src_collect_forwarding,
diff --git a/vnet/vnet/ip/ip4_source_and_port_range_check.c b/vnet/vnet/ip/ip4_source_and_port_range_check.c
index c6037c48946..0c4d87c0ebc 100644
--- a/vnet/vnet/ip/ip4_source_and_port_range_check.c
+++ b/vnet/vnet/ip/ip4_source_and_port_range_check.c
@@ -864,8 +864,8 @@ VLIB_CLI_COMMAND (set_interface_ip_source_and_port_range_check_command, static)
static u8 *
format_ppr_dpo (u8 * s, va_list * args)
{
- index_t index = va_arg (args, index_t);
- CLIB_UNUSED (u32 indent) = va_arg (args, u32);
+ index_t index = va_arg (*args, index_t);
+ CLIB_UNUSED (u32 indent) = va_arg (*args, u32);
protocol_port_range_dpo_t *ppr_dpo;
int i, j;
diff --git a/vnet/vnet/lisp-gpe/lisp_gpe_adjacency.c b/vnet/vnet/lisp-gpe/lisp_gpe_adjacency.c
index 93a6d01326a..37a8b089755 100644
--- a/vnet/vnet/lisp-gpe/lisp_gpe_adjacency.c
+++ b/vnet/vnet/lisp-gpe/lisp_gpe_adjacency.c
@@ -446,7 +446,7 @@ format_lisp_gpe_adjacency (u8 * s, va_list * args)
{
lisp_gpe_adjacency_t *ladj = va_arg (*args, lisp_gpe_adjacency_t *);
lisp_gpe_adjacency_format_flags_t flags =
- va_arg (args, lisp_gpe_adjacency_format_flags_t);
+ va_arg (*args, lisp_gpe_adjacency_format_flags_t);
if (flags & LISP_GPE_ADJ_FORMAT_FLAG_DETAIL)
{
diff --git a/vnet/vnet/mpls/interface.c b/vnet/vnet/mpls/interface.c
index 553d7fb5f82..0baf2d3b127 100644
--- a/vnet/vnet/mpls/interface.c
+++ b/vnet/vnet/mpls/interface.c
@@ -497,14 +497,6 @@ VNET_HW_INTERFACE_CLASS (mpls_eth_hw_interface_class) = {
.flags = VNET_HW_INTERFACE_CLASS_FLAG_P2P,
};
-/**
- * A conversion of DPO next object tpyes to VLIB graph next nodes from
- * the mpls_post_rewrite node
- */
-static const int dpo_next_2_mpls_post_rewrite[DPO_LAST] = {
- [DPO_LOAD_BALANCE] = IP_LOOKUP_NEXT_LOAD_BALANCE,
-};
-
static void
mpls_gre_fixup (vlib_main_t *vm,
ip_adjacency_t *adj,
sa">u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF # IPs used in packet headers. self.p1_src_start_ip = u"10.0.0.0" self.p1_src_end_ip = u"10.7.161.31" self.p1_dst_start_ip = u"20.0.0.0" self.p1_dst_end_ip = u"20.7.161.31" self.p2_src_start_ip = u"20.0.0.0" self.p2_src_end_ip = u"20.7.161.31" self.p2_dst_start_ip = u"10.0.0.0" self.p2_dst_end_ip = u"10.7.161.31" def define_packets(self): """Defines the packets to be sent from the traffic generator. Packet definition: | ETH | IP | :returns: Packets to be sent from the traffic generator. :rtype: tuple """ # Direction 0 --> 1 base_pkt_a = ( Ether( src=self.p1_src_start_mac, dst=self.p1_dst_start_mac ) / IP( src=self.p1_src_start_ip, dst=self.p1_dst_start_ip, proto=61 ) ) # Direction 1 --> 0 base_pkt_b = ( Ether( src=self.p2_src_start_mac, dst=self.p2_dst_start_mac ) / IP( src=self.p2_src_start_ip, dst=self.p2_dst_start_ip, proto=61 ) ) # Direction 0 --> 1 vm1 = STLScVmRaw( [ STLVmFlowVar( name=u"mac_src", min_value=0, max_value=self.clients-1, size=4, op=u"inc" ), STLVmFlowVar( name=u"mac_dst", min_value=0, max_value=self.clients-1, size=4, op=u"inc" ), STLVmWrFlowVar( fv_name=u"mac_src", pkt_offset= 8 ), STLVmWrFlowVar( fv_name=u"mac_dst", pkt_offset= 2 ), STLVmFlowVar( name=u"ip_src", min_value=self.p1_src_start_ip, max_value=self.p1_src_end_ip, size=4, op=u"inc" ), STLVmWrFlowVar( fv_name=u"ip_src", pkt_offset=u"IP.src" ), STLVmFlowVar( name=u"ip_dst", min_value=self.p1_dst_start_ip, max_value=self.p1_dst_end_ip, size=4, op=u"inc" ), STLVmWrFlowVar( fv_name=u"ip_dst", pkt_offset=u"IP.dst" ), STLVmFixIpv4( offset=u"IP" ) ] ) # Direction 1 --> 0 vm2 = STLScVmRaw( [ STLVmFlowVar( name=u"mac_src", min_value=0, max_value=self.clients-1, size=4, op=u"inc" ), STLVmFlowVar( name=u"mac_dst", min_value=0, max_value=self.clients-1, size=4, op=u"inc" ), STLVmWrFlowVar( fv_name=u"mac_src", pkt_offset= 8 ), STLVmWrFlowVar( fv_name=u"mac_dst", pkt_offset= 2 ), STLVmFlowVar( name=u"ip_src", min_value=self.p2_src_start_ip, max_value=self.p2_src_end_ip, size=4, op=u"inc" ), STLVmWrFlowVar( fv_name=u"ip_src", pkt_offset=u"IP.src" ), STLVmFlowVar( name=u"ip_dst", min_value=self.p2_dst_start_ip, max_value=self.p2_dst_end_ip, size=4, op=u"inc" ), STLVmWrFlowVar( fv_name=u"ip_dst", pkt_offset=u"IP.dst" ), STLVmFixIpv4( offset=u"IP" ) ] ) return base_pkt_a, base_pkt_b, vm1, vm2 def register(): """Register this traffic profile to T-rex. Do not change this function. :return: Traffic streams. :rtype: Object """ return TrafficStreams()