We need to send and receive UDP with high priority and high bandwidth (50Mbps in Rx and 5Mbps in Tx).
We also are using TCP and MQTT - but these are not real-time critical.
We notice that when we enable TCP and MQTT threads the performance of UDP drops (delayed packet arrival to our netconn_recv routine).
Every time a new TCP connection is initiated by an external client, or whenever MQTT polls for an external broker we get this performance issue.
Here are our freeRtos priorities...
sys_thread_new("udpecho_thread", udpecho_thread, NULL, TASK_STACKSIZE_UDP, 8);
sys_thread_new("tcpecho_thread", tcpecho_thread, NULL, TASK_STACKSIZE_TCP, 4);
Is there a way to prioritize UPD packets over TCP at a lower level?
Hi @avbot :
If you are using RT1170, and RT1170 has two ENET peripherals and one of them, ENET QoS, allows to have prioritized queues.
For RT106x, no ENET QoS .
In your case,
sys_thread_new("udpecho_thread", udpecho_thread, NULL, TASK_STACKSIZE_UDP, 8);
sys_thread_new("tcpecho_thread", tcpecho_thread, NULL, TASK_STACKSIZE_TCP, 4);
Though udpecho thread has higher priority, all the enet packets go through tcpip_thread at the end and packets are sent and received serially.
I think the TCP acknowledge is sent by the tcpip_thread, before the packet gets to tcpecho_thread.
I would suggest you try to set TCP WND as low as possible, maybe it could make the remote TCP sender to slow down.
Regards
Daniel
About RT1170 do you know if the two ENET periphs can act as network switch? I.E traffic pass through from one external port through the 1170 to the second external port... and also allow 1170 to send and receive packets. If so do you know if there is example code for this somewhere?