LKML Archive mirror
 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 2/4] net: qede: use return from qede_parse_flow_attr() for flower
Date: Fri, 26 Apr 2024 09:12:24 +0000	[thread overview]
Message-ID: <20240426091227.78060-3-ast@fiberby.net> (raw)
In-Reply-To: <20240426091227.78060-1-ast@fiberby.net>

In qede_add_tc_flower_fltr(), 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 these functions.

Only compile tested.

Fixes: 2ce9c93eaca6 ("qede: Ingress tc flower offload (drop action) support.")
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 8ecdfa36a685..25ef0f4258cb 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -1879,10 +1879,9 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
 	}
 
 	/* parse flower attribute and prepare filter */
-	if (qede_parse_flow_attr(edev, proto, f->rule, &t)) {
-		rc = -EINVAL;
+	rc = qede_parse_flow_attr(edev, proto, f->rule, &t);
+	if (rc)
 		goto unlock;
-	}
 
 	/* Validate profile mode and number of filters */
 	if ((edev->arfs->filter_count && edev->arfs->mode != t.mode) ||
-- 
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 ` Asbjørn Sloth Tønnesen [this message]
2024-04-27 17:37   ` [PATCH net 2/4] net: qede: use return from qede_parse_flow_attr() for flower Simon Horman
2024-04-26  9:12 ` [PATCH net 3/4] net: qede: use return from qede_parse_flow_attr() for flow_spec Asbjørn Sloth Tønnesen
2024-04-27 17:37   ` 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-3-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 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 read-only IMAP folder(s) and NNTP newsgroup(s).