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:
Liu Zhi Fu
2016-11-28 18:36:14 +08:00
parent db1e86b3d9
commit 9a3f9af2db
9 changed files with 122 additions and 24 deletions

View File

@@ -213,6 +213,23 @@ struct stats_mib2_netif_ctrs {
u32_t ifouterrors;
};
struct stats_esp {
/* mbox post fail stats */
u32_t rx_rawmbox_post_fail;
u32_t rx_udpmbox_post_fail;
u32_t rx_tcpmbox_post_fail;
u32_t err_tcp_rxmbox_post_fail;
u32_t err_tcp_acceptmbox_post_fail;
u32_t acceptmbox_post_fail;
u32_t free_mbox_post_fail;
u32_t tcpip_inpkt_post_fail;
u32_t tcpip_cb_post_fail;
/* memory malloc/free/failed stats */
u32_t wlanif_input_pbuf_fail;
u32_t wlanif_outut_pbuf_fail;
};
struct stats_ {
#if LINK_STATS
struct stats_proto link;
@@ -265,6 +282,9 @@ struct stats_ {
#if MIB2_STATS
struct stats_mib2 mib2;
#endif
#if ESP_STATS
struct stats_esp esp;
#endif
};
extern struct stats_ lwip_stats;
@@ -438,6 +458,14 @@ void stats_init(void);
#define MIB2_STATS_INC(x)
#endif
#if ESP_STATS
#define ESP_STATS_INC(x) STATS_INC(x)
#define ESP_STATS_DISPLAY() stats_display_esp(&lwip_stats.esp);
#else
#define ESP_STATS_INC(x)
#define ESP_STATS_DISPLAY()
#endif
/* Display of statistics */
#if LWIP_STATS_DISPLAY
void stats_display(void);
@@ -446,6 +474,7 @@ void stats_display_igmp(struct stats_igmp *igmp, const char *name);
void stats_display_mem(struct stats_mem *mem, const char *name);
void stats_display_memp(struct stats_mem *mem, int index);
void stats_display_sys(struct stats_sys *sys);
void stats_display_esp(struct stats_esp *esp);
#else /* LWIP_STATS_DISPLAY */
#define stats_display()
#define stats_display_proto(proto, name)
@@ -453,6 +482,7 @@ void stats_display_sys(struct stats_sys *sys);
#define stats_display_mem(mem, name)
#define stats_display_memp(mem, index)
#define stats_display_sys(sys)
#define stats_display_esp(esp)
#endif /* LWIP_STATS_DISPLAY */
#ifdef __cplusplus

View File

@@ -379,22 +379,21 @@
* The queue size value itself is platform-dependent, but is passed to
* sys_mbox_new() when tcpip_init is called.
*/
#define TCPIP_MBOX_SIZE 16
#define TCPIP_MBOX_SIZE 32
/**
* DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
* NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
* to sys_mbox_new() when the recvmbox is created.
*/
#define DEFAULT_UDP_RECVMBOX_SIZE 16
#define DEFAULT_UDP_RECVMBOX_SIZE 6
/**
* DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
* NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
* to sys_mbox_new() when the recvmbox is created.
*/
#define DEFAULT_TCP_RECVMBOX_SIZE 16
//#define DEFAULT_TCP_RECVMBOX_SIZE 6
#define DEFAULT_TCP_RECVMBOX_SIZE 6
/**
* DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
@@ -466,7 +465,7 @@
/**
* LWIP_STATS==1: Enable statistics collection in lwip_stats.
*/
#define LWIP_STATS 0
#define LWIP_STATS 1
/*
---------------------------------
@@ -556,6 +555,29 @@
*/
#define TCPIP_DEBUG LWIP_DBG_OFF
/**
* statistic debugs
*/
#define TCP_STATS LWIP_DBG_ON
#define UDP_STATS LWIP_DBG_ON
#define ICMP_STATS LWIP_DBG_ON
#define IGMP_STATS LWIP_DBG_ON
#define IP_STATS LWIP_DBG_ON
#define IPFRAG_STATS LWIP_DBG_ON
#define ETHARP_STATS LWIP_DBG_ON
#define LINK_STATS LWIP_DBG_ON
#define MEM_STATS LWIP_DBG_ON
#define MEMM_STATS LWIP_DBG_ON
#define SYS_STATS LWIP_DBG_ON
#define IP6_STATS LWIP_DBG_ON
#define IP6_FRAG_STATS LWIP_DBG_ON
#define ICMP6_STATS LWIP_DBG_ON
#define MLD6_STATS LWIP_DBG_ON
#define ND6_STATS LWIP_DBG_ON
#define MIB2_STATS LWIP_DBG_ON
#define ESP_STATS LWIP_DBG_ON
#define LWIP_STATS_DISPLAY LWIP_DBG_ON
/* Enable all Espressif-only options */
#define ESP_LWIP 1
@@ -572,9 +594,10 @@
#define ESP_LIGHT_SLEEP 1
#define ESP_L2_TO_L3_COPY CONFIG_L2_TO_L3_COPY
#define ESP_CNT_DEBUG 0
#define ESP_DUAL_CORE 0
#define TCP_WND_DEFAULT (4*TCP_MSS)
#define TCP_SND_BUF_DEFAULT (2*TCP_MSS)
#define TCP_WND_DEFAULT (10*TCP_MSS)
#define TCP_SND_BUF_DEFAULT (5*TCP_MSS)
#if ESP_PER_SOC_TCP_WND
#define TCP_WND(pcb) (pcb->per_soc_tcp_wnd)