-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Bluetooth: Controller: Allow setting ISO TX/RX buffer count to 0 #69382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hello @yuxCai, and thank you very much for your first pull request to the Zephyr project! |
bf0e1d4 to
2267b9a
Compare
subsys/bluetooth/controller/Kconfig
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already depends on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BT_CTLR_ISO_TX_BUFFERS is set to default BT_ISO_TX_BUF_COUNT if BT_ISO. But when BT_ISO_TX_BUF_COUNT is 0, it will return error because BT_CTLR_ISO_TX_BUFFERS is out of the range
BT_CTLR_ISO_RX_BUFFERS, however, is independent of BT_ISO_RX_BUF_COUNT. I suggest changing the minimum values of the mentioned kconfigs to 0
subsys/bluetooth/controller/Kconfig
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| range 0 30 | |
| range 1 30 |
subsys/bluetooth/controller/Kconfig
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| range 0 255 | |
| range 1 255 |
Upstream PR: zephyrproject-rtos/zephyr#69382 There is no need to allocate TX/RX buffers when the device is an receiver/transmitter only. Signed-off-by: Yuxuan Cai <yuxuan.cai@nordicsemi.no>
2267b9a to
2c780e7
Compare
Thalley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CONFIG_BT_ISO_TX_BUF_COUNT and CONFIG_BT_ISO_RX_BUF_COUNT are not specific to the controller, and are also being used by the host, so the commit should not start with Bluetooth: Controller.
Furthermore, setting these to 0 might cause issues in the host:
NET_BUF_POOL_FIXED_DEFINE(iso_tx_pool, CONFIG_BT_ISO_TX_BUF_COUNT,
BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU),
CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL);What happens if we define a pool with 0 count?
It should also not be possible to set BT_ISO_TX_BUF_COUNT=0 when BT_ISO_BROADCASTER=y, or BT_ISO_RX_BUF_COUNT=0 when BT_ISO_SYNC_RECEIVER=y.
There are likely several places in iso.c that needs to be guarded if we allow either of them to be 0.
Also consider making some promptless Kconfig options that depend on these, so that if BT_ISO_TX_BUF_COUNT > 0 then BT_ISO_TX gets enabled, and similar for RX.
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
There is no need to allocate TX/RX buffers when the device is an receiver/transmitter only. Signed-off-by: Yuxuan Cai <yuxuan.cai@nordicsemi.no>
|
rebased to trigger stuck CI job |
As already mentioned, these are not (now) Controller Kconfig options after my change requests where addressed (only value may be inherited). The commit title needs correction. Plus, all code that use these Kconfig define need update to handle value of 0. |
These options are also used by the host. See #69382 (review) |
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
There is no need to allocate TX/RX buffers when the device is an receiver/transmitter only.