Skip to content

Bluetooth: Mesh: Blob Server considers friendship #93335

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

omkar3141
Copy link
Contributor

@omkar3141 omkar3141 commented Jul 18, 2025

Fix Max Chunk reporting during Block_Information_Get:
If friendship is established, then max possible chunk size for transfer
is reported according to friend's queue size.

ChunkSize = (FndQ sz * Bytes per seg (12)) - Opcode(1) - Chunk_Num (2)-
8 byte MIC (max)
= (FndQ sz * 12) - 11

This allows all segments of Chunk_Transfer messages to fit in a friend
queue. If this is not done, friend queue keeps overflowing
systematically causing unstable PULL_MODE transfers.

Fix Chunk requests:
Adapt number of requested chunks according to current friend queue size.
If friend queue is too small, at least 1 chunk is requested.

@omkar3141 omkar3141 requested a review from alxelax July 18, 2025 13:20
@omkar3141 omkar3141 force-pushed the omka/NCSDK-34138_blob_server_understands_lpn branch 3 times, most recently from 8129cdd to 221a3b0 Compare July 18, 2025 14:19
@alxelax
Copy link
Contributor

alxelax commented Jul 21, 2025

Hi @omkar3141, this change is ok to me to provide aligned to the friend queue size information. It makes our server smarter.
However, it does not solve the main issue here: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/mesh/blob_srv.c#L154-L155
If friend queue size is less than segments per chunk, the blob server drops requests.
As we discussed offline BLOB server should continue requesting segments despite it has guaranteed missed segments due to lack of friend queue place.

@omkar3141 omkar3141 force-pushed the omka/NCSDK-34138_blob_server_understands_lpn branch from 221a3b0 to de71cc5 Compare July 21, 2025 08:32
alxelax
alxelax previously approved these changes Jul 21, 2025
Copy link
Contributor

@alxelax alxelax left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@alxelax alxelax left a comment

Choose a reason for hiding this comment

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

LGTM just minor suggestion for improvement

@omkar3141 omkar3141 force-pushed the omka/NCSDK-34138_blob_server_understands_lpn branch from b84805a to 1ae6640 Compare July 21, 2025 13:50
@omkar3141 omkar3141 requested a review from alxelax July 21, 2025 13:50
@omkar3141 omkar3141 force-pushed the omka/NCSDK-34138_blob_server_understands_lpn branch from 1ae6640 to 3c6876e Compare July 22, 2025 10:14
@omkar3141 omkar3141 requested a review from HaavardRei July 22, 2025 10:14
alxelax
alxelax previously approved these changes Jul 22, 2025
HaavardRei
HaavardRei previously approved these changes Jul 22, 2025
Fix Max Chunk reporting during Block_Information_Get:
If friendship is established, then max possible chunk size for transfer
is reported according to friend's queue size.

ChunkSize = (FndQ sz * Bytes per seg (12)) - Opcode(1) - Chunk_Num (2)-
            8 byte MIC (max)
	  = (FndQ sz * 12) - 11

This allows all segments of Chunk_Transfer messages to fit in a friend
queue. If this is not done, friend queue keeps overflowing
systematically causing unstable PULL_MODE transfers.

Fix Chunk requests:
Adapt number of requested chunks according to current friend queue size.
If friend queue is too small, at least 1 chunk is requested.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
@omkar3141 omkar3141 dismissed stale reviews from HaavardRei and alxelax via 5692977 July 25, 2025 08:33
@omkar3141 omkar3141 force-pushed the omka/NCSDK-34138_blob_server_understands_lpn branch from 3c6876e to 5692977 Compare July 25, 2025 08:33
Copy link

@cfriedt cfriedt merged commit 602fd0d into zephyrproject-rtos:main Jul 25, 2025
28 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.

6 participants