On Fri, Jun 19, 2020 at 04:01:57PM +0300, Vladimir Oltean wrote:
> Again, I would have accepted any technical argument you could bring.

Thinking more about this, there is in fact a technical reason to leave
the code as is.  For DGRAM sockets, the behavior of recvmsg() in
sk_receive() is the same with and without DONTWAIT.  But this is only
by chance.

Consider a STREAM socket with fixed message sizes.  In that case, poll
indicates only that the socket is readable, and not that an entire
message is available.  When recvmsg(flags=DONTWAIT) returns, the
length may be less than a full message, and the code in sk_receive()
would have to read the socket again (and again) until a whole message
arrives.  If sk_receive(flags=DONTWAIT) is allowed, then that method
would have to cover the case of reading a partial message.

But sk_receive() does not implement that programming pattern. Instead
the caller knows a message is available, and then sk_receive()
"blocks" in recvmsg() for that one message.  That is the design
pattern.

> So, as a matter of personal style, I think the only right thing for me
> to do is to retreat now. Feel free to use any portion of the patches I
> submitted so far in any combination you see desirable.

I will likely apply patch 3.  For patch 2, could you please comment on
the diff I posted as an alternate solution?

Thanks,
Richard


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to