]> granicus.if.org Git - esp-idf/commitdiff
lwip: optimize tx flow control
authorLiu Zhi Fu <liuzhifu@espressif.com>
Mon, 31 Oct 2016 13:26:33 +0000 (21:26 +0800)
committerLiu Zhi Fu <liuzhifu@espressif.com>
Mon, 31 Oct 2016 13:26:33 +0000 (21:26 +0800)
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()

components/lwip/api/sockets.c
components/lwip/port/netif/wlanif.c

index 455d007ea7178b606e695b276fcd980a843214c8..df658578af4008ba78133ad292adfee667a0aa72 100755 (executable)
@@ -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);
index 548bb7f970026dbed9f35ed5e6c1a055d275da42..ffad69cd46a27674a270ecb76f1443cba89fdf02 100755 (executable)
@@ -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
 }
 
 /**