From patchwork Fri Apr 26 09:12:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13644436 X-Patchwork-Delegate: kuba@kernel.org Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85EF413D500; Fri, 26 Apr 2024 09:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122804; cv=none; b=BOvXXwmttJuVzR2hQr6OvPqI3EbCvWHealJaTK4pczphPiyVZZzMgnnEIwsy0ccN+oCbwtcnHyC/YfVrBGFJEhy6BcPiYLEtwSuklnhyQW+N0BNNO8RHXrt0A+lPdhCkhzDJ/DFn9e8+Dj3fkafzmv4mFlAoEu6VZLBW5aXZY/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122804; c=relaxed/simple; bh=9s0mATnN17jEJYUCW4+yq71pom+Nt3UtcqB4xbXFZ7w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=N6XNJKMbfprP6hQg5++uiw/DZqEE6sy4hZmYQImSu4piGi6zIA66CnjzBPOljPWWkeGULE0GnTE/xyZ03mHGV7bOhp8Du7xRofkT8p6Xc8ZMcJFqVpUJXsp51JxIEgkdC68dhJicvd7MeUuN1SdzZRU629BE/wCNYo4dhSSMV4M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=Kvxscx6g; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="Kvxscx6g" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id C19BE600B1; Fri, 26 Apr 2024 09:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1714122793; bh=9s0mATnN17jEJYUCW4+yq71pom+Nt3UtcqB4xbXFZ7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kvxscx6grJ1CTmvgKJiu28JcHEpSuqoYNQdFRTBV8WF18J3Zl6/5AQ6Mj1Oi4/7I/ heK+iFloz/yJMJSZ5eeDOkqM7T037XYTuelPpnyruK14B60Czkl4t1N9f1Afc4jBVt 2zsCYrBzVO/YV84GQpFhNwOYassMXI/r6n3UsMCMbqFxx933wv95PuFoG+9JZHVvMB YXHm5s1c/ZYn7uh0cwPMr+FFLk0esp+YdzwXiZ1ccI5VUH0E+U+zwCOalCYAfk8g2g +rh3GmzXboHN+3H1VUjHeWAWYlDKqiyumwDC53ajOf6ylNPZR8Vu5JfuBwol/eOw41 rQXXq83BuXBPQ== Received: by x201s (Postfix, from userid 1000) id 6C2B821BB44; Fri, 26 Apr 2024 09:12:28 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ariel Elior , Manish Chopra , Jiri Pirko , Pablo Neira Ayuso Subject: [PATCH net 1/4] net: qede: sanitize 'rc' in qede_add_tc_flower_fltr() Date: Fri, 26 Apr 2024 09:12:23 +0000 Message-ID: <20240426091227.78060-2-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240426091227.78060-1-ast@fiberby.net> References: <20240426091227.78060-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Explicitly set 'rc' (return code), before jumping to the unlock and return path. By not having any code depend on that 'rc' remains at it's initial value of -EINVAL, then we can re-use 'rc' for the return code of function calls in subsequent patches. Only compile tested. Signed-off-by: Asbjørn Sloth Tønnesen Reviewed-by: Simon Horman --- drivers/net/ethernet/qlogic/qede/qede_filter.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index a5ac21a0ee33..8ecdfa36a685 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c @@ -1868,8 +1868,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, struct flow_cls_offload *f) { struct qede_arfs_fltr_node *n; - int min_hlen, rc = -EINVAL; struct qede_arfs_tuple t; + int min_hlen, rc; __qede_lock(edev); @@ -1879,8 +1879,10 @@ 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)) + if (qede_parse_flow_attr(edev, proto, f->rule, &t)) { + rc = -EINVAL; goto unlock; + } /* Validate profile mode and number of filters */ if ((edev->arfs->filter_count && edev->arfs->mode != t.mode) || @@ -1888,12 +1890,15 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, DP_NOTICE(edev, "Filter configuration invalidated, filter mode=0x%x, configured mode=0x%x, filter count=0x%x\n", t.mode, edev->arfs->mode, edev->arfs->filter_count); + rc = -EINVAL; goto unlock; } /* parse tc actions and get the vf_id */ - if (qede_parse_actions(edev, &f->rule->action, f->common.extack)) + if (qede_parse_actions(edev, &f->rule->action, f->common.extack)) { + rc = -EINVAL; goto unlock; + } if (qede_flow_find_fltr(edev, &t)) { rc = -EEXIST; From patchwork Fri Apr 26 09:12:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13644437 X-Patchwork-Delegate: kuba@kernel.org Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0417813D299; Fri, 26 Apr 2024 09:13:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122804; cv=none; b=bS6L1oCD9t/JnGYhxSSyiNAZUSr0eK4pJeha2xtwPIhRBoj97dD+en6v/SAuk59EgnLsvh0FAaBIBnQ4BUYGpea+z6OxkIY8xl4FEe5/FgcIeNqk4FybIjljJdpgDPZQHpf7fhBER/yge4ghCnmUNjYS5IaPuuUgqdbbFjKI/9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122804; c=relaxed/simple; bh=0ToFWkE+BIdond+WXbqiMqObFzawzXIHgGpNFXxnRjc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ugcc8EJnvF4sDM1j6pe98njmquOtWHOwad/97ZS/6hjmHZRIK5YNbBfLQm3vSxtmSTzoX8Iyi+tn7Iyw7zWHNTKW7tKAOFrv/EjY1ofUh1Bufexm6b+cWnQ9iN4X5oAJtyPd0XnGutcqfdL2h9mMQ/RvNSRvjJ0oHOtBAIXvhlo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=IQwbG6Dj; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="IQwbG6Dj" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 569A4600A5; Fri, 26 Apr 2024 09:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1714122793; bh=0ToFWkE+BIdond+WXbqiMqObFzawzXIHgGpNFXxnRjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IQwbG6DjpVmZC92m8hszY4nji7ACLonfAcYNsms82yiN45LKnaOHDM6Rsxp+3VwH+ G3Gm4MR9JI0J4r5VwOH8bfYQL2SPZZIrgcRQgZ4/hpkQLtnMj6q1KF1CByNOLc/TKo f8UU+v34HHFy9zeLMrgItwxBKvI7kdRk3iJmCBHrG2IpgZCZdGItdpOoEtY+9yfNCu 3Agn1PcYdwNfFdeRGgGwGBy3UK2lkxx3Hn7hrLJGPTHJ56nuJHtdcZV2lh0U7+tFKi NIDOkMnUacpLO/MZoqjrYtz56DgsjEH5x1B2NU/pYlWMHWm3WzDzHrljVQxNHhO6hx sCcis7GLIWlNw== Received: by x201s (Postfix, from userid 1000) id 955F521BB46; Fri, 26 Apr 2024 09:12:28 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ariel Elior , Manish Chopra , Jiri Pirko , Pablo Neira Ayuso 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 Message-ID: <20240426091227.78060-3-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240426091227.78060-1-ast@fiberby.net> References: <20240426091227.78060-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Simon Horman --- 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) || From patchwork Fri Apr 26 09:12:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13644435 X-Patchwork-Delegate: kuba@kernel.org Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A07C13D2BF; Fri, 26 Apr 2024 09:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122804; cv=none; b=kLbu8ZE3IkFx1Juy54QE2jaA+A1vu4gZTxBQwDQb82RzYKQa94bWZtWCwKHUBdYOpA/l48qV3p47EM4k24CWphEcXOGPnAZxiWvoSeutV+/C8M4FcTYUlDS8N3iLTFGMvotQGY647ZGprbvUBLak6I9cGLGgOJrFm/tKIx7RNl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122804; c=relaxed/simple; bh=eV33PMxw0Cc21m0h+LKsBOgy4HzT4yeVL9NTNgNOzUg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jiTdlSMrEAbVz27o9B7peGy3SIf5byuHWEc3y5KIpRZRrKXPp+I4cskeiz0ayBWUihBppkqu4EFyFj6mq/R+eqgDxddYzxFfApvMcxdrU43sZzTWjY2m3wa2LpzlBJuxJUTEuNtRqZ7MGudCnc7hhNc3xtoTViQDFVSc/Ys4nGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=qRE12cjV; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="qRE12cjV" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 4A1B2600A2; Fri, 26 Apr 2024 09:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1714122793; bh=eV33PMxw0Cc21m0h+LKsBOgy4HzT4yeVL9NTNgNOzUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRE12cjVZ4Mcz4/uXis4EX/HjYv7KESNpmUUDkna1CHOODlCdCLzVGDlH8z8QEwM0 7bJxthBBffvjqhGEohwNiOVIVpVGV8+cHtN0+Q6g8YVTi82OYjFtr9UCZJkrEDkOUi 9kb/p0eoLm7nCE39hLCOTatwYVd3dwiw8wifA5FFIZAN06UjBcDn5QiCBur8yalR/h 3r5HMzEYQ+RqVp9tzGk8fD6Du65BtqZY/wNisRh3536kwqWdsGu2sdX29pGZpCXRbP YmG0nsiyKSUoftwLIQZ4k1BXFxII5SV82U+9zBdm7ktmJflxmu/F4qbOK32U9m/O/0 F2EpjEy4KyI4A== Received: by x201s (Postfix, from userid 1000) id B838721BB48; Fri, 26 Apr 2024 09:12:28 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ariel Elior , Manish Chopra , Jiri Pirko , Pablo Neira Ayuso 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 Message-ID: <20240426091227.78060-4-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240426091227.78060-1-ast@fiberby.net> References: <20240426091227.78060-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Simon Horman --- 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, From patchwork Fri Apr 26 09:12:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13644438 X-Patchwork-Delegate: kuba@kernel.org Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 040F3282EA; Fri, 26 Apr 2024 09:13:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122805; cv=none; b=dvq54TXGjvKWmF4dJDmH2bBf0UaZMcLkMsxy+P4FRrvggzpJuVgUJCB6GG5i+BsAGZNin7iLDQY/xbSF/xR4aY4cx50TiV11BWvdgPbj05vJPB/2JN8CcK1FVGbckkixKqqDKHegntLR7OMmWeKXljty8bH/45AhfhxWue9dEBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714122805; c=relaxed/simple; bh=3ii8rmx58QKPD7NlzblSbXJrF9bHIa8Z3g1LxRb5V34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PSdGYMefTAkRboC5sGvj79pJRDeWFKYl2AZjr2aX8OKJuIkSJkt6tujDMet5cVABXwXQWgZMDNVOiLWBcY/8n3QOMUXOMMBElFz8SJncOML24ftDgiJDga+d3mDYFdzTFRnNw+J4jZwCeFwDR7JqDyKHR6ZY8uGN/Vq/yif0kJA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=W6B1Df0b; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="W6B1Df0b" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 58F0D600A7; Fri, 26 Apr 2024 09:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1714122793; bh=3ii8rmx58QKPD7NlzblSbXJrF9bHIa8Z3g1LxRb5V34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W6B1Df0bBRIS+HdXLLJ7mdkIpCR4Hb08D7PeltSSSKjp6ABE3HuWqO/ZvAILCJIiv oSilXzgIeYw6AaRMHL3yWLsK0ZOE7K05oU3ZvcTYomSmHf8c1uLAOwovSxGFeIOWsW K8i3C2CW08r2SQuCHuVdXnEcrrSiPGfnE1Mfwo2Uzk4IpQkWYqyP6qgRAlYFy3yIn2 J4oxlEOBIrMDVB1D8FvbzMzGNQwOB3lOl4Fj5xogP9NXKjfok1nTxRKDBHFZKP3JQ3 F0fOY8Z8DmRX/dJQ+DOQyDTyxe4tHuNKQgQzBxrXhBPHqT3rKtBujijTLIqF4G/RP3 l4jdnlQBIWnaw== Received: by x201s (Postfix, from userid 1000) id E1B9821BB4A; Fri, 26 Apr 2024 09:12:28 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Ariel Elior , Manish Chopra , Jiri Pirko , Pablo Neira Ayuso Subject: [PATCH net 4/4] net: qede: use return from qede_parse_actions() Date: Fri, 26 Apr 2024 09:12:26 +0000 Message-ID: <20240426091227.78060-5-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240426091227.78060-1-ast@fiberby.net> References: <20240426091227.78060-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org When calling qede_parse_actions() then the return code was only used for a non-zero check, and then -EINVAL was returned. qede_parse_actions() can currently fail with: * -EINVAL * -EOPNOTSUPP This patch changes the code to use the actual return code, not just return -EINVAL. The blaimed commit broke the implicit assumption that only -EINVAL would ever be returned. Only compile tested. Fixes: 319a1d19471e ("flow_offload: check for basic action hw stats type") Signed-off-by: Asbjørn Sloth Tønnesen Reviewed-by: Simon Horman --- 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 377d661f70f7..cb6b33a228ea 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c @@ -1894,10 +1894,9 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, } /* parse tc actions and get the vf_id */ - if (qede_parse_actions(edev, &f->rule->action, f->common.extack)) { - rc = -EINVAL; + rc = qede_parse_actions(edev, &f->rule->action, f->common.extack); + if (rc) goto unlock; - } if (qede_flow_find_fltr(edev, &t)) { rc = -EEXIST;