lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Packet reception stopping after some time


From: Jannis Achstetter
Subject: [lwip-users] Packet reception stopping after some time
Date: Sun, 15 Jan 2023 23:07:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

Hi list,

I got a bit of a complex case here and would like some ideas. The code is running on an RaspberryPi RP2040 and I have two network interfaces that lwIP handles. The one uses CDC NCM over the USB connection to the USB host. The other interface is an ENC28J60 connected to the device via SPI. There is the lwIP-provided HTTP server running on the chip serving files converted via makefsdata + dynamic content.

The version of lwIP I'm using is this: https://github.com/kripton/lwIP/tree/zopfliAndSvg, based on upstream commit a44fcb2e2e2c86ed1436814c8488d3d824af382b. lwipopts are here: https://github.com/kripton/rp2040-dmxsun/blob/ethernet/src/lwipopts.h

lwIP handles most packages just fine (ICMP ping and HTTP tested). I can even "flood-ping" both interfaces with 1200 byte large ICMP packets 1000 times per second and both interfaces handle them just fine. However, I have a custom UDP-handling class (https://github.com/kripton/rp2040-dmxsun/blob/ethernet/src/udp_artnet.cpp#L77). When "a lot" of those UDP packets come in (about 50 per second, around 600 byte each), the the USB CDC NCM interface continues working. However, the Ethernet interface stops acting on them after 23 packets (half a second).

In my packet-handling-routine, the call to pbuf_alloc (https://github.com/krystiancha/pico-enc28j60/blob/master/src/ethernetif.c#L146) returns NULL after those packets, making me wonder if there is a memory-leak somewhere.

On the other hand, the UDP packets are handled fine on the USB interface (hinting at no memory problems with the UDP packet handling code) AND all other packets are handled well on the Ehternet interface (hinting at no memory issues connecting the interface with the lwIP stack).

Does anyone have an idea on what I could try to get to the root cause of my problem?

Thank you!
        Jannis



reply via email to

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