Re: [dpdk-dev] [PATCH 28/40] net/virtio: add Virtio-user vring setting ops
From: David Marchand <hidden>
Date: 2021-01-05 21:24:36
From: David Marchand <hidden>
Date: 2021-01-05 21:24:36
Skipping to the build error, I did not review this patch yet. On Sun, Dec 20, 2020 at 10:16 PM Maxime Coquelin [off-list ref] wrote:
--- a/drivers/net/virtio/virtio_user/vhost_kernel.c +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c@@ -219,12 +219,49 @@ vhost_kernel_set_memory_table(struct virtio_user_dev *dev) return -1; } +static int +vhost_kernel_set_vring(struct virtio_user_dev *dev, uint64_t req, struct vhost_vring_state *state) +{ + int ret, fd; + uint32_t index = state->index; + + /* Convert from queue index to queue-pair & offset */ + fd = dev->vhostfds[state->index / 2]; + state->index %= 2; + + ret = vhost_kernel_ioctl(fd, req, state); + if (ret < 0) { + PMD_DRV_LOG(ERR, "Failed to set vring (request %lu)", req);
Breaks 32bits build.
+ return -1; + } + + /* restore index back to queue index */ + state->index = index; + + return 0; +} +
-- David Marchand