Skip to content

Commit 394a3fa

Browse files
P Praneeshjeff-t-johnson
authored andcommitted
wifi: ath12k: Optimize NAPI budget by adjusting PPDU processing
In the current implementation, when PPDU spans multiple ring descriptors, leading to inefficient use of the NAPI budget. The budget counter is decremented for each ring descriptor, causing rapid depletion of the budget even though the processing of a single PPDU might not be complete. To address this issue, modify the code to decrement the budget counter only when the driver receives HAL_MON_END_OF_PPDU as the end reason. This change ensures that the budget is decremented only once per PPDU, resulting in more efficient utilization of the NAPI budget and better handling of monitor destination ring. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: P Praneesh <quic_ppranees@quicinc.com> Link: https://patch.msgid.link/20241223060132.3506372-11-quic_ppranees@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
1 parent 8520ba9 commit 394a3fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/wireless/ath/ath12k/dp_mon.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,13 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int *budget,
23882388
goto move_next;
23892389
}
23902390

2391+
/* Calculate the budget when the ring descriptor with the
2392+
* HAL_MON_END_OF_PPDU to ensure that one PPDU worth of data is always
2393+
* reaped. This helps to efficiently utilize the NAPI budget.
2394+
*/
2395+
if (end_reason == HAL_MON_END_OF_PPDU)
2396+
*budget -= 1;
2397+
23912398
end_offset = u32_get_bits(info0, HAL_MON_DEST_INFO0_END_OFFSET);
23922399
if (likely(end_offset <= DP_RX_BUFFER_SIZE)) {
23932400
skb_put(skb, end_offset);

0 commit comments

Comments
 (0)