summaryrefslogtreecommitdiffstats
path: root/src/vnet/gre/gre.c
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-02-15 15:47:53 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-16 08:10:06 +0000
commit25d417f28680c78a709792d997884dd80227bb70 (patch)
treeb687b43388065d9763ecb1d2d6d8683909e2e38a /src/vnet/gre/gre.c
parent9fa5cf46690601e4e25605d548671c84634363e3 (diff)
Minor VXLAN/GRE Tunnel Encap Optimization and Cleanup
Change-Id: I62a2a6524b72115a4239fbd7dc9ac8fdc35e20ed Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/gre/gre.c')
-rw-r--r--src/vnet/gre/gre.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/vnet/gre/gre.c b/src/vnet/gre/gre.c
index a3702920334..75b11017e50 100644
--- a/src/vnet/gre/gre.c
+++ b/src/vnet/gre/gre.c
@@ -383,19 +383,22 @@ gre_interface_tx (vlib_main_t * vm,
adj_index0 = gt0->l2_adj_index;
}
- if (sw_if_index0 == vnet_buffer (b1)->sw_if_index[VLIB_TX])
+ if (sw_if_index1 != vnet_buffer (b1)->sw_if_index[VLIB_TX])
{
- sw_if_index1 = sw_if_index0;
- gt1 = gt0;
- adj_index1 = adj_index0;
- }
- else if (sw_if_index1 != vnet_buffer (b1)->sw_if_index[VLIB_TX])
- {
- sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX];
- vnet_hw_interface_t *hi1 =
- vnet_get_sup_hw_interface (vnm, sw_if_index1);
- gt1 = &gm->tunnels[hi1->dev_instance];
- adj_index1 = gt1->l2_adj_index;
+ if (sw_if_index0 == vnet_buffer (b1)->sw_if_index[VLIB_TX])
+ {
+ sw_if_index1 = sw_if_index0;
+ gt1 = gt0;
+ adj_index1 = adj_index0;
+ }
+ else
+ {
+ sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX];
+ vnet_hw_interface_t *hi1 =
+ vnet_get_sup_hw_interface (vnm, sw_if_index1);
+ gt1 = &gm->tunnels[hi1->dev_instance];
+ adj_index1 = gt1->l2_adj_index;
+ }
}
vnet_buffer (b0)->ip.adj_index[VLIB_TX] = adj_index0;