From: Sarah Sharp <sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: David Laight
<David.Laight-ZS65k/vG3HxXrIkS9f7CXA@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] usb: xhci: Link TRB must not occur with a USB payload burst.
Date: Tue, 12 Nov 2013 09:15:13 -0800 [thread overview]
Message-ID: <20131112171438.GA4925@xanatos> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1311111525480.17105-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
On Mon, Nov 11, 2013 at 03:34:53PM -0500, Alan Stern wrote:
> On Mon, 11 Nov 2013, David Laight wrote:
>
> > > Suppose, for example, the MBP is 1024. If you have a TD with length
> > > 1500, and if it had only one fragment, the last (and only) fragment's
> > > length would not less than the MBP and it would not be an exact
> > > multiple of the MBP.
> >
> > That doesn't matter - eg example 2 in figure 25
>
> You're right. I do wish the spec had been written more clearly.
>
> > Reading it all again makes me think that a LINK trb is only
> > allowed on the burst boundary (which might be 16k bytes).
> > The only real way to implement that is to ensure that TD never
> > contain LINK TRB.
>
> That's one way to do it. Or you could allow a Link TRB at an
> intermediate MBP boundary.
I like this idea instead. The xHCI driver should be modified to be able
to handle link TRBs in the middle of the segments (the cancellation code
would have to be touched as well). We would keep a running count
of the number of bytes left in a TD fragment, as we fill in the TRBs.
If we find the TD fragment would span a link TRB, we backtrack to the
end of the last TD fragment, put in a link TRB, and then continue on the
next segment.
> It comes down to a question of how often you want the controller to
> issue an interrupt. If a ring segment is 4 KB (one page), then it can
> hold 256 TRBs. With scatter-gather transfers, each SG element
> typically refers to something like a 2-page buffer (depends on how
> fragmented the memory is). Therefore a ring segment will describe
> somewhere around 512 pages of data, i.e., something like 2 MB. Since
> SuperSpeed is 500 MB/s, you'd end up getting in the vicinity of 250
> interrupts every second just because of ring segment crossings.
The driver is currently defined to have 64 TRBs per ring segment. But
that doesn't matter; we don't get an interrupt when a ring segment is
crossed. Instead we set the interrupt-on-completion flag on the last
TRB of the TD, not on any earlier fragment or link TRB.
> Using larger ring segments would help.
Ring segments have to be physically contiguous, so I'm not sure if we
want to ask for segments that are bigger than a page. I've already got
a report from someone else about the ring expansion getting out of
control, so I would like to figure that out before we talk about using
even bigger segments.
Finally, it's interesting to note that the USB mass storage driver is
using scatter gather lists just fine without the driver following the TD
fragment rules. Or at least no one has reported any issues. I wonder
why it works?
Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-11-12 17:15 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 17:20 [PATCH] usb: xhci: Link TRB must not occur with a USB payload burst David Laight
2013-11-08 0:18 ` Sarah Sharp
2013-11-08 10:47 ` David Laight
2013-11-08 16:45 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1311081119510.1162-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-11-08 17:39 ` David Laight
2013-11-08 18:12 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1311081303460.1162-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-11-11 17:12 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B73FE-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-11 20:34 ` Alan Stern
2013-11-12 9:43 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B73FF-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-12 16:08 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1311121051090.1200-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-11-12 16:50 ` David Laight
2013-11-12 19:00 ` Alan Stern
2013-11-13 9:28 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B740B-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-13 16:20 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1311131113090.1424-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-11-13 16:58 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B741A-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-16 1:38 ` Ben Hutchings
[not found] ` <1384565904.29151.66.camel-/LGg1Z1CJKQ+9kgCwbf1HqK4ta4zdZpAajtMo4Cw6ucAvxtiuMwx3w@public.gmane.org>
2013-11-18 9:48 ` David Laight
2013-11-18 15:03 ` Ben Hutchings
[not found] ` <1384787003.10077.34.camel-nDn/Rdv9kqW9Jme8/bJn5UCKIB8iOfG2tUK59QYPAWc@public.gmane.org>
2013-11-18 15:41 ` David Laight
2013-11-19 22:58 ` Sarah Sharp
2013-11-20 3:09 ` Alan Stern
2013-11-20 9:36 ` David Laight
2013-11-20 15:03 ` Eric Dumazet
[not found] ` <1384959827.8604.141.camel-XN9IlZ5yJG9HTL0Zs8A6p/gx64E7kk8eUsxypvmhUTTZJqsBc5GL+g@public.gmane.org>
2013-11-20 15:54 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B7437-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-20 16:06 ` Sarah Sharp
2013-11-20 17:02 ` David Laight
2013-11-20 17:16 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B743D-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-20 18:39 ` Sarah Sharp
2013-11-20 21:11 ` Paul Zimmerman
2013-11-21 9:53 ` David Laight
2013-11-20 9:46 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B7438-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-20 16:26 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1311201121350.1826-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-11-20 17:08 ` David Laight
2013-11-20 16:50 ` Sarah Sharp
[not found] ` <Pine.LNX.4.44L0.1311111525480.17105-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-11-12 17:15 ` Sarah Sharp [this message]
2013-11-12 17:33 ` David Laight
2013-11-12 19:22 ` Alan Stern
2013-11-13 9:45 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B740C-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-13 16:27 ` Alan Stern
2013-11-08 11:07 ` David Laight
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B73F1-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2013-11-12 17:15 ` Sarah Sharp
2013-11-12 17:28 ` David Laight
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=20131112171438.GA4925@xanatos \
--to=sarah.a.sharp-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=David.Laight-ZS65k/vG3HxXrIkS9f7CXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).