lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Code hangs on UDP send on Virtex-4 PPC


From: Patrick Dubois
Subject: [lwip-users] Code hangs on UDP send on Virtex-4 PPC
Date: Tue, 3 Jul 2007 11:03:51 -0400

Hello everyone,

I am currently using lwip on a Virtex-4 PowerPC. I'm using the temac raw driver from Paul Tobias (www.paultobias.com/Xilinx ) because Xilinx doesn't yet have support for its hard temac in lwip raw mode.

My application is a SPI to ethernet bridge (undirectional, from SPI to ethernet). I need high throughtput (which is why I'm using UDP in raw mode), ideally up to 100 Mbps although 10 Mbps would be alright for now.

My problem is that I seem to only be able to send a few packets in UDP, after that my code hangs. I am not sure yet where the problem is but I have clues. It seems related to ARP packet reception. If I unplug the ethernet cable the code doesn't hang at all and data transmission "seems" successful (it's hard to know without a cable connected!).

If I keep the ethernet cable connected but I disable the temac receive interrupt, then the code doesn't hang, data transmission seems to work but I don't receive anything at the remote end (thus it doesn't work). I'm not sure that I quite understand why data transmission doesn't work if I disable the receive interrupts. Sure, the ARP transaction won't be complete, but does it matter for unidirectionnal UDP transfers? (yes, I'm an ethernet newbie). I am directly connected to the remote end, no router/hub/switch involved.

The problem might also be due to interrupt conflicts. I have two other hardware interrupts to handle the SPI transfers.

I'm running out of ideas for troubleshooting steps. I'm fairly experienced in FPGA development but less so in embedded software. For example, I don't know how to troubleshoot stack overflow (other than increasing stack size), interrupts conflicts, etc...
To make matters worse, I can't use Etherreal because I don't have admin rights on my computer (sigh).

Could someone suggest some troubleshooting ideas (logs are at the end of the post)?

Thank you!

Patrick Dubois


Here is the log when the code hangs:

---------------------------------------------------------------
netif: IP address of interface    set to 1.2.3.4
netif: netmask of interface    set to 255.255.255.0
netif: GW address of interface    set to 0.0.0.0
[xtemacif: low_level_init]
Setting up link for 100 Mbps
netif: added interface e0 IP addr 1.2.3.4 netmask 255.255.255.0 gw 0.0.0.0
netif: setting default interface e0
udp_bind(ipaddr = 0.0.0.0, port = 982)
udp_bind: bound to 0.0.0.0, port 982
udp_connect: connected to 1.2.3.7, port 983
pbuf_alloc(length=0)
pbuf_alloc(length=0) == 0x24208
Calling udp_send... udp_send
pbuf_alloc(length=8)
pbuf_alloc(length=8) == 0x2236c
pbuf_chain: 0x2236c references 0x24208
udp_send: added header pbuf 0x2236c before given pbuf 0x24208
udp_send: sending datagram of length 1448
udp_send: UDP packet length 1448
udp_send: UDP checksum 0x5a8b
udp_send: ip_output_if (,,,,IP_PROTO_UDP,)
pbuf_header: old 0x223a0 new 0x2238c (20)
ip_output_if: e00
IP header:
+-------------------------------+
| 4 | 5 |  0x00 |      1468     | (v, hl, tos, len)
+-------------------------------+
|        0      |010|       0   | (id, flags, offset)
+-------------------------------+
|  255  |   17  |    0x6e22     | (ttl, proto, chksum)
+-------------------------------+
|    1  |    2  |    3  |    4  | (src)
+-------------------------------+
|    1  |    2  |    3  |    7  | (dest)
+-------------------------------+
netif->output()pbuf_header: old 0x2238c new 0x2237e (14)
pbuf_take(0x2236c)
pbuf_take: skipping pbuf not of type PBUF_REF
pbuf_take: encountered PBUF_REF 0x24208
pbuf_alloc(length=1440)
pbuf_alloc: allocated pbuf 0x25fe0
pbuf_alloc(length=1440) == 0x25fe0
pbuf_free(0x24208)
pbuf_free: 0x24208 has ref 1, ending here.
pbuf_take: replaced PBUF_REF 0x24208 with 0x25fe0
pbuf_take: end of chain reached.
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 0x223b0
pbuf_alloc(length=60)
pbuf_alloc: allocated pbuf 0x265f0
pbuf_alloc(length=60) == 0x265f0
pbuf_free(0x2236c)
pbuf_free: 0x2236c has ref 1, ending here.
pbuf_free(0x265f0)
pbuf_free: deallocating 0x265f0
pbuf_free: deallocapbuf_free: deallocating 0x223b0
pbuf_free(0x2236c)
pbuf_free: deallocating 0x2236c
pbuf_free: deallocating 0x25fe0
pbuf_free(0x24208)
pbuf_free: deallocating 0x24208
====> No more output, the code is stuck at this point!
---------------------------------------------------------------


And this is the code when the cable is disconnected:

---------------------------------------------------------------
netif: IP address of interface    set to 1.2.3.4
netif: netmask of interface    set to 255.255.255.0
netif: GW address of interface    set to 0.0.0.0
[xtemacif: low_level_init]
Setting up link for 100 Mbps
netif: added interface e0 IP addr 1.2.3.4 netmask 255.255.255.0 gw 0.0.0.0
netif: setting default interface e0
udp_bind(ipaddr = 0.0.0.0, port = 982)
udp_bind: bound to 0.0.0.0 , port 982
udp_connect: connected to 1.2.3.7, port 983
pbuf_alloc(length=0)
pbuf_alloc(length=0) == 0x24208
udp_send
pbuf_alloc(length=8)
pbuf_alloc(length=8) == 0x2236c
pbuf_chain: 0x2236c references 0x24208
udp_send: added header pbuf 0x2236c before given pbuf 0x24208
udp_send: sending datagram of length 1448
udp_send: UDP packet length 1448
udp_send: UDP checksum 0x5a8b
udp_send: ip_output_if (,,,,IP_PROTO_UDP,)
pbuf_header: old 0x223a0 new 0x2238c (20)
ip_output_if: e00
IP header:
+-------------------------------+
| 4 | 5 |  0x00 |      1468     | (v, hl, tos, len)
+-------------------------------+
|        0      |010|       0   | (id, flags, offset)
+-------------------------------+
|  255  |   17  |    0x6e22     | (ttl, proto, chksum)
+-------------------------------+
|    1  |    2  |    3  |    4  | (src)
+-------------------------------+
|    1  |    2  |    3  |    7  | (dest)
+-------------------------------+
netif->output()pbuf_header: old 0x2238c new 0x2237e (14)
pbuf_take(0x2236c)
pbuf_take: skipping pbuf not of type PBUF_REF
pbuf_take: encountered PBUF_REF 0x24208
pbuf_alloc(length=1440)
pbuf_alloc: allocated pbuf 0x25fe0
pbuf_alloc(length=1440) == 0x25fe0
pbuf_free(0x24208)
pbuf_free: 0x24208 has ref 1, ending here.
pbuf_take: replaced PBUF_REF 0x24208 with 0x25fe0
pbuf_take: end of chain reached.
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 0x223b0
pbuf_free(0x223b0)
pbuf_free: deallocating 0x223b0
pbuf_free(0x2236c)
pbuf_free: 0x2236c has ref 1, ending here.
pbuf_free(0x24208)
pbuf_free: deallocating 0x24208
pbuf_alloc(length=0)
pbuf_alloc(length=0) == 0x24208
udp_send
pbuf_alloc(length=8)
pbuf_alloc(length=8) == 0x223b0
pbuf_chain: 0x223b0 references 0x24208
udp_send: added header pbuf 0x223b0 before given pbuf 0x24208
udp_send: sending datagram of length 1448
udp_send: UDP packet length 1448
udp_send: UDP checksum 0x5a8b
udp_send: ip_output_if (,,,,IP_PROTO_UDP,)
pbuf_header: old 0x223e4 new 0x223d0 (20)
ip_output_if: e00
IP header:
+-------------------------------+
| 4 | 5 |  0x00 |      1468     | (v, hl, tos, len)
+-------------------------------+
|        1      |010|       0   | (id, flags, offset)
+-------------------------------+
|  255  |   17  |    0x6e21     | (ttl, proto, chksum)
+-------------------------------+
|    1  |    2  |    3  |    4  | (src)
+-------------------------------+
|    1  |    2  |    3  |    7  | (dest)
+-------------------------------+
netif->output()pbuf_header: old 0x223d0 new 0x223c2 (14)
pbuf_free(0x2236c)
pbuf_free: deallocating 0x2236c
pbuf_free: deallocating 0x25fe0
pbuf_take(0x223b0)
pbuf_take: skipping pbuf not of type PBUF_REF
pbuf_take: encountered PBUF_REF 0x24208
pbuf_alloc(length=1440)
pbuf_alloc: allocated pbuf 0x25fe0
pbuf_alloc(length=1440) == 0x25fe0
pbuf_free(0x24208)
pbuf_free: 0x24208 has ref 1, ending here.
pbuf_take: replaced PBUF_REF 0x24208 with 0x25fe0
pbuf_take: end of chain reached.
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 0x223f4
pbuf_free(0x223f4)
pbuf_free: deallocating 0x223f4
pbuf_free(0x223b0)
pbuf_free: 0x223b0 has ref 1, ending here.
pbuf_free(0x24208)
pbuf_free: deallocating 0x24208
Calling etharp_tmr()
pbuf_alloc(length=0)
pbuf_alloc(length=0) == 0x24208
udp_send
pbuf_alloc(length=8)
pbuf_alloc(length=8) == 0x223f4
pbuf_chain: 0x223f4 references 0x24208
udp_send: added header pbuf 0x223f4 before given pbuf 0x24208
udp_send: sending datagram of length 1448
udp_send: UDP packet length 1448
udp_send: UDP checksum 0x5a8b
udp_send: ip_output_if (,,,,IP_PROTO_UDP,)
pbuf_header: old 0x22428 new 0x22414 (20)
ip_output_if: e00
IP header:
+-------------------------------+
| 4 | 5 |  0x00 |      1468     | (v, hl, tos, len)
+-------------------------------+
|        2      |010|       0   | (id, flags, offset)
+-------------------------------+
|  255  |   17  |    0x6e20     | (ttl, proto, chksum)
+-------------------------------+
|    1  |    2  |    3  |    4  | (src)
+-------------------------------+
|    1  |    2  |    3  |    7  | (dest)
+-------------------------------+
netif->output()pbuf_header: old 0x22414 new 0x22406 (14)
pbuf_free(0x223b0)
pbuf_free: deallocating 0x223b0
pbuf_free: deallocating 0x25fe0
pbuf_take(0x223f4)
pbuf_take: skipping pbuf not of type PBUF_REF
pbuf_take: encountered PBUF_REF 0x24208
pbuf_alloc(length=1440)
pbuf_alloc: allocated pbuf 0x25fe0
pbuf_alloc(length=1440) == 0x25fe0
pbuf_free(0x24208)
pbuf_free: 0x24208 has ref 1, ending here.
pbuf_take: replaced PBUF_REF 0x24208 with 0x25fe0
pbuf_take: end of chain reached.
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 0x2236c
pbuf_free(0x2236c)
pbuf_free: deallocating 0x2236c
pbuf_free(0x223f4)
pbuf_free: 0x223f4 has ref 1, ending here.
done.
pbuf_free(0x24208)
pbuf_free: deallocating 0x24208
pbuf_alloc(length=0)
pbuf_alloc(length=0) == 0x24208
=====> The code continues forever....
---------------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]