DPDK patches and discussions
 help / color / mirror / Atom feed
From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
To: dev@dpdk.org
Cc: Mike Baucom <michael.baucom@broadcom.com>,
	Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Subject: [dpdk-dev] [PATCH 02/11] net/bnxt: allow usage of more resources in flow db
Date: Wed, 15 Apr 2020 20:19:07 +0530	[thread overview]
Message-ID: <1586962156-11179-3-git-send-email-venkatkumar.duvvuru@broadcom.com> (raw)
In-Reply-To: <1586962156-11179-1-git-send-email-venkatkumar.duvvuru@broadcom.com>

From: Mike Baucom <michael.baucom@broadcom.com>

Allow the flow db resources to be more effectively utilized.

Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 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


  parent reply	other threads:[~2020-04-15 14:50 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 14:49 [dpdk-dev] [PATCH 00/11] enhancements to host based flow table management Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 01/11] net/bnxt: SVIF changes for dpdk port id Venkat Duvvuru
2020-04-15 14:49 ` Venkat Duvvuru [this message]
2020-04-15 14:49 ` [dpdk-dev] [PATCH 03/11] net/bnxt: Added flow database resource iteration API Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 04/11] net/bnxt: added type of resource name to debug messages Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 05/11] net/bnxt: aggregated ulp rte parser arguments to single structure Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 06/11] net/bnxt: aggregated ulp mapper create " Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 07/11] net/bnxt: use hashing for flow template matching Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 08/11] net/bnxt: addition of session and function flow flush Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 09/11] net/bnxt: default identifiers added to ulp mapper Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 10/11] net/bnxt: cache table type added for tcam lookups Venkat Duvvuru
2020-04-15 14:49 ` [dpdk-dev] [PATCH 11/11] net/bnxt: addition of the port database Venkat Duvvuru
2020-04-17 16:19 ` [dpdk-dev] [PATCH v2 00/12] enhancements to host based flow table management Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 01/12] net/bnxt: add SVIF changes for dpdk port id Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 02/12] net/bnxt: allow usage of more resources in flow db Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 03/12] net/bnxt: add flow database resource iteration API Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 04/12] net/bnxt: add resource name type to debug messages Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 05/12] net/bnxt: aggregate ulp rte parser arguments Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 06/12] net/bnxt: aggregate ulp mapper create arguments Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 07/12] net/bnxt: use hashing for flow template match Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 08/12] net/bnxt: add session and function flow flush Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 09/12] net/bnxt: add default identifiers to ulp mapper Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 10/12] net/bnxt: add cache table type for TCAM lookup Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 11/12] net/bnxt: add port database Ajit Khaparde
2020-04-17 16:19   ` [dpdk-dev] [PATCH v2 12/12] net/bnxt: remove redefinition of page size Ajit Khaparde
2020-04-17 21:00   ` [dpdk-dev] [PATCH v2 00/12] enhancements to host based flow table management Ajit Khaparde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1586962156-11179-3-git-send-email-venkatkumar.duvvuru@broadcom.com \
    --to=venkatkumar.duvvuru@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=michael.baucom@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).