zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.9k stars 6.64k forks source link

Bluetooth: (conn.c) ACL buffers can "steal" ISO TX contexts #72017

Open jori-nordic opened 6 months ago

jori-nordic commented 6 months ago

Reporting just so I don't forget about it.

Both iso_tx[] and conn_tx[] arrays end up in the free_tx fifo. This fifo is then used indiscriminately by conn_tx_alloc() to allocate a TX context for a given buffer. That buffer can be for an ACL or ISO link.

This means an ACL link can starve an ISO link.

Env

Zephyr @ https://github.com/zephyrproject-rtos/zephyr/blob/78150c8e1b2c07537ba35a05d9428983f1968f99/subsys/bluetooth/host/conn.c#L427-L449

github-actions[bot] commented 4 months ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

Thalley commented 4 months ago

I guess the solution here is to have individual pools for ACL and ISO? What about BREDR? L2CAP?

jori-nordic commented 4 months ago

we already have the individual pools. I guess the solution is pretty simple, also have individual fifos, by adding a conn-type param to conn_tx_alloc(). I have not dived too deep on this one yet.

Thalley commented 4 months ago

we already have the individual pools. I guess the solution is pretty simple, also have individual fifos, by adding a conn-type param to conn_tx_alloc(). I have not dived too deep on this one yet.

Right, I'm sure that's also what I meant :P

But I still assume that the issue between ISO and ACL also exist for ACL and SCO/BR, although much less apparent?

jori-nordic commented 4 months ago

It's possible, yes. Although I'm not sure how to test SCO.

github-actions[bot] commented 2 months ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

github-actions[bot] commented 2 days ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.