Description
Checklist
- Checked the issue tracker for similar issues to ensure this is not a duplicate
- Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
- Tested with the latest version to ensure the issue hasn't been fixed
How often does this bug occurs?
always
Expected behavior
Irrespectful of network load or transfer volume, when the link is idle, network performance should remain stable with baseline latency.
Actual behavior (suspected bug)
On our custom device, with kernel 5.10 and using SPI, the baseline performance is good after boot.
Observations for baseline performance:
- Ping times are low, below 100ms (typically 25ms).
- No packet drop.
- Network responsive.
If iperf is run 3 - 5 times (or more), network performance degrades:
- Ping times are above 300ms, and often go around 2000-5000ms.
- Some packet drop (low).
- Connections time out.
NOTE: This persists after iperf is stopped.
Error logs or terminal output
Steps to reproduce the behavior
- Boot as normal, loading esp32_hosted_ng
- Connect to WiFi
- ping -c 10 8.8.8.8 # verify baseline response time
- run iperf3 -c <server_hostname> more than 3 times (example: for i in
seq 1 10
;do iperf3 -c <server_hostname> ;done - ping -c 10 8.8.8.8 # verify response time after test
Project release version
latest
System architecture
MIPS - Custom device
Operating system
Linux
Operating system version
Linux kernel 5.10
Shell
ZSH
Setup Details
Transport: SPI
Slave: ESP32-S3
Reproductability: It does not occur on a raspberry pi.
Signal routing: Custom PCB
Frequency: Initial 10MHz, after negotiation 30MHz.
Additional context
- Reloading the module seems to have some positive effect.
- The issue does not reproduce over a raspberry pi (latest raspian). On the RPi, we also see good performance during the iperf3 test (ping response times around 20-50ms)
- We worked around the issue with the following changes:
diff --git a/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/esp_cmd.c b/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/esp_cmd.c
index b32b577be..3da4ec994 100644
--- a/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/esp_cmd.c
+++ b/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/esp_cmd.c
@@ -485,7 +485,7 @@ static void esp_cmd_work(struct work_struct *work)
static int create_cmd_wq(struct esp_adapter *adapter)
{
- adapter->cmd_wq = create_singlethread_workqueue("ESP_CMD_WORK_QUEUE");
+ adapter->cmd_wq = alloc_workqueue("ESP_CMD_WQ", WQ_HIGHPRI | WQ_MEM_RECLAIM, 1);
RET_ON_FAIL(!adapter->cmd_wq);
diff --git a/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/main.c b/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/main.c
index ebea4040d..492c91d5b 100644
--- a/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/main.c
+++ b/kernel/kernel-5.10/module_drivers/drivers/net/wireless/esp_hosted_ng/main.c
@@ -1039,7 +1039,7 @@ static struct esp_adapter *init_adapter(void)
memset(&adapter, 0, sizeof(adapter));
/* Prepare interface RX work */
- adapter.if_rx_workqueue = alloc_workqueue("ESP_IF_RX_WORK_QUEUE", 0, 0);
+ adapter.if_rx_workqueue = alloc_workqueue("ESP_RX_WQ", WQ_HIGHPRI | WQ_MEM_RECLAIM, 1);
if (!adapter.if_rx_workqueue) {
deinit_adapter();
We are not sure if this will cause an issue over time. Please confirm.
4. We think this could be related to a defect on the SPI driver or SPI transaction. We would kindly like to add some resilience for faulty transfers to esp_hosted_ng
.