On Wed, Sep 29, 2021 at 04:32:12PM -0300, Leonardo Bras Soares Passos wrote: > Hello Daniel, > > On Fri, Sep 24, 2021 at 2:38 PM Daniel P. Berrangé <berra...@redhat.com> > wrote: > [...] > > > @@ -154,6 +171,19 @@ int qio_channel_socket_connect_sync(QIOChannelSocket > > > *ioc, > > > return -1; > > > } > > > > > > +#ifdef CONFIG_LINUX > > > + if (addr->type != SOCKET_ADDRESS_TYPE_INET) { > > > + return 0; > > > + } > > > + > > > + ret = qemu_setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &v, sizeof(v)); > > > + if (ret >= 0) { > > > + QIOChannelClass *klass = QIO_CHANNEL_GET_CLASS(ioc); > > > + klass->io_async_writev = qio_channel_socket_async_writev; > > > + klass->io_async_flush = qio_channel_socket_async_flush; > > > + } > > > +#endif > > > > This is not write - the async APIs should not be tied 1:1 to ZEROCOPY > > usage - we should have them take a flag to request ZEROCOPY behaviour. > > I agree, but I am not aware of how to do asynchronous send in a socket > without MSG_ZEROCOPY. > > I mean, I know of the non-blocking send, but I am not sure how it > checks if everything was sent (i.e. the flush part). > Would it also be using the ERRQUEUE for that? > > What would you suggest?
Yeah, there isn't any really. I guess I'm anticipating a future that probably won't exist. Lets just call the callbacks 'io_write_zerocopy' and 'io_flush_zerocopy' and ignore the flag. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|