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

Re: Linux kernel NBD driver support for structured replies?



On Tue, Sep 07, 2021 at 04:35:13PM -0500, Eric Blake wrote:
> On Tue, Sep 07, 2021 at 02:19:32PM -0700, Josh Triplett wrote:
> > Does that seem reasonable to add to the kernel driver? I wanted to check
> > before considering development of a patch.
> 
> I'm not aware of anyone else doing it yet (I haven't yet been brave
> enough to dive into implementing this in the kernel, although I have
> implemented it in user space in both qemu and libnbd).  I'm certainly
> happy to help with integration testing, or give you tips on how to
> test it.

It's been on my low-priority TODO list since essentially when we
hammered down the spec, and even had a half-baked preliminary patch at
one point, but other things just keep being more urgent than that. I
won't complain if you implement it instead of me :)

Some thoughts you'll want to consider:

The kernel doesn't do the negotiation phase, only the transmission
phase; the negotiation phase is done in user space. This means the
client needs to figure out whether the currently-running kernel even
supports structured replies before it can negotiate them (otherwise the
kernel will be horribly confused). My half-baked patch would create a
driver sysfs attribute called "features" which just shows
"structured_replies" if they are supported by this kernel (the idea
being that the file could be extended in the future to also show
"metadata" if that ends up being supported, etc).

I was thinking it might also make sense to have an initial version of
structured replies set the "don't fragment" bit unconditionally, to keep
the accounting easier. Not sure whether that's worth it, though (never
got that far).

Obviously the server currently doesn't implement structured replies, and
implementing that properly could end up being somewhat complicated. I've
started working on that part of the equation recently, however.

Regards,

-- 
     w@uter.{be,co.za}
wouter@{grep.be,fosdem.org,debian.org}


Reply to: