qcacmn: Use qdf_nbuf_page_frag_alloc() for WBUFF SKBs
Since SKBs allocated from the WBUFF module are reusable SKBs, allocate them using qdf_nbuf_page_frag_alloc() to have memory savings and also to avoid memory fragmentation issues. Change-Id: Icecf4f6de0842a8c767217281984c4ef25e9b9be CRs-Fixed: 3559261
This commit is contained in:

committed by
Rahul Choudhary

parent
d621993b84
commit
621c2d72b8
@@ -81,9 +81,11 @@ struct wbuff_module {
|
|||||||
* struct wbuff_holder - allocation holder for wbuff
|
* struct wbuff_holder - allocation holder for wbuff
|
||||||
* @initialized: to identified whether module is initialized
|
* @initialized: to identified whether module is initialized
|
||||||
* @mod: list of modules
|
* @mod: list of modules
|
||||||
|
* @pf_cache: Reference to page frag cache, used for nbuf allocations
|
||||||
*/
|
*/
|
||||||
struct wbuff_holder {
|
struct wbuff_holder {
|
||||||
bool initialized;
|
bool initialized;
|
||||||
struct wbuff_module mod[WBUFF_MAX_MODULES];
|
struct wbuff_module mod[WBUFF_MAX_MODULES];
|
||||||
|
qdf_frag_cache_t pf_cache;
|
||||||
};
|
};
|
||||||
#endif /* _WBUFF_H */
|
#endif /* _WBUFF_H */
|
||||||
|
@@ -97,7 +97,8 @@ static qdf_nbuf_t wbuff_prepare_nbuf(uint8_t module_id, uint8_t pool_id,
|
|||||||
qdf_nbuf_t buf;
|
qdf_nbuf_t buf;
|
||||||
unsigned long dev_scratch = 0;
|
unsigned long dev_scratch = 0;
|
||||||
|
|
||||||
buf = qdf_nbuf_alloc(NULL, len, reserve, align, false);
|
buf = qdf_nbuf_page_frag_alloc(NULL, len, reserve, align,
|
||||||
|
&wbuff.pf_cache);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return NULL;
|
return NULL;
|
||||||
dev_scratch = module_id;
|
dev_scratch = module_id;
|
||||||
|
Reference in New Issue
Block a user