net: buf: Add debug for fragments
net_buf_unref actually unrefs the fragments but it only logs information of the parent. Change-Id: I03208f250d030b7927d68c8da442f830f6070dc3 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
e891c290cb
commit
2de6e8da4d
1 changed files with 9 additions and 4 deletions
13
net/buf.c
13
net/buf.c
|
@ -135,13 +135,18 @@ void net_buf_put(struct k_fifo *fifo, struct net_buf *buf)
|
||||||
void net_buf_unref(struct net_buf *buf)
|
void net_buf_unref(struct net_buf *buf)
|
||||||
{
|
{
|
||||||
NET_BUF_ASSERT(buf);
|
NET_BUF_ASSERT(buf);
|
||||||
NET_BUF_ASSERT(buf->ref > 0);
|
|
||||||
NET_BUF_DBG("buf %p ref %u fifo %p frags %p", buf, buf->ref,
|
|
||||||
buf->free, buf->frags);
|
|
||||||
|
|
||||||
while (buf && --buf->ref == 0) {
|
while (buf) {
|
||||||
struct net_buf *frags = buf->frags;
|
struct net_buf *frags = buf->frags;
|
||||||
|
|
||||||
|
NET_BUF_ASSERT(buf->ref > 0);
|
||||||
|
NET_BUF_DBG("buf %p ref %u fifo %p frags %p", buf, buf->ref,
|
||||||
|
buf->free, buf->frags);
|
||||||
|
|
||||||
|
if (--buf->ref > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
buf->frags = NULL;
|
buf->frags = NULL;
|
||||||
|
|
||||||
if (buf->destroy) {
|
if (buf->destroy) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue