From patchwork Tue Nov 16 13:04:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkat Duvvuru X-Patchwork-Id: 104401 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CF3DA0032; Tue, 16 Nov 2021 14:04:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E0654115E; Tue, 16 Nov 2021 14:04:47 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 5F28B4115B for ; Tue, 16 Nov 2021 14:04:46 +0100 (CET) Received: from S60.dhcp.broadcom.net (unknown [10.123.66.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by relay.smtp-ext.broadcom.com (Postfix) with ESMTPS id AC6E180D8; Tue, 16 Nov 2021 05:04:43 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com AC6E180D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1637067884; bh=Yx4A0Az8coG6c9gjFWhXX85679oh9Tj7KP/1kPM8jNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CdGlEE1rK0+6lxify9sb31DKib17ayKz/sOm1QK9XdbIKkh2z+GoHUgLnpGAVWGPW DxygFKtc1x8SGSmfbW4ZiGdcB+xqq7HMcj1Gn4XcFNZR2uQu/ZEBPORXMC31ye4NJ0 j6u8BfCfAGWMnC/RRlMcn8c3j2Dipp6GE20yf33w= From: Venkat Duvvuru To: dev@dpdk.org Cc: Kishore Padmanabha , Venkat Duvvuru Subject: [PATCH 2/4] net/bnxt: fix sram resource free block list Date: Tue, 16 Nov 2021 18:34:35 +0530 Message-Id: <20211116130437.2022-3-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211116130437.2022-1-venkatkumar.duvvuru@broadcom.com> References: <20211116130437.2022-1-venkatkumar.duvvuru@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Kishore Padmanabha 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 Signed-off-by: Venkat Duvvuru Reviewed-by: Michael Baucom Reviewed-by: Randy Schacher --- 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; }