feat(wifi): optimize esp32c6 iperf performance

This commit is contained in:
xuxiao
2023-07-20 11:14:02 +08:00
committed by muhaidong
parent 71c201617e
commit b74c293505
16 changed files with 429 additions and 37 deletions

View File

@@ -14,5 +14,18 @@ menu "Iperf Configuration"
The value is used for iperf socket TCP tx timeout, iperf will be aborted
and socket will be closed and shutdown.
config IPERF_TRAFFIC_TASK_PRIORITY
int "iperf traffic task priority"
default 4
range 1 24
help
The value is used for iperf traffic task priority.
config IPERF_REPORT_TASK_PRIORITY
int "iperf result report task priority"
default 6
range 1 24
help
The value is used for iperf result report task priority.
endmenu

View File

@@ -36,10 +36,10 @@ extern "C" {
#define IPERF_DEFAULT_NO_BW_LIMIT -1
#define IPERF_TRAFFIC_TASK_NAME "iperf_traffic"
#define IPERF_TRAFFIC_TASK_PRIORITY 4
#define IPERF_TRAFFIC_TASK_PRIORITY CONFIG_IPERF_TRAFFIC_TASK_PRIORITY
#define IPERF_TRAFFIC_TASK_STACK 4096
#define IPERF_REPORT_TASK_NAME "iperf_report"
#define IPERF_REPORT_TASK_PRIORITY 6
#define IPERF_REPORT_TASK_PRIORITY CONFIG_IPERF_REPORT_TASK_PRIORITY
#define IPERF_REPORT_TASK_STACK 4096
#define IPERF_UDP_TX_LEN (1470)

View File

@@ -118,7 +118,7 @@ static esp_err_t iperf_start_report(void)
return ESP_OK;
}
static void socket_recv(int recv_socket, struct sockaddr_storage listen_addr, uint8_t type)
static void IRAM_ATTR socket_recv(int recv_socket, struct sockaddr_storage listen_addr, uint8_t type)
{
bool iperf_recv_start = true;
uint8_t *buffer;
@@ -149,7 +149,7 @@ static void socket_recv(int recv_socket, struct sockaddr_storage listen_addr, ui
}
}
static void socket_send(int send_socket, struct sockaddr_storage dest_addr, uint8_t type, int bw_lim)
static void IRAM_ATTR socket_send(int send_socket, struct sockaddr_storage dest_addr, uint8_t type, int bw_lim)
{
uint8_t *buffer;
int32_t *pkt_id_p;
@@ -222,7 +222,7 @@ static void socket_send(int send_socket, struct sockaddr_storage dest_addr, uint
}
}
static esp_err_t IRAM_ATTR iperf_run_tcp_server(void)
static esp_err_t iperf_run_tcp_server(void)
{
int listen_socket = -1;
int client_socket = -1;
@@ -389,7 +389,7 @@ exit:
return ret;
}
static esp_err_t IRAM_ATTR iperf_run_udp_server(void)
static esp_err_t iperf_run_udp_server(void)
{
int listen_socket = -1;
int opt = 1;