+static int
+netdev_vport_send(struct netdev *netdev, const void *data, size_t size)
+{
+ struct netdev_dev *dev_ = netdev_get_dev(netdev);
+ struct netdev_dev_vport *dev = netdev_dev_vport_cast(dev_);
+
+ if (dev->dp_ifindex == -1) {
+ const char *name = netdev_get_name(netdev);
+ struct dpif_linux_vport reply;
+ struct ofpbuf *buf;
+ int error;
+
+ error = dpif_linux_vport_get(name, &reply, &buf);
+ if (error) {
+ VLOG_ERR_RL(&rl, "%s: failed to query vport for send (%s)",
+ name, strerror(error));
+ return error;
+ }
+ dev->dp_ifindex = reply.dp_ifindex;
+ dev->port_no = reply.port_no;
+ ofpbuf_delete(buf);
+ }
+
+ return dpif_linux_vport_send(dev->dp_ifindex, dev->port_no, data, size);
+}
+