aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2011-10-05 19:06:29 -0700
committerPravin B Shelar <pshelar@nicira.com>2011-10-05 19:06:29 -0700
commit33b14e70e2c1c6dd6bf52ae4ec3099bc4456270e (patch)
tree78c3116b7e081f63fa0f254d45af3ee252ae8689
parentc4f8424e0e18bf2c0be4d0800cc343b9d91ea897 (diff)
datapath: Strip down vport interface - ifIndex.
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
-rw-r--r--datapath/datapath.c5
-rw-r--r--include/openvswitch/datapath-protocol.h6
-rw-r--r--lib/dpif-linux.c8
-rw-r--r--lib/dpif-linux.h1
4 files changed, 0 insertions, 20 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 15c1e33b..a925f6f2 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 3db960a9..6c894111 100644
--- a/include/openvswitch/datapath-protocol.h
+++ b/include/openvswitch/datapath-protocol.h
@@ -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
};
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index 4ddd4647..89815006 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 41ede747..f1a4faad 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 *);