- 
                Notifications
    
You must be signed in to change notification settings  - Fork 720
 
[nrf fromtree] bluetooth: host: downstream bluetooth/buf.h API change #2353
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
          
     Merged
      
      
            jukkar
  merged 10 commits into
  nrfconnect:main
from
PavelVPV:hci_driver_async_buf_get_downstream
  
      
      
   
  Dec 20, 2024 
      
    
                
     Merged
            
            [nrf fromtree] bluetooth: host: downstream bluetooth/buf.h API change #2353
                    jukkar
  merged 10 commits into
  nrfconnect:main
from
PavelVPV:hci_driver_async_buf_get_downstream
  
      
      
   
  Dec 20, 2024 
              
            Conversation
  
    
      This file contains hidden or 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
    
  
  
    
    5255cf0    to
    bb327d7      
    Compare
  
    
              
                    theob-pro
  
              
              approved these changes
              
                  
                    Dec 11, 2024 
                  
              
              
            
            
              
                    alwa-nordic
  
              
              approved these changes
              
                  
                    Dec 11, 2024 
                  
              
              
            
            
…GRESS` Fix discrepancy in reference management between calls to `bt_l2cap_chan_ops.recv` when the application returns `-EINPROGRESS`. There are two call sites, `l2cap_chan_le_recv_sdu` and `l2cap_chan_le_recv`, that were inconsistent. `l2cap_chan_le_recv_sdu` moves the reference, and this patch updates `l2cap_chan_le_recv` to do the same. This behavior is also now documented. This bug has existed since the introduction of this feature in 3151d26. Signed-off-by: Aleksander Wasaznik <[email protected]> (cherry picked from commit 200de7c)
…rror For ease of development, we should log the event as an error. Signed-off-by: Aleksander Wasaznik <[email protected]> (cherry picked from commit 70ad45d)
…ol destroy This is needed for a test to catch a double-free. Signed-off-by: Aleksander Wasaznik <[email protected]> (cherry picked from commit 5f89a6b)
…00_00_00_00_` This is shorthand for random static addresses. It's similar to `bt_addr_le_from_str`, but is a macro that results in an object literal, making it more versatile and less verbose. This macro only gives access to the first 255 random static addresses, but this ought to be enough addresses for testing. Signed-off-by: Aleksander Wasaznik <[email protected]> (cherry picked from commit abeca24)
The test implementation is based on a copy of the HFC multilink test. The test verifies that the stack respects the reference counting of SDU buffers when the L2CAP -EINPROGRESS feature is used. Signed-off-by: Aleksander Wasaznik <[email protected]> (cherry picked from commit 47325f8)
…uide docs for 4.1 This introduces the release notes and migration guide for 4.1.0 earlier than we typically do, so that people have a placeholder to start adding content as they line up pull requests for 4.1. The two documents are currently orphan and not visible from the main documentation as this would confuse users of 4.0. Signed-off-by: Benjamin Cabé <[email protected]> (cherry picked from commit d342f9e)
Because the number of ACL RX buffers must be at least the number of maximum connections plus one, increasing `CONFIG_BT_MAX_CONN` could inadvertently lead to a build failure if the number of ACL RX buffers is not also increased. This dependency may not be obvious to users. To address this issue, this commit deprecates the `CONFIG_BT_BUF_RX_COUNT` Kconfig symbol and computes the value in `buf.h` using the new `BT_BUF_RX_COUNT` define. Note that the default value and the minimum range value have been changed to 0 to "disable" the option. Additionally, to allow users to increase the number of ACL RX buffers, this commit introduces the new `CONFIG_BT_BUF_RX_COUNT_EXTRA` Kconfig symbol. The value of this symbol will be added to the computed value of `BT_BUF_RX_COUNT`. The configurations of tests and samples have been updated to reflect these changes. Signed-off-by: Théo Battrel <[email protected]> (cherry picked from commit 66ff97e)
This allows to combine several types in a single value. Signed-off-by: Pavel Vasilyev <[email protected]> (cherry picked from commit bd9a1ce)
…pool The Bluetooth data buffer API currently lacks a mechanism to notify when a buffer is freed in the RX pool. This limitation forces HCI drivers to adopt inefficient workarounds to manage buffer allocation. HCI drivers face two suboptimal options: - Blocking calls: Use bt_buf_get_rx with K_FOREVER, which blocks the execution context until a buffer becomes available. - Polling: Repeatedly call bt_buf_get_rx with K_NO_WAIT, which increases CPU load and reduces efficiency. This commit introduces a callback mechanism that is triggered each time a buffer is freed in the RX pool. With this feature, HCI drivers can: - Call bt_buf_get_rx with K_NO_WAIT. - Wait for the callback notification if a NULL buffer is returned, avoiding unnecessary polling. The new callback improves efficiency by enabling event-driven behavior for buffer management, reducing CPU overhead while maintaining responsiveness. Signed-off-by: Pavel Vasilyev <[email protected]> (cherry picked from commit c2488fd)
This commit adds a unit test that checks the freed buffer callback of the bluetooth data buffer API. Signed-off-by: Pavel Vasilyev <[email protected]> (cherry picked from commit 0d06691)
bb327d7    to
    13aed60      
    Compare
  
    
    
  PavelVPV 
      added a commit
        to PavelVPV/sdk-nrf
      that referenced
      this pull request
    
      Jan 7, 2025 
    
    
      
  
    
      
    
  
Update sdk-zephyr revision to pull in nrfconnect/sdk-zephyr#2353 Signed-off-by: Pavel Vasilyev <[email protected]>
    
  rlubos 
      pushed a commit
        to nrfconnect/sdk-nrf
      that referenced
      this pull request
    
      Jan 7, 2025 
    
    
      
  
    
      
    
  
Update sdk-zephyr revision to pull in nrfconnect/sdk-zephyr#2353 Signed-off-by: Pavel Vasilyev <[email protected]>
    
  degjorva 
      pushed a commit
        to degjorva/sdk-nrf
      that referenced
      this pull request
    
      Jan 8, 2025 
    
    
      
  
    
      
    
  
Update sdk-zephyr revision to pull in nrfconnect/sdk-zephyr#2353 Signed-off-by: Pavel Vasilyev <[email protected]>
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
This PR downstreams zephyrproject-rtos/zephyr#81646 PR which is needed to complete nrfconnect/sdk-nrf#18953 PR.
The following changes were cherry-picked due to dependencies:
BT_BUF_ACL_RX_COUNTsymbol zephyrproject-rtos/zephyr#81747