patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/sfc: fix error path inconsistency
@ 2021-03-26  9:39 Ivan Malov
  2021-03-30 14:15 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Malov @ 2021-03-26  9:39 UTC (permalink / raw)
  To: dev; +Cc: stable, Andrew Rybchenko, Andy Moreton

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 <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 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");
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/sfc: fix error path inconsistency
  2021-03-26  9:39 [dpdk-stable] [PATCH] net/sfc: fix error path inconsistency Ivan Malov
@ 2021-03-30 14:15 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2021-03-30 14:15 UTC (permalink / raw)
  To: Ivan Malov, dev; +Cc: stable, Andrew Rybchenko, Andy Moreton

On 3/26/2021 9:39 AM, Ivan Malov wrote:
> 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 <ivan.malov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Reviewed-by: Andy Moreton <amoreton@xilinx.com>

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-30 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26  9:39 [dpdk-stable] [PATCH] net/sfc: fix error path inconsistency Ivan Malov
2021-03-30 14:15 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).