[PoC] gnrc_netif: revamp gnrc_netif_ops_t interface #18965
Draft
+343
−282
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
This PoC revamps the GNRC Network Interface to make it independent of the source of events and adapt it better to slotted MAC layers.
The reason for doing this are:
event_thread
, which may enable running multiple interfaces on a single thread.get
orset
function will postpone IRQ offloading, which can be fatal for slotted MAC layers.gnrc_netif_pktq
is redundant with the openDSME MAC queue.Proposed changes
gnrc_netif_ops_t
interface (netif->ops->xxx
functions) to interact with the network interface, instead ofgnrc_netapi
. I propose to usegnrc_netif_xxx
functions as a wrapper, in case we need to structure common code.netif->ops->send
tonetif->ops->schedule
and adapt documentation to indicate the function schedules a transmission to be as soon as possible.ctx
parameter to the init function, which can be used to pass link layer specific information (e.g thread stacksize for current netdev implementations).kernel_pid_t
for simplicity, but this could be any identifier.PoC
To showcase the proposed changes, I wrote the new
gnrc_netif_ops_t
interface to use event loops instead of IPC messages. The implementation saves ~100 bytes of RAM and seems to perform slightly better than the current master:This PR
Master
Testing procedure
I only implemented the changes to
gnrc_netif_ieee802154
. Feel free to try e.ggnrc_networking
with a IEEE 802.15.4 transceiver.Issues/PRs references
There have been long discussions in the past with @miri64 in order to make
gnrc_netif
independent of the source of events. But now that #18156 and future MAC layers are very close, this makes IMO the transition smoother.