All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>
To: netdev@vger.kernel.org
Cc: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>,
	linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Ariel Elior" <aelior@marvell.com>,
	"Manish Chopra" <manishc@marvell.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Pablo Neira Ayuso" <pablo@netfilter.org>
Subject: [PATCH net 3/4] net: qede: use return from qede_parse_flow_attr() for flow_spec
Date: Fri, 26 Apr 2024 09:12:25 +0000	[thread overview]
Message-ID: <20240426091227.78060-4-ast@fiberby.net> (raw)
In-Reply-To: <20240426091227.78060-1-ast@fiberby.net>

In qede_flow_spec_to_rule(), when calling
qede_parse_flow_attr() then the return code
was only used for a non-zero check, and then
-EINVAL was returned.

qede_parse_flow_attr() can currently fail with:
* -EINVAL
* -EOPNOTSUPP
* -EPROTONOSUPPORT

This patch changes the code to use the actual
return code, not just return -EINVAL.

The blaimed commit introduced qede_flow_spec_to_rule(),
and this call to qede_parse_flow_attr(), it looks
like it just duplicated how it was already used.

Only compile tested.

Fixes: 37c5d3efd7f8 ("qede: use ethtool_rx_flow_rule() to remove duplicated parser code")
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---
 drivers/net/ethernet/qlogic/qede/qede_filter.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index 25ef0f4258cb..377d661f70f7 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -2002,10 +2002,9 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev,
 	if (IS_ERR(flow))
 		return PTR_ERR(flow);
 
-	if (qede_parse_flow_attr(edev, proto, flow->rule, t)) {
-		err = -EINVAL;
+	err = qede_parse_flow_attr(edev, proto, flow->rule, t);
+	if (err)
 		goto err_out;
-	}
 
 	/* Make sure location is valid and filter isn't already set */
 	err = qede_flow_spec_validate(edev, &flow->rule->action, t,
-- 
2.43.0


  parent reply	other threads:[~2024-04-26  9:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  9:12 [PATCH net 0/4] net: qede: avoid overruling error codes Asbjørn Sloth Tønnesen
2024-04-26  9:12 ` [PATCH net 1/4] net: qede: sanitize 'rc' in qede_add_tc_flower_fltr() Asbjørn Sloth Tønnesen
2024-04-27 17:37   ` Simon Horman
2024-04-26  9:12 ` [PATCH net 2/4] net: qede: use return from qede_parse_flow_attr() for flower Asbjørn Sloth Tønnesen
2024-04-27 17:37   ` Simon Horman
2024-04-26  9:12 ` Asbjørn Sloth Tønnesen [this message]
2024-04-27 17:37   ` [PATCH net 3/4] net: qede: use return from qede_parse_flow_attr() for flow_spec Simon Horman
2024-04-26  9:12 ` [PATCH net 4/4] net: qede: use return from qede_parse_actions() Asbjørn Sloth Tønnesen
2024-04-27 17:38   ` Simon Horman
2024-04-27 11:48 ` [PATCH net 0/4] net: qede: avoid overruling error codes Simon Horman
2024-04-27 12:58   ` Asbjørn Sloth Tønnesen
2024-04-27 17:36     ` Simon Horman
2024-04-29  9:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240426091227.78060-4-ast@fiberby.net \
    --to=ast@fiberby.net \
    --cc=aelior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.