diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-03-06 10:34:24 -0800 |
---|---|---|
committer | Pravin B Shelar <pshelar@nicira.com> | 2013-03-06 10:34:24 -0800 |
commit | 12db604eb63272924e122f57640b5ebd9a20c87a (patch) | |
tree | ac83e32d2f03abc792452e68d67d1415e63b3849 /lib | |
parent | 2834ce46735cb31d3007d2c0364583f57d2903b1 (diff) |
Tunnel: Cleanup old tunnel infrastructure.
Since userspace flow based tunneling code is checked in, the kernel
port based tunneling code can be removed.
Patch removes following components:
- tunnel ports hash table and moved tunnel ports list to individual
vports.
- Cleaned per tnl-port config.
- OVS_KEY_ATTR_TUN_ID action is removed.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #15078
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpif-linux.c | 1 | ||||
-rw-r--r-- | lib/dpif-netdev.c | 1 | ||||
-rw-r--r-- | lib/netdev-vport.c | 12 | ||||
-rw-r--r-- | lib/odp-util.c | 28 | ||||
-rw-r--r-- | lib/odp-util.h | 3 |
5 files changed, 5 insertions, 40 deletions
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index 8ee2bcca..05446ee3 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -47,7 +47,6 @@ #include "odp-util.h" #include "ofpbuf.h" #include "openvswitch/datapath-compat.h" -#include "openvswitch/tunnel.h" #include "packets.h" #include "poll-loop.h" #include "random.h" diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 038dfdc9..054de1c4 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1198,7 +1198,6 @@ execute_set_action(struct ofpbuf *packet, const struct nlattr *a) const struct ovs_key_udp *udp_key; switch (type) { - case OVS_KEY_ATTR_TUN_ID: case OVS_KEY_ATTR_PRIORITY: case OVS_KEY_ATTR_SKB_MARK: case OVS_KEY_ATTR_TUNNEL: diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 88817ac1..ccf80d7c 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -327,6 +327,10 @@ set_tunnel_config(struct netdev_dev *dev_, const struct smap *args) struct in_addr in_addr; if (lookup_ip(node->value, &in_addr)) { VLOG_WARN("%s: bad %s 'remote_ip'", name, type); + } else if (ip_is_multicast(in_addr.s_addr)) { + VLOG_WARN("%s: multicast remote_ip="IP_FMT" not allowed", + name, IP_ARGS(in_addr.s_addr)); + return EINVAL; } else { tnl_cfg.ip_dst = in_addr.s_addr; } @@ -439,14 +443,6 @@ set_tunnel_config(struct netdev_dev *dev_, const struct smap *args) name, type); return EINVAL; } - - if (tnl_cfg.ip_src) { - if (ip_is_multicast(tnl_cfg.ip_dst)) { - VLOG_WARN("%s: remote_ip is multicast, ignoring local_ip", name); - tnl_cfg.ip_src = 0; - } - } - if (!tnl_cfg.ttl) { tnl_cfg.ttl = DEFAULT_TTL; } diff --git a/lib/odp-util.c b/lib/odp-util.c index 503e51ae..19d3b7d3 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -94,7 +94,6 @@ ovs_key_attr_to_string(enum ovs_key_attr attr) case OVS_KEY_ATTR_ENCAP: return "encap"; case OVS_KEY_ATTR_PRIORITY: return "skb_priority"; case OVS_KEY_ATTR_SKB_MARK: return "skb_mark"; - case OVS_KEY_ATTR_TUN_ID: return "tun_id"; case OVS_KEY_ATTR_TUNNEL: return "tunnel"; case OVS_KEY_ATTR_IN_PORT: return "in_port"; case OVS_KEY_ATTR_ETHERNET: return "eth"; @@ -616,7 +615,6 @@ odp_flow_key_attr_len(uint16_t type) case OVS_KEY_ATTR_ENCAP: return -2; case OVS_KEY_ATTR_PRIORITY: return 4; case OVS_KEY_ATTR_SKB_MARK: return 4; - case OVS_KEY_ATTR_TUN_ID: return 8; case OVS_KEY_ATTR_TUNNEL: return -2; case OVS_KEY_ATTR_IN_PORT: return 4; case OVS_KEY_ATTR_ETHERNET: return sizeof(struct ovs_key_ethernet); @@ -820,10 +818,6 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds) ds_put_format(ds, "(%#"PRIx32")", nl_attr_get_u32(a)); break; - case OVS_KEY_ATTR_TUN_ID: - ds_put_format(ds, "(%#"PRIx64")", ntohll(nl_attr_get_be64(a))); - break; - case OVS_KEY_ATTR_TUNNEL: memset(&tun_key, 0, sizeof tun_key); if (tun_key_from_attr(a, &tun_key) == ODP_FIT_ERROR) { @@ -1055,18 +1049,6 @@ parse_odp_key_attr(const char *s, const struct simap *port_names, { char tun_id_s[32]; - int n = -1; - - if (sscanf(s, "tun_id(%31[x0123456789abcdefABCDEF])%n", - tun_id_s, &n) > 0 && n > 0) { - uint64_t tun_id = strtoull(tun_id_s, NULL, 0); - nl_msg_put_be64(key, OVS_KEY_ATTR_TUN_ID, htonll(tun_id)); - return n; - } - } - - { - char tun_id_s[32]; int tos, ttl; struct flow_tnl tun_key; int n = -1; @@ -1455,8 +1437,6 @@ odp_flow_key_from_flow(struct ofpbuf *buf, const struct flow *flow, if (flow->tunnel.ip_dst) { tun_key_to_attr(buf, &flow->tunnel); - } else if (flow->tunnel.tun_id != htonll(0)) { - nl_msg_put_be64(buf, OVS_KEY_ATTR_TUN_ID, flow->tunnel.tun_id); } if (flow->skb_mark) { @@ -1955,11 +1935,6 @@ odp_flow_key_to_flow(const struct nlattr *key, size_t key_len, expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_SKB_MARK; } - if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TUN_ID)) { - flow->tunnel.tun_id = nl_attr_get_be64(attrs[OVS_KEY_ATTR_TUN_ID]); - expected_attrs |= UINT64_C(1) << OVS_KEY_ATTR_TUN_ID; - } - if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TUNNEL)) { enum odp_key_fitness res; @@ -2087,9 +2062,6 @@ commit_odp_tunnel_action(const struct flow *flow, struct flow *base, /* A valid IPV4_TUNNEL must have non-zero ip_dst. */ if (flow->tunnel.ip_dst) { odp_put_tunnel_action(&base->tunnel, odp_actions); - } else { - commit_set_action(odp_actions, OVS_KEY_ATTR_TUN_ID, - &base->tunnel.tun_id, sizeof base->tunnel.tun_id); } } diff --git a/lib/odp-util.h b/lib/odp-util.h index ff87bf18..796aa285 100644 --- a/lib/odp-util.h +++ b/lib/odp-util.h @@ -54,7 +54,6 @@ int odp_actions_from_string(const char *, const struct simap *port_names, * struct pad nl hdr total * ------ --- ------ ----- * OVS_KEY_ATTR_PRIORITY 4 -- 4 8 - * OVS_KEY_ATTR_TUN_ID 8 -- 4 12 * OVS_KEY_ATTR_TUNNEL 0 -- 4 4 * - OVS_TUNNEL_KEY_ATTR_ID 8 -- 4 12 * - OVS_TUNNEL_KEY_ATTR_IPV4_SRC 4 -- 4 8 @@ -74,7 +73,7 @@ int odp_actions_from_string(const char *, const struct simap *port_names, * OVS_KEY_ATTR_ICMPV6 2 2 4 8 * OVS_KEY_ATTR_ND 28 -- 4 32 * ---------------------------------------------------------- - * total 220 + * total 208 * * We include some slack space in case the calculation isn't quite right or we * add another field and forget to adjust this value. |