{
struct ovs_header *ovs_header;
struct nlattr *nla;
- int ifindex;
int err;
ovs_header = genlmsg_put(skb, pid, seq, &dp_vport_genl_family,
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:
* @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.
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
};
.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)];
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;
}
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. */
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 *);