add comments about current tx flow control

pull/21/head
liuzhifu 2016-09-09 17:54:13 +08:00 zatwierdzone przez Wu Jian Gang
rodzic e38c4b0365
commit 32f01c61a2
2 zmienionych plików z 12 dodań i 6 usunięć

Wyświetl plik

@ -388,8 +388,18 @@ static void lwip_socket_drop_registered_memberships(int s);
#endif /* LWIP_IGMP */
#ifdef LWIP_ESP8266
//extern size_t system_get_free_heap_size(void);
//extern bool esp_wifi_tx_is_stop(void);
/* Since esp_wifi_tx_is_stop/system_get_free_heap_size are not an public wifi API, so extern them here*/
extern size_t system_get_free_heap_size(void);
extern bool esp_wifi_tx_is_stop(void);
/* Please be notified that this flow control is just a workaround for fixing wifi Q full issue.
* Under UDP/TCP pressure test, we found that the sockets may cause wifi tx queue full if the socket
* sending speed is faster than the wifi sending speed, it will finally cause the packet to be dropped
* in wifi layer, it's not acceptable in some application. That's why we introdue the tx flow control here.
* However, current solution is just a workaround, we need to consider the return value of wifi tx interface,
* and feedback the return value to lwip and let lwip do the flow control itself.
*/
static inline void esp32_tx_flow_ctrl(void)
{
uint8_t _wait_delay = 0;

Wyświetl plik

@ -68,9 +68,5 @@ void sys_delay_ms(uint32_t ms);
sys_sem_t* sys_thread_sem_init(void);
void sys_thread_sem_deinit(void);
sys_sem_t* sys_thread_sem_get(void);
size_t system_get_free_heap_size(void);
bool esp_wifi_tx_is_stop(void);
#endif /* __SYS_ARCH_H__ */