qcacmn: QDF API and SKB debug framework support for alloc_skb

Implementation of QDF API to allocate skb to avoid recycler pool
and extending skb debug framework support.
QDF API: qdf_nbuf_alloc_no_recycler

Change-Id: I32ccae7337000c899e8fba8127aa9fb3c8551783
CRs-Fixed: 2734717
此提交包含在:
Shivani Soni
2020-07-24 18:08:33 +05:30
提交者 snandini
父節點 3faf147264
當前提交 15d8bb5c6b
共有 3 個檔案被更改,包括 121 行新增0 行删除

查看文件

@@ -1520,6 +1520,25 @@ qdf_nbuf_t qdf_nbuf_alloc_debug(qdf_device_t osdev, qdf_size_t size,
int reserve, int align, int prio,
const char *func, uint32_t line);
/**
* qdf_nbuf_alloc_no_recycler() - Allocates skb
* @size: Size to be allocated for skb
* @reserve: Reserved headroom size
* @align: Align
* @func: Function name of the call site
* @line: Line number of the callsite
*
* This API allocates skb of required size and aligns if needed and reserves
* some space in the front. This skb allocation is not from skb recycler pool.
*
* Return: Allocated nbuf pointer
*/
#define qdf_nbuf_alloc_no_recycler(s, r, a) \
qdf_nbuf_alloc_no_recycler_debug(s, r, a, __func__, __LINE__)
qdf_nbuf_t qdf_nbuf_alloc_no_recycler_debug(size_t size, int reserve, int align,
const char *func, uint32_t line);
#define qdf_nbuf_free(d) \
qdf_nbuf_free_debug(d, __func__, __LINE__)
@@ -1616,6 +1635,10 @@ qdf_net_buf_debug_update_unmap_node(qdf_nbuf_t net_buf,
#define qdf_nbuf_alloc(osdev, size, reserve, align, prio) \
qdf_nbuf_alloc_fl(osdev, size, reserve, align, prio, \
__func__, __LINE__)
#define qdf_nbuf_alloc_no_recycler(size, reserve, align) \
qdf_nbuf_alloc_no_recycler_fl(size, reserve, align, __func__, __LINE__)
static inline qdf_nbuf_t
qdf_nbuf_alloc_fl(qdf_device_t osdev, qdf_size_t size, int reserve, int align,
int prio, const char *func, uint32_t line)
@@ -1628,6 +1651,33 @@ qdf_nbuf_alloc_fl(qdf_device_t osdev, qdf_size_t size, int reserve, int align,
return nbuf;
}
/**
* qdf_nbuf_alloc_no_recycler_fl() - Allocate SKB
* @size: Size to be allocated for skb
* @reserve: Reserved headroom size
* @align: Align
* @func: Function name of the call site
* @line: Line number of the callsite
*
* This API allocates skb of required size and aligns if needed and reserves
* some space in the front. This skb allocation is not from skb recycler pool.
*
* Return: Allocated nbuf pointer
*/
static inline qdf_nbuf_t
qdf_nbuf_alloc_no_recycler_fl(size_t size, int reserve, int align,
const char *func, uint32_t line)
{
qdf_nbuf_t nbuf;
nbuf = __qdf_nbuf_alloc_no_recycler(size, reserve, align, func, line);
if (qdf_likely(nbuf))
qdf_mem_skb_inc(nbuf->truesize);
return nbuf;
}
static inline void qdf_nbuf_free(qdf_nbuf_t buf)
{
if (qdf_likely(buf))