From a671ff2ee1a14a7b331c23f4deb4ca0784c84752 Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Fri, 28 Jul 2023 00:48:51 +0530 Subject: [PATCH] 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 --- dp/wifi3.0/dp_rx_buffer_pool.c | 6 +++--- dp/wifi3.0/dp_rx_buffer_pool.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dp/wifi3.0/dp_rx_buffer_pool.c b/dp/wifi3.0/dp_rx_buffer_pool.c index 481ef24770..0610e5bb09 100644 --- a/dp/wifi3.0/dp_rx_buffer_pool.c +++ b/dp/wifi3.0/dp_rx_buffer_pool.c @@ -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; diff --git a/dp/wifi3.0/dp_rx_buffer_pool.h b/dp/wifi3.0/dp_rx_buffer_pool.h index 8a1f995437..4cfa58f150 100644 --- a/dp/wifi3.0/dp_rx_buffer_pool.h +++ b/dp/wifi3.0/dp_rx_buffer_pool.h @@ -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)