DPDK patches and discussions
 help / color / mirror / Atom feed
From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
To: dev@dpdk.org
Cc: Kishore Padmanabha <kishore.padmanabha@broadcom.com>,
	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Subject: [PATCH 2/4] net/bnxt: fix sram resource free block list
Date: Tue, 16 Nov 2021 18:34:35 +0530	[thread overview]
Message-ID: <20211116130437.2022-3-venkatkumar.duvvuru@broadcom.com> (raw)
In-Reply-To: <20211116130437.2022-1-venkatkumar.duvvuru@broadcom.com>

From: Kishore Padmanabha <kishore.padmanabha@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@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Michael Baucom <michael.baucom@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@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


  parent reply	other threads:[~2021-11-16 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 13:04 [PATCH 0/4] fixes to TruFlow Venkat Duvvuru
2021-11-16 13:04 ` [PATCH 1/4] net/bnxt: remove settings to support multiple session Venkat Duvvuru
2021-11-16 13:04 ` Venkat Duvvuru [this message]
2021-11-16 13:04 ` [PATCH 3/4] net/bnxt: fix multi adapter support Venkat Duvvuru
2021-11-16 13:04 ` [PATCH 4/4] net/bnxt: fix ULP context list deadlock Venkat Duvvuru
2021-11-17  4:01 ` [PATCH 0/4] fixes to TruFlow Ajit Khaparde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211116130437.2022-3-venkatkumar.duvvuru@broadcom.com \
    --to=venkatkumar.duvvuru@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kishore.padmanabha@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).