diff mbox series

[net-next,3/3] net: qede: use return from qede_flow_parse_ports()

Message ID 20240503105505.839342-4-ast@fiberby.net (mailing list archive)
State Accepted
Commit c0c66eba6322a300a27cffb2295af70ad7f63d40
Delegated to: Netdev Maintainers
Headers show
Series net: qede: don't restrict error codes | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 37 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-05--03-00 (tests: 1003)

Commit Message

Asbjørn Sloth Tønnesen May 3, 2024, 10:55 a.m. UTC
When calling qede_flow_parse_ports(), then the
return code was only used for a non-zero check,
and then -EINVAL was returned.

qede_flow_parse_ports() can currently fail with:
* -EINVAL

This patch changes qede_flow_parse_v{4,6}_common() to
use the actual return code from qede_flow_parse_ports(),
so it's no longer assumed that all errors are -EINVAL.

Only compile tested.

Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
---
 drivers/net/ethernet/qlogic/qede/qede_filter.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Simon Horman May 4, 2024, 2:59 p.m. UTC | #1
On Fri, May 03, 2024 at 10:55:03AM +0000, Asbjørn Sloth Tønnesen wrote:
> When calling qede_flow_parse_ports(), then the
> return code was only used for a non-zero check,
> and then -EINVAL was returned.
> 
> qede_flow_parse_ports() can currently fail with:
> * -EINVAL
> 
> This patch changes qede_flow_parse_v{4,6}_common() to
> use the actual return code from qede_flow_parse_ports(),
> so it's no longer assumed that all errors are -EINVAL.
> 
> Only compile tested.
> 
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>

Reviewed-by: Simon Horman <horms@kernel.org>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index 07af0464eb1e..ded48523c383 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -1725,6 +1725,7 @@  qede_flow_parse_v6_common(struct qede_dev *edev, struct flow_rule *rule,
 			  struct qede_arfs_tuple *t)
 {
 	struct in6_addr zero_addr, addr;
+	int err;
 
 	memset(&zero_addr, 0, sizeof(addr));
 	memset(&addr, 0xff, sizeof(addr));
@@ -1746,8 +1747,9 @@  qede_flow_parse_v6_common(struct qede_dev *edev, struct flow_rule *rule,
 		memcpy(&t->dst_ipv6, &match.key->dst, sizeof(addr));
 	}
 
-	if (qede_flow_parse_ports(edev, rule, t))
-		return -EINVAL;
+	err = qede_flow_parse_ports(edev, rule, t);
+	if (err)
+		return err;
 
 	return qede_set_v6_tuple_to_profile(edev, t, &zero_addr);
 }
@@ -1756,6 +1758,8 @@  static int
 qede_flow_parse_v4_common(struct qede_dev *edev, struct flow_rule *rule,
 			struct qede_arfs_tuple *t)
 {
+	int err;
+
 	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV4_ADDRS)) {
 		struct flow_match_ipv4_addrs match;
 
@@ -1770,8 +1774,9 @@  qede_flow_parse_v4_common(struct qede_dev *edev, struct flow_rule *rule,
 		t->dst_ipv4 = match.key->dst;
 	}
 
-	if (qede_flow_parse_ports(edev, rule, t))
-		return -EINVAL;
+	err = qede_flow_parse_ports(edev, rule, t);
+	if (err)
+		return err;
 
 	return qede_set_v4_tuple_to_profile(edev, t);
 }