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 3244CA0352; Thu, 16 Jan 2020 13:47:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2D3321D416; Thu, 16 Jan 2020 13:47:51 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 5F1B91D176 for ; Thu, 16 Jan 2020 13:47:47 +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 66B5A28F520; Thu, 16 Jan 2020 04:47:46 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 66B5A28F520 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1579178866; bh=Gcp30UYwWI0RdZt++NZqahD4Vit5RXP9785/bCeQ680=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BccVIhajEqUIAJ39cLPfHkO/PpQR+XU8UlPcKIQdcC56XWcNnNKbtUuG8iWGIoraS R0i/Gs8UjyM9ddkyozbedVIjPK8lWVGjsAPJ6Cqh0EN6Jdf6+v54W9xQnxWyBAzuax CJoGhEZDFa9BpiEdMDSSEo32/i/HJ188zHS3OeYQ= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Thu, 16 Jan 2020 18:34:46 +0530 Message-Id: <20200116130455.30193-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200116130455.30193-1-kalesh-anakkur.purayil@broadcom.com> References: <20200116130455.30193-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH V4 01/10] net/bnxt: fix 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. Fixes: 5c1171c ("net/bnxt: refactor filter/flow") Cc: stable@dpdk.org 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