AnsweredAssumed Answered

How to properly destroy an ODP queue of type ODP_QUEUE_TYPE_SCHED?

Question asked by Clemens Eisserer on May 18, 2016
Latest reply on May 20, 2016 by Pavel Chubakov

I am currently writing an ODP application which should terminate gracefully and therefore has to release all obtained ressources. So far I am struggling with releasing scheduled ODP queues (ODP_QUEUE_TYPE_SCHED).


Despite calling odp_queue_destroy, when the application calls odp_term_global(), I get the follwoing error:

> odp_queue.c:171:odp_queue_term_global():Not destroyed queue: 1-pktio_inq_def


When starting the application a second time it fails with the following message, most likely because some resscources requested have not been released during the first program execution:

> nadk_eth_setup_rx_vq 881-ERR-Error in setting the rx flow: ErrorCode = -5


My current findings are:

  • odp_queue_term_global() fails, because "1-pktio_inq_def" is not in state QUEUE_STATUS_FREE.
  • odp_queue_destroy() does not set status the queue's status to QUEUE_STATUS_FREE, instead it re-assigns the queues dequeue-function to queue_deq_multi_destroy() and sets its status to QUEUE_STATUS_DESTROYED.
  • queue_deq_multi_destroy() is said to be called at some schedule point, however in my application it is never called.
  • I don't see any code where the queue is released back to NADK. The whole NXP ODP code only contains a single call to nadk_put_frameq(), which is in some error-handling code.
  • Currently all ODP examples assume to be running forever and don't do proper cleanup at exit.


So currently my questions are:

  • How is it possible to destroy a ODP queue of the type ODP_QUEUE_TYPE_SCHED?
  • Is it possible with restool to reset the network hardware to the state it had after boot-up? This would avoid many reboot-cycles.


Thank you in advance, Clemens