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 289EDA04B5; Fri, 11 Sep 2020 03:59:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6228F1C1B1; Fri, 11 Sep 2020 03:57:25 +0200 (CEST) Received: from mail-pj1-f99.google.com (mail-pj1-f99.google.com [209.85.216.99]) by dpdk.org (Postfix) with ESMTP id 50A171C1AF for ; Fri, 11 Sep 2020 03:57:24 +0200 (CEST) Received: by mail-pj1-f99.google.com with SMTP id n3so1943975pjq.1 for ; Thu, 10 Sep 2020 18:57:24 -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=fyc0ZBRqySLH1RrbZrwcMJSqFospvMhgcUQpZjfyxf4=; b=JbtiBnxhlgW/tzwrYdX7c5VNeMUgbpl1adpQvm7yQKc3R/WrCjYOKgHlJX/0f3zTBL 9H1E4HoGapKMVkBLw5v2xJ9M/n68fN/JoNEls8md7IAOdOvSQk2ABoenfPjsewp8ZczA bXiNyBnNOM9mXh6B4V2+Ep94Y81dXdHWO6DlI= 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=fyc0ZBRqySLH1RrbZrwcMJSqFospvMhgcUQpZjfyxf4=; b=hTbHvNk28bfdcbVuhyIRJ8X7CIP6Q+tJCBhucF5wVa/uN3i7T51NeV7xwqVG49UzBp v3HbER35UpQTZ8RBueO+O6+At9CkTiYT6poGQWQXdfp8EUZ6vdwutuR1Ts8QUECkg5bQ O/bQs4GBGii5bKbeLqpxVZzvjF8qDBhPtWL0eIDTBmO3aVxVHo6sLLwJPNCctcLhUmfn twhvu94CZBbaBb3ytE50s2GAH/+FRuJY9p3f/yzDPdkraeJIndU2Nu25gYH2GNjlQyuC s80oyjvEduXqo1wPoE2UDULlf60tHnIsiUuHEvgEFWygF0OaHsLvuZqtYCctjuj9Pt+X o3Bw== X-Gm-Message-State: AOAM53352IcgoYTepfxYpHRLLVBP+E4B8rLuA+7rdHgSqELry7eOO/qF 2Vw9vP9z5y0GpmrLsTmBvQhZEcu02jUObTfoNpVlkbgy39NqOg56GDRqEVXEPAEiN8zkH3r1xmP SQ9gHO/OK0yOObbezD+BcTqdG2lEv0IzLuEkfC1Lhp6oFxeyHmPWQfEAIfEfZTPsQkDUcMvVLH0 tW/w== X-Google-Smtp-Source: ABdhPJwiStEzyE8gKbD427YifIfHrZ44hTwynvu65RwNQT4FzZS765GNcOmlBMAIkS7fSXnfUI56djPD8FMb X-Received: by 2002:a17:90a:6343:: with SMTP id v3mr33932pjs.163.1599789443333; Thu, 10 Sep 2020 18:57:23 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id cl6sm80986pjb.15.2020.09.10.18.57.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2020 18:57:23 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: Somnath Kotur , Venkat Duvvuru Date: Thu, 10 Sep 2020 18:55:55 -0700 Message-Id: <20200911015603.88359-18-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200911015603.88359-1-ajit.khaparde@broadcom.com> References: <20200911015603.88359-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 17/25] net/bnxt: fix to explicitly check and set for start cntr ID 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: Somnath Kotur Instead of relying on value of Flow counter ID to determine validity have an explicit boolean flag for the same to check and set. Fixes: 306c2d28e247 ("net/bnxt: support count action in flow query") Fixes: 9cf9c8385df7 ("net/bnxt: add ULP flow counter manager") Signed-off-by: Somnath Kotur Reviewed-by: Venkat Duvvuru --- drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 8 ++++---- drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c index df1921d54..5a0bf602a 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c @@ -431,8 +431,7 @@ bool ulp_fc_mgr_start_idx_isset(struct bnxt_ulp_context *ctxt, enum tf_dir dir) ulp_fc_info = bnxt_ulp_cntxt_ptr2_fc_info_get(ctxt); - /* Assuming start_idx of 0 is invalid */ - return (ulp_fc_info->shadow_hw_tbl[dir].start_idx != 0); + return ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set; } /* @@ -456,9 +455,10 @@ int32_t ulp_fc_mgr_start_idx_set(struct bnxt_ulp_context *ctxt, enum tf_dir dir, if (!ulp_fc_info) return -EIO; - /* Assuming that 0 is an invalid counter ID ? */ - if (ulp_fc_info->shadow_hw_tbl[dir].start_idx == 0) + if (!ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set) { ulp_fc_info->shadow_hw_tbl[dir].start_idx = start_idx; + ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set = true; + } return 0; } diff --git a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h index 9c317b023..0cb880d4b 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h +++ b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h @@ -38,6 +38,7 @@ struct hw_fc_mem_info { */ void *mem_pa; uint32_t start_idx; + bool start_idx_is_set; }; struct bnxt_ulp_fc_info { -- 2.21.1 (Apple Git-122.3)