Skip to content

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

@jori-nordic

Description

@jori-nordic

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 @

static struct bt_conn_tx *conn_tx_alloc(void)
{
/* The TX context always get freed in the system workqueue,
* so if we're in the same workqueue but there are no immediate
* contexts available, there's no chance we'll get one by waiting.
*/
if (k_current_get() == &k_sys_work_q.thread) {
return k_fifo_get(&free_tx, K_NO_WAIT);
}
if (IS_ENABLED(CONFIG_BT_CONN_LOG_LEVEL_DBG)) {
struct bt_conn_tx *tx = k_fifo_get(&free_tx, K_NO_WAIT);
if (tx) {
return tx;
}
LOG_WRN("Unable to get an immediate free conn_tx");
}
return k_fifo_get(&free_tx, K_FOREVER);
}

Metadata

Metadata

Assignees

Labels

area: Bluetooth HostBluetooth Host (excluding BR/EDR)bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions