On Tue, Aug 4, 2015 at 7:27 PM, Alexei Starovoitov <alexei.starovoi...@gmail.com> wrote: > On Tue, Aug 04, 2015 at 04:22:35PM -0700, Pravin B Shelar wrote: >> Following patch adds support for flow based tunnel to GRE >> tap deivces. Using flow based tunneling, we can implement >> OVS GRE vport. This patch removes all of the OVS >> specific GRE code and make OVS use a ip_gre net_device. >> Minimal GRE vport is kept to handle compatibility with >> current userspace application. >> >> Signed-off-by: Pravin B Shelar <pshe...@nicira.com> > ... >> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c > ... >> +struct net_device *ipgre_fb_dev_create(struct net *net, const char *name, >> + u8 name_assign_type) >> +{ >> + struct ip_tunnel_net *itn = net_generic(net, gre_tap_net_id); >> + struct nlattr *tb[IFLA_MAX + 1]; >> + struct net_device *dev; >> + struct ip_tunnel *t; >> + int err; >> + >> + if (rtnl_dereference(itn->flow_based_tunnel)) >> + return ERR_PTR(-EEXIST); >> + >> + memset(&tb, 0, sizeof(tb)); >> + >> + dev = rtnl_create_link(net, name, name_assign_type, >> + &ipgre_tap_ops, tb); >> + if (IS_ERR(dev)) >> + return dev; >> + >> + /* Configure flow based GRE device. */ >> + t = netdev_priv(dev); >> + t->is_fb_tunnel = true; >> + >> + err = ipgre_newlink(net, dev, tb, NULL); >> + if (err < 0) >> + goto out; >> + return dev; >> +out: >> + free_netdev(dev); >> + return ERR_PTR(err); >> +} >> +EXPORT_SYMBOL_GPL(ipgre_fb_dev_create); > > ... >> diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c > ... >> +static struct vport *gre_tnl_create(const struct vport_parms *parms) >> { > ... >> + rtnl_lock(); >> + dev = ipgre_fb_dev_create(net, parms->name, NET_NAME_USER); >> + if (IS_ERR(dev)) { >> + rtnl_unlock(); >> + ovs_vport_free(vport); >> + return ERR_CAST(dev); > > So the code from vport-gre.c got moved into ip_gre.c and ipgre_fb_dev_create() > got exported with the only user being ovs vport-gre ?! > Then the proper commit message should say 'move ovs specific gre bits > to ip_gre.c', since the only way to use it is to create ovs vport-gre. > Instead, can you please do it similar to Thomas's vxlan patch so that > such gre tunnel can actually be usable outside of ovs? >
I am planning on adding the ip_gre netlink interface later on. OVS userspace needs same interface to directly create the GRE device without vport-gre module. vport-gre module is compatibility code. If you want I can do it in same patch. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html