qcacmn: Cleanup the tx desc cleanup logic

Cleanup the tx desc clean up logic used in
direct switch and umac reset cases.
The excess code being removed tries to
get the next descriptor address in boundary
conditions is not useful, as the descriptor
extracted this way will be overwritten
immediately in the beginning of next iteration
of the loop.

Change-Id: Ibcd873719929b94147152ff48205774d3ed4f452
CRs-Fixed: 3371831
This commit is contained in:
Pavankumar Nandeshwar
2023-01-03 10:03:19 -08:00
committed by Madan Koyyalamudi
parent 0f5242e08a
commit fd6fed3e07
3 changed files with 10 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2016-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
@@ -58,6 +58,7 @@ static void
dp_tx_desc_pool_counter_initialize(struct dp_tx_desc_pool_s *tx_desc_pool, dp_tx_desc_pool_counter_initialize(struct dp_tx_desc_pool_s *tx_desc_pool,
uint16_t num_elem) uint16_t num_elem)
{ {
tx_desc_pool->elem_count = num_elem;
tx_desc_pool->num_free = num_elem; tx_desc_pool->num_free = num_elem;
tx_desc_pool->num_allocated = 0; tx_desc_pool->num_allocated = 0;
} }

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2021-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
@@ -1112,7 +1112,7 @@ qdf_shared_mem_t *qdf_mem_shared_mem_alloc(qdf_device_t osdev, uint32_t size);
* @ctxt: Context to be passed to the cb * @ctxt: Context to be passed to the cb
* @pages: Multi page information storage * @pages: Multi page information storage
* @elem_size: Each element size * @elem_size: Each element size
* @elem_count: Total number of elements should be allocated * @elem_count: Total number of elements in the pool.
* @cacheable: Coherent memory or cacheable memory * @cacheable: Coherent memory or cacheable memory
* @cb: Callback to free the elements * @cb: Callback to free the elements
* @elem_list: elem list for delayed free * @elem_list: elem list for delayed free

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2021-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
@@ -2330,7 +2330,7 @@ qdf_export_symbol(qdf_aligned_malloc_fl);
* @ctxt: Context to be passed to the cb * @ctxt: Context to be passed to the cb
* @pages: Multi page information storage * @pages: Multi page information storage
* @elem_size: Each element size * @elem_size: Each element size
* @elem_count: Total number of elements should be allocated * @elem_count: Total number of elements in the pool.
* @cacheable: Coherent memory or cacheable memory * @cacheable: Coherent memory or cacheable memory
* @cb: Callback to free the elements * @cb: Callback to free the elements
* @elem_list: elem list for delayed free * @elem_list: elem list for delayed free
@@ -2345,7 +2345,7 @@ int qdf_tx_desc_pool_free_bufs(void *ctxt, struct qdf_mem_multi_page_t *pages,
uint16_t i, i_int; uint16_t i, i_int;
void *page_info; void *page_info;
void *elem; void *elem;
uint32_t num_link = 0; uint32_t num_elem = 0;
for (i = 0; i < pages->num_pages; i++) { for (i = 0; i < pages->num_pages; i++) {
if (cacheable) if (cacheable)
@@ -2358,29 +2358,12 @@ int qdf_tx_desc_pool_free_bufs(void *ctxt, struct qdf_mem_multi_page_t *pages,
elem = page_info; elem = page_info;
for (i_int = 0; i_int < pages->num_element_per_page; i_int++) { for (i_int = 0; i_int < pages->num_element_per_page; i_int++) {
if (i_int == (pages->num_element_per_page - 1)) {
cb(ctxt, elem, elem_list);
if ((i + 1) == pages->num_pages)
break;
if (cacheable)
elem =
(void *)(pages->cacheable_pages[i + 1]);
else
elem = (void *)(pages->
dma_pages[i + 1].page_v_addr_start);
num_link++;
break;
}
cb(ctxt, elem, elem_list); cb(ctxt, elem, elem_list);
elem = ((char *)elem + elem_size); elem = ((char *)elem + elem_size);
num_link++; num_elem++;
/* Last link established exit */ /* Number of desc pool elements reached */
if (num_link == (elem_count - 1)) if (num_elem == (elem_count - 1))
break; break;
} }
} }