Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp435417lqh; Tue, 7 May 2024 04:00:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlGAMEldsOU8YV4YViV4JflLSZE1Rb4u70+D73ZkN/Vau1EGAVF50iyKlvCKIGcD/cKdq9Uv5JR9gC4j15/RUbwKouIPjkIelDiG64tA== X-Google-Smtp-Source: AGHT+IGwRGqTHhHkGStV75iiDIkc31cRjVEQ2ZQhALQJqJLTeuYA6Ph1QEBksOrPpvSzwJ9+dm/R X-Received: by 2002:a17:90a:c687:b0:2ab:8e59:9da9 with SMTP id n7-20020a17090ac68700b002ab8e599da9mr3485033pjt.6.1715079612992; Tue, 07 May 2024 04:00:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715079612; cv=pass; d=google.com; s=arc-20160816; b=hr+IafckKHy62ELKEQi8Hyt5PdwA6+qdt5CKQMBi5RDoSdZKegQgcUbMMk8pfIWIaj vS6JAdWr1Yrz6pIAGhovWb+JWpnMDFm5SJ3KVAP/YLDa8P8Gs0mp5nKi2+TjCdWXkRAN OnQavY5jGtMmoJGGLKLYkEA6oneVMDaTqahNU3fUxxyScLbwT1QpgTGiu16mcNGY8SLa dpN5eKrnDXViY7RPV0u/nID3cI5o+kYD55AU0dg621YKlCgHf7XjwAqnGvHVW8F6ENZ4 tXpD/xPXaWOLM5a4lEfd+l9QZRLaeu/d/XWVDejNI0LS9gGU+ptRZy8kHhDnR/XoATys yr7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ko3V1Vy2kV/+RscmpRr6Fy7drQ6XYF9ztg0I8Ujcsls=; fh=wpGFVURqdBYDJvISrQoODZEHnVcuUZOfUAhWJ5UTCYQ=; b=wzQMKdY0yXZTUDOjs8nuOCxOnUNR1wDUx4iUBuRSIRG0ntkbV60wWLVUGa2tkQ8JjA dlSrJ3adrgaPKNiTgEVMraW6fKWIRzE3u8WsuSa4SlpnLsBHJNxhClA5AtBC1DH5EnuB TKLZSuSQEfR3ZkhRupSLIQ8et8cU4N0icntH2D+rym7rHDyAlDpWcDo4fz0+pNgsMkF1 XF8sivw+vlQZZZWdtJ8kTggP8r17Lrul+D8LG4BZ2TISODD2DyXUkuIDRUPh6a7rNxAm cw81njgixBWY1BZpahG1u/HqUHbS6imo//k+dFpTbUl4tJBp52YSgwMOhjh77K2fGgHN HzMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=U32LXCVC; arc=pass (i=1 spf=pass spfdomain=fiberby.net dkim=pass dkdomain=fiberby.net dmarc=pass fromdomain=fiberby.net); spf=pass (google.com: domain of linux-kernel+bounces-171132-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a10-20020a17090a688a00b002abae747f20si9943739pjd.109.2024.05.07.04.00.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 04:00:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171132-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=U32LXCVC; arc=pass (i=1 spf=pass spfdomain=fiberby.net dkim=pass dkdomain=fiberby.net dmarc=pass fromdomain=fiberby.net); spf=pass (google.com: domain of linux-kernel+bounces-171132-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 114D228C032 for ; Tue, 7 May 2024 10:47:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1DA115E216; Tue, 7 May 2024 10:44:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="U32LXCVC" 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 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: 8bit 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ørn Sloth Tønnesen --- 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/ethernet/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 *edev, { struct ethtool_rx_flow_spec_input input = {}; struct ethtool_rx_flow_rule *flow; + struct netlink_ext_ack extack; __be16 proto; int err; @@ -2016,7 +2017,7 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev, if (IS_ERR(flow)) return PTR_ERR(flow); - err = qede_parse_flow_attr(NULL, proto, flow->rule, t); + err = qede_parse_flow_attr(&extack, proto, flow->rule, t); if (err) goto err_out; @@ -2024,6 +2025,8 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev, err = 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; -- 2.43.0