[PATCH 2/4] net/bnxt: fix sram resource free block list
Venkat Duvvuru
venkatkumar.duvvuru at broadcom.com
Tue Nov 16 14:04:35 CET 2021
From: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
The sram resource free did not reset the next block to be used
when the block is not empty. This caused the flows not be created
when max flows limit is reached and you delete one flow and try to
add a new flow. The fix calls the update of the next free block
even when block is not empty.
Fixes: 37ff91c158a3 ("net/bnxt: add SRAM manager model")
Signed-off-by: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru at broadcom.com>
Reviewed-by: Michael Baucom <michael.baucom at broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher at broadcom.com>
---
drivers/net/bnxt/tf_core/tf_sram_mgr.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bnxt/tf_core/tf_sram_mgr.c b/drivers/net/bnxt/tf_core/tf_sram_mgr.c
index a248ef2ce8..acb3372486 100644
--- a/drivers/net/bnxt/tf_core/tf_sram_mgr.c
+++ b/drivers/net/bnxt/tf_core/tf_sram_mgr.c
@@ -794,17 +794,19 @@ tf_sram_mgr_free(void *sram_handle,
TFP_DRV_LOG(ERR, "Free block_id(%d) failed error(%s)\n",
block_id, strerror(-rc));
}
- /* Free local entry regardless
- */
+ /* Free local entry regardless */
tf_sram_free_block(slice_list, block);
- /* Find the next non-full block in the list
- */
- tf_sram_find_first_not_full_block(slice_list,
- parms->slice_size,
- &slice_list->first_not_full_block);
+ /* Clear the not full block to set it again */
+ slice_list->first_not_full_block = NULL;
}
+ if (slice_list->first_not_full_block)
+ return rc;
+ /* set the non full block so it can be used in next alloc */
+ tf_sram_find_first_not_full_block(slice_list,
+ parms->slice_size,
+ &slice_list->first_not_full_block);
return rc;
}
--
2.17.1
More information about the dev
mailing list