summaryrefslogtreecommitdiffstats
path: root/plugins/lb-plugin/lb/node.c
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2016-08-11 16:04:05 +0100
committerPierre Pfister <ppfister@cisco.com>2016-08-11 16:04:05 +0100
commit63048844682c3b99a5a1de28649ab9b595905959 (patch)
tree280aee15ae8b2bf76687993175637023ccef41d4 /plugins/lb-plugin/lb/node.c
parent5bcb3391f9eee85b4edcc0e42649ffeeea2dd997 (diff)
VPP-130: LoadBal: Add lookup bypass and fix adjacency format function
Change-Id: Ib83c6ba04c41dbb80603c6a08c324d71eb44a102 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'plugins/lb-plugin/lb/node.c')
-rw-r--r--plugins/lb-plugin/lb/node.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/lb-plugin/lb/node.c b/plugins/lb-plugin/lb/node.c
index 4d598104..8df462c0 100644
--- a/plugins/lb-plugin/lb/node.c
+++ b/plugins/lb-plugin/lb/node.c
@@ -38,6 +38,7 @@ static char *lb_error_strings[] = {
typedef enum {
LB_NEXT_LOOKUP,
+ LB_NEXT_REWRITE,
LB_NEXT_DROP,
LB_N_NEXT,
} lb_next_t;
@@ -47,14 +48,14 @@ typedef struct {
u32 as_index;
} lb_trace_t;
-u8 *lb_format_adjacency(u8 * s,
- struct ip_lookup_main_t * lm,
- ip_adjacency_t *adj)
+u8 *lb_format_adjacency(u8 * s, va_list * va)
{
lb_main_t *lbm = &lb_main;
+ __attribute((unused)) ip_lookup_main_t *lm = va_arg (*va, ip_lookup_main_t *);
+ ip_adjacency_t *adj = va_arg (*va, ip_adjacency_t *);
lb_adj_data_t *ad = (lb_adj_data_t *) &adj->opaque;
__attribute__((unused)) lb_vip_t *vip = pool_elt_at_index (lbm->vips, ad->vip_index);
- return format(s, "idx:%d", ad->vip_index);
+ return format(s, "vip idx:%d", ad->vip_index);
}
u8 *
@@ -251,6 +252,9 @@ lb_node_fn (vlib_main_t * vm,
clib_host_to_net_u16(0x0800):
clib_host_to_net_u16(0x86DD);
+ vnet_buffer(p0)->ip.adj_index[VLIB_TX] = as0->adj_index;
+ next0 = (as0->adj_index != ~0)?LB_NEXT_REWRITE:next0;
+
if (PREDICT_FALSE (p0->flags & VLIB_BUFFER_IS_TRACED))
{
lb_trace_t *tr = vlib_add_trace (vm, node, p0, sizeof (*tr));
@@ -310,6 +314,7 @@ VLIB_REGISTER_NODE (lb6_gre6_node) =
.next_nodes =
{
[LB_NEXT_LOOKUP] = "ip6-lookup",
+ [LB_NEXT_REWRITE] = "ip6-rewrite",
[LB_NEXT_DROP] = "error-drop"
},
};
@@ -334,6 +339,7 @@ VLIB_REGISTER_NODE (lb6_gre4_node) =
.next_nodes =
{
[LB_NEXT_LOOKUP] = "ip4-lookup",
+ [LB_NEXT_REWRITE]= "ip4-rewrite-transit",
[LB_NEXT_DROP] = "error-drop"
},
};
@@ -358,6 +364,7 @@ VLIB_REGISTER_NODE (lb4_gre6_node) =
.next_nodes =
{
[LB_NEXT_LOOKUP] = "ip6-lookup",
+ [LB_NEXT_REWRITE] = "ip6-rewrite",
[LB_NEXT_DROP] = "error-drop"
},
};
@@ -382,6 +389,7 @@ VLIB_REGISTER_NODE (lb4_gre4_node) =
.next_nodes =
{
[LB_NEXT_LOOKUP] = "ip4-lookup",
+ [LB_NEXT_REWRITE]= "ip4-rewrite-transit",
[LB_NEXT_DROP] = "error-drop"
},
};