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: Mesh: Add full virtual addresses support #57878
Bluetooth: Mesh: Add full virtual addresses support #57878
Conversation
41c6331
to
ae4079f
Compare
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.
LGTM 👍 I have a couple of minor comments
include/zephyr/bluetooth/mesh/msg.h
Outdated
@@ -102,6 +105,8 @@ struct bt_mesh_msg_ctx { | |||
/** | |||
* @brief Helper for bt_mesh_msg_ctx structure initialization. | |||
* | |||
* @note If @c dst is a Virtual Address, Label UUID shall initialized separately. |
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.
* @note If @c dst is a Virtual Address, Label UUID shall initialized separately. | |
* @note If @c dst is a Virtual Address, Label UUID shall be initialized separately. |
subsys/bluetooth/mesh/va.h
Outdated
* | ||
* @param uuid pointer to momry with Label UUID to be found. | ||
* | ||
* @return Pointer to an valid entry, NULL otherwise. |
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.
* @return Pointer to an valid entry, NULL otherwise. | |
* @return Pointer to a valid entry, NULL otherwise. |
subsys/bluetooth/mesh/va.h
Outdated
* | ||
* @c uuid can be a user data. | ||
* | ||
* @param uuid pointer to momry with Label UUID to be found. |
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.
* @param uuid pointer to momry with Label UUID to be found. | |
* @param uuid pointer to memory with Label UUID to be found. |
subsys/bluetooth/mesh/va.h
Outdated
* | ||
* @param addr Virtual address to check | ||
* | ||
* @return true if there is collision, false otherwise. |
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.
* @return true if there is collision, false otherwise. | |
* @return True if there is collision, false otherwise. |
subsys/bluetooth/mesh/va.h
Outdated
|
||
/** @brief Iterate stored Label UUIDs. | ||
* | ||
* When @c addr is @ref BT_MESH_ADDR_UNASSIGNED, this function iterates all available addresses |
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.
* When @c addr is @ref BT_MESH_ADDR_UNASSIGNED, this function iterates all available addresses | |
* When @c addr is @ref BT_MESH_ADDR_UNASSIGNED, this function iterates over all available addresses |
?
tests/bsim/bluetooth/mesh/tests_scripts/friendship/msg_va_collision.sh
Outdated
Show resolved
Hide resolved
ae4079f
to
014816b
Compare
When LPN sends a segmented message to itself, it unnecesseraly polls Friend. Since Friend doesn't receive this message, the segmented message transmission will eventually fail (send end callback will return error), while the message will actually be passed to the access layer. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
15df358
to
880b321
Compare
This commit adds the following features related to virtual addresses support: - Allows to store Label UUIDs which virtual addresses collide; - Allows to decrypt messages encrypted with a virtual address with collision; - Allows to publish a message to a specific Label UUID to avoid virtual addresses collision by adding a pointer to Label UUID to struct bt_mesh_msg_ctx and struct bt_mesh_model_pub; - Allows to differentiate Label UUIDs in the model's Subscription List by storing all subscribed UUIDs in struct bt_mesh_model.uuids field. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Test that: - virtual addresses in subscription list and publication states are stored and restored correctly - virtual addresses with collisions are stored and restored correctly Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Test that transport layer correctly encrypts and decrypts messages to virtual addresses with collision. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Test that LPN correctly sends Friend Subscription List Add and Remove messages to Friend when subscribed and unsubscribed to virtual addresses wirth collision. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
880b321
to
4aa8db6
Compare
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.
LGTM just needs to clarify the final case with backward compatibility. After this, I'll approve PR.
e44b721
to
94b1c1e
Compare
After adding support for virtual addresses with collision (where two Label UUIDs have the same virtual address), the format of the data in the persistent storage with the Label UUIDs which a model is subscribed to or publishes to has been changed. The recovery code is added and the Label UUIDs will be recovered by picking first Label UUID matching to the virtual address in the subscription list or model publication. This options can disable the recovery code and save some flash if the recovery is not required (e.g. virtual address support wasn't enabled before this option was added, or the devices were unprovisioned before upgrading to the version with this option). Making this option as deprecated to be able to drop support of this option and remove the recovery code eventually. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
94b1c1e
to
8515e36
Compare
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it requires label uuid to be added before any message can be sent and desired uuid should be passed to message context structure before sending a message to a virtual address. This change should fix MESH/NODE/NET/BV-02-C and MESH/NODE/TNPT/BV-05-C failing tests. For MESH/NODE/NET/BV-02-C the virtual address is added on hdl_wid_21 as PTS asks the stack to provide known virtual address. For MESH/NODE/TNPT/BV-05-C PTS gives the label uuid in the message, therefore we need to add this address first before sending a message to it. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it requires label uuid to be added before any message can be sent and desired uuid should be passed to message context structure before sending a message to a virtual address. This change should fix MESH/NODE/NET/BV-02-C and MESH/NODE/TNPT/BV-05-C failing tests. For MESH/NODE/NET/BV-02-C the virtual address is added on hdl_wid_21 as PTS asks the stack to provide known virtual address. For MESH/NODE/TNPT/BV-05-C PTS gives the label uuid in the message, therefore we need to add this address first before sending a message to it. Corresponding PR to zephyrproject-rtos: zephyrproject-rtos/zephyr#59486 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it requires label uuid to be added before any message can be sent and desired uuid should be passed to message context structure before sending a message to a virtual address. This change should fix MESH/NODE/NET/BV-02-C and MESH/NODE/TNPT/BV-05-C failing tests. For MESH/NODE/NET/BV-02-C the virtual address is added on hdl_wid_21 as PTS asks the stack to provide known virtual address. For MESH/NODE/TNPT/BV-05-C PTS gives the label uuid in the message, therefore we need to add this address first before sending a message to it. Corresponding PR to zephyrproject-rtos: zephyrproject-rtos/zephyr#59486 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it requires label uuid to be added before any message can be sent and desired uuid should be passed to message context structure before sending a message to a virtual address. This change should fix MESH/NODE/NET/BV-02-C and MESH/NODE/TNPT/BV-05-C failing tests. For MESH/NODE/NET/BV-02-C the virtual address is added on hdl_wid_21 as PTS asks the stack to provide known virtual address. For MESH/NODE/TNPT/BV-05-C PTS gives the label uuid in the message, therefore we need to add this address first before sending a message to it. Corresponding PR to zephyrproject-rtos: zephyrproject-rtos/zephyr#59486 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it requires label uuid to be added before any message can be sent and desired uuid should be passed to message context structure before sending a message to a virtual address. This change should fix MESH/NODE/NET/BV-02-C and MESH/NODE/TNPT/BV-05-C failing tests. For MESH/NODE/NET/BV-02-C the virtual address is added on hdl_wid_21 as PTS asks the stack to provide known virtual address. For MESH/NODE/TNPT/BV-05-C PTS gives the label uuid in the message, therefore we need to add this address first before sending a message to it. Corresponding PR to zephyrproject-rtos: zephyrproject-rtos/zephyr#59486 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: #57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
…ual addresses Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no> (cherry picked from commit 4d56a31) Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it requires label uuid to be added before any message can be sent and desired uuid should be passed to message context structure before sending a message to a virtual address. This change should fix MESH/NODE/NET/BV-02-C and MESH/NODE/TNPT/BV-05-C failing tests. For MESH/NODE/NET/BV-02-C the virtual address is added on hdl_wid_21 as PTS asks the stack to provide known virtual address. For MESH/NODE/TNPT/BV-05-C PTS gives the label uuid in the message, therefore we need to add this address first before sending a message to it. Corresponding PR to zephyrproject-rtos: zephyrproject-rtos/zephyr#59486 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
…ual addresses Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no> (cherry picked from commit 4d56a31) Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 (cherry picked from commit 4d56a31) Original-Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no> GitOrigin-RevId: 4d56a31 Change-Id: I8d32b5d0bb9a9fa6983c1a3b5a8bab2529a4c2e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4716825 Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos/zephyr#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Virtual address behavior has been changed in this PR: zephyrproject-rtos#57878 Now it is required to register virtual address before using it. Corresponding PR to auto-pts: auto-pts/auto-pts#961 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This PR adds the following features related to virtual addresses
support:
collision;
addresses collision by adding a pointer to Label UUID to
struct bt_mesh_msg_ctx and struct bt_mesh_model_pub;
by storing all subscribed UUIDs in struct bt_mesh_model.uuids field.
This PR adds BabbleSim test to cover new functionality.
This PR also fixes an issue where an LPN will unnecessarily poll Friend when sending a message over loopback.