-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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: L2CAP: simplify codepath for SDU TX #67212
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a93a2c2
tests: Bluetooth: use unique IDs for l2cap bsim tests
jori-nordic 02871d3
Bluetooth: L2CAP: single codepath for sending SDUs
jori-nordic a5ec0b2
Bluetooth: L2CAP: stop stealing buffers from SDU pool
jori-nordic 68de060
Bluetooth: L2CAP: fix net buf frags handling
jori-nordic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -579,22 +579,29 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan); | |||||||||
* size the buffers for the for the outgoing buffer pool. | ||||||||||
* | ||||||||||
* When sending L2CAP data over an LE connection the application is sending | ||||||||||
* L2CAP SDUs. The application can optionally reserve | ||||||||||
* L2CAP SDUs. The application shall reserve | ||||||||||
* @ref BT_L2CAP_SDU_CHAN_SEND_RESERVE bytes in the buffer before sending. | ||||||||||
* By reserving bytes in the buffer the stack can use this buffer as a segment | ||||||||||
* directly, otherwise it will have to allocate a new segment for the first | ||||||||||
* segment. | ||||||||||
* If the application is reserving the bytes it should use the | ||||||||||
* BT_L2CAP_BUF_SIZE() helper to correctly size the buffers for the for the | ||||||||||
* outgoing buffer pool. | ||||||||||
* When segmenting an L2CAP SDU into L2CAP PDUs the stack will first attempt | ||||||||||
* to allocate buffers from the original buffer pool of the L2CAP SDU before | ||||||||||
* using the stacks own buffer pool. | ||||||||||
* | ||||||||||
* The application can use the BT_L2CAP_SDU_BUF_SIZE() helper to correctly size | ||||||||||
* the buffers for the outgoing buffer pool. | ||||||||||
Comment on lines
+585
to
+586
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
* | ||||||||||
* When segmenting an L2CAP SDU into L2CAP PDUs the stack will first attempt to | ||||||||||
* allocate buffers from the channel's `alloc_seg` callback and will fallback | ||||||||||
* on the stack's global buffer pool (sized | ||||||||||
* @kconfig{CONFIG_BT_L2CAP_TX_BUF_COUNT}). | ||||||||||
* | ||||||||||
* @note Buffer ownership is transferred to the stack in case of success, in | ||||||||||
* case of an error the caller retains the ownership of the buffer. | ||||||||||
* | ||||||||||
* @return Bytes sent in case of success or negative value in case of error. | ||||||||||
* @return 0 in case of success or negative value in case of error. See below. | ||||||||||
* @return -EINVAL if `buf` or `chan` is NULL. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||
* @return -EINVAL if `chan` is not either BR/EDR or LE credit-based. | ||||||||||
* @return -EINVAL if buffer doesn't have enough bytes reserved to fit header. | ||||||||||
* @return -ENOBUFS if L2CAP TX context couldn't be allocated. Retry later. | ||||||||||
* @return -EMSGSIZE if `buf` is larger than `chan`'s MTU. | ||||||||||
* @return -ENOTCONN if underlying conn is disconnected. | ||||||||||
* @return -ESHUTDOWN if L2CAP channel is disconnected. | ||||||||||
* @return a negative value on error (from lower layers) if chan is BR/EDR. | ||||||||||
*/ | ||||||||||
int bt_l2cap_chan_send(struct bt_l2cap_chan *chan, struct net_buf *buf); | ||||||||||
|
||||||||||
|
Oops, something went wrong.
Oops, something went wrong.
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.
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.
This should go in the change log. Also add that it never returned anything useful.