From patchwork Fri Mar 26 09:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 89911 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9DCAAA0A02; Fri, 26 Mar 2021 10:39:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72648140D4C; Fri, 26 Mar 2021 10:39:35 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 25B8340685; Fri, 26 Mar 2021 10:39:34 +0100 (CET) Received: from localhost.localdomain (unknown [188.242.7.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 8F4B17F4F3; Fri, 26 Mar 2021 12:39:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 8F4B17F4F3 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1616751573; bh=VapyeqEd6MvSR6SCRi3XCJADVDb+4sH/Jxu3WvABHA0=; h=From:To:Cc:Subject:Date; b=Dp6q2YzRHyUyuSgDQluPgh2OPI8Oe1zPhYt4Hy5m/g25E3pmSShEREYJj0z1Wlj+M lt2+9KsKLd4FXCFTgHOFM8qZ82WFSOAIJlbiUJ4l/bjQJN/QCNB+8tXB4HZYdP7tLt q2VQ5yEQ8bA2atkj0Gs/zZOX1ddQFm+bXbEjwJU4= From: Ivan Malov To: dev@dpdk.org Cc: stable@dpdk.org, Andrew Rybchenko , Andy Moreton Date: Fri, 26 Mar 2021 12:39:27 +0300 Message-Id: <20210326093927.2535-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] net/sfc: fix error path inconsistency X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" At the fail label, there's a statement to set general errno and error message. However, before the label is reached, a custom error message can be set by the code which parses actions. This custom (action-specific) message, when present, must not be replaced by the general one. Fixes: 662286ae61d2 ("net/sfc: add actions parsing stub to MAE backend") Cc: stable@dpdk.org Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_mae.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 8afa09341..4dafe3dcd 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -2634,6 +2634,8 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa, efx_mae_actions_t *spec; int rc; + rte_errno = 0; + if (actions == NULL) { return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_NUM, NULL, @@ -2690,7 +2692,7 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa, efx_mae_action_set_spec_fini(sa->nic, spec); fail_action_set_spec_init: - if (rc > 0) { + if (rc > 0 && rte_errno == 0) { rc = rte_flow_error_set(error, rc, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "Failed to process the action");