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:

committed by
Rahul Choudhary

parent
adb0ec3b16
commit
a671ff2ee1
@@ -138,7 +138,7 @@ void dp_rx_refill_buff_pool_enqueue(struct dp_soc *soc)
|
|||||||
if (tail > head)
|
if (tail > head)
|
||||||
total_num_refill = (tail - head - 1);
|
total_num_refill = (tail - head - 1);
|
||||||
else
|
else
|
||||||
total_num_refill = (DP_RX_REFILL_BUFF_POOL_SIZE - head +
|
total_num_refill = (buff_pool->max_bufq_len - head +
|
||||||
tail - 1);
|
tail - 1);
|
||||||
|
|
||||||
while (total_num_refill) {
|
while (total_num_refill) {
|
||||||
@@ -171,7 +171,7 @@ void dp_rx_refill_buff_pool_enqueue(struct dp_soc *soc)
|
|||||||
rx_desc_pool->buf_size);
|
rx_desc_pool->buf_size);
|
||||||
|
|
||||||
buff_pool->buf_elem[head++] = nbuf;
|
buff_pool->buf_elem[head++] = nbuf;
|
||||||
head &= (DP_RX_REFILL_BUFF_POOL_SIZE - 1);
|
head &= (buff_pool->max_bufq_len - 1);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ static inline qdf_nbuf_t dp_rx_refill_buff_pool_dequeue_nbuf(struct dp_soc *soc)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
nbuf = buff_pool->buf_elem[tail++];
|
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;
|
buff_pool->tail = tail;
|
||||||
|
|
||||||
return nbuf;
|
return nbuf;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* 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)
|
if (tail > head)
|
||||||
num_refill = (tail - head - 1);
|
num_refill = (tail - head - 1);
|
||||||
else
|
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 &&
|
if (soc->cdp_soc.ol_ops->dp_rx_sched_refill_thread &&
|
||||||
num_refill >= DP_RX_REFILL_THRD_THRESHOLD)
|
num_refill >= DP_RX_REFILL_THRD_THRESHOLD)
|
||||||
|
Reference in New Issue
Block a user