[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Packet reception stopping after some time
From: |
Jannis Achstetter |
Subject: |
Re: [lwip-users] Packet reception stopping after some time |
Date: |
Sun, 15 Jan 2023 23:23:01 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 |
Oh well, got it fixed, sorry for the noise.
I added a "pbuf_free(p)" to the UDP packet handling code and it no
longer stops handling packets. Still surprised why it worked on the USB
CDC NCM interface. I would have expected it to fail there as well.
How do pbufs behave if they are free'd multiple times?
Jannis
Am 15.01.23 um 23:07 schrieb Jannis Achstetter:
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
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users