qemu-block
[Top][All Lists]
Advanced

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

Re: [RFC v2] nbd/proto: introduce extended request and 64bit commands


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [RFC v2] nbd/proto: introduce extended request and 64bit commands
Date: Mon, 25 May 2020 17:40:16 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

25.05.2020 16:37, Wouter Verhelst wrote:
Hi guys,

Sorry for slacking here.

On Wed, Mar 18, 2020 at 07:22:39AM -0500, Eric Blake wrote:
On 3/18/20 3:04 AM, Wouter Verhelst wrote:
On Wed, Mar 18, 2020 at 09:19:45AM +0300, Vladimir Sementsov-Ogievskiy wrote:
OK, understand. Reasonable thing, agreed. I'll resend.

Hmm. But we can't read in one go anyway, because we need to distinguish 
NBD_REQUEST_MAGIC
from NBD_EXTENDED_REQUEST_MAGIC..

Yes, that needs to happen at any rate, indeed. So the difference will be
two reads rather than three, instead of one read rather than two.

That's still an advantage.

Not much of one.  You're micro-optimizing the read()s, but in reality, the
sender will likely send() the entire packet at once, at which point the data
is in the kernel and the reads will succeed back-to-back, or you can even
write the client to read into a buffer to minimize syscalls and then parse
as much as needed out of the buffer.

You've got a LOT more overhead in the TCP packet and network transmission
time than you do in deciding whether the server has to do 2 or 3 read()s per
client message.

While it might be nice to design a message that doesn't need the server to
do additional decision points mid-packet in determining how much packet
remains, that should not be your driving factor. Even with current servers,
that is already the case (the server has to decide mid-packet whether it is
handling NBD_CMD_WRITE and thus has more data to read).

Having payload length and affected length as separate entities also
makes the protocol context free, which should make things easier to
parse for things like wireshark etc. It also feels a bit cleaner to me,
in that a server implementation can separate "reading data" from
"handling data" more cleanly.

(e.g., nbd-server has to special-case NBD_CMD_WRITE in a generic "read
the next command" function, which I think is rather ugly)

Other than this (minor) issue, I think this proposal is certainly ready
to go, and I apologise for not having followed up on it ealier.

Would you be so kind as to propose a new patch, with changes as
suggested in this thread? I promise to not let it linger for months
again then ;-)


Hi!) Which changes do you mean?

In my last two emails I argue for no-changes and nobody answered.. Are you OK 
with patch as is or what do you want to change?

--
Best regards,
Vladimir



reply via email to

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