[ECOS] Re: timeout in tftp_client_test.c

HG henri@broadbandnetdevices.com
Wed Apr 23 12:20:00 GMT 2003


>
> My feeling is its not the tftp_get code. The tcpdump trace is just too
> strange. The transfer seems to be going fine and then suddenly it
> sends the RRQ again. Why?
>
> How big is your stack for the thread doing the tftp_get? Where is your
> buf located? To me, this looks like stack corruption.
>
>     Andrew

I tried a much larger stack for that thread as an experiment (0x30000
instead of 0x1000):
// Note: the TFTP client calls need at least (SEGSIZE==512)+4
// additional bytes of workspace, thus the padding.
#define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL+0x30000)
still the same problem

>Where is your buf located?
the buf variable in that program are probably located in bss ???  static
char buf[32*1024]; it should be initialised by vectors.s
the pci buffer for the 82559 are located in a pci window at the top of the
16 M workspace declared
to the ecos system , the ldi & h files where hand edited based on an older
version produced with the 1.3 tool version
from ldi file :
......
// space for ethernet buffers = 8
    CYG_LABEL_DEFN(__pci_window) = 0x80ff0000; . =
CYG_LABEL_DEFN(__pci_window) + 0x10000;
    SECTIONS_END
from the h file :
.....
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x80ff0000 - (size_t) CYG_LABEL_NAME
(__heap1))
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__pci_window) [];
#endif
#define CYGMEM_SECTION_pci_window (CYG_LABEL_NAME (__pci_window))
#define CYGMEM_SECTION_pci_window_SIZE (0x10000)

from the .inl file in devs/eth/mips/.../include
#define CYGHWR_INTEL_I82559_PCI_MEM_MAP_BASE
(CYGARC_UNCACHED_ADDRESS(0x80ff0000))
#define CYGHWR_INTEL_I82559_PCI_MEM_MAP_SIZE 0x10000

in the config tool :
the 82559 driver tx & rx descriptor are set to 8
in the ecos hal : use separate stack for interrupt , interrupt stack size :
32k , save min context on interrupt
> >

many thanks for the help ,

Henri


 >
> > viewed on the diagnostic serial output:
> > Start TFTP test
> > BOOTP[eth0] op: REPLY
> >        htype: Ethernet
> >         hlen: 6
> >         hops: 0
> >          xid: 0x0
> >         secs: 0
> >        flags: 0x0
> >        hw_addr: 08:88:12:34:56:78
> >      client IP: 192.168.0.21
> >          my IP: 192.168.0.21
> >      server IP: 192.168.0.4
> >     gateway IP: 192.168.0.4
> >   options:
> >         subnet mask: 255.255.255.0
> >        IP broadcast: 192.168.0.255
> >             gateway: 192.168.0.4
> > Trying tftp_get hello.s      192.168.0.4...
> > res = 3584, err = 0
> >
> >
> > here is the windump command running on a cygwin window :
> >  $ ./windump -n  udp > tftp_client_test_timeout.txt
> > d:\download_pour_nt\windump\windump.exe: listening on
\Device\NPF_RTL80291
> >
> > content of tftp_client_test_timeout.txt
> > 16:15:33.720814 IP 192.168.0.21.7700 > 192.168.0.4.69:  16 RRQ "hello.s"
> > 16:15:33.741326 IP 192.168.0.4.1077 > 192.168.0.21.7700: udp 516
> > 16:15:33.972907 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:33.976868 IP 192.168.0.4.1077 > 192.168.0.21.7700: udp 516
> > 16:15:34.223731 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:34.227658 IP 192.168.0.4.1077 > 192.168.0.21.7700: udp 516
> > 16:15:34.474590 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:34.478536 IP 192.168.0.4.1077 > 192.168.0.21.7700: udp 516
> > 16:15:34.725576 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:34.729551 IP 192.168.0.4.1077 > 192.168.0.21.7700: udp 516
> > 16:15:34.976489 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:34.980418 IP 192.168.0.4.1077 > 192.168.0.21.7700: udp 516
> > 16:15:35.227418 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:35.231460 IP 192.168.0.4.1077 > 192.168.0.21.7700: udp 516
> > 16:15:35.476783 IP 192.168.0.21.7700 > 192.168.0.4.69:  16 RRQ "hello.s"
> > 16:15:35.478337 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:35.583451 IP 192.168.0.4.1079 > 192.168.0.21.7700: udp 516
> > 16:15:35.727715 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:35.729181 IP 192.168.0.21.7700 > 192.168.0.4.1077: udp 4
> > 16:15:41.986711 IP 192.168.0.4.1079 > 192.168.0.21.7700: udp 516
> > 16:15:48.496087 IP 192.168.0.4.1079 > 192.168.0.21.7700: udp 516
> > 16:15:51.087107 IP 192.168.0.4.137 > 192.168.0.21.137: udp 50
> > 16:15:52.588931 IP 192.168.0.4.137 > 192.168.0.21.137: udp 50
> > 16:15:54.091066 IP 192.168.0.4.137 > 192.168.0.21.137: udp 50
> > 16:15:55.005422 IP 192.168.0.4.1079 > 192.168.0.21.7700: udp 516
> > 16:16:01.512078 IP 192.168.0.4.1079 > 192.168.0.21.7700: udp 82
> >
> > extract from the application code tftp_client_test.c:
> > the thread is created with priority 5 instead of 10 as in the example
> > an other type of error message was observed with the different priority
> > the server would keep writing  that it timed out for several minutes .
> > ......
> >
> > #define GETFILE "hello.s"
> >
> >
> > static void
> > tftp_test(struct bootp *bp)
> > {
> >     int res, err, len;
> >     struct sockaddr_in host;
> >
> >     memset((char *)&host, 0, sizeof(host));
> >     host.sin_len = sizeof(host);
> >     host.sin_family = AF_INET;
> >     host.sin_addr = bp->bp_siaddr;
> >     host.sin_port = 0;
> >     diag_printf("Trying tftp_get %s %16s...\n", GETFILE,
> > inet_ntoa(host.sin_addr));
> >     res = tftp_get( GETFILE, &host, buf, sizeof(buf), TFTP_OCTET, &err);
> >     diag_printf("res = %d, err = %d\n", res, err);
> > ......
> >
> >
> >
> > --
> > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> > and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> >
>


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



More information about the Ecos-discuss mailing list