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 6E04DA0518; Fri, 24 Jul 2020 07:36:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7FD2C1C1A3; Fri, 24 Jul 2020 07:33:53 +0200 (CEST) Received: from mail-ua1-f99.google.com (mail-ua1-f99.google.com [209.85.222.99]) by dpdk.org (Postfix) with ESMTP id A051A1C10E for ; Fri, 24 Jul 2020 07:33:46 +0200 (CEST) Received: by mail-ua1-f99.google.com with SMTP id g4so2571592uaq.10 for ; Thu, 23 Jul 2020 22:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pWyU3XAas9H7gxMlBnHnIRXmuzl0L9TCx05uiYMQAEQ=; b=c6tylwwdeO0JhHjZVOe5HaU3oPmZQ9mWSuaS6zXSjYrKwNIZ2f5da4KqF5v4XftbHb q0iFvdXFoR9DQyHCZOq7/q/HyWbX7E+X8Y/2R4aUSgonVvxRIhV1B5pxtRyuaHtM+IT+ frsV7QAIUA4MZ5swckTLHoL+EoStDIyWtVAsU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pWyU3XAas9H7gxMlBnHnIRXmuzl0L9TCx05uiYMQAEQ=; b=CGLtSS9HQeAROE66Et7Y43ba/u+99ytAGSlaNQZYe7eKdLF3K36Mg1qRUHIdISIa7V VgCNKTYCm4xLNL7sfIQOJdmTFfVPlIIBQvhdm5CKrn2RjK2CHSYfwnsVnlE5pLTR3fnd K/cJJX8PyTtJFRYCbYL3MnI+JehhJ41/lIVOq9SU059Xd13f2waUa4MJbpQ5RrHRSt+m lvmbYRe5YgNDnD0VncUHMfDo2xJFh0YHFMuYTY4gpR9w+3jjhNbUP7oP4xln/+bdJrAs YL66iBngnjMp4JP/idDvHxAEypgDoKVAoJUGOCwyuMPI528yDPa8ZZJ6KOFoDOk3wbXE dpPg== X-Gm-Message-State: AOAM530UnMOjhUipQwkQG/x0OvHgaxIKleSZ0FwtsOxdOU0uCPGjM9Rh 0+CD/VPp1qeYIPn8SfDsEsswRvt0issBtqQXP8+0W30cEwPbU9yXhsMoZg5aPbFH1QVmITvcVQl LsyeeUlWkpdqoBNC2kOKBGTugtCuYgcGruoYa6VoMAAGQYBmkuSLTWUxVvSpZNE01GauwMpjZx1 F5Gw== X-Google-Smtp-Source: ABdhPJx7SUfHlMgtfjnM3kTaYGf6QTRvfigHkfMYK3hfnY3BZL6vnJf9QUgiWN/4gjo3fWJpN/YCda9oSvOo X-Received: by 2002:ab0:498e:: with SMTP id e14mr6913856uad.38.1595568825967; Thu, 23 Jul 2020 22:33:45 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id h17sm592840vsk.0.2020.07.23.22.33.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2020 22:33:45 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Mike Baucom , Kishore Padmanabha Date: Thu, 23 Jul 2020 22:32:29 -0700 Message-Id: <20200724053235.71069-17-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200724053235.71069-1-ajit.khaparde@broadcom.com> References: <20200723115639.22357-1-somnath.kotur@broadcom.com> <20200724053235.71069-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 16/22] net/bnxt: modify shadow tcam and tbl reference count logic 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 019a26eba..a4207eb3a 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 a0130d6a8..e2c347a1e 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.21.1 (Apple Git-122.3)