aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>2023-03-17 14:59:49 +0100
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-03 15:18:54 +0300
commit75dbf6ff44fc7f499f401265703d4bca5aaf3a79 (patch)
treec46aa78e02026d26708afb6451890ba13dbfea2f
parent7dc0d72ab800c9d65d44cc3ba41f2bc3083c1d48 (diff)
Update/Polish virtio-loopback-adapter Delta release:
- Add new ioctl for sharing communication shared struct - Remove old ioctls and comments Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
-rw-r--r--vhost_user_loopback.c2
-rw-r--r--virtio_loopback.c4
-rw-r--r--virtio_loopback.h4
3 files changed, 3 insertions, 7 deletions
diff --git a/vhost_user_loopback.c b/vhost_user_loopback.c
index 91e2efb..bf5c8da 100644
--- a/vhost_user_loopback.c
+++ b/vhost_user_loopback.c
@@ -1273,8 +1273,6 @@ void find_add_new_reg(struct vhost_dev *dev)
int sglist_elem_num;
int i;
- (void)ioctl(loopback_fd, BARRIER);
-
DBG("Total nvqs: %d\n", dev->nvqs);
for (int i = 0; i < dev->nvqs; i++) {
diff --git a/virtio_loopback.c b/virtio_loopback.c
index 0eaac50..38b4209 100644
--- a/virtio_loopback.c
+++ b/virtio_loopback.c
@@ -2122,8 +2122,8 @@ int virtio_loopback_start(void)
*/
(void)ioctl(fd, EFD_INIT, &info);
- /* Map notification mechanism */
- /* Multiple mmaps: /dev/loopback-0/vqs, /dev/loopback-0/ctlr */
+ /* Map communication mechanism */
+ (void)ioctl(fd, SHARE_COM_STRUCT);
address = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (address == MAP_FAILED) {
perror("mmap operation failed");
diff --git a/virtio_loopback.h b/virtio_loopback.h
index e581d92..ae0a8b4 100644
--- a/virtio_loopback.h
+++ b/virtio_loopback.h
@@ -166,10 +166,8 @@
#define IRQ _IOC(_IOC_WRITE, 'k', 4, sizeof(int))
#define SHARE_VQS _IOC(_IOC_WRITE, 'k', 5, sizeof(uint32_t))
#define SHARE_BUF _IOC(_IOC_WRITE, 'k', 6, sizeof(uint64_t))
-#define USED_INFO _IOC(_IOC_WRITE, 'k', 7, 0)
-#define DATA_INFO _IOC(_IOC_WRITE, 'k', 8, 0)
+#define SHARE_COM_STRUCT _IOC(_IOC_WRITE, 'k', 7, 0)
#define MAP_BLK _IOC(_IOC_WRITE, 'k', 9, 0)
-#define BARRIER _IOC(_IOC_WRITE, 'k', 10, 0)
#define VIRTIO_PCI_VRING_ALIGN 4096