mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
lwip: optimize tx flow control
1. Remove tx flow control for TCP 2. Remove tx flow control for UDP temporary 3. Return the error code when call esp_wifi_internal_tx()
This commit is contained in:
parent
c7f8d206ed
commit
92b663d9f2
@ -395,12 +395,15 @@ static void lwip_socket_drop_registered_memberships(int s);
|
||||
*/
|
||||
static inline void esp32_tx_flow_ctrl(void)
|
||||
{
|
||||
//TODO we need to do flow control for UDP
|
||||
#if 0
|
||||
uint8_t _wait_delay = 1;
|
||||
|
||||
while ((system_get_free_heap_size() < HEAP_HIGHWAT) || esp_wifi_internal_tx_is_stop()){
|
||||
vTaskDelay(_wait_delay/portTICK_RATE_MS);
|
||||
if (_wait_delay < 64) _wait_delay *= 2;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
@ -1208,8 +1211,6 @@ lwip_send(int s, const void *data, size_t size, int flags)
|
||||
#endif /* (LWIP_UDP || LWIP_RAW) */
|
||||
}
|
||||
|
||||
esp32_tx_flow_ctrl();
|
||||
|
||||
write_flags = NETCONN_COPY |
|
||||
((flags & MSG_MORE) ? NETCONN_MORE : 0) |
|
||||
((flags & MSG_DONTWAIT) ? NETCONN_DONTBLOCK : 0);
|
||||
|
@ -142,16 +142,13 @@ low_level_output(struct netif *netif, struct pbuf *p)
|
||||
}
|
||||
}
|
||||
|
||||
esp_wifi_internal_tx(wifi_if, q->payload, pbuf_x_len);
|
||||
return ERR_OK;
|
||||
|
||||
return esp_wifi_internal_tx(wifi_if, q->payload, pbuf_x_len);
|
||||
#else
|
||||
for(q = p; q != NULL; q = q->next) {
|
||||
esp_wifi_internal_tx(wifi_if, q->payload, q->len);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ERR_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user