This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Network speed very slow with redboot


>>>>> Gary Thomas writes:

> On Thu, 2002-03-07 at 08:01, Nejat Tek wrote:
>> 
>> Hello all,
>> 
>> Now we know that it is supposed to be slow, is there any quick fix
>> that can speed up the redboot networking?
>> Do you think, for example, polling the ethernet device driver more
>> often, or, changing background networking thread priority, can I
>> obtain a significant improvement ? If so, which piece of code should
>> I play with ?
>> 

> There are no threads in RedBoot :-)

> I don't think that there is much that can be done [easily].  The biggest
> problem is the size of the packets that GDB uses and the associated
> overhead.  If you use RedBoot to download code directly (using TFTP and
> the 'load' command), you'll see much faster download times.  I just tested 
> it on one of our platforms here and the difference was pretty
> large:
>   GDB - 153k (bits/sec)
>   RedBoot via 'load' - 700k (bits/sec)
> So the problem is not really with RedBoot's networking code, but the
> additional overheads involved with the GDB protocol.

There are some knobs in gdb which can be used to improve the situation.
By default, gdb will send relatively small packets during download.

  (gdb) set download-write-size xxx

asks gdb to try using xxx bytes per download packet. There is interaction
with the memory-write-size knob which may limit the download size. For
my xscale toolchain, I see:

  (gdb) show remote memory-write-packet-size 
  The memory-write-packet-size is 0. Packets are limited to 399 bytes.

You can force gdb to use a larger memory-write-packet-size with:
 
  (gdb) set remote memory-write-packet-size 800
  The memory-write-packet-size is 800. Packets are limited to 399 bytes.

Notice how gdb still limits it to 399. Force gdb to use the previously
entered 800:
  
  (gdb) set remote memory-write-packet-size fixed
  The target may not be able to correctly handle a memory-write-packet-size
  of 800 bytes. Change the packet size? (y or n) y

  (gdb) show remote memory-write-packet-size
  The memory-write-packet-size is 800. Packets are fixed at 800 bytes.

Now the problem is that the target side has to be able to handle packets of
up to 800 bytes. Unfortunately, the ARM HAL cannot handle packets larger
than (NUMREGBYTES * 2)+32 bytes, where NUMREGBYTES is defined in:

   hal/arm/arch/include/arm_stub.h

As an experiment, I commented out the NUMREGBYTES define in arm_stub.h
so that a default gdb stub buffer of 2k was used. I then downloaded an
app using the default gdb settings and got 155K/sec. I then used:

  (gdb) set download-write-size 1000
  (gdb) set remote memory-write-packet-size 1000
  (gdb) set remote memory-write-packet-size fixed
  The target may not be able to correctly handle a memory-write-packet-size
  of 1000 bytes. Change the packet size? (y or n) y

I then reloaded the app and saw 320K/sec.

--Mark

  


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]