sys/net/gnrc_netif: Make use of confirm send#18139
Merged
maribu merged 2 commits intoRIOT-OS:masterfrom Sep 17, 2022
Merged
Conversation
bc18120 to
47f807f
Compare
Contributor
|
Does the WIP label still apply? |
Member
Author
|
This could be merged if I drop the Ethernet change, as that change will break lwIP. I am currently working on the same thing for lwIP, after which driver could safely start making use of confirm_send. |
This was referenced Aug 9, 2022
Contributor
|
This needs a rebase |
21d2f01 to
eb21b20
Compare
Member
Author
|
Ping :) |
benpicco
reviewed
Sep 14, 2022
eb21b20 to
21c0969
Compare
Contributor
|
Please squash! |
This adds support for netdevs implementing the new API that provides `netdev_driver_t::confirm_send()`. This allows implementing netdevs in an event based non-blocking fashion, making live of driver developers a bit easier. In addition, `gnrc_tx_sync` will now throttle users of `sock_udp_send()` so that they can only send datagrams as fast as the network stack and hardware is able to send out. Finally, this lays the groundwork to fetch TX statistics (such as TX timestamps, reception of layer 2 ACKs/NACKs, etc.) from the network devices.
For Ethernet, raw netifs, and IEEE 802.15.4 netifs only release outgoing frame with legacy drivers, as gnrc_netif does so with new non-blocking API.
460a279 to
581f35e
Compare
benpicco
approved these changes
Sep 15, 2022
Member
Author
|
All green. If anyone wants to have another look before I hit merge, it is now or never ;) |
Member
Author
|
Thx everyone :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
netdev_legacy_apiandnetdev_new_apito allow optimizing for the "withconfirm_send()" and "withoutconfirm_send()" variant of the netdev APInetdev_new_apitranslateNETDEV_EVENT_TX_COMPLETEinto ansys/eventevent, so that this can be signaled from ISR. This safes a roundtrip to the ISR handler if the type of the event is known at ISR time (e.g. multiple signal pins or peripheral netdev)NETDEV_EVENT_TX_COMPLETEevent before signalling upper layers completion withgnrc_tx_sync.Testing procedure
This needs to be tested in conjunction with a driver actually being ported to the new API. However, we cannot port drivers to the new API until both GNRC and lwIP correctly operate with the new API.
#18428 ports the STM32 Ethernet driver to the new API, so that this PR can be tested there.
Issues/PRs references
Similar to #15821 but uses the now existing sys/event infrastructure rather than thread_flags
fixes #7474