aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-10-31 23:21:46 +0100
committerDave Barach <openvpp@barachs.net>2016-11-01 00:12:07 +0000
commitd5c9d6f30aa37ea8d7fdf8a79d3ab4c2e67d3249 (patch)
tree96ce287ef43e1369f6c1c526034ad65acc7627aa
parent6e3c65e8b9fdc563bbac43f8b2fb380d7604c309 (diff)
l2: fix l2-patch node
This node was not setting vnet_buffer (b0)->sw_if_index[VLIB_TX] properly. Change-Id: I3e9f095da5f79c4186e3988ef315a7045ac85708 Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vnet/vnet/l2/l2_patch.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/vnet/vnet/l2/l2_patch.c b/vnet/vnet/l2/l2_patch.c
index 5d097bb792e..ad05fa0d034 100644
--- a/vnet/vnet/l2/l2_patch.c
+++ b/vnet/vnet/l2/l2_patch.c
@@ -20,9 +20,6 @@
typedef struct
{
- u32 cached_next_index;
- u32 cached_rx_sw_if_index;
-
/* vector of dispositions, indexed by rx_sw_if_index */
u32 *tx_next_by_rx_sw_if_index;
u32 *tx_sw_if_index_by_rx_sw_if_index;
@@ -139,19 +136,12 @@ l2_patch_node_fn (vlib_main_t * vm,
ASSERT (l2pm->tx_next_by_rx_sw_if_index[sw_if_index1] != ~0);
ASSERT (l2pm->tx_sw_if_index_by_rx_sw_if_index[sw_if_index1] != ~0);
- if (PREDICT_TRUE (sw_if_index0 == l2pm->cached_rx_sw_if_index))
- next0 = l2pm->cached_next_index;
- else
- {
- next0 = l2pm->tx_next_by_rx_sw_if_index[sw_if_index0];
- l2pm->cached_rx_sw_if_index = sw_if_index0;
- l2pm->cached_next_index = next0;
- }
-
- if (PREDICT_TRUE (sw_if_index1 == l2pm->cached_rx_sw_if_index))
- next1 = l2pm->cached_next_index;
- else
- next1 = l2pm->tx_next_by_rx_sw_if_index[sw_if_index1];
+ next0 = l2pm->tx_next_by_rx_sw_if_index[sw_if_index0];
+ next1 = l2pm->tx_next_by_rx_sw_if_index[sw_if_index1];
+ vnet_buffer (b0)->sw_if_index[VLIB_TX] =
+ l2pm->tx_sw_if_index_by_rx_sw_if_index[sw_if_index0];
+ vnet_buffer (b1)->sw_if_index[VLIB_TX] =
+ l2pm->tx_sw_if_index_by_rx_sw_if_index[sw_if_index1];
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
{
@@ -201,14 +191,9 @@ l2_patch_node_fn (vlib_main_t * vm,
ASSERT (l2pm->tx_next_by_rx_sw_if_index[sw_if_index0] != ~0);
ASSERT (l2pm->tx_sw_if_index_by_rx_sw_if_index[sw_if_index0] != ~0);
- if (PREDICT_TRUE (sw_if_index0 == l2pm->cached_rx_sw_if_index))
- next0 = l2pm->cached_next_index;
- else
- {
- next0 = l2pm->tx_next_by_rx_sw_if_index[sw_if_index0];
- l2pm->cached_rx_sw_if_index = sw_if_index0;
- l2pm->cached_next_index = next0;
- }
+ next0 = l2pm->tx_next_by_rx_sw_if_index[sw_if_index0];
+ vnet_buffer (b0)->sw_if_index[VLIB_TX] =
+ l2pm->tx_sw_if_index_by_rx_sw_if_index[sw_if_index0];
if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE)))
{
@@ -240,7 +225,7 @@ l2_patch_node_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (l2_patch_node, static) = {
.function = l2_patch_node_fn,
- .name = "l2_patch",
+ .name = "l2-patch",
.vector_size = sizeof (u32),
.format_trace = format_l2_patch_trace,
.type = VLIB_NODE_TYPE_INTERNAL,