Skip to content
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

Bluetooth: controller: llcp: set refactored LLCP as default #46462

Merged
merged 2 commits into from
Aug 14, 2022

Conversation

kruithofa
Copy link
Collaborator

@kruithofa kruithofa commented Jun 13, 2022

This PR sets the refactored LLCP as default

This exposed some missing include files, and updates to some KConfig settings,
which are also added in this PR

Issue #48823 has been created because of an observed instability in
the tests/bluetooth/bsim_bt/bsim_test_multiple test

Issue #44339 has been created for the missing support of advanced scheduling

Fixes #46065

subsys/bluetooth/controller/ll_sw/ull_conn_iso.c Outdated Show resolved Hide resolved
Comment on lines 483 to 484
uint8_t cis_id;
uint32_t c_max_sdu:12;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could uint16_t conn_event_count; be placed between cis_id and c_max_sdu?

At least to me it looks like that would be better in terms of grouping by word size of 32-bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, however this is the way it was defined for legacy.

subsys/bluetooth/controller/ll_sw/ull_iso.c Outdated Show resolved Hide resolved
subsys/bluetooth/controller/ll_sw/ull_peripheral_iso.c Outdated Show resolved Hide resolved
tests/bluetooth/bsim_bt/bsim_test_eatt/src/common.h Outdated Show resolved Hide resolved
@@ -10,7 +10,7 @@ CONFIG_BT_AUTO_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_AUTO_DATA_LEN_UPDATE=y

CONFIG_BT_MAX_CONN=250
CONFIG_BT_MAX_CONN=150
Copy link
Collaborator

Choose a reason for hiding this comment

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

The "new" LLCP doesn't support 250 connections?
Should CONFIG_BT_ID_MAX be reduced as well then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, we need to fix the new LLCP so that it supports 250 connections

Copy link
Contributor

Choose a reason for hiding this comment

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

Tracked by: #48823, but is this a bug or a design limitation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe this is a bug

@kruithofa kruithofa force-pushed the llcp_set_default branch 2 times, most recently from 5fdcfa8 to dc938bc Compare August 9, 2022 12:34
Thalley
Thalley previously approved these changes Aug 9, 2022
Thalley
Thalley previously approved these changes Aug 9, 2022
Comment on lines 368 to 369
default y if (BT_CENTRAL || (BT_BROADCASTER && BT_CTLR_ADV_EXT) || BT_CTLR_ADV_ISO) && \
BT_LL_SW_LLCP_LEGACY
Copy link
Contributor

Choose a reason for hiding this comment

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

Link a GH issue to fix the missing support for advanced scheduling in new LLCP

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment on lines 11 to 12
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4
Copy link
Contributor

Choose a reason for hiding this comment

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

Make CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4 as default in Kconfig. Setting CONFIG_BT_CTLR_ADVANCED_FEATURES=y in projects will display build warning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment on lines 11 to 12
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4
Copy link
Contributor

Choose a reason for hiding this comment

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

Make CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4 as default in Kconfig. Setting CONFIG_BT_CTLR_ADVANCED_FEATURES=y in projects will display build warning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment on lines 12 to 13
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4
Copy link
Contributor

Choose a reason for hiding this comment

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

Make CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4 as default in Kconfig. Setting CONFIG_BT_CTLR_ADVANCED_FEATURES=y in projects will display build warning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment on lines 19 to 24
/*
* we need to sync with peer to ensure that we get collisions
*/
backchannel_sync_send();
backchannel_sync_wait();

Copy link
Contributor

Choose a reason for hiding this comment

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

This is test procedure change, changes should be separate PR and merged before this PR. And these changes should pass CI before and after switch to refactored LLCP.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is test procedure change, changes should be separate PR and merged before this PR. And these changes should pass CI before and after switch to refactored LLCP.

See PR #48859

Comment on lines 20 to 22
if (rx == NEW_MTU || tx == NEW_MTU) {
SET_FLAG(flag_reconfigured);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Again test case execution change, have in separate PR and be merged before switch to refactor PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See PR #48859

Comment on lines 15 to 17

CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4
Copy link
Contributor

Choose a reason for hiding this comment

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

Make CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=4 as default in Kconfig. Setting CONFIG_BT_CTLR_ADVANCED_FEATURES=y in projects will display build warning.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -10,7 +10,7 @@ CONFIG_BT_AUTO_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_AUTO_DATA_LEN_UPDATE=y

CONFIG_BT_MAX_CONN=250
CONFIG_BT_MAX_CONN=150
Copy link
Contributor

Choose a reason for hiding this comment

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

Tracked by: #48823, but is this a bug or a design limitation?

@@ -43,3 +43,4 @@ CONFIG_BT_CTLR_RX_BUFFERS=6
# accuracy, current value here is sufficient for 500ppm at 1 second interval.
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_SCHED_ADVANCED_CENTRAL_CONN_SPACING=1000
CONFIG_BT_CTLR_SCHED_ADVANCED=y
Copy link
Contributor

Choose a reason for hiding this comment

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

Why turn of in Kconfig file and enable CONFIG_BT_CTLR_SCHED_ADVANCED here?

This babblesim test is reuse of https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth/central_multilink and https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth/peripheral_identity, have you tested them on target?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Collaborator

@jori-nordic jori-nordic left a comment

Choose a reason for hiding this comment

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

https://github.com/zephyrproject-rtos/zephyr/pull/46462/files#r941999012 . You can assign me to the PR you create for that test.

@kruithofa
Copy link
Collaborator Author

https://github.com/zephyrproject-rtos/zephyr/pull/46462/files#r941999012 . You can assign me to the PR you create for that test.

See PR #48859

Set the new refactored LLCP the default

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
@@ -58,7 +58,7 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
#endif
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */

#if defined(CONFIG_BT_CONN)
#if defined(CONFIG_BT_CONN) && (defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_LEGACY))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should update the #endif on line 65 too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -58,7 +58,7 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
#endif
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */

#if defined(CONFIG_BT_CONN)
#if defined(CONFIG_BT_CONN) && (defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_LEGACY))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since CONFIG_BT_CENTRAL implies CONFIG_BT_CONN, this should perhaps have been

Suggested change
#if defined(CONFIG_BT_CONN) && (defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_LEGACY))
#if (defined(CONFIG_BT_CONN) && defined(CONFIG_BT_LEGACY)) || defined(CONFIG_BT_CENTRAL)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Normally yes, but I'll leave it as is, since this change has to be reverted once issue #44339 is resolved

erbr-ot
erbr-ot previously approved these changes Aug 11, 2022
Copy link
Collaborator

@erbr-ot erbr-ot left a comment

Choose a reason for hiding this comment

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

LGTM

Setting the new LLCP as default exposed errors in CI tests, which
are fixed here
Note that advanced scheduling needs to be disabled. Work is in
progress for implementing this for the new LLCP

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
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.

Bluetooth: controller: llcp: verify that refactored LLCP is used in EDTT
8 participants