[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 2/3] QIOChannelSocket: Implement io_async_write & io_async
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v3 2/3] QIOChannelSocket: Implement io_async_write & io_async_flush |
Date: |
Thu, 30 Sep 2021 09:39:03 +0100 |
User-agent: |
Mutt/2.0.7 (2021-05-04) |
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é <berrange@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 :|
[PATCH v3 2/3] QIOChannelSocket: Implement io_async_write & io_async_flush, Leonardo Bras, 2021/09/22
Re: [PATCH v3 2/3] QIOChannelSocket: Implement io_async_write & io_async_flush, Peter Xu, 2021/09/28
[PATCH v3 3/3] multifd: Send using asynchronous write on nocomp to send RAM pages., Leonardo Bras, 2021/09/22
Re: [PATCH v3 0/3] QIOChannel async_write & async_flush + MSG_ZEROCOPY + multifd, Peter Xu, 2021/09/28