Priority of Eth RX task

Hello,

I implemented the network interface for a microcontroller as described in the documentation. My MCU calls an interrupt when a message is received, and this interrupt wakes up a task for processing called

prvEMACDeferredInterruptHandlerTask

Now, my question is, what is the correct way of setting the priority for this task in relation to the main IP task? Should the priority be higher or lower?

Any ideas and thoughts are welcome!

Thanks in advance

Higher. That way the events processed by the IP task aren’t blocked by the IP task, and the IP task can’t delay the [deferred] interrupt handling.

Got it. Thanks for your response!

On the note of priorities, if I have a server that accepts multiple connections, and I create tasks with the child socket, should the priority of this child task be higher/lower/same than the parent listen socket? @rtel

I think there you can do whatever suites your application. If the server task has higher priority it will immediately enter the Blocked state again anyway, as it waits for another connection.

@rtel wrote:

I think there you can do whatever suites your application

I think so too.

My recommended scheme has always been:

  • high for ‘prvEMACDeferredInterruptHandlerTask’
  • medium for ‘ipconfigIP_TASK_PRIORITY’
  • low for all tasks that make use of the TCP/IP.

Tasks that do not use TCP/IP are free to choose their priority.