datapath: Add Upstream id for GRE type.
authorPravin B Shelar <pshelar@nicira.com>
Mon, 5 Nov 2012 21:38:34 +0000 (13:38 -0800)
committerPravin B Shelar <pshelar@nicira.com>
Mon, 5 Nov 2012 21:38:34 +0000 (13:38 -0800)
Once GRE is upstream it will have new type to have continuous sequence
of ids for vport type.  Following patch adds this ID to have
compatibility with it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/vport-gre.c
datapath/vport.c
datapath/vport.h
include/linux/openvswitch.h

index d02d4ec625db8f01a71256cc74c16219dbcb3513..e810173ff95e29cec03f302f377c57a1b54e921c 100644 (file)
@@ -488,6 +488,11 @@ static struct vport *gre_create(const struct vport_parms *parms)
        return ovs_tnl_create(parms, &ovs_gre_vport_ops, &gre_tnl_ops);
 }
 
+static struct vport *gre_create_ft(const struct vport_parms *parms)
+{
+       return ovs_tnl_create(parms, &ovs_gre_ft_vport_ops, &gre_tnl_ops);
+}
+
 static const struct tnl_ops gre64_tnl_ops = {
        .tunnel_type    = TNL_T_PROTO_GRE64,
        .ipproto        = IPPROTO_GRE,
@@ -536,6 +541,24 @@ static void gre_exit(void)
        inet_del_protocol(&gre_protocol_handlers, IPPROTO_GRE);
 }
 
+const struct vport_ops ovs_gre_ft_vport_ops = {
+       .type           = OVS_VPORT_TYPE_FT_GRE,
+       .flags          = VPORT_F_TUN_ID,
+       .init           = gre_init,
+       .exit           = gre_exit,
+       .create         = gre_create_ft,
+       .destroy        = ovs_tnl_destroy,
+       .set_addr       = ovs_tnl_set_addr,
+       .get_name       = ovs_tnl_get_name,
+       .get_addr       = ovs_tnl_get_addr,
+       .get_options    = ovs_tnl_get_options,
+       .set_options    = ovs_tnl_set_options,
+       .get_dev_flags  = ovs_vport_gen_get_dev_flags,
+       .is_running     = ovs_vport_gen_is_running,
+       .get_operstate  = ovs_vport_gen_get_operstate,
+       .send           = ovs_tnl_send,
+};
+
 const struct vport_ops ovs_gre_vport_ops = {
        .type           = OVS_VPORT_TYPE_GRE,
        .flags          = VPORT_F_TUN_ID,
index d9c8cfd20fbe95678c3320ed8115c0da36f189ea..bb2bd27c7650136deedf2487d9df1d4734cc888a 100644 (file)
@@ -41,6 +41,7 @@ static const struct vport_ops *base_vport_ops_list[] = {
        &ovs_internal_vport_ops,
        &ovs_patch_vport_ops,
        &ovs_gre_vport_ops,
+       &ovs_gre_ft_vport_ops,
        &ovs_gre64_vport_ops,
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
        &ovs_capwap_vport_ops,
index 61d52743045b19af4e4eb37295fdcd46acc6fe48..5a7caf5f76ea4cb0472a59d9ca2d6e0cd48ae496 100644 (file)
@@ -254,6 +254,7 @@ extern const struct vport_ops ovs_netdev_vport_ops;
 extern const struct vport_ops ovs_internal_vport_ops;
 extern const struct vport_ops ovs_patch_vport_ops;
 extern const struct vport_ops ovs_gre_vport_ops;
+extern const struct vport_ops ovs_gre_ft_vport_ops;
 extern const struct vport_ops ovs_gre64_vport_ops;
 extern const struct vport_ops ovs_capwap_vport_ops;
 
index 89feb61f6532bcb85d40596c2e2faf335b40dbd5..e76135749b3ca131d3315ea6da9c9bdbe3b62964 100644 (file)
@@ -182,6 +182,7 @@ enum ovs_vport_type {
        OVS_VPORT_TYPE_UNSPEC,
        OVS_VPORT_TYPE_NETDEV,   /* network device */
        OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */
+       OVS_VPORT_TYPE_FT_GRE,   /* Flow based GRE tunnel. */
        OVS_VPORT_TYPE_PATCH = 100, /* virtual tunnel connecting two vports */
        OVS_VPORT_TYPE_GRE,      /* GRE tunnel */
        OVS_VPORT_TYPE_CAPWAP,   /* CAPWAP tunnel */