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 2A6AAA04F0; Mon, 13 Jan 2020 05:44:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 038211D5A2; Mon, 13 Jan 2020 05:44:14 +0100 (CET) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id A5A5E1D57D for ; Mon, 13 Jan 2020 05:44:09 +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 6203428F8E6; Sun, 12 Jan 2020 20:44:08 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 6203428F8E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578890648; bh=5W1wV5ycwgSrghVx8Nh/6jRsbGWrg8oupMcAFwm7HNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NAAAYUBmP8UmhDf12CSpujrZrXgJgxYesZPfcOOHcTf5N9dU3m/H3l2Vtj506V4go 7iX7ajg7H+VxshLmDGr4apC7EX9H0HHVaGXkFLspKLTFZhkQnITBTN6S1zcsPPFZjI HsN6jRaaB67UyrNfx1g0TXKpDvkwlQ4gSgrSoQNI= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Mon, 13 Jan 2020 10:31:09 +0530 Message-Id: <20200113050118.28719-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200113050118.28719-1-kalesh-anakkur.purayil@broadcom.com> References: <20200113050118.28719-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH V2 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