qcacmn: Update debug info in wbuff_buff_get()
The debug node for all the nbufs allocated by wbuff for a module contains the file and line info pertaining to wbuff_module_register(). To enhance debugging, Use qdf_net_buf_debug_update_node() to update debug info when nbuf is requested through wbuff_buff_get(). Change-Id: Ie8b148ef6313bd3b265cfa3f141e8d0de8b75597 CRs-Fixed: 2328257
This commit is contained in:

committed by
nshrivas

parent
27d564647e
commit
5c881ec3ec
@@ -95,11 +95,14 @@ QDF_STATUS wbuff_module_deregister(struct wbuff_mod_handle *hdl);
|
|||||||
* wbuff_buff_get() - return buffer to the requester
|
* wbuff_buff_get() - return buffer to the requester
|
||||||
* @handle: wbuff_handle corresponding to the module
|
* @handle: wbuff_handle corresponding to the module
|
||||||
* @len: length of buffer requested
|
* @len: length of buffer requested
|
||||||
|
* file_name: file from which buffer is requested
|
||||||
|
* line_num: line number in the file
|
||||||
*
|
*
|
||||||
* Return: Network buffer if success
|
* Return: Network buffer if success
|
||||||
* NULL if failure
|
* NULL if failure
|
||||||
*/
|
*/
|
||||||
qdf_nbuf_t wbuff_buff_get(struct wbuff_mod_handle *hdl, uint32_t len);
|
qdf_nbuf_t wbuff_buff_get(struct wbuff_mod_handle *hdl, uint32_t len,
|
||||||
|
uint8_t *file_name, uint32_t line_num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wbuff_buff_put() - put the buffer back to wbuff pool
|
* wbuff_buff_put() - put the buffer back to wbuff pool
|
||||||
@@ -136,7 +139,8 @@ static inline QDF_STATUS wbuff_module_deregister(struct wbuff_mod_handle *hdl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline qdf_nbuf_t
|
static inline qdf_nbuf_t
|
||||||
wbuff_buff_get(struct wbuff_mod_handle *hdl, uint32_t len)
|
wbuff_buff_get(struct wbuff_mod_handle *hdl, uint32_t len, int8_t *file_name,
|
||||||
|
uint32_t line_num)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -296,7 +296,8 @@ QDF_STATUS wbuff_module_deregister(struct wbuff_mod_handle *hdl)
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_nbuf_t wbuff_buff_get(struct wbuff_mod_handle *hdl, uint32_t len)
|
qdf_nbuf_t wbuff_buff_get(struct wbuff_mod_handle *hdl, uint32_t len,
|
||||||
|
uint8_t *file_name, uint32_t line_num)
|
||||||
{
|
{
|
||||||
struct wbuff_handle *handle;
|
struct wbuff_handle *handle;
|
||||||
struct wbuff_module *mod = NULL;
|
struct wbuff_module *mod = NULL;
|
||||||
@@ -321,8 +322,10 @@ qdf_nbuf_t wbuff_buff_get(struct wbuff_mod_handle *hdl, uint32_t len)
|
|||||||
mod->pending_returns++;
|
mod->pending_returns++;
|
||||||
}
|
}
|
||||||
qdf_spin_unlock_bh(&mod->lock);
|
qdf_spin_unlock_bh(&mod->lock);
|
||||||
if (buf)
|
if (buf) {
|
||||||
qdf_nbuf_set_next(buf, NULL);
|
qdf_nbuf_set_next(buf, NULL);
|
||||||
|
qdf_net_buf_debug_update_node(buf, file_name, line_num);
|
||||||
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@@ -1525,7 +1525,8 @@ wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint32_t len, uint8_t *file_name,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wmi_buf = wbuff_buff_get(wmi_handle->wbuff_handle, len);
|
wmi_buf = wbuff_buff_get(wmi_handle->wbuff_handle, len, file_name,
|
||||||
|
line_num);
|
||||||
if (!wmi_buf)
|
if (!wmi_buf)
|
||||||
wmi_buf = qdf_nbuf_alloc_debug(NULL,
|
wmi_buf = qdf_nbuf_alloc_debug(NULL,
|
||||||
roundup(len + WMI_MIN_HEAD_ROOM,
|
roundup(len + WMI_MIN_HEAD_ROOM,
|
||||||
@@ -1567,7 +1568,8 @@ wmi_buf_t wmi_buf_alloc_fl(wmi_unified_t wmi_handle, uint32_t len,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wmi_buf = wbuff_buff_get(wmi_handle->wbuff_handle, len);
|
wmi_buf = wbuff_buff_get(wmi_handle->wbuff_handle, len, __FILE__,
|
||||||
|
__LINE__);
|
||||||
if (!wmi_buf)
|
if (!wmi_buf)
|
||||||
wmi_buf = qdf_nbuf_alloc_fl(NULL, roundup(len +
|
wmi_buf = qdf_nbuf_alloc_fl(NULL, roundup(len +
|
||||||
WMI_MIN_HEAD_ROOM, 4), WMI_MIN_HEAD_ROOM, 4,
|
WMI_MIN_HEAD_ROOM, 4), WMI_MIN_HEAD_ROOM, 4,
|
||||||
|
Reference in New Issue
Block a user