qcacmn: Modify refill buff pool enqueue to use max_bufq_len

Currently Refill buffer pool enqueue is using POOL_SIZE
macro, but there is possibility of dynamically configuring
max pool size less than that. So use max_bufq_len which will
be configured dynamically during refill pool init instead of
POOL_SIZE macro.

Change-Id: I610b5dff71861254aa8b6d30e2c562bd7316e120
CRs-Fixed: 3575599
This commit is contained in:
Karthik Kantamneni
2023-07-28 00:48:51 +05:30
committed by Rahul Choudhary
parent adb0ec3b16
commit a671ff2ee1
2 changed files with 5 additions and 5 deletions

View File

@@ -138,7 +138,7 @@ void dp_rx_refill_buff_pool_enqueue(struct dp_soc *soc)
if (tail > head)
total_num_refill = (tail - head - 1);
else
total_num_refill = (DP_RX_REFILL_BUFF_POOL_SIZE - head +
total_num_refill = (buff_pool->max_bufq_len - head +
tail - 1);
while (total_num_refill) {
@@ -171,7 +171,7 @@ void dp_rx_refill_buff_pool_enqueue(struct dp_soc *soc)
rx_desc_pool->buf_size);
buff_pool->buf_elem[head++] = nbuf;
head &= (DP_RX_REFILL_BUFF_POOL_SIZE - 1);
head &= (buff_pool->max_bufq_len - 1);
count++;
}
@@ -200,7 +200,7 @@ static inline qdf_nbuf_t dp_rx_refill_buff_pool_dequeue_nbuf(struct dp_soc *soc)
return NULL;
nbuf = buff_pool->buf_elem[tail++];
tail &= (DP_RX_REFILL_BUFF_POOL_SIZE - 1);
tail &= (buff_pool->max_bufq_len - 1);
buff_pool->tail = tail;
return nbuf;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -116,7 +116,7 @@ static inline void dp_rx_schedule_refill_thread(struct dp_soc *soc)
if (tail > head)
num_refill = (tail - head - 1);
else
num_refill = (DP_RX_REFILL_BUFF_POOL_SIZE - head + tail - 1);
num_refill = (buff_pool->max_bufq_len - head + tail - 1);
if (soc->cdp_soc.ol_ops->dp_rx_sched_refill_thread &&
num_refill >= DP_RX_REFILL_THRD_THRESHOLD)