net/bnxt: allow usage of more resources in flow DB

Allow the flow db resources to be more effectively utilized.

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
Mike Baucom 2020-04-15 20:19:07 +05:30 committed by Ferruh Yigit
parent a7420bd934
commit 5a640d0010

View File

@ -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;
}