From 94df7953ac6599c2887b859de19c541e5b5830d9 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Mon, 31 May 2021 12:56:37 +0530 Subject: [PATCH] net/bnxt: set flow error when free filter not available 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: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde --- 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 66012b8057..9b4780773a 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, + 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, -- 2.20.1