On Mon, Mar 30, 2015 at 3:14 PM, Jesse Gross <je...@nicira.com> wrote: > This adds basic userspace dataplane support for the Geneve > tunneling protocol. The rest of userspace only has the ability > to handle Geneve without options and this follows that pattern > for the time being. However, when the rest of userspace is updated > it should be easy to extend the dataplane as well. > > Signed-off-by: Jesse Gross <je...@nicira.com> > --- > NEWS | 4 +- > lib/netdev-vport.c | 114 > ++++++++++++++++++++++++++++++++++++++++++++++- > lib/odp-util.c | 28 ++++++++++-- > lib/packets.h | 19 ++++++++ > tests/odp.at | 1 + > tests/tunnel-push-pop.at | 16 +++++++ > 6 files changed, 176 insertions(+), 6 deletions(-) > > diff --git a/NEWS b/NEWS > index 9f9dc4c..87460a7 100644 > --- a/NEWS > +++ b/NEWS > @@ -62,8 +62,8 @@ Post-v2.3.0 > - A simple wrapper script, 'ovs-docker', to integrate OVS with Docker > containers. If and when there is a native integration of Open vSwitch > with Docker, the wrapper script will be retired. > - - Added support for DPDK Tunneling. VXLAN and GRE are supported protocols. > - This is generic tunneling mechanism for userspace datapath. > + - Added support for DPDK Tunneling. VXLAN, GRE, and Geneve are supported > + protocols. This is generic tunneling mechanism for userspace datapath. > - Support for multicast snooping (IGMPv1 and IGMPv2) > - Support for Linux kernels up to 3.19.x > - The documentation now use the term 'destination' to mean one of syslog, > diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c > index 0c9f5a4..ef96862 100644 > --- a/lib/netdev-vport.c > +++ b/lib/netdev-vport.c > @@ -61,6 +61,11 @@ static struct vlog_rate_limit err_rl = > VLOG_RATE_LIMIT_INIT(60, 5); > sizeof(struct udp_header) + \ > sizeof(struct vxlanhdr)) > ...
> + > + if (gnh->proto_type != htons(ETH_TYPE_TEB)) { > + VLOG_WARN_RL(&err_rl, "unknown geneve encapsulated protocol: %#x\n", > + ntohs(gnh->proto_type)); > + reset_tnl_md(md); > + return; > + } > + > + tnl->flags |= gnh->oam ? FLOW_TNL_F_OAM : 0; > + tnl->tun_id = htonll(ntohl(get_16aligned_be32(&gnh->vni)) >> 8); > + We need to set FLOW_TNL_F_KEY. It is also missing for vxlan. > + dp_packet_reset_packet(packet, hlen); > +} > + > +static int > +netdev_geneve_pop_header(struct netdev *netdev_ OVS_UNUSED, .... > + > +static int > +netdev_geneve_push_header(const struct netdev *netdev OVS_UNUSED, > + struct dp_packet **packets, int cnt, > + const struct ovs_action_push_tnl *data) > +{ > + int i; > + > + for (i = 0; i < cnt; i++) { > + push_udp_header(packets[i], data->header, data->header_len); > + packets[i]->md = > PKT_METADATA_INITIALIZER(u32_to_odp(data->out_port)); > + } > + return 0; > +} > + This looks like vxlan_push, Is there reason for having two different function? > +static void > netdev_vport_range(struct unixctl_conn *conn, int argc, > const char *argv[], void *aux OVS_UNUSED) > { > @@ -1331,7 +1441,9 @@ netdev_vport_tunnel_register(void) Otherwise looks good. Acked-by: Pravin B Shelar <pshe...@nicira.com> _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev