Following patch removes ifIndex attribute of vport which
is not used in userspace.

Signed-off-by: Pravin B Shelar <pshe...@nicira.com>
Bug #7114
---
 datapath/datapath.c                     |    5 -----
 include/openvswitch/datapath-protocol.h |    4 ----
 lib/dpif-linux.c                        |    8 --------
 lib/dpif-linux.h                        |    1 -
 4 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 15c1e33..a925f6f 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1551,7 +1551,6 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, 
struct sk_buff *skb,
 {
        struct ovs_header *ovs_header;
        struct nlattr *nla;
-       int ifindex;
        int err;
 
        ovs_header = genlmsg_put(skb, pid, seq, &dp_vport_genl_family,
@@ -1578,10 +1577,6 @@ static int ovs_vport_cmd_fill_info(struct vport *vport, 
struct sk_buff *skb,
        if (err == -EMSGSIZE)
                goto error;
 
-       ifindex = vport_get_ifindex(vport);
-       if (ifindex > 0)
-               NLA_PUT_U32(skb, OVS_VPORT_ATTR_IFINDEX, ifindex);
-
        return genlmsg_end(skb, ovs_header);
 
 nla_put_failure:
diff --git a/include/openvswitch/datapath-protocol.h 
b/include/openvswitch/datapath-protocol.h
index 3db960a..80a76d6 100644
--- a/include/openvswitch/datapath-protocol.h
+++ b/include/openvswitch/datapath-protocol.h
@@ -230,14 +230,11 @@ enum ovs_vport_cmd {
  * @OVS_VPORT_ATTR_STATS: A &struct ovs_vport_stats giving statistics for
  * packets sent or received through the vport.
  * @OVS_VPORT_ATTR_ADDRESS: A 6-byte Ethernet address for the vport.
- * @OVS_VPORT_ATTR_IFINDEX: ifindex of the underlying network device, if any.
  *
  * These attributes follow the &struct ovs_header within the Generic Netlink
  * payload for %OVS_VPORT_* commands.
  *
  * All attributes applicable to a given port are present in notifications.
- * This means that, for example, a vport that has no corresponding network
- * device would omit %OVS_VPORT_ATTR_IFINDEX.
  *
  * For %OVS_VPORT_CMD_NEW requests, the %OVS_VPORT_ATTR_TYPE and
  * %OVS_VPORT_ATTR_NAME attributes are required.  %OVS_VPORT_ATTR_PORT_NO is
@@ -259,7 +256,6 @@ enum ovs_vport_attr {
        OVS_VPORT_ATTR_STATS,   /* struct ovs_vport_stats */
        OVS_VPORT_ATTR_ADDRESS, /* hardware address */
        OVS_VPORT_ATTR_OPTIONS, /* nested attributes, varies by vport type */
-       OVS_VPORT_ATTR_IFINDEX, /* 32-bit ifindex of backing netdev */
        __OVS_VPORT_ATTR_MAX
 };
 
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index 4ddd464..8981500 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -1299,7 +1299,6 @@ dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport 
*vport,
                                      .max_len = ETH_ADDR_LEN,
                                      .optional = true },
         [OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = true },
-        [OVS_VPORT_ATTR_IFINDEX] = { .type = NL_A_U32, .optional = true },
     };
 
     struct nlattr *a[ARRAY_SIZE(ovs_vport_policy)];
@@ -1339,9 +1338,6 @@ dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport 
*vport,
         vport->options = nl_attr_get(a[OVS_VPORT_ATTR_OPTIONS]);
         vport->options_len = nl_attr_get_size(a[OVS_VPORT_ATTR_OPTIONS]);
     }
-    if (a[OVS_VPORT_ATTR_IFINDEX]) {
-        vport->ifindex = nl_attr_get_u32(a[OVS_VPORT_ATTR_IFINDEX]);
-    }
     return 0;
 }
 
@@ -1387,10 +1383,6 @@ dpif_linux_vport_to_ofpbuf(const struct dpif_linux_vport 
*vport,
         nl_msg_put_nested(buf, OVS_VPORT_ATTR_OPTIONS,
                           vport->options, vport->options_len);
     }
-
-    if (vport->ifindex) {
-        nl_msg_put_u32(buf, OVS_VPORT_ATTR_IFINDEX, vport->ifindex);
-    }
 }
 
 /* Clears 'vport' to "empty" values. */
diff --git a/lib/dpif-linux.h b/lib/dpif-linux.h
index 41ede74..f1a4faa 100644
--- a/lib/dpif-linux.h
+++ b/lib/dpif-linux.h
@@ -39,7 +39,6 @@ struct dpif_linux_vport {
     const uint8_t *address;                /* OVS_VPORT_ATTR_ADDRESS. */
     const struct nlattr *options;          /* OVS_VPORT_ATTR_OPTIONS. */
     size_t options_len;
-    int ifindex;                           /* OVS_VPORT_ATTR_IFINDEX. */
 };
 
 void dpif_linux_vport_init(struct dpif_linux_vport *);
-- 
1.7.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to