net: buf: Redesigned API with split data and meta-data

Redesign of the net_buf_simple and net_buf structs, where the data
payload portion is split to a separately allocated chunk of memory. In
practice this means that buf->__buf becomes a pointer from having just
been a marker (empty array) for where the payload begins right after
the meta-data.

Fixes #3283

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2018-02-06 19:16:49 +02:00 committed by Johan Hedberg
commit dd09cbc1c4
10 changed files with 357 additions and 146 deletions

View file

@ -25,6 +25,11 @@ BUILD_ASSERT(CONFIG_SYSTEM_WORKQUEUE_PRIORITY < 0);
*/
BUILD_ASSERT(CONFIG_BT_HCI_TX_PRIO < CONFIG_BT_RX_PRIO);
/* The Bluetooth subsystem requires network buffers to have at least 8 bytes
* reserved for user data.
*/
BUILD_ASSERT(CONFIG_NET_BUF_USER_DATA_SIZE >= 8);
#if defined(CONFIG_BT_CTLR)
/* The Bluetooth Controller's priority receive thread priority shall be higher
* than the Bluetooth Host's Tx and the Controller's receive thread priority.