[2/9] net/bnxt: set flow error when free filter is not available

Message ID 20210531072644.24656-3-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Series bnxt PMD fixes |


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kalesh A P May 31, 2021, 7:26 a.m. UTC
  From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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

Also, fixed the error code.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org

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>
 drivers/net/bnxt/bnxt_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 66012b8..9b47807 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1550,9 +1550,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,
+				   "Not enough resources for a new flow");
-		return -ENOMEM;
+		return -ENOSPC;
 	ret = bnxt_validate_and_parse_flow(dev, pattern, actions, attr,