mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 20:21:04 +00:00
esp32/lwip: some misc changes
1. Update phy to fix HT40 rx issue 2. Add code about RX_DONE/TX_DONE/Lock-free optimization 3. Fix wifi ioctl return value error 4. Add lwip statistics debug code 5. Modify TCP window size to 10 and send buffer size to 5
This commit is contained in:
@@ -128,6 +128,7 @@ recv_raw(void *arg, struct raw_pcb *pcb, struct pbuf *p,
|
||||
|
||||
len = q->tot_len;
|
||||
if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) {
|
||||
ESP_STATS_INC(esp.rx_rawmbox_post_fail);
|
||||
netbuf_delete(buf);
|
||||
return 0;
|
||||
} else {
|
||||
@@ -203,6 +204,7 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
|
||||
|
||||
len = p->tot_len;
|
||||
if (sys_mbox_trypost(&conn->recvmbox, buf) != ERR_OK) {
|
||||
ESP_STATS_INC(esp.rx_udpmbox_post_fail);
|
||||
netbuf_delete(buf);
|
||||
return;
|
||||
} else {
|
||||
@@ -262,6 +264,7 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
|
||||
}
|
||||
|
||||
if (sys_mbox_trypost(&conn->recvmbox, p) != ERR_OK) {
|
||||
ESP_STATS_INC(esp.rx_tcpmbox_post_fail);
|
||||
/* don't deallocate p: it is presented to us later again from tcp_fasttmr! */
|
||||
return ERR_MEM;
|
||||
} else {
|
||||
@@ -391,12 +394,16 @@ err_tcp(void *arg, err_t err)
|
||||
/* pass NULL-message to recvmbox to wake up pending recv */
|
||||
if (sys_mbox_valid(&conn->recvmbox)) {
|
||||
/* use trypost to prevent deadlock */
|
||||
sys_mbox_trypost(&conn->recvmbox, NULL);
|
||||
if (sys_mbox_trypost(&conn->recvmbox, NULL) != ERR_OK){
|
||||
ESP_STATS_INC(esp.err_tcp_rxmbox_post_fail);
|
||||
}
|
||||
}
|
||||
/* pass NULL-message to acceptmbox to wake up pending accept */
|
||||
if (sys_mbox_valid(&conn->acceptmbox)) {
|
||||
/* use trypost to preven deadlock */
|
||||
sys_mbox_trypost(&conn->acceptmbox, NULL);
|
||||
if (sys_mbox_trypost(&conn->acceptmbox, NULL) != ERR_OK) {
|
||||
ESP_STATS_INC(esp.err_tcp_rxmbox_post_fail);
|
||||
}
|
||||
}
|
||||
|
||||
if ((old_state == NETCONN_WRITE) || (old_state == NETCONN_CLOSE) ||
|
||||
@@ -476,6 +483,7 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
|
||||
newconn->last_err = err;
|
||||
|
||||
if (sys_mbox_trypost(&conn->acceptmbox, newconn) != ERR_OK) {
|
||||
ESP_STATS_INC(esp.acceptmbox_post_fail);
|
||||
/* When returning != ERR_OK, the pcb is aborted in tcp_process(),
|
||||
so do nothing here! */
|
||||
/* remove all references to this netconn from the pcb */
|
||||
|
Reference in New Issue
Block a user