bool use_builtin_virtio_net;
bool extbuf;
bool linearbuf;
+ bool async_copy;
/*
* The "supported_features" indicates the feature bits the
size_t size;
struct vhost_user_connection *conn;
int ret;
+ struct virtio_net *dev;
if (vsocket == NULL)
return;
if (vsocket->linearbuf)
vhost_enable_linearbuf(vid);
+ if (vsocket->async_copy) {
+ dev = get_device(vid);
+
+ if (dev)
+ dev->async_copy = 1;
+ }
+
VHOST_LOG_CONFIG(INFO, "new device, handle is %d\n", vid);
if (vsocket->notify_ops->new_connection) {
}
vdpa_dev = vsocket->vdpa_dev;
- if (!vdpa_dev || !vdpa_dev->ops->get_features) {
+ if (!vdpa_dev) {
*features = vsocket->features;
goto unlock_exit;
}
}
vdpa_dev = vsocket->vdpa_dev;
- if (!vdpa_dev || !vdpa_dev->ops->get_protocol_features) {
+ if (!vdpa_dev) {
*protocol_features = vsocket->protocol_features;
goto unlock_exit;
}
}
vdpa_dev = vsocket->vdpa_dev;
- if (!vdpa_dev || !vdpa_dev->ops->get_queue_num) {
+ if (!vdpa_dev) {
*queue_num = VHOST_MAX_QUEUE_PAIRS;
goto unlock_exit;
}
goto out_mutex;
}
+ vsocket->async_copy = flags & RTE_VHOST_USER_ASYNC_COPY;
+
+ if (vsocket->async_copy &&
+ (flags & (RTE_VHOST_USER_IOMMU_SUPPORT |
+ RTE_VHOST_USER_POSTCOPY_SUPPORT))) {
+ VHOST_LOG_CONFIG(ERR, "error: enabling async copy and IOMMU "
+ "or post-copy feature simultaneously is not "
+ "supported\n");
+ goto out_mutex;
+ }
+
/*
* Set the supported features correctly for the builtin vhost-user
* net driver.
~(1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT);
}
+ if (vsocket->async_copy) {
+ vsocket->supported_features &= ~(1ULL << VHOST_F_LOG_ALL);
+ vsocket->features &= ~(1ULL << VHOST_F_LOG_ALL);
+ VHOST_LOG_CONFIG(INFO,
+ "Logging feature is disabled in async copy mode\n");
+ }
+
/*
* We'll not be able to receive a buffer from guest in linear mode
* without external buffer if it will not fit in a single mbuf, which is