Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Suwan Kim <suwan.kim027@gmail.com>
Cc: shuah@kernel.org, <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] usbip: Implement SG support to vhci
Date: Mon, 24 Jun 2019 13:24:15 -0400 (EDT)
Message-ID: <Pine.LNX.4.44L0.1906241322140.1609-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20190624145852.GC7547@localhost.localdomain>

On Mon, 24 Jun 2019, Suwan Kim wrote:

> > > +	hcd->self.sg_tablesize = ~0;
> > > +	hcd->self.no_sg_constraint = 1;
> > 
> > You probably shouldn't do this, for two reasons.  First, sg_tablesize
> > of the server's HCD may be smaller than ~0.  If the client's value is
> > larger than the server's, a transfer could be accepted on the client
> > but then fail on the server because the SG list was too big.

On the other hand, I don't know of any examples where an HCD has 
sg_tablesize set to anything other than 0 or ~0.  vhci-hcd might end up 
being the only one.

> > Also, you may want to restrict the size of SG transfers even further,
> > so that you don't have to allocate a tremendous amount of memory all at
> > once on the server.  An SG transfer can be quite large.  I don't know 
> > what a reasonable limit would be -- 16 perhaps?
> 
> Is there any reason why you think that 16 is ok? Or Can I set this
> value as the smallest value of all HC? I think that sg_tablesize
> cannot be a variable value because vhci interacts with different
> machines and all machines has different sg_tablesize value.

I didn't have any good reason for picking 16.  Using the smallest value 
of all the HCDs seems like a good idea.

Alan Stern


  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 17:45 [PATCH 0/2] " Suwan Kim
2019-06-21 17:45 ` [PATCH 1/2] usbip: Skip DMA mapping and unmapping for urb at vhci Suwan Kim
2019-06-29  0:11   ` shuah
2019-07-01  9:29     ` Suwan Kim
2019-06-21 17:45 ` [PATCH 2/2] usbip: Implement SG support to vhci Suwan Kim
2019-06-21 20:05   ` Alan Stern
2019-06-24 14:58     ` Suwan Kim
2019-06-24 17:24       ` Alan Stern [this message]
2019-07-04 17:24         ` Suwan Kim
2019-07-05  1:41           ` Alan Stern
2019-07-05  9:07             ` Suwan Kim
2019-06-22 10:40   ` kbuild test robot

Reply instructions:

You may reply publically 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=Pine.LNX.4.44L0.1906241322140.1609-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=suwan.kim027@gmail.com \
    /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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox