You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Timer discussion #11 got me think of our network face implementation might also be problematic. For example, current 802.15.4 face uses ISR to receive frames from network, and transfers data by directly invoking callback from forwarder, which may further invoke callbacks from direct face (which application code be involved with). Thus, the interrupt probably reaches to application region. Given that we can't expect what application do in direct face's onData()/onInterest(), we better decouple forwarder callback from this ISR.
Wonder if using event queue could solve this. We can do it with timer implementation together. Plus, I suggest to keep interrupts confined in "kernel space" and keep all ISR use cases in NDN-Lite as short and simple as possible to ensure interrupts can return quickly.
The text was updated successfully, but these errors were encountered:
tianyuan129
changed the title
face: decoupling forwarder callback from 802.15.4 frames reception
face: decoupling forwarder_receive from ISR
Mar 21, 2019
Current face_receive is still called inside ISR, though only the last segment will trigger it. Our UDP face in POSIX adaptation is a good example, showing how to utilize msg queue to avoid abusing ISR, in order to receive and drive forwarder processing packets. Faces should be refactored with msg queue's help.
The classical way to turn a push into a pull is adding a queue. nrf_802154_receivedpushes the frame into a queue, and a normal thread pulls from the queue.
I had this trouble when developing esp8266ndn's EthernetTransport, and ended up adding a queue.
ESP32 variant uses FreeRTOS Queue API because incoming frames are arriving on another CPU; ESP8266 variant is a simple circular buffer.
Timer discussion #11 got me think of our network face implementation might also be problematic. For example, current 802.15.4 face uses ISR to receive frames from network, and transfers data by directly invoking callback from forwarder, which may further invoke callbacks from direct face (which application code be involved with). Thus, the interrupt probably reaches to application region. Given that we can't expect what application do in direct face's onData()/onInterest(), we better decouple forwarder callback from this ISR.
Wonder if using event queue could solve this. We can do it with timer implementation together. Plus, I suggest to keep interrupts confined in "kernel space" and keep all ISR use cases in NDN-Lite as short and simple as possible to ensure interrupts can return quickly.
The text was updated successfully, but these errors were encountered: