Skip to content

Commit

Permalink
net/bnxt: set flow error when free filter not available
Browse files Browse the repository at this point in the history
[ upstream commit 94df795 ]

In bnxt_flow_validate(), when bnxt_get_unused_filter() fails due to
no filter resources available, driver is not setting flow error using
"rte_flow_error_set".

Also, fixed the error code.

Fixes: 5ef3b79 ("net/bnxt: support flow filter ops")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
Kalesh AP authored and cpaelzer committed Aug 9, 2021
1 parent 3e3ef06 commit efb741b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/bnxt/bnxt_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1514,9 +1514,11 @@ bnxt_flow_validate(struct rte_eth_dev *dev,

filter = bnxt_get_unused_filter(bp);
if (filter == NULL) {
PMD_DRV_LOG(ERR, "Not enough resources for a new flow.\n");
rte_flow_error_set(error, ENOSPC,
RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
"Not enough resources for a new flow");
bnxt_release_flow_lock(bp);
return -ENOMEM;
return -ENOSPC;
}

ret = bnxt_validate_and_parse_flow(dev, pattern, actions, attr,
Expand Down

0 comments on commit efb741b

Please sign in to comment.