datapath: Strip down vport interface - ifIndex.
authorPravin B Shelar <pshelar@nicira.com>
Thu, 6 Oct 2011 02:06:29 +0000 (19:06 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Thu, 6 Oct 2011 02:06:29 +0000 (19:06 -0700)
        Following patch removes ifIndex attribute of vport which is not
used in userspace.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #7114

datapath/datapath.c
include/openvswitch/datapath-protocol.h
lib/dpif-linux.c
lib/dpif-linux.h

index 15c1e33..a925f6f 100644 (file)
@@ -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:
index 3db960a..6c89411 100644 (file)
@@ -230,15 +230,10 @@ 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
  * optional; if not specified a free port number is automatically selected.
@@ -259,7 +254,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
 };
 
index 4ddd464..8981500 100644 (file)
@@ -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. */
index 41ede74..f1a4faa 100644 (file)
@@ -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 *);