aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
diff options
context:
space:
mode:
authorMarco Varlese <marco.varlese@suse.com>2017-09-19 14:25:28 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-10-06 08:51:09 +0000
commitb598f1d3d7d4ace9a29c01d93a8d1ba616a91e15 (patch)
tree25f408f1255c61138499d146f66da27d390c7cbd /src/vpp
parent4e5ceefb5522cfde1e916d84b56c318ec1ea614e (diff)
Initial GENEVE TUNNEL implementation and tests.
Notes on this first implementation: * First version of the implementation does NOT support GENEVE OPTIONS HEADER: it isn't well understood what the purpose of the OPTIONS will be and/or what content would be placed in the variable option data; Once the IETF work will evolve and further information will be available it could be possible to modify the frame rewrite to contemplate the actual GENEVE OPTIONS. Change-Id: Iddfe6f408cc45bb0800f00ce6a3e302e48a4ed52 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
Diffstat (limited to 'src/vpp')
-rw-r--r--src/vpp/api/custom_dump.c68
-rw-r--r--src/vpp/api/vpe.api1
2 files changed, 69 insertions, 0 deletions
diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c
index 8063d680d6e..ecb0ab172f7 100644
--- a/src/vpp/api/custom_dump.c
+++ b/src/vpp/api/custom_dump.c
@@ -26,6 +26,7 @@
#include <vnet/l2/l2_input.h>
#include <vnet/srv6/sr.h>
#include <vnet/vxlan-gpe/vxlan_gpe.h>
+#include <vnet/geneve/geneve.h>
#include <vnet/classify/policer_classify.h>
#include <vnet/policer/xlate.h>
#include <vnet/policer/policer.h>
@@ -229,6 +230,26 @@ static void *vl_api_sw_interface_set_vxlan_bypass_t_print
FINISH;
}
+static void *vl_api_sw_interface_set_geneve_bypass_t_print
+ (vl_api_sw_interface_set_geneve_bypass_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: sw_interface_set_geneve_bypass ");
+
+ s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
+
+ if (mp->is_ipv6)
+ s = format (s, "ip6 ");
+
+ if (mp->enable)
+ s = format (s, "enable ");
+ else
+ s = format (s, "disable ");
+
+ FINISH;
+}
+
static void *vl_api_sw_interface_set_l2_xconnect_t_print
(vl_api_sw_interface_set_l2_xconnect_t * mp, void *handle)
{
@@ -1495,6 +1516,50 @@ static void *vl_api_vxlan_tunnel_dump_t_print
FINISH;
}
+static void *vl_api_geneve_add_del_tunnel_t_print
+ (vl_api_geneve_add_del_tunnel_t * mp, void *handle)
+{
+ u8 *s;
+ s = format (0, "SCRIPT: geneve_add_del_tunnel ");
+
+ ip46_address_t local = to_ip46 (mp->is_ipv6, mp->local_address);
+ ip46_address_t remote = to_ip46 (mp->is_ipv6, mp->remote_address);
+
+ u8 is_grp = ip46_address_is_multicast (&remote);
+ char *remote_name = is_grp ? "group" : "dst";
+
+ s = format (s, "src %U ", format_ip46_address, &local, IP46_TYPE_ANY);
+ s = format (s, "%s %U ", remote_name, format_ip46_address,
+ &remote, IP46_TYPE_ANY);
+
+ if (is_grp)
+ s = format (s, "mcast_sw_if_index %d ", ntohl (mp->mcast_sw_if_index));
+
+ if (mp->encap_vrf_id)
+ s = format (s, "encap-vrf-id %d ", ntohl (mp->encap_vrf_id));
+
+ s = format (s, "decap-next %d ", ntohl (mp->decap_next_index));
+
+ s = format (s, "vni %d ", ntohl (mp->vni));
+
+ if (mp->is_add == 0)
+ s = format (s, "del ");
+
+ FINISH;
+}
+
+static void *vl_api_geneve_tunnel_dump_t_print
+ (vl_api_geneve_tunnel_dump_t * mp, void *handle)
+{
+ u8 *s;
+
+ s = format (0, "SCRIPT: geneve_tunnel_dump ");
+
+ s = format (s, "sw_if_index %d ", ntohl (mp->sw_if_index));
+
+ FINISH;
+}
+
static void *vl_api_gre_add_del_tunnel_t_print
(vl_api_gre_add_del_tunnel_t * mp, void *handle)
{
@@ -3065,6 +3130,7 @@ _(SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
_(SW_INTERFACE_SET_MPLS_ENABLE, sw_interface_set_mpls_enable) \
_(SW_INTERFACE_SET_VPATH, sw_interface_set_vpath) \
_(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
+_(SW_INTERFACE_SET_GENEVE_BYPASS, sw_interface_set_geneve_bypass) \
_(TAP_CONNECT, tap_connect) \
_(TAP_MODIFY, tap_modify) \
_(TAP_DELETE, tap_delete) \
@@ -3118,6 +3184,8 @@ _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \
_(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) \
_(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
_(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
+_(GENEVE_ADD_DEL_TUNNEL, geneve_add_del_tunnel) \
+_(GENEVE_TUNNEL_DUMP, geneve_tunnel_dump) \
_(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \
_(GRE_TUNNEL_DUMP, gre_tunnel_dump) \
_(L2_FIB_CLEAR_TABLE, l2_fib_clear_table) \
diff --git a/src/vpp/api/vpe.api b/src/vpp/api/vpe.api
index d68beae13d3..b8e581891df 100644
--- a/src/vpp/api/vpe.api
+++ b/src/vpp/api/vpe.api
@@ -26,6 +26,7 @@
* IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
* TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
* VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
+ * GENEVE APIs: see .../src/vnet/geneve/{geneve.api, geneve_api.c}
* LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
* AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
* NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}