From patchwork Fri May 3 10:55:01 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: 13652627 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 4FD3514A4E9; Fri, 3 May 2024 10:55:32 +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=1714733735; cv=none; b=rX8e1XQ4itGkPbnaz7W7SU4MsMDse8doUSIUz5/DxcSQczV8LiQamYdXYnieCpuh1Z0bkBXajV3xrHuNzAyCk+voYIX2RYMKtmlNRSFMo6gd//9/kHAaJTXIn0gOFYe0XC0LvXBBCKOwXZTU2+pCFf+vF70PB2kmMpJqK8LLgNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714733735; c=relaxed/simple; bh=M3HQs9C2Rd0Wt95wYa+Q8dqxkvEUKVv2uyT/x8WU/7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ttn79z0Cnqm6g0qZWKdJJ0n7TaenuNKi+FmjA2tpAa6HafYm9ddaSpJWqucs2yMCvUX4xVcvbJkYm/9zlmRDarScKsnXM838ZemSqniN6FDWfBPqRvHQyoa7hV3vpFgMvqdlS/t8Ubtvb051xz0nlJdRd9pW2meWLPHZFQGZDzU= 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=i7WG1q8D; 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="i7WG1q8D" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 90545600A5; Fri, 3 May 2024 10:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1714733723; bh=M3HQs9C2Rd0Wt95wYa+Q8dqxkvEUKVv2uyT/x8WU/7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i7WG1q8D9sBq5kFC5O8t04v5P2LMKgg0Xh3jz7cSoTls24QS3pnV1IHoNYmDbX0Br yhAlhrU1tp856DC37dMBjU9nnSFNF35I29dnk5WecqHwyHCj2DKTbJs98NenHQl1dO K0eugXx7qZjR3tJwRMYAHk/gRWEL+oWy48K00TGzZ8wNDlBybGsQd6AkhPQXSBOnu4 tirkQ9dxZCTg0K6186P16Hl5TtgGmcB7s79GSRqj9AwHn05eAukikmsSx9MSJk1Y9f cg+WBjYxx5ErfHLcm2OZK1QAb1EiW/+SiBTWwZkitX43/umMt5QuKsA88P70vM36FM dQNPXW5NF11Gw== Received: by x201s (Postfix, from userid 1000) id 012F121BB70; Fri, 03 May 2024 10:55:06 +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 , Manish Chopra Subject: [PATCH net-next 1/3] net: qede: use return from qede_parse_actions() for flow_spec Date: Fri, 3 May 2024 10:55:01 +0000 Message-ID: <20240503105505.839342-2-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240503105505.839342-1-ast@fiberby.net> References: <20240503105505.839342-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_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 Commit 319a1d19471e ("flow_offload: check for basic action hw stats type") broke the implicit assumption that it could only fail with -EINVAL, by changing it to return -EOPNOTSUPP, when hardware stats are requested. However AFAICT it's not possible to trigger qede_parse_actions() to return -EOPNOTSUPP, when called from qede_flow_spec_to_rule(), as hardware stats can't be requested by ethtool_rx_flow_rule_create(). This patch changes qede_flow_spec_to_rule() to use the actual return code from qede_parse_actions(), so it's no longer assumed that all errors are -EINVAL. Only compile tested. Signed-off-by: Asbjørn Sloth Tønnesen Reviewed-by: Simon Horman --- drivers/net/ethernet/qlogic/qede/qede_filter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index cb6b33a228ea..d5ca4bf6dba5 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c @@ -1943,6 +1943,8 @@ static int qede_flow_spec_validate(struct qede_dev *edev, struct qede_arfs_tuple *t, __u32 location) { + int err; + if (location >= QEDE_RFS_MAX_FLTR) { DP_INFO(edev, "Location out-of-bounds\n"); return -EINVAL; @@ -1963,8 +1965,9 @@ static int qede_flow_spec_validate(struct qede_dev *edev, return -EINVAL; } - if (qede_parse_actions(edev, flow_action, NULL)) - return -EINVAL; + err = qede_parse_actions(edev, flow_action, NULL); + if (err) + return err; return 0; }