-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth: scan: Implement non-blocking ext-adv report reassembly
Re-assemble the extended advertising reports into a dedicated buffer pool and notify the application asynchronously. To achieve this we: - decompose the re-assembly function into fragmented and non-frag parts - for reassembled reports: push any other info onto the reassembled buffer - for non-frag reports: pass the raw event buffer directly - put that buffer on a FIFO - trigger a (sys)work item that pulls and calls the cb The optimization for 80% of cases is kept: Processing non-fragmented extended advertising reports will not double-copy: We add a buffer pool similar to `sync_evt_pool` and apply the following algo: - if report is non-frag & we have at least 1 buf available in pool -> ref() that buffer and put it on the FIFO directly - else: -> allocate from re-assembly pool and copy into it Note that we can only apply this optimization when we are processing the last report in the event buffer. Note to reviewers: The diff of this commit is garbage, you're probably better of comparing with the previous implementation manually. Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no> Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
- Loading branch information
1 parent
90d264b
commit a07430c
Showing
4 changed files
with
364 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.