From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9C422A04F0; Mon, 13 Jan 2020 05:19:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BC1881D590; Mon, 13 Jan 2020 05:19:10 +0100 (CET) Received: from relay.smtp.broadcom.com (unknown [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id F2C491D579 for ; Mon, 13 Jan 2020 05:19:05 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 9679A1BDD03; Sun, 12 Jan 2020 20:19:01 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 9679A1BDD03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578889142; bh=5W1wV5ycwgSrghVx8Nh/6jRsbGWrg8oupMcAFwm7HNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p1n+eIvV2G7RBb6RcwGm57NSD10MCDf2+NAgZJrYGKdOg9BGFKF7FfdnWG0t4NE3o mkwYjK2Dey0bPhjf6sArufLFSOV9QFVYaJFheD6xriA/gztcwTs/mqiAUHE5+Ij/fa CG+FOZVwkKV7IlM6SNGB0m2BrglFMZfWSgGf1CCM= From: Kalesh A P To: dev@dpdk.org, ajit.khaparde@broadcom.com Cc: ferruh.yigit@intel.com Date: Mon, 13 Jan 2020 10:06:00 +0530 Message-Id: <20200113043609.27363-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200113043609.27363-1-kalesh-anakkur.purayil@broadcom.com> References: <20200113043609.27363-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 01/10] net/bnxt: handle flow create failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP If flow create fails due to not enough filter resources, driver does not populate the rte_flow_error using rte_flow_error_set(). Since "rte_errno" could have garbage value and is not relaiable, it could cause a segfault in the stack in port_flow_complain(). Fix it to set rte_flow_error using rte_flow_error_set() when flow create fails due to not enough filter resources. Signed-off-by: Kalesh AP Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt_flow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index cde1fa4..5564c53 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -1702,7 +1702,9 @@ bnxt_flow_create(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"); goto free_flow; } -- 2.10.1