Skip to contentSkip to conversation

vhost: dequeue zero copy with linear buffers

PATCH In review Sivaprasad Tummala 2 participants 2 messages Mar 26, 2020 – Apr 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: dequeue zero copy with linear buffers

Removed the linear buffer and zero_copy compatibility restriction.

Applications that requires packets contained in a single buffer will enable linear buffer in vhost library. This restriction is not allowing zero_copy mode for such cases.

---
 lib/librte_vhost/socket.c | 6 ------
 1 file changed, 6 deletions(-)
lib/librte_vhost/socket.c +0 -6
index 7c8012179..e1afc290e 100644
@@ -920,12 +920,6 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (vsocket->linearbuf) {
-			VHOST_LOG_CONFIG(ERR,
-			"error: zero copy is incompatible with linear buffers\n");
-			ret = -1;
-			goto out_mutex;
-		}
 		vsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER);
 		vsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER);
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Sivaprasad Tummala

Removed the linear buffer and zero_copy compatibility restriction.

Applications that requires packets contained in a single buffer will enable linear buffer in vhost library. This restriction is not allowing zero_copy mode for such cases.

As discussed off-list, this restriction makes sense because we cannot control how the guest splits the packets into chained descriptors.

So as soon as the zero-copy is enabled, we cannot guarantee the application that buffers will be linear.

Regards,
Maxime

Quoted 23 lines
---
 lib/librte_vhost/socket.c | 6 ------
 1 file changed, 6 deletions(-)
lib/librte_vhost/socket.c +0 -6
index 7c8012179..e1afc290e 100644
@@ -920,12 +920,6 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (vsocket->linearbuf) {
-			VHOST_LOG_CONFIG(ERR,
-			"error: zero copy is incompatible with linear buffers\n");
-			ret = -1;
-			goto out_mutex;
-		}
 		vsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER);
 		vsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER);