mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Greg KH <greg@kroah.com>
Cc: linux-usb@vger.kernel.org, bgmerrell@novell.com,
	hirofuchi@users.sourceforge.net, linux-kernel@vger.kernel.org,
	usbip-devel@lists.sourceforge.net
Subject: Re: USBIP protocol
Date: Tue, 2 Sep 2008 22:25:43 -0600	[thread overview]
Message-ID: <20080903042539.GB2772@parisc-linux.org> (raw)
In-Reply-To: <20080829145407.GB18423@kroah.com>

On Fri, Aug 29, 2008 at 07:54:07AM -0700, Greg KH wrote:
> Fair enough, patches welcome :)

Here's a document for discussion.  No code yet, though I'm quite willing
to modify the current usbip code to follow this new protocol.  Just a
matter of time.

http://www.kernel.org/pub/linux/kernel/people/willy/usbip/usbip-protocol-draft-1

To save some time for reviewers, here's a list of decisions I took while
working on the document.  I appreciate that some of the decisions I made
were not necessarily those another designer might have made, so I ask
that any comments along the lines of "I would have done it differently"
include a really good reason.

----

I've merged the two protocols.  It is no longer the case that the protocol
completely changes when userspace drops the connection into the kernel.
It's still possible to do a hybrid implementation where userspace
implements version, list and claim and kernelspace handles release,
submit and unlink.

During development of my own implementation, I noticed the client and
server get confused about where the packets were in the TCP stream.
No more; if using a stream protocol, we wrap each packet in a 'RM'.

I considered using the whole of sunrpc.  The encoding is quite
heavyweight and I felt I could do better by specialising the protocol to
USB's purposes.

'get version' is now a call rather than including a version field in
every request.

Devices are now referred to as an ascii string rather than an encoded
4-byte quantity.  This helps userspace configure the device and lets us
interoperate with other OSes that might want to implement this protocol.

Instead of transmitting the device number in every command, we now bind
each socket to a particular device.  This was already what happened,
so it was just overhead.

I've split 'cmd_submit' into four commands (control, data, isoc, irq).
That gives us the ability to make 'data' very small.

There's no need to respond with the call number to each call -- the
caller should be using the call identifier to find out what type of
call it was.  Often the implementation will issue a command and then
wait for the response, so even that is unnecessary.

Replying with the status is vital.

I decided to make the 'call' value 32-bit (instead of 8-bit) to make
everything align nicely.  Then I wanted to slim down the data command
call, so I tucked the endpoint and direction in there too.

I have no experience with isosynchronous transactions, nor interrupt
transactions, so I decline to define them at this moment.

I've given up on the big/little endian thing.  Network protocols are
traditionally BE, USB is LE and it can encapsulate SCSI which is BE again.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  parent reply	other threads:[~2008-09-03  4:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-29 14:02 Matthew Wilcox
2008-08-29 14:06 ` Andi Kleen
2008-08-29 22:31   ` Marcel Holtmann
2008-08-29 20:46     ` Matthew Wilcox
2008-08-29 20:51       ` Willy Tarreau
2008-08-29 14:30 ` Greg KH
2008-08-29 14:43   ` Matthew Wilcox
2008-08-29 14:54     ` Greg KH
2008-08-29 15:36       ` Matthew Wilcox
2008-08-29 15:53         ` Dave Higton
2008-09-03  4:25       ` Matthew Wilcox [this message]
2008-09-03 15:40         ` Alan Stern
2008-09-03 19:10           ` Matthew Wilcox
2008-09-03 20:15             ` Alan Stern
2008-09-04 21:48               ` Matthew Wilcox
2008-09-04 22:15                 ` Greg KH
2008-09-05  3:26                 ` Pete Zaitcev
2008-09-05 11:37                 ` Tilman Schmidt
2008-09-05 15:05                 ` Alan Stern
2008-09-09  0:53                   ` Matthew Wilcox
2008-09-09  7:12                     ` Steve Calfee
2008-09-09  7:33                       ` Greg KH
2008-09-09  8:04                         ` Greg KH
2008-09-09 15:21                     ` Alan Stern
2008-09-03 15:57         ` Greg KH
2008-09-03 19:43           ` Matthew Wilcox
2008-09-04  2:41             ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080903042539.GB2772@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=bgmerrell@novell.com \
    --cc=greg@kroah.com \
    --cc=hirofuchi@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=usbip-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®