qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 06/11] QIOChannelSocket: Implement io_writev zero copy flag &


From: Peter Xu
Subject: Re: [PULL 06/11] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX
Date: Mon, 2 May 2022 21:22:38 -0400

On Mon, May 02, 2022 at 09:12:53PM -0300, Leonardo Bras Soares Passos wrote:
> Hello Peter,
> 
> On Mon, May 2, 2022 at 8:52 PM Peter Xu <peterx@redhat.com> wrote:
> >
> > Leo,
> >
> > On Fri, Apr 29, 2022 at 11:40:44PM -0300, Leonardo Bras Soares Passos wrote:
> > > Does anyone else have any further suggestions, or know how this kind of 
> > > issue
> > > is generally solved in qemu?
> >
> > I've no solid idea why it can't see MSG_ZEROCOPY defined in the specific
> > environment, but when I was looking at bits/socket.h I saw this:
> >
> > #ifndef _SYS_SOCKET_H
> > # error "Never include <bits/socket.h> directly; use <sys/socket.h> 
> > instead."
> > #endif
> >
> > Maybe worth a shot to do a replacement in all cases?
> >
> 
> Sure, no problem with this, I will update for v11.
> (Or should I send a different patch since Dave has already merged in his 
> tree?)
> 
> But it should not interfere in MSG_ZEROCOPY definition:
> 
> > > I tracked down how the test happened, downloaded the same docker image 
> > > from the
> > > tests(opensuse-leap-15.2), and took a look at the filesystem for the
> > > MSG_ZEROCOPY define, which I could not find anywhere.
> 
> By this, I mean I did a 'grep MSG_ZEROCOPY -r /' and could not find anything, 
> so
> it's probably not defined anywhere in the fs.

What you described gives me the feeling that the distro seems to have had
mismatched versions of asm-generic/socket.h (who should define
SO_ZEROCOPY), and bits/socket.h (who should define MSG_ZEROCOPY).

Let's first replace it with sys/socket.h, then one trick you could consider
play with (even if any env could have broken headers) that I thought of, is
you can put your code into:

#if defined(MSG_ZEROCOPY) && defined(SO_ZEROCOPY)
...
#endif

Blocks.  Just to avoid assuming CONFIG_LINUX will be the same.

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]