public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/5] ehci-hcd: Boost transfer speed
Date: Tue, 31 Jul 2012 22:01:51 +0200	[thread overview]
Message-ID: <501839AF.60208@herbrechtsmeier.net> (raw)
In-Reply-To: <635841778.759390.1343522898919.JavaMail.root@advansee.com>

Dear Beno?t

Am 29.07.2012 02:48, schrieb Beno?t Th?baudeau:
> Sorry for the delay. I'm very busy, and there is much to tell on this topic.
No problem. Hopefully I don't make you to much extra trouble.

>>> BTW, the 15x speed gain that I gave in my patch description was
>>> compared to an
>>> older version of the original code that used 20 blocks per transfer
>>> in
>>> usb_storage.c. This is now 40 blocks per transfer with a
>>> page-aligned buffer, so
>>> the speed gain compared to the current code should be rather about
>>> 7x. I should
>>> update that.
>> I'm sure that there is a significant speed gain but you shouldn't
>> miss
>> the heap usage as the main CONFIG_SYS_MALLOC_LEN is 128kB.
> I have checked all the config files. Among those using EHCI, most have a heap
> size >= 1 MiB. The only exceptions are:
>
> ---------------------------------------------
> | Heap Size |      Board       |  RAM Size  |
> |-------------------------------------------|
> |   512 kiB | MERGERBOX        |   > 10 MiB |
> |           | MPC8315ERDB      |    128 MiB |
> |           | MVBLM7           |    512 MiB |
> |-------------------------------------------|
> |   256 kiB | MPC8349ITX       |    256 MiB |
> |           | omap4_panda      |      1 GiB |
> |-------------------------------------------|
> |   128 kiB | adp-ag102        |    256 MiB |
> |           | at91sam9m10g45ek |    128 MiB |
> |           | edminiv2         |     64 MiB |
> |           | M52277EVB        |     64 MiB |
> |           | omap3_beagle     | >= 128 MiB |
> ---------------------------------------------
>
> As you can see, these small heap sizes are not linked to any hardware
> constraint, but only to the lack of need to have larger heaps, so they could be
> easily enlarged if needed. But even 128 kiB should be enough for common usage.
You are right.
>
>> Maybe you should also add a worst case heap usage and I'm not sure,
>> if
>> your calculation are right, as the size of struct qTD is allays 32B
>> and
>> thereby I get 50kB or 64kB.
> >From ehci.h:
> struct qTD {
> 	/* this part defined by EHCI spec */
> 	uint32_t qt_next;		/* see EHCI 3.5.1 */
> #define	QT_NEXT_TERMINATE	1
> 	uint32_t qt_altnext;		/* see EHCI 3.5.2 */
> 	uint32_t qt_token;		/* see EHCI 3.5.3 */
> 	uint32_t qt_buffer[5];		/* see EHCI 3.5.4 */
> 	uint32_t qt_buffer_hi[5];	/* Appendix B */
> 	/* pad struct for 32 byte alignment */
> 	uint32_t unused[3];
> };
>
> So sizeof(struct qTD) is 16 * 32 bits = 64 bytes. For the worst alignment case,
> the number of qTDs to allocate for 65535 blocks of 512 bytes (worst MSC case
> with 512-byte sectors) is DIV_ROUND_UP(65535 * 512, 4 * 4096) = 2048 qTDs, i.e.
> 128 kiB. For the same transfer size with the best alignment case, it is
> DIV_ROUND_UP(65535 * 512, 5 * 4096) = 1639 qTDs, i.e. 104896 B.
Sorry, you are right. I had missed the arrays.

Regards,
     Stefan

  parent reply	other threads:[~2012-07-31 20:01 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 20:17 [U-Boot] [PATCH 2/5] ehci-hcd: Boost transfer speed Benoît Thébaudeau
2012-07-20 11:26 ` [U-Boot] [PATCH v2 " Benoît Thébaudeau
2012-07-20 11:37   ` Stefan Herbrechtsmeier
2012-07-20 13:17     ` Benoît Thébaudeau
2012-07-20 13:44       ` Marek Vasut
2012-07-20 13:56         ` Benoît Thébaudeau
2012-07-20 14:51           ` Stefan Herbrechtsmeier
2012-07-20 15:03             ` Benoît Thébaudeau
2012-07-20 15:15               ` Stefan Herbrechtsmeier
2012-07-20 15:35                 ` Benoît Thébaudeau
2012-07-23 13:35                   ` Stefan Herbrechtsmeier
2012-07-23 17:15                     ` Benoît Thébaudeau
2012-07-24 13:02                       ` Stefan Herbrechtsmeier
2012-07-29  0:48                         ` Benoît Thébaudeau
2012-07-30 22:38                           ` Marek Vasut
2012-07-31  1:06                             ` Benoît Thébaudeau
2012-07-31 19:52                               ` Stefan Herbrechtsmeier
2012-08-01  2:41                                 ` Marek Vasut
2012-08-03 23:02                               ` Benoît Thébaudeau
2012-08-04  7:45                                 ` Marek Vasut
2012-08-08 23:14                                   ` Benoît Thébaudeau
2012-08-08 23:14                                     ` Marek Vasut
2012-07-31 20:01                           ` Stefan Herbrechtsmeier [this message]
2012-07-27 14:07   ` Marek Vasut
2012-07-27 14:16     ` Benoît Thébaudeau
2012-07-27 14:30       ` Marek Vasut
2012-08-09 21:51   ` [U-Boot] [PATCH v3 3/8] " Benoît Thébaudeau
2012-08-09 22:32     ` Marek Vasut
2012-07-27 12:54 ` [U-Boot] [PATCH 2/5] " Marek Vasut
2012-07-27 13:59   ` Benoît Thébaudeau
2012-07-27 14:01     ` Marek Vasut
2012-07-27 14:13       ` Benoît Thébaudeau
2012-07-27 14:31         ` Marek Vasut
2012-07-29  0:58         ` Benoît Thébaudeau
2012-07-29  1:40           ` Marek Vasut
2012-07-29 14:14             ` Benoît Thébaudeau
2012-07-29 18:08               ` Marek Vasut

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=501839AF.60208@herbrechtsmeier.net \
    --to=stefan@herbrechtsmeier.net \
    --cc=u-boot@lists.denx.de \
    /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