qcacmn: Fallback to 4k slab allocation on page_frag alloc fail

In low memory conditions 32K page frag allocations via
qdf_nbuf_frag_alloc will fail, fallback and try 4k slab allocations.

Change-Id: I3c9b08af8b1cc3aa881a91338a88b736589fb4dd
CRs-Fixed: 3571487
This commit is contained in:
Prakash Manjunathappa
2023-07-27 23:19:45 -07:00
committed by Rahul Choudhary
parent 41a1814948
commit a57c1c99b5
2 changed files with 7 additions and 0 deletions

View File

@@ -360,6 +360,9 @@ __qdf_nbuf_t __qdf_nbuf_alloc_ppe_ds(__qdf_device_t osdev, size_t size,
* unaligned will result in an unaligned address. * unaligned will result in an unaligned address.
* It will call into kernel page fragment APIs, long time keeping for scattered * It will call into kernel page fragment APIs, long time keeping for scattered
* allocations should be considered for avoidance. * allocations should be considered for avoidance.
* This also brings in more probability of page frag allocation failures during
* low memory situation. In case of page frag allocation failure, fallback to
* non-frag slab allocations.
* *
* Return: nbuf or %NULL if no memory * Return: nbuf or %NULL if no memory
*/ */

View File

@@ -647,7 +647,11 @@ struct sk_buff *__qdf_nbuf_frag_alloc(qdf_device_t osdev, size_t size,
} }
skb = __netdev_alloc_skb(NULL, size, flags); skb = __netdev_alloc_skb(NULL, size, flags);
if (skb)
goto skb_alloc;
/* 32k page frag alloc failed, try page slab allocation */
skb = alloc_skb(size, flags);
if (skb) if (skb)
goto skb_alloc; goto skb_alloc;