From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 303C5A0521; Thu, 23 Jul 2020 14:05:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C288F1C120; Thu, 23 Jul 2020 14:02:42 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id BE2B71BFEE for ; Thu, 23 Jul 2020 14:02:06 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 5623D29AE60; Thu, 23 Jul 2020 05:02:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 5623D29AE60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1595505726; bh=Y3ykrQBOFatdhQ7roXMrV/Oa+QJxVxHri9dcAzbTKec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oKuuHF/u35GqWGcZGod+sNnkpK4pdHeV5ZnM2Tt8Q50csoHkSlUog8yrHqTJhureV LnMKMjkJeAxO7okZjRmGIIj6LlqU8z9yVVpdeE6rOsaDNdLJ5PjSqxW80ks+4sUgZr 9cu+d8o98vObJrl5NV/TdJIJRPc0ZPaH3iDuqARE= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 23 Jul 2020 17:26:35 +0530 Message-Id: <20200723115639.22357-17-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200723115639.22357-1-somnath.kotur@broadcom.com> References: <20200723111329.21855-1-somnath.kotur@broadcom.com> <20200723115639.22357-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH v2 16/20] net/bnxt: shadow tcam and tbl reference count modification X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Mike Baucom Moved setting the refcnt for shadow tcam and table entries to the allocation path only. The insert can be called multiple times for updates and was resetting the refcnt to 1 each time. Now multiple insertion/modifications will not change the reference count. Signed-off-by: Mike Baucom Reviewed-by: Kishore Padmanabha --- drivers/net/bnxt/tf_core/tf_shadow_tbl.c | 2 -- drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/bnxt/tf_core/tf_shadow_tbl.c b/drivers/net/bnxt/tf_core/tf_shadow_tbl.c index 019a26e..a4207eb 100644 --- a/drivers/net/bnxt/tf_core/tf_shadow_tbl.c +++ b/drivers/net/bnxt/tf_core/tf_shadow_tbl.c @@ -687,8 +687,6 @@ tf_shadow_tbl_insert(struct tf_shadow_tbl_insert_parms *parms) if (!TF_SHADOW_HB_HANDLE_IS_VALID(sr_entry->hb_handle)) return 0; - sr_entry->refcnt = 1; - return 0; } diff --git a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c b/drivers/net/bnxt/tf_core/tf_shadow_tcam.c index a0130d6..e2c347a 100644 --- a/drivers/net/bnxt/tf_core/tf_shadow_tcam.c +++ b/drivers/net/bnxt/tf_core/tf_shadow_tcam.c @@ -472,6 +472,7 @@ tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms) /* Write the result table */ sr_entry->key_size = parms->key_size; sr_entry->hb_handle = parms->hb_handle; + sr_entry->refcnt = 1; return 0; } @@ -738,7 +739,6 @@ tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms) memcpy(sr_entry->result, sparms->result, sparms->result_size); sr_entry->result_size = sparms->result_size; - sr_entry->refcnt = 1; return 0; } -- 2.7.4