From nobody Wed Dec 17 15:58:08 2025 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 4E6F1152E18; Tue, 7 May 2024 10:44:48 +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=1715078691; cv=none; b=qzb/bO2QJBCSK6W/xS42BetoKpPFH8kutJikHlzdHYBjLYQhwx7yTc+m7Q9x8FtwlEBU9Ovx8CoWZO5VmZ//xMhlh7cgIOXT+rp00VNq78cHZwvFMoTadainVzkxqqAeSMOGuL0tpzf+lirxlhQX20NaVNtdIW8eep4D+07m+c0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078691; c=relaxed/simple; bh=GSOXcR4bbFPjJZ3frmuY6IjJLkcw6hvn1PqSul/wOIw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HXzx3FEMLP91JffP6zlnuVhY7BRYdLEvOcxZ6YN9AXwZKDwJcGLMy0OIgJ1+tZoJ7DGTauwimCbdHruIEeSzP+9y0fR+S/rqn4f09FcrhemGjsjC+O4LNSQMVyW4uQt22uJZbZUNkzlQ2+uQP+jhYKSNz4Sf5QOBLkcsnR5H0P8= 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=U32LXCVC; 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="U32LXCVC" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 33909600B7; Tue, 7 May 2024 10:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1715078675; bh=GSOXcR4bbFPjJZ3frmuY6IjJLkcw6hvn1PqSul/wOIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U32LXCVCnDhD6Lcvjt/wky2/xmMGL8Wzq9LX6Lnn/BR8c+J87p6cAhRKO/IrxzUk3 VGD8HcJ6q43QvVuVTikOUMaf6+8tBbQz5jcNtURUQ7wQajtfAn+9DfvB9gLpRMcxQQ hWwBjslbk8VUh3J0IUK1uIDhbpw8bqtKBkDM/iP46Z9j4VDuXP6xYrWHiiHLdpMPrX hb2MAYzBGatTLFnLuPuy4bxy2qajLAdhJVqJRQoOpO6KnVDlnoaNXj88E6Vs/YdmDs E0yrqw9QfYLC0+D49D2FWA0Hf57SRA+dmHeyVGLTi2A+dp/+uF8ukgffdJEsYAvR4h yR9+bO6hSGV6Q== Received: by x201s (Postfix, from userid 1000) id BA7B0203D5D; Tue, 07 May 2024 10:44:24 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Manish Chopra Subject: [PATCH net-next 12/14] net: qede: use faked extack in qede_flow_spec_to_rule() Date: Tue, 7 May 2024 10:44:13 +0000 Message-ID: <20240507104421.1628139-13-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507104421.1628139-1-ast@fiberby.net> References: <20240507104421.1628139-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Since qede_parse_flow_attr() now does error reporting through extack, then give it a fake extack and extract the error message afterwards if one was set. The extracted error message is then passed on through DP_NOTICE(), including messages that was earlier issued with DP_INFO(). This fake extack approach is already used by mlxsw_env_linecard_modules_power_mode_apply() in drivers/net/ethernet/mellanox/mlxsw/core_env.c Only compile tested. Signed-off-by: Asbj=C3=B8rn Sloth T=C3=B8nnesen --- Note: Even through _msg is marked in include/linux/netlink.h as "don't access directly, use NL_SET_ERR_MSG", then the comment above NL_SET_ERR_MSG, seams to indicate that it should be fine to access it directly if for reading, as is done other places. I could also add a NL_GET_ERR_MSG but I would rather not do that in this series. drivers/net/ethernet/qlogic/qede/qede_filter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/e= thernet/qlogic/qede/qede_filter.c index 8734c864f324..3727ab5af088 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c @@ -1989,6 +1989,7 @@ static int qede_flow_spec_to_rule(struct qede_dev *ed= ev, { struct ethtool_rx_flow_spec_input input =3D {}; struct ethtool_rx_flow_rule *flow; + struct netlink_ext_ack extack; __be16 proto; int err; =20 @@ -2016,7 +2017,7 @@ static int qede_flow_spec_to_rule(struct qede_dev *ed= ev, if (IS_ERR(flow)) return PTR_ERR(flow); =20 - err =3D qede_parse_flow_attr(NULL, proto, flow->rule, t); + err =3D qede_parse_flow_attr(&extack, proto, flow->rule, t); if (err) goto err_out; =20 @@ -2024,6 +2025,8 @@ static int qede_flow_spec_to_rule(struct qede_dev *ed= ev, err =3D qede_flow_spec_validate(edev, &flow->rule->action, t, fs->location); err_out: + if (extack._msg) + DP_NOTICE(edev, "%s\n", extack._msg); ethtool_rx_flow_rule_destroy(flow); return err; =20 --=20 2.43.0