Skip to content

Conversation

@ankuns
Copy link
Contributor

@ankuns ankuns commented Oct 16, 2024

This PR adds the following:

  1. Kconfig option IEEE802154_SELECTIVE_TXCHANNEL is added that allows ieee802154 drivers that support the new (also introduced) capability IEEE802154_HW_SELECTIVE_TXCHANNEL to transmit timed messages with a channel passed through net_pkt. Upper layer that is aware of this feature should query the driver for the capability. If the driver has the capability then the upper layer passes the channel to radio_api->tx operation via net_pkt. This allows to perfrom CSL transmissions as stated in as stated in IEEE 802.15.4-2020 chapter 6.12.2.7 without additional call to radio_api->set_channel which would interrupt reception of any incoming frame. However the actual transmission occurs later. Drivers have no duty to support this feature, as they do not have to claim the IEEE802154_HW_SELECTIVE_TXCHANNEL capability. The upper layer has no duty to support this feature because it might not enable Kconfig option.
  2. The support for IEEE802154_SELECTIVE_TXCHANNEL is added to nrf802154_nrf5 drier.
  3. The OpenThread integration is made aware of the IEEE802154_SELECTIVE_TXCHANNEL Kconfig option and supports the IEEE802154_HW_SELECTIVE_TXCHANNEL capability.

This PR improves performance of reception while OpenThread schedules timed CSL transmissions.

This is an alternative to #79782

@ankuns
Copy link
Contributor Author

ankuns commented Oct 16, 2024

@fgrandel This (draft) PR is another approach instead of #79782
Could you please have a look and let me know if it is justified enough? Please also refer to our discord discussion (my nickname is ankuns) and what we agreed there.
The first commit is the most relevant to you, later commits simply implement the proposed API within nrf5 and openthread.
As you see the approach doesn't enforce any driver to implement/support the new Kconfig and related capability.
Just these higher layers that are interested in this feature (currently OpenThread) need to know and possibly turn the feature on. If the feature is on, the higher layer can check if underlying driver supports the selective tx channel feature.

ghost
ghost previously approved these changes Oct 16, 2024
edmont
edmont previously approved these changes Oct 16, 2024
@ankuns ankuns dismissed stale reviews from edmont and ghost via 1216c6e October 16, 2024 11:53
@ankuns ankuns force-pushed the ieee802154_selective_tx_channel_v2 branch 2 times, most recently from 1216c6e to c75f55c Compare October 16, 2024 12:41
The Kconfig `IEEE802154_SELECTIVE_TXCHANNEL` is added along with
the new capability `IEEE802154_HW_SELECTIVE_TXCHANNEL`.
The new capability of the ieee802154 drivers allows to schedule
CSL transmissions as stated in IEEE 802.15.4-2020 chapter 6.12.2.7
CSL over multiple channels. The benefit of the new API is that
additional call to `ieee802154_radio_api::set_channel()` is not
required. The drivers will switch to the new channel as late as
possible for CSL transmissions thus will not interrupt any reception
that might be in progress until the very late moment when the
transmission actually starts.
This improves reception performance when CSL transmissions are used.

Signed-off-by: Damian Krolik <[email protected]>
Signed-off-by: Andrzej Kuroś <[email protected]>
The ieee802154_nrf5 supports the IEEE802154_SELECTIVE_TXCHANNEL
Kconfig option and advertises the IEEE802154_HW_SELECTIVE_TXCHANNEL
capability.
The ieee802154_nrf5 driver now allows to schedule timed transmission
requests with selective tx channel, that is set at the latest
possible moment. This improves reception performance when the
timed transmissions are requested.

Signed-off-by: Damian Krolik <[email protected]>
Signed-off-by: Andrzej Kuroś <[email protected]>
@ankuns ankuns force-pushed the ieee802154_selective_tx_channel_v2 branch from c75f55c to a17d1ac Compare October 16, 2024 12:53
ankuns added a commit to ankuns/sdk-zephyr that referenced this pull request Oct 16, 2024
…TXCHANNEL

The Kconfig `IEEE802154_SELECTIVE_TXCHANNEL` is added along with
the new capability `IEEE802154_HW_SELECTIVE_TXCHANNEL`.
The new capability of the ieee802154 drivers allows to schedule
CSL transmissions as stated in IEEE 802.15.4-2020 chapter 6.12.2.7
CSL over multiple channels. The benefit of the new API is that
additional call to `ieee802154_radio_api::set_channel()` is not
required. The drivers will switch to the new channel as late as
possible for CSL transmissions thus will not interrupt any reception
that might be in progress until the very late moment when the
transmission actually starts.
This improves reception performance when CSL transmissions are used.

Upstream PR: zephyrproject-rtos/zephyr#79919

Signed-off-by: Damian Krolik <[email protected]>
Signed-off-by: Andrzej Kuroś <[email protected]>
ankuns added a commit to ankuns/sdk-zephyr that referenced this pull request Oct 16, 2024
…_TXCHANNEL

The ieee802154_nrf5 supports the IEEE802154_SELECTIVE_TXCHANNEL
Kconfig option and advertises the IEEE802154_HW_SELECTIVE_TXCHANNEL
capability.
The ieee802154_nrf5 driver now allows to schedule timed transmission
requests with selective tx channel, that is set at the latest
possible moment. This improves reception performance when the
timed transmissions are requested.

Upstream PR: zephyrproject-rtos/zephyr#79919

Signed-off-by: Damian Krolik <[email protected]>
Signed-off-by: Andrzej Kuroś <[email protected]>
ankuns added a commit to ankuns/sdk-zephyr that referenced this pull request Oct 16, 2024
The capabilities returned by radio_api->get_capabilities do not change.
The result is cached in a variable to improve performance.

Upstream PR: zephyrproject-rtos/zephyr#79919

Signed-off-by: Andrzej Kuroś <[email protected]>
ankuns added a commit to ankuns/sdk-zephyr that referenced this pull request Oct 16, 2024
…TXCHANNEL

For transmit_message if the transmission is timed and underlying
driver supports `IEEE802154_HW_SELECTIVE_TXCHANNEL` then use
the selective txchannel feature for transmission.
This does not change the current `channel` at the moment of call,
the driver will transmit the message on the channel selected through
`net_pkt_set_ieee802154_txchannel` then (after receiving an ACK
if requested) it will return to the original channel.
When Kconfig option IEEE802154_SELECTIVE_TXCHANNEL is turned on,
the timed transmissions scheduled some time ahead on different
channel will not abort ongoing reception until the exact moment
of transmission comes.

Upstream PR: zephyrproject-rtos/zephyr#79919

Signed-off-by: Andrzej Kuroś <[email protected]>
For transmit_message if the transmission is timed and underlying
driver supports `IEEE802154_HW_SELECTIVE_TXCHANNEL` then use
the selective txchannel feature for transmission.
This does not change the current `channel` at the moment of call,
the driver will transmit the message on the channel selected through
`net_pkt_set_ieee802154_txchannel` then (after receiving an ACK
if requested) it will return to the original channel.
When Kconfig option IEEE802154_SELECTIVE_TXCHANNEL is turned on,
the timed transmissions scheduled some time ahead on different
channel will not abort ongoing reception until the exact moment
of transmission comes.

Signed-off-by: Andrzej Kuroś <[email protected]>
@ankuns ankuns force-pushed the ieee802154_selective_tx_channel_v2 branch from a17d1ac to 2ea27d9 Compare October 18, 2024 10:51
Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very neatly done. I hope we can see other drivers supporting this feature soon as well 👍

@aescolar aescolar merged commit adf4e73 into zephyrproject-rtos:main Oct 22, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants