From: Lorand Jakab Date: Tue, 19 Nov 2013 09:06:44 +0000 (+0200) Subject: ofproto-dpif: add support for layer 3 ports X-Git-Tag: sliver-openvswitch-2.0.90-1~5^2~2 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=a6363cfddb91620c9325e2812ae5af96a8d7f127 ofproto-dpif: add support for layer 3 ports Add member is_layer3 to struct ofport_dpif to mark layer 3 ports. Set it to "true" for the only layer 3 port we support for now: lisp. Additionally, prevent flooding to layer 3 ports. A later patch will also prevent MAC learning. Signed-off-by: Lorand Jakab Signed-off-by: Ben Pfaff --- diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index ae4f6261e..07b2381cc 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -108,6 +108,14 @@ netdev_vport_is_patch(const struct netdev *netdev) return class->get_config == get_patch_config; } +bool +netdev_vport_is_layer3(const struct netdev *dev) +{ + const char *type = netdev_get_type(dev); + + return (!strcmp("lisp", type)); +} + static bool netdev_vport_needs_dst_port(const struct netdev *dev) { diff --git a/lib/netdev-vport.h b/lib/netdev-vport.h index dc490970c..eaeb3869a 100644 --- a/lib/netdev-vport.h +++ b/lib/netdev-vport.h @@ -30,6 +30,7 @@ void netdev_vport_tunnel_register(void); void netdev_vport_patch_register(void); bool netdev_vport_is_patch(const struct netdev *); +bool netdev_vport_is_layer3(const struct netdev *); char *netdev_vport_patch_peer(const struct netdev *netdev); diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 339159475..b984ea535 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -332,6 +332,7 @@ struct ofport_dpif { struct bfd *bfd; /* BFD, if any. */ bool may_enable; /* May be enabled in bonds. */ bool is_tunnel; /* This port is a tunnel. */ + bool is_layer3; /* This is a layer 3 port. */ long long int carrier_seq; /* Carrier status changes. */ struct ofport_dpif *peer; /* Peer if patch port. */ @@ -1708,6 +1709,7 @@ port_construct(struct ofport *port_) port->realdev_ofp_port = 0; port->vlandev_vid = 0; port->carrier_seq = netdev_get_carrier_resets(netdev); + port->is_layer3 = netdev_vport_is_layer3(netdev); if (netdev_vport_is_patch(netdev)) { /* By bailing out here, we don't submit the port to the sFlow module @@ -2305,6 +2307,7 @@ bundle_update(struct ofbundle *bundle) bundle->floodable = true; LIST_FOR_EACH (port, bundle_node, &bundle->ports) { if (port->up.pp.config & OFPUTIL_PC_NO_FLOOD + || port->is_layer3 || !stp_forward_in_state(port->stp_state)) { bundle->floodable = false; break; @@ -2352,6 +2355,7 @@ bundle_add_port(struct ofbundle *bundle, ofp_port_t ofp_port, port->bundle = bundle; list_push_back(&bundle->ports, &port->bundle_node); if (port->up.pp.config & OFPUTIL_PC_NO_FLOOD + || port->is_layer3 || !stp_forward_in_state(port->stp_state)) { bundle->floodable = false; } diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 9da34d9f4..35d59b93f 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -1387,8 +1387,18 @@
lisp
- A layer 3 tunnel over the experimental, UDP-based Locator/ID - Separation Protocol (RFC 6830). +

+ A layer 3 tunnel over the experimental, UDP-based Locator/ID + Separation Protocol (RFC 6830). +

+

+ Only IPv4 and IPv6 packets are supported by the protocol, and + they are sent and received without an Ethernet header. Traffic + to/from LISP ports is expected to be configured explicitly, and + the ports are not intended to participate in learning based + switching. As such, they are always excluded from packet + flooding. +

patch