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,