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 63F1DA0563; Wed, 15 Apr 2020 16:50:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5295D1D8F3; Wed, 15 Apr 2020 16:50:29 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 7B69E1D8EF for ; Wed, 15 Apr 2020 16:50:28 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id r4so18133pgg.4 for ; Wed, 15 Apr 2020 07:50:28 -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; bh=jEyu32gnsCi5VQA9/DP6d0jWwaprV8CnYNDTyZbF+ic=; b=B0g4QcXailVvifdoZTF7JhojysoSpIFF9OnMJ1h7wG0nE6MlpEq9t4SfaG4cq2KoIE jd5QFFIZA6d2g7REJ29aeJhqE1qQNK8F/x7FsWYiIDTxVcqnLw9DpxxclwD6vzU4XvZy JXHIIW0pzSDi3aMGJ91+ddc+dR6fX/7YFD0uM= 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; bh=jEyu32gnsCi5VQA9/DP6d0jWwaprV8CnYNDTyZbF+ic=; b=PZHhzvDm2puGhDqiaRB910AkKQJ0FI57BCC7pXtyLmIVC8TGr1rAKL+cJucu2El8Zl HpYwzaFyZDqxzIL/02r1uECPbEjt0yIfULIZO/0DHjB3TnbeznnGU0/5P/FIzJoVuBEp +cGv6k8U7BpMEaTwCboNowsmps128/F5QlY77fdd15usmKU1vacV6lSRCHMuJMPNTIJr wKeOb2iXsZisIlxa+9E+viXG4dzdodVHlSlnZR3vRM53RDFbihclDGOyXBh7o/QIkXJ/ T21/Si1UKCcO7Yy3SOTvytvKkeWECdKQd9V34Lcp1xA7a5q7ckN5MQkYZ4IS0ggkHCk/ daww== X-Gm-Message-State: AGi0PuYyk+jwUdbp4OI1TWLv1O2V9DDSeTzIdXE1Dfhor4Ep02dsU9Mr LCWc8jkXKR+flbHivS+t16pFnbV915s2rPONdogfqfnqRcPCaswdGo+lxqwUVqXnOLm4woK9Jyb QkEzCPpN8j77hGi0rUsRZ8mOnCl8mUaQUMDkR5Q2FV0czuodA8YfBD8XMJWVZ78i+HbFg X-Google-Smtp-Source: APiQypLtHyGD7+R9s3ZpmCxhCoaNqxcbthYjep4zHlYMN4vMt3infLpjqOJcSSmMHpM1jlzJUoNKEA== X-Received: by 2002:a63:6a84:: with SMTP id f126mr24648324pgc.14.1586962227142; Wed, 15 Apr 2020 07:50:27 -0700 (PDT) Received: from S60.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 11sm13767969pfz.91.2020.04.15.07.50.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2020 07:50:26 -0700 (PDT) From: Venkat Duvvuru To: dev@dpdk.org Cc: Mike Baucom , Venkat Duvvuru Date: Wed, 15 Apr 2020 20:19:07 +0530 Message-Id: <1586962156-11179-3-git-send-email-venkatkumar.duvvuru@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586962156-11179-1-git-send-email-venkatkumar.duvvuru@broadcom.com> References: <1586962156-11179-1-git-send-email-venkatkumar.duvvuru@broadcom.com> Subject: [dpdk-dev] [PATCH 02/11] net/bnxt: allow usage of more resources in flow db 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 Allow the flow db resources to be more effectively utilized. Reviewed-by: Kishore Padmanabha Signed-off-by: Mike Baucom Signed-off-by: Venkat Duvvuru --- drivers/net/bnxt/tf_ulp/ulp_flow_db.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c index aed5078..e99e94a 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_flow_db.c +++ b/drivers/net/bnxt/tf_ulp/ulp_flow_db.c @@ -331,6 +331,10 @@ int32_t ulp_flow_db_fid_alloc(struct bnxt_ulp_context *ulp_ctxt, BNXT_TF_DBG(ERR, "Flow database has reached max flows\n"); return -ENOMEM; } + if (flow_tbl->tail_index <= (flow_tbl->head_index + 1)) { + BNXT_TF_DBG(ERR, "Flow database has reached max resources\n"); + return -ENOMEM; + } *fid = flow_tbl->flow_tbl_stack[flow_tbl->head_index]; flow_tbl->head_index++; ulp_flow_db_active_flow_set(flow_tbl, *fid, 1); @@ -385,7 +389,7 @@ int32_t ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt, } /* check for max resource */ - if ((flow_tbl->num_flows + 1) >= flow_tbl->tail_index) { + if ((flow_tbl->head_index + 1) >= flow_tbl->tail_index) { BNXT_TF_DBG(ERR, "Flow db has reached max resources\n"); return -ENOMEM; } -- 2.7.4