On Fri, May 18, 2018 at 5:49 PM, Greg Rose <[email protected]> wrote: > Add handlers for OVS_VPORT_TYPE_IP6GRE > > Cc: Ben Pfaff <[email protected]> > Signed-off-by: Greg Rose <[email protected]> > --- > > V2 - Folded in additional change from Ben Pfaff as per his suggestion. > ---
LGTM Acked-by: William Tu <[email protected]> > lib/dpif-netlink-rtnl.c | 4 +++- > lib/dpif-netlink.c | 7 +++++-- > lib/netdev-native-tnl.c | 8 ++++++-- > lib/netdev-vport.c | 4 ++++ > lib/odp-util.c | 9 +++++++-- > lib/tnl-ports.c | 2 +- > 6 files changed, 26 insertions(+), 8 deletions(-) > > diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c > index 817e544..bec3fce 100644 > --- a/lib/dpif-netlink-rtnl.c > +++ b/lib/dpif-netlink-rtnl.c > @@ -104,6 +104,7 @@ vport_type_to_kind(enum ovs_vport_type type, > case OVS_VPORT_TYPE_IP6ERSPAN: > return "ip6erspan"; > case OVS_VPORT_TYPE_IP6GRE: > + return "ip6gre"; > case OVS_VPORT_TYPE_NETDEV: > case OVS_VPORT_TYPE_INTERNAL: > case OVS_VPORT_TYPE_LISP: > @@ -349,7 +350,8 @@ dpif_netlink_rtnl_create(const struct > netdev_tunnel_config *tnl_cfg, > nl_msg_end_nested(&request, linkinfo_off); > > err = nl_transact(NETLINK_ROUTE, &request, NULL); > - if (!err && type == OVS_VPORT_TYPE_GRE) { > + if (!err && (type == OVS_VPORT_TYPE_GRE || > + type == OVS_VPORT_TYPE_IP6GRE)) { > /* Work around a bug in kernel GRE driver, which ignores IFLA_MTU in > * RTM_NEWLINK, by setting the MTU again. See > * https://bugzilla.redhat.com/show_bug.cgi?id=1488484. */ > diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c > index f5ae21e..607b497 100644 > --- a/lib/dpif-netlink.c > +++ b/lib/dpif-netlink.c > @@ -791,9 +791,10 @@ get_vport_type(const struct dpif_netlink_vport *vport) > return "erspan"; > > case OVS_VPORT_TYPE_IP6ERSPAN: > - return "ip6erspan"; > + return "ip6erspan"; > + > case OVS_VPORT_TYPE_IP6GRE: > - return ""; > + return "ip6gre"; > > case OVS_VPORT_TYPE_UNSPEC: > case __OVS_VPORT_TYPE_MAX: > @@ -826,6 +827,8 @@ netdev_to_ovs_vport_type(const char *type) > return OVS_VPORT_TYPE_ERSPAN; > } else if (!strcmp(type, "ip6erspan")) { > return OVS_VPORT_TYPE_IP6ERSPAN; > + } else if (!strcmp(type, "ip6gre")) { > + return OVS_VPORT_TYPE_IP6GRE; > } else { > return OVS_VPORT_TYPE_UNSPEC; > } > diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c > index 66eb18e..c70811e 100644 > --- a/lib/netdev-native-tnl.c > +++ b/lib/netdev-native-tnl.c > @@ -513,7 +513,11 @@ netdev_gre_build_header(const struct netdev *netdev, > hlen = (uint8_t *) options - (uint8_t *) greh; > > data->header_len += hlen; > - data->tnl_type = OVS_VPORT_TYPE_GRE; > + if (!params->is_ipv6) { > + data->tnl_type = OVS_VPORT_TYPE_GRE; > + } else { > + data->tnl_type = OVS_VPORT_TYPE_IP6GRE; > + } > return 0; > } > > @@ -552,7 +556,7 @@ netdev_erspan_pop_header(struct dp_packet *packet) > } > > ersh = ERSPAN_HDR(greh); > - tnl->tun_id = be32_to_be64(be16_to_be32(htons(get_sid(ersh)))); > + tnl->tun_id = be16_to_be64(htons(get_sid(ersh))); thanks for fixing this. Regards, William _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
