History

Revert "openvswitch: Add erspan tunnel support."

This reverts commit ceaa001a170e43608854d5290a48064f57b565ed. The OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS attr should be designed as a nested attribute to support all ERSPAN v1 and v2's fields. The current attr is a be32 supporting only one field. Thus, this patch reverts it and later patch will redo it using nested attr.

William Tu committed 8 years ago

Commit 95a33201 parent 30be8f82 files · +1 −51Browse files

Unified · Split

2 files
  1. include/uapi/linux/openvswitch.h +0 −1
  2. net/openvswitch/flow_netlink.c +1 −50
include/uapi/linux/openvswitch.h+0−1
@@ -363,7 +363,6 @@ enum ovs_tunnel_key_attr { · 362 unmodified lines
363363 OVS_TUNNEL_KEY_ATTR_IPV6_SRC, /* struct in6_addr src IPv6 address. */
364364 OVS_TUNNEL_KEY_ATTR_IPV6_DST, /* struct in6_addr dst IPv6 address. */
365365 OVS_TUNNEL_KEY_ATTR_PAD,
366− OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS, /* be32 ERSPAN index. */
367366 __OVS_TUNNEL_KEY_ATTR_MAX
368367 };
369368
net/openvswitch/flow_netlink.c+1−50
@@ -49,7 +49,6 @@ · 48 unmodified lines
4949 #include <net/mpls.h>
5050 #include <net/vxlan.h>
5151 #include <net/tun_proto.h>
52−#include <net/erspan.h>
5352
5453 #include "flow_netlink.h"
5554
@@ -334,8 +333,7 @@ size_t ovs_tun_key_attr_size(void) · 278 unmodified lines
334333 * OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS and covered by it.
335334 */
336335 + nla_total_size(2) /* OVS_TUNNEL_KEY_ATTR_TP_SRC */
337− + nla_total_size(2) /* OVS_TUNNEL_KEY_ATTR_TP_DST */
338− + nla_total_size(4); /* OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS */
336+ + nla_total_size(2); /* OVS_TUNNEL_KEY_ATTR_TP_DST */
339337 }
340338
341339 static size_t ovs_nsh_key_attr_size(void)
@@ -402,7 +400,6 @@ static const struct ovs_len_tbl ovs_tunnel_key_lens[OVS_TUNNEL_KEY_ATTR_MAX + 1] · 60 unmodified lines
402400 .next = ovs_vxlan_ext_key_lens },
403401 [OVS_TUNNEL_KEY_ATTR_IPV6_SRC] = { .len = sizeof(struct in6_addr) },
404402 [OVS_TUNNEL_KEY_ATTR_IPV6_DST] = { .len = sizeof(struct in6_addr) },
405− [OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS] = { .len = sizeof(u32) },
406403 };
407404
408405 static const struct ovs_len_tbl
@@ -634,33 +631,6 @@ static int vxlan_tun_opt_from_nlattr(const struct nlattr *attr, · 225 unmodified lines
634631 return 0;
635632 }
636633
637−static int erspan_tun_opt_from_nlattr(const struct nlattr *attr,
638− struct sw_flow_match *match, bool is_mask,
639− bool log)
640−{
641− unsigned long opt_key_offset;
642− struct erspan_metadata opts;
643−
644− BUILD_BUG_ON(sizeof(opts) > sizeof(match->key->tun_opts));
645−
646− memset(&opts, 0, sizeof(opts));
647− opts.index = nla_get_be32(attr);
648−
649− /* Index has only 20-bit */
650− if (ntohl(opts.index) & ~INDEX_MASK) {
651− OVS_NLERR(log, "ERSPAN index number %x too large.",
652− ntohl(opts.index));
653− return -EINVAL;
654− }
655−
656− SW_FLOW_KEY_PUT(match, tun_opts_len, sizeof(opts), is_mask);
657− opt_key_offset = TUN_METADATA_OFFSET(sizeof(opts));
658− SW_FLOW_KEY_MEMCPY_OFFSET(match, opt_key_offset, &opts, sizeof(opts),
659− is_mask);
660−
661− return 0;
662−}
663−
664634 static int ip_tun_from_nlattr(const struct nlattr *attr,
665635 struct sw_flow_match *match, bool is_mask,
666636 bool log)
@@ -768,19 +738,6 @@ static int ip_tun_from_nlattr(const struct nlattr *attr, · 101 unmodified lines
768738 break;
769739 case OVS_TUNNEL_KEY_ATTR_PAD:
770740 break;
771− case OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS:
772− if (opts_type) {
773− OVS_NLERR(log, "Multiple metadata blocks provided");
774− return -EINVAL;
775− }
776−
777− err = erspan_tun_opt_from_nlattr(a, match, is_mask, log);
778− if (err)
779− return err;
780−
781− tun_flags |= TUNNEL_ERSPAN_OPT;
782− opts_type = type;
783− break;
784741 default:
785742 OVS_NLERR(log, "Unknown IP tunnel attribute %d",
786743 type);
@@ -905,10 +862,6 @@ static int __ip_tun_to_nlattr(struct sk_buff *skb, · 118 unmodified lines
905862 else if (output->tun_flags & TUNNEL_VXLAN_OPT &&
906863 vxlan_opt_to_nlattr(skb, tun_opts, swkey_tun_opts_len))
907864 return -EMSGSIZE;
908− else if (output->tun_flags & TUNNEL_ERSPAN_OPT &&
909− nla_put_be32(skb, OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS,
910− ((struct erspan_metadata *)tun_opts)->index))
911− return -EMSGSIZE;
912865 }
913866
914867 return 0;
@@ -2533,8 +2486,6 @@ static int validate_and_copy_set_tun(const struct nlattr *attr, · 1618 unmodified lines
25332486 break;
25342487 case OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS:
25352488 break;
2536− case OVS_TUNNEL_KEY_ATTR_ERSPAN_OPTS:
2537− break;
25382489 }
25392490 };
25402491

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t