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 83B5BA04C7; Wed, 16 Sep 2020 06:31:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD0411C1F7; Wed, 16 Sep 2020 06:29:38 +0200 (CEST) Received: from mail-pl1-f227.google.com (mail-pl1-f227.google.com [209.85.214.227]) by dpdk.org (Postfix) with ESMTP id 55FFF1C1AE for ; Wed, 16 Sep 2020 06:29:16 +0200 (CEST) Received: by mail-pl1-f227.google.com with SMTP id f1so2494980plo.13 for ; Tue, 15 Sep 2020 21:29:16 -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=Kyfyx4wSxuPsFs/MaRie3StpydrP4L2YsWPAChfpQmk=; b=Oe/ViBmJ8igOsv9fWy73PiyU2/jBNt7mjINH/zV5DQNKvySjMv0xQ4rrSchsGYoOb0 PQM++JYJZZYkM1RhQZOZHz0NKpsDy38KI+/4DLBAuMQxMQ4AlKu5vH74wimSfgiqjjxH m99Xg9qX4yTlFVtdRjWtOi5POQtOkWDl+ki+g= 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=Kyfyx4wSxuPsFs/MaRie3StpydrP4L2YsWPAChfpQmk=; b=kf+2c3sN8sX4s3bDYdq7Te3A6tTz/UXouKW7k7YgC2QJ5iPN43d32OcYK5NW5TtjQC keeypCV2PdzZWBc1cZ+Z9Nh3yOhTsdNOyqjwEcl/IjqIKMEktzQ9XfETNWTqgSKrqpAn FVLg4jR484hOtAMWOzAvl0Ze0gX2IMYTZqUhEZrs/aPa+WJMl/ituQecfhjA7sPLxLWm MddIOYmpPee9CX/VZXfUI4P46ZzJNWazXO/B2DgYmp5zAXJFFDdS595CyXdlhLmy/qMa ycjpwpGwF/VAyDewC77aTFLct10+7QWtWS66XR4uBNdpnskL1r5TBcfF/7sGLvSt9P4C PigQ== X-Gm-Message-State: AOAM530qdE/1vjt/4K6IIn29XmduyX2AsFZIGIpw1lBsv/R/6ATV2xUv bjcWDJy5DSPS5A3alYLh6iTDleKptP5DNFwPDzw2QAMWjgEZLeP9GLgf3vCQ4K2Fj22BHCWSBhw 5DNpoNDLeZ5WBBBFGuyQQ5VTkfEofswir5DhgsSfqad/qQWsZ1UjmVOEdptrZtc74fXIvr4p5fi VP5g== X-Google-Smtp-Source: ABdhPJzj3OqoiFFRv3heIyhLIudw9nUYzz4PABuAn6nzIhvUp4GS8xQIhMnPbiutETklVpDdbHBnh7e7hmRI X-Received: by 2002:a17:90a:738d:: with SMTP id j13mr2266293pjg.114.1600230555356; Tue, 15 Sep 2020 21:29:15 -0700 (PDT) Received: from localhost.localdomain ([192.19.223.252]) by smtp-relay.gmail.com with ESMTPS id hk6sm132636pjb.6.2020.09.15.21.29.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2020 21:29:15 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Ajit Khaparde To: dev@dpdk.org Cc: Somnath Kotur , Venkat Duvvuru Date: Tue, 15 Sep 2020 21:28:43 -0700 Message-Id: <20200916042851.32914-18-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200916042851.32914-1-ajit.khaparde@broadcom.com> References: <20200911015603.88359-1-ajit.khaparde@broadcom.com> <20200916042851.32914-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 17/25] net/bnxt: check and set initial counter 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 Reviewed-by: Ajit Khaparde --- 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)