Network in RedBoot

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Network in RedBoot

Wolfgang Köbler-3
Hi,

Just two hints about the RedBoot network stack:

1. There are strange max eth frame sizes that could lead to problems:

- Usually, eth packages contain up to 1500 bytes of data (+14 Header +4 CRC)
(according to http://www.erg.abdn.ac.uk/users/gorry/course/lan-pages/mac.html)
Yet, packgages/redboot/current/include/net/net.h defines ETH_MAX_PKTLEN as
1526. Strange. (There is also a entry from 2001-12-04 in
redboot/current/Changelog: "include/net/net.h (ETH_MAX_PKTLEN): Increase to
match definition of MAX_ETH_MSG." ???)

- ETH_MAX_PKTLEN is used in src/net/net.c to calculate MAX_TCP_SEGMENT.
This is used in "__tcp_write" to limit the "len". However, I wrote a program
that implements a server in redboot. In case it tries to send large junks of
data, it hangs. I decreased ETH_MAX_PKTLEN to 1500 and it worked much
better (no crash, but "performane" problems). This is a hint that there is
actually a problem with ETH_MAX_PKTLEN in redboot. (I use a modified,
incomplete and not very well testet version of ecos, so there could be other
reasons, too. But I think it is better to post this hint anyway).


2. __tcp_write_block() always returns 0. This is different from __tcp_write()
and probably not the intended return value.

I think
>        if (n > 0) {
>            len -= n;
>            buf += n;
>        }
should be replaced by
>        if (n > 0) {
>            len -= n;
>            buf += n;
>            total += n;
>        }


Bye,
Wolfgang


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