qcacmn: SKB buf memory Leak@ Func dp_pdev_nbuf_alloc_and_map

Fix the skb leak in dp_rx_process where rx descriptor cookie
validity fails. This skb should be cleaned up as part of the
rx desc and nbuf free function called during the driver unload.
However this will ensure that the skb released and added rx desc
added to the free list during dp_rx_process itself.

Add skb map, unmap functions, line numbers and if the nbuf is
mapped or unmapped to the nbuf tracking table. This debug info
will be logged once the skb is leaked.

Change-Id: I52dbf38922be20fc0aaea380e0e572af16de773e
CRs-Fixed: 2662992
This commit is contained in:
Nisha Menon
2020-04-21 20:29:40 -07:00
committed by nshrivas
parent 70eb719dfe
commit 12cc7c6558
3 changed files with 133 additions and 1 deletions

View File

@@ -1468,6 +1468,32 @@ void qdf_net_buf_debug_update_node(qdf_nbuf_t net_buf, const char *func_name,
uint32_t line_num);
void qdf_net_buf_debug_delete_node(qdf_nbuf_t net_buf);
/**
* qdf_net_buf_debug_update_map_node() - update nbuf in debug
* hash table with the mapping function info
* @nbuf: network buffer
* @func: function name that requests for mapping the nbuf
* @line_num: function line number
*
* Return: none
*/
void qdf_net_buf_debug_update_map_node(qdf_nbuf_t net_buf,
const char *func_name,
uint32_t line_num);
/**
* qdf_net_buf_debug_update_unmap_node() - update nbuf in debug
* hash table with the unmap function info
* @nbuf: network buffer
* @func: function name that requests for unmapping the nbuf
* @line_num: function line number
*
* Return: none
*/
void qdf_net_buf_debug_update_unmap_node(qdf_nbuf_t net_buf,
const char *func_name,
uint32_t line_num);
/**
* qdf_net_buf_debug_acquire_skb() - acquire skb to avoid memory leak
* @net_buf: Network buf holding head segment (single)
@@ -1572,6 +1598,19 @@ qdf_net_buf_debug_update_node(qdf_nbuf_t net_buf, const char *func_name,
{
}
static inline void
qdf_net_buf_debug_update_map_node(qdf_nbuf_t net_buf,
const char *func_name,
uint32_t line_num)
{
}
static inline void
qdf_net_buf_debug_update_unmap_node(qdf_nbuf_t net_buf,
const char *func_name,
uint32_t line_num)
{
}
/* Nbuf allocation rouines */
#define qdf_nbuf_alloc(osdev, size, reserve, align, prio) \