Re: [PATCH net-next v3 4/4] vsock/virtio: MSG_ZEROCOPY flag support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 27, 2023 at 11:32:00AM +0300, Arseniy Krasnov wrote:
On 25.07.2023 15:28, Stefano Garzarella wrote:
On Tue, Jul 25, 2023 at 12:16:11PM +0300, Arseniy Krasnov wrote:
On 25.07.2023 11:46, Arseniy Krasnov wrote:
On 25.07.2023 11:43, Stefano Garzarella wrote:
On Fri, Jul 21, 2023 at 08:09:03AM +0300, Arseniy Krasnov wrote:

[...]

+    t = vsock_core_get_transport(info->vsk);

-        if (msg_data_left(info->msg) == 0 &&
-            info->type == VIRTIO_VSOCK_TYPE_SEQPACKET) {
-            hdr->flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM);
+    if (t->msgzerocopy_check_iov &&
+        !t->msgzerocopy_check_iov(iov_iter))
+        return false;

I'd avoid adding a new transport callback used only internally in virtio
transports.

Ok, I see.


Usually the transport callbacks are used in af_vsock.c, if we need a
callback just for virtio transports, maybe better to add it in struct
virtio_vsock_pkt_info or struct virtio_vsock_sock.

Hm, may be I just need to move this callback from 'struct vsock_transport' to parent 'struct virtio_transport',
after 'send_pkt' callback. In this case:
1) AF_VSOCK part is not touched.
2) This callback stays in 'virtio_transport.c' and is set also in this file.
  vhost and loopback are unchanged - only 'send_pkt' still enabled in both
  files for these two transports.

Yep, this could also work!

Stefano

Great! I'll send this implementation when this patchset for MSG_PEEK will be merged
to net-next as both conflicts with each other.

https://lore.kernel.org/netdev/20230726060150-mutt-send-email-mst@xxxxxxxxxx/T/#m56f3b850361a412735616145162d2d9df25f6350

Ack!

Thanks,
Stefano

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization




[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux