Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp435339lqh; Tue, 7 May 2024 04:00:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZefIpzZF6Kz7Q9xTb3HT8Da94mXv/RBBC6iuD3EOpg3aVMH7lOjBJDYLyjpTXqH1L1t48MKkqCa8/ffXFpjWDUY2Fqo9S/Bx04xPDQA== X-Google-Smtp-Source: AGHT+IElJzDK0RMcDNtMuG5jcwqlDegTCyjBspWb3t8rbJdE0b8iAXXS1ixhV99IitRwx2BCmkbI X-Received: by 2002:a17:902:f64c:b0:1eb:66b6:930b with SMTP id m12-20020a170902f64c00b001eb66b6930bmr15737681plg.55.1715079602612; Tue, 07 May 2024 04:00:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715079602; cv=pass; d=google.com; s=arc-20160816; b=bZT7GPhpjne7fFxlFbmHdXEGw2fdNBgNuvy4ZX0VuA27vwvRNFB8G0MaK/YAZECvLx 02ftWsjgn8FZ6KJjpLhfmQQvcH0M7d2WG+Jz2ofGH/EQF13DiR/SbdrgCC8iH5w2TO8V 7Vq5BkTXil4oHESzQz8frGn09ZQvkYNNvGGTv1SLyapqcg3SNyxlSlsDlcVOvXCOR5FR ExXimHun5KrhtdclQfRSAqxCLbg4b8m3+cte/qx3pprsqkYuucXWi8OIyhovs8Z0wZMO JsLlPzmz/rudlqVCparrbV57n5HbR5UibZXkV/5kL03QtNdRy7oPrYo2WobxOlkM5WNf 0M0A== 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=YEmC9zy4YFT/zclrPtuflUjSEfD5satYyL3n1KGUCmw=; fh=wpGFVURqdBYDJvISrQoODZEHnVcuUZOfUAhWJ5UTCYQ=; b=a1MdN9Zfy3HmktJ05jccSbJqI1gK3PgNfGyuWr/yt50vQoX6TjDSuijOFRfj8xHvfE 6ZsruAdzZBaCGkP6l7/6krzwOQjtGQE+sWJAUfJR3ekQxZxO2WfzP/KT5EwGXQSYvJP2 X76MduTLWWaDKOKaqmlvhc8uSpLl5tRHVUQYvRfWn1iO1YEVyc7PvRVi+26hvbIbcuAs ZuBhH6nJwR8f5Kx7jJEt/BVRHe07csh0JtAPB19r47btMobAL7d3Bybm+e/yoNF4cYIe QagOztKnS0CgKpmlA+RVuY14rFltb4ICkORT9XtfzqO0lPpSF7NP1BZFh4IRp2dvdNgv wZ1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=SnbIGSu2; 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-171124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171124-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d12-20020a170903230c00b001e51f5c83ddsi10337550plh.371.2024.05.07.04.00.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 04:00:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=SnbIGSu2; 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-171124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171124-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 1855428A750 for ; Tue, 7 May 2024 10:45:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32712152E0A; Tue, 7 May 2024 10:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="SnbIGSu2" 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 9BDB114F100; Tue, 7 May 2024 10:44:43 +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=1715078687; cv=none; b=BZdE17I4AYwFS2uOIjlVdjaes8ML9nMQu+8XOYjbDu6DRH/zrsBq5VPuV8mgL0Gm2cW4kc+ESlz9nn9aoPQLngkYixy8+rhfmC3Ra6p4BM5eRCODdvGbkGFgkb+AH8hwHir2DPVarJKLFDvjTuVDGCqiCBS7s0ig7WvCOGnUW+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078687; c=relaxed/simple; bh=ZztlPtdm5BgjIFka9qvM8fk/AJlWEYDvLqfkiSCDozU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mPn1/1tgq2vY3HRf1+XhDfO2yvWjYApfJbcCZ9F8KQ8ulFE1xEcyrMSvj1cDcfbk6aBcSHC2UHyBs8vGa/V878xf+kIyWleLzYvC5NKhCvjPH6R0oTVroR7mfLu500S1Ec1bzT8LO3nZoOkEnkgEdLrolL7GD82O0AM0W0unzck= 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=SnbIGSu2; 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 1DE05600A9; Tue, 7 May 2024 10:44:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1715078675; bh=ZztlPtdm5BgjIFka9qvM8fk/AJlWEYDvLqfkiSCDozU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SnbIGSu2TJvGuW7/HvmGAe3wMVkDnQNVDZ12CbxnDNq1mY3c5oMzT+bWFnenFWLVs cR9qG5LQlnXRtLBnoeU+ZCmdJl9eGVaKdxEHYDwfhmYK3BGUa9VMtbCmrFLx8HGcnJ PYIslkvrl3W7RRuZUQjJwUeBDBNlMJIvPzJiuScl+tVkrGdnRSkn+TggAuwpXoX1l1 qYIn6lT73ojljmLhOpOwnqLpgEUj1vZSTVgxdNoZ5dYumKnEo9Q0lFGZcvWsPD6daM lJXITe1JzneXTj2kXaYsVoXZ6FYpL1uE9N38CTJnjeLkwLaryk1SPQvg/kScG7Fp4y NqmuXXFExisFg== Received: by x201s (Postfix, from userid 1000) id 8C122203D02; 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 11/14] net: qede: use extack in qede_parse_flow_attr() Date: Tue, 7 May 2024 10:44:12 +0000 Message-ID: <20240507104421.1628139-12-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 Convert qede_parse_flow_attr() to take extack, and drop the edev argument. Convert DP_NOTICE calls to use NL_SET_ERR_MSG_* instead. Pass extack in calls to qede_flow_parse_{tcp,udp}_v{4,6}(). In calls to qede_parse_flow_attr(), if extack is unavailable, then use NULL for now, until a subsequent patch makes extack available. Only compile tested. Signed-off-by: Asbjørn Sloth Tønnesen --- .../net/ethernet/qlogic/qede/qede_filter.c | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c index 5b353a160d15..8734c864f324 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_filter.c +++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c @@ -1826,7 +1826,7 @@ qede_flow_parse_udp_v4(struct netlink_ext_ack *extack, struct flow_rule *rule, } static int -qede_parse_flow_attr(struct qede_dev *edev, __be16 proto, +qede_parse_flow_attr(struct netlink_ext_ack *extack, __be16 proto, struct flow_rule *rule, struct qede_arfs_tuple *tuple) { struct flow_dissector *dissector = rule->match.dissector; @@ -1841,14 +1841,15 @@ qede_parse_flow_attr(struct qede_dev *edev, __be16 proto, BIT_ULL(FLOW_DISSECTOR_KEY_BASIC) | BIT_ULL(FLOW_DISSECTOR_KEY_IPV6_ADDRS) | BIT_ULL(FLOW_DISSECTOR_KEY_PORTS))) { - DP_NOTICE(edev, "Unsupported key set:0x%llx\n", - dissector->used_keys); + NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported key used: 0x%llx", + dissector->used_keys); return -EOPNOTSUPP; } if (proto != htons(ETH_P_IP) && proto != htons(ETH_P_IPV6)) { - DP_NOTICE(edev, "Unsupported proto=0x%x\n", proto); + NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported proto=0x%x", + proto); return -EPROTONOSUPPORT; } @@ -1860,15 +1861,15 @@ qede_parse_flow_attr(struct qede_dev *edev, __be16 proto, } if (ip_proto == IPPROTO_TCP && proto == htons(ETH_P_IP)) - rc = qede_flow_parse_tcp_v4(NULL, rule, tuple); + rc = qede_flow_parse_tcp_v4(extack, rule, tuple); else if (ip_proto == IPPROTO_TCP && proto == htons(ETH_P_IPV6)) - rc = qede_flow_parse_tcp_v6(NULL, rule, tuple); + rc = qede_flow_parse_tcp_v6(extack, rule, tuple); else if (ip_proto == IPPROTO_UDP && proto == htons(ETH_P_IP)) - rc = qede_flow_parse_udp_v4(NULL, rule, tuple); + rc = qede_flow_parse_udp_v4(extack, rule, tuple); else if (ip_proto == IPPROTO_UDP && proto == htons(ETH_P_IPV6)) - rc = qede_flow_parse_udp_v6(NULL, rule, tuple); + rc = qede_flow_parse_udp_v6(extack, rule, tuple); else - DP_NOTICE(edev, "Invalid protocol request\n"); + NL_SET_ERR_MSG_MOD(extack, "Invalid protocol request"); return rc; } @@ -1889,7 +1890,7 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto, } /* parse flower attribute and prepare filter */ - rc = qede_parse_flow_attr(edev, proto, f->rule, &t); + rc = qede_parse_flow_attr(extack, proto, f->rule, &t); if (rc) goto unlock; @@ -2015,7 +2016,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(edev, proto, flow->rule, t); + err = qede_parse_flow_attr(NULL, proto, flow->rule, t); if (err) goto err_out; -- 2.43.0