lwip update

* The mdns responder has been reworked to lower stack and memory usage. This is
  a variation on the upstream code, it use malloc whereas the upstream code uses
  pools. The high stack usage of the mdns responder was problem for
  esp-open-rtos, so we might have to maintain the differences for now.

* Improved lwip core locking, and lock checking. Upstream improvements, that
  need some added support from esp-open-rtos specific code. More core lock is
  performed when calling from the esp-open-rtos code now, so a little safer. The
  checking is not enforced, but projects might see warning messages and might
  want to look into them.

* The esp-open-rtos lwip support has been sync'ed with the new freertos port
  included with lwip. There are still some minor differences.

* A few lwip timer bugs have been resolved. This might help resolve some issues.

* Plus it picks up all the other upstream fixes and improvements.

* The default lwip stack has been lowered from 768 words to 480 words,
  due to the reduced stack usage by the mdns responder.
This commit is contained in:
Our Air Quality 2018-01-24 14:56:24 +11:00
parent 5f8b3d43c7
commit 3c81f7d587
12 changed files with 345 additions and 185 deletions

View file

@ -81,7 +81,9 @@
* UNLOCK_TCPIP_CORE().
* Your system should provide mutexes supporting priority inversion to use this.
*/
#ifndef LWIP_TCPIP_CORE_LOCKING
#define LWIP_TCPIP_CORE_LOCKING 1
#endif
/**
* LWIP_TCPIP_CORE_LOCKING_INPUT: when LWIP_TCPIP_CORE_LOCKING is enabled,
@ -95,6 +97,48 @@
#define LWIP_TCPIP_CORE_LOCKING_INPUT 0
#endif
/**
* Macro/function to check whether lwIP's threading/locking
* requirements are satisfied during current function call.
* This macro usually calls a function that is implemented in the OS-dependent
* sys layer and performs the following checks:
* - Not in ISR
* - If @ref LWIP_TCPIP_CORE_LOCKING = 1: TCPIP core lock is held
* - If @ref LWIP_TCPIP_CORE_LOCKING = 0: function is called from TCPIP thread
* @see @ref multithreading
*/
#ifndef LWIP_ASSERT_CORE_LOCKED
void sys_check_core_locking(void);
#define LWIP_ASSERT_CORE_LOCKED() sys_check_core_locking()
#endif
/**
* Called as first thing in the lwIP TCPIP thread. Can be used in conjunction
* with @ref LWIP_ASSERT_CORE_LOCKED to check core locking.
* @see @ref multithreading
*/
#ifndef LWIP_MARK_TCPIP_THREAD
void sys_mark_tcpip_thread(void);
#define LWIP_MARK_TCPIP_THREAD() sys_mark_tcpip_thread()
#endif
#if LWIP_TCPIP_CORE_LOCKING
#ifndef LOCK_TCPIP_CORE
void sys_lock_tcpip_core(void);
#define LOCK_TCPIP_CORE() sys_lock_tcpip_core()
#endif
#ifndef UNLOCK_TCPIP_CORE
void sys_unlock_tcpip_core(void);
#define UNLOCK_TCPIP_CORE() sys_unlock_tcpip_core()
#endif
#else
#define LOCK_TCPIP_CORE()
#define UNLOCK_TCPIP_CORE()
#endif /* LWIP_TCPIP_CORE_LOCKING */
/*
------------------------------------
---------- Memory options ----------
@ -483,6 +527,21 @@
#define LWIP_NETIF_HOSTNAME 1
#endif
/**
* LWIP_NETIF_API==1: Support netif api (in netifapi.c)
*/
#ifndef LWIP_NETIF_API
#define LWIP_NETIF_API 0
#endif
/**
* LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
* changes its up/down status (i.e., due to DHCP IP acquisition)
*/
#ifndef LWIP_NETIF_STATUS_CALLBACK
#define LWIP_NETIF_STATUS_CALLBACK 0
#endif
/**
* LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP *tries* to put all data
* to be sent into one single pbuf. This is for compatibility with DMA-enabled
@ -515,7 +574,7 @@
* sys_thread_new() when the thread is created.
*/
#ifndef TCPIP_THREAD_STACKSIZE
#define TCPIP_THREAD_STACKSIZE 768
#define TCPIP_THREAD_STACKSIZE 480
#endif
/**
@ -672,6 +731,20 @@
---------------------------------------
*/
/*
---------------------------------------
---------- mDNS options ---------------
---------------------------------------
*/
/**
* LWIP_MDNS_RESPONDER_QUEUE_ANNOUNCEMENTS==1: Unsolicited announcements are
* queued and run from a timer callback.
*/
#ifndef LWIP_MDNS_RESPONDER_QUEUE_ANNOUNCEMENTS
#define LWIP_MDNS_RESPONDER_QUEUE_ANNOUNCEMENTS 1
#endif
/*
---------------------------------------
---------- Debugging options ----------
@ -855,6 +928,11 @@
*/
#define IP6_DEBUG LWIP_DBG_OFF
/**
* MDNS_DEBUG: Enable debugging for multicast DNS.
*/
#define MDNS_DEBUG LWIP_DBG_OFF
/*
--------------------------------------------------
---------- Performance tracking options ----------