lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #64909] No memory pool MEMP_SYS_TIMEOUT allocation for


From: Brendan McDonnell
Subject: [lwip-devel] [bug #64909] No memory pool MEMP_SYS_TIMEOUT allocation for SNTP timer
Date: Tue, 18 Jun 2024 22:24:49 -0400 (EDT)

Follow-up Comment #2, bug #64909 (group lwip):


> there doesn't seem to be any allowance for the SNTP timer.  SNTP support is
conditionally included based on LWIP_UDP so I'd expect the above declaration
should be
>
>  #define LWIP_NUM_SYS_TIMEOUT_INTERNAL   (LWIP_TCP + LWIP_UDP +
IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS
+ PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))
I agree with your assessment. I think your proposal is part of the solution.
Searching the code (at commit 86c9f799, which is a descendent of
STABLE-2_2_0_RELEASE), I find:

$ git grep -w MEMP_NUM_SYS_TIMEOUT | grep -i increase
doc/mqtt_client.txt:You need to increase MEMP_NUM_SYS_TIMEOUT by one if you
use MQTT!
src/apps/mdns/mdns.c: * You need to increase MEMP_NUM_SYS_TIMEOUT by one if
you use MDNS!
src/apps/sntp/sntp.c: * You need to increase MEMP_NUM_SYS_TIMEOUT by one if
you use SNTP!
src/apps/tftp/tftp.c: * You need to increase MEMP_NUM_SYS_TIMEOUT by one if
you use TFTP!


So there are several lwIP "apps" which say that if you use them, you must
"increase" MEMP_NUM_SYS_TIMEOUT, but lwIP provides no way to *_increase it
relative_* to the default value (LWIP_NUM_SYS_TIMEOUT_INTERNAL). The only
thing the user application can do is #define its own absolute value for
MEMP_NUM_SYS_TIMEOUT (since LWIP_NUM_SYS_TIMEOUT_INTERNAL isn't exposed). But
later if the user enables/uses more lwIP apps w/o remembering to also increase
their MEMP_NUM_SYS_TIMEOUT, it will break.

IMO, a proper solution to this issue would include:
1. #defines to enable/disable the lwIP apps found by my grep above (mqtt,
mdns, sntp, tftp)
2. Add those #defines as part of the calculation for the value of
LWIP_NUM_SYS_TIMEOUT_INTERNAL (similar to as suggested in the original
submission)
3. Remove those lines found by my grep above from the documentation
4. Probably also provide a new #define (e.g. MEMP_ADD_NUM_SYS_TIMEOUT),
default value 0, which the user can optionally override. Then change
MEMP_NUM_SYS_TIMEOUT definition to

  #define  MEMP_NUM_SYS_TIMEOUT  (LWIP_NUM_SYS_TIMEOUT_INTERNAL +
MEMP_ADD_NUM_SYS_TIMEOUT)




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?64909>

_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/




reply via email to

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