Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp607824lqp; Sun, 9 Jun 2024 10:36:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsbf7URBsqSyX/7cTthYGmOwJuFXZZ+ZaUX7MEeI0MqGeUsG5A5XaxQ9dBOjwjaAdFxPLiR7ALE4LRu31+jzP4nm88g4QYoTPKAAIRtw== X-Google-Smtp-Source: AGHT+IE4RXqjaGYd/tCXWq81VhGQicVnNi+tFLMMUUijui+PUETF4dTfwTmZrtj8Hnnt9SajcCGH X-Received: by 2002:a25:3185:0:b0:dfa:5a07:2396 with SMTP id 3f1490d57ef6-dfaf65e7420mr6769459276.23.1717954565766; Sun, 09 Jun 2024 10:36:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717954565; cv=pass; d=google.com; s=arc-20160816; b=EXkiiNNWmjKFRBnL4FQQztPQAiBYFIykX4884NvWgLefr9a9Q0Zuz9gBGwe/DjgtBn LCwbdDt0w/O6XxGUNuHICF4uQxZQL810fToKYJNBImqWSQbWjUeBzJkeSWH1tidkzDRz wgcObasVRC4gn0pNPhZQ/B2ho7HQCwd1ZqjeLU6wogsdV6choNblrhMERvlnD83SFBwX ek688M5K15Dkw6V4/ETCNxCYkJQ3znch2sdFK+MxwSMKZQJWtYErfNMkViRJ8K7jpeqZ /fTrpakfJlUFjj1veyDjCY5Jpi/CuUznlwL3uBh0HTdGjzm0bMXWLu7BQNX/0CL9Pcvm RSqQ== 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=nNTkumdBta08gIDxHhbCIB3WaKZAG26mzfa8zSbu0U4=; fh=NMJjGA7aflQMPIhpvsA4i+dCSr7fXFZYjo6umaJRvs0=; b=Bkf5KiHUSSH4Pufr6iMRp1iKiu5ErYbGsUs6PT1YioFfQEJH7L5S6cLMs/oogcALaN xHbp3GdMpH3DSh/V/X43EgTpF8B2N5d/TAeP05fuDnUQMZhq1y1qIM3M/LN4mnWHNdT6 6tkRdeP4skYJFFN0Sr4Bn9VvvjnHrMoLkollsxcTo9dBj/oOPtXEBHIdvMlzCSf2DU3T g+kp+avrIr8v20pFXuDyWQOyx74SqPx2QcddZf7MSAcAGgSKetI3hi6BinkGroyokwp0 Pi2SiWPgVM/KGv5gvPFnznclfFfuNrWiT6bo45aHExcHNlBxrLIZZDFcvLJOKH2iKPbh yVUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=FHLyEX5c; 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-207448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207448-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038b3a304si90657561cf.422.2024.06.09.10.36.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 10:36:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=FHLyEX5c; 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-207448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207448-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7AD5B1C209AB for ; Sun, 9 Jun 2024 17:36:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27456537E9; Sun, 9 Jun 2024 17:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="FHLyEX5c" 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 9D6CA4317C; Sun, 9 Jun 2024 17:34:58 +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=1717954501; cv=none; b=WymV+QW403bsGLOOVBRt8TI4+tQiCVoJesqXWeQxs5t/Jw3Hj/9Op/vFY4XvwRa6I7tJ53WIOOyzrfgOcWOc3Q2rUewu92V87QzbPQcWWhFWXtjcZJd0EIwwAAKXKg4/7pfet1ygt+k7cnFqMAMKYjYZ/cocCplmRxmstcS7SWo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717954501; c=relaxed/simple; bh=t6x1tv97EU9SAZz9jzRF2dm87Yph3Q6Qy9KKIp/7l64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HH9qi4MTSMCdtsZwtAbkfdzTIBKJalLGNKS67OKYDjGqaw8FqTJVIc8i0oRhDETdvPwMp95spCwn9vRpR/KsH6PrAeT11qoTzFOi6SBhfdt4Xoqz7/UmUc68nGLgZV0/mlaubWMr+X+neFSvNpGRo6fp4sW2BwAAy60PvpaJ8Rc= 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=FHLyEX5c; 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 E2F77600B4; Sun, 9 Jun 2024 17:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1717954494; bh=t6x1tv97EU9SAZz9jzRF2dm87Yph3Q6Qy9KKIp/7l64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FHLyEX5cFRXCMaCxEXQ9Yb3NUuOeB8ZXuW2/sZ2EbA05SJnsXnG1jGXc3cRd27R3e Lug9thFOPvT2s0r+YBLoZSIRjqW2OvQfyZVZ9BAwygRDnsCmCOi4y+T+WE24jZWUds bvu+gLbyPhNKRb9LOrval2YJ5BVtVGn0G4/9W43d5GkqyKl4Wa9UMUcCHjI77gofxz 5NuCgagsobeK1WsbwJRfqaOYGdhYo+Z/P5y+mU78OfW8Mp5sS0d/yQL+oYWFPaYW2Q eP2x/vS6LLYhYnqnr4wJQnfnMpw2aZwSYg/9cau9rdqW10Dr9qP6Vg34FZhwtVxkHi UorT6YIktC1eA== Received: by x201s (Postfix, from userid 1000) id 8C8052045EE; Sun, 09 Jun 2024 17:34:30 +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?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Edward Cree , Martin Habets , linux-net-drivers@amd.com, Saeed Mahameed , Leon Romanovsky , Tariq Toukan , linux-rdma@vger.kernel.org, Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org, Louis Peens , oss-drivers@corigine.com, linux-kernel@vger.kernel.org, Davide Caratti , i.maximets@ovn.org Subject: [PATCH net-next 4/5] nfp: flower: validate encapsulation control flags Date: Sun, 9 Jun 2024 17:33:54 +0000 Message-ID: <20240609173358.193178-5-ast@fiberby.net> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240609173358.193178-1-ast@fiberby.net> References: <20240609173358.193178-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 Encapsulation control flags are currently not used anywhere, so all flags are currently unsupported by all drivers. This patch adds validation of this assumption, so that encapsulation flags may be used in the future. In case any encapsulation control flags are masked, flow_rule_match_has_enc_control_flags() sets a NL extended error message, and we return -EOPNOTSUPP. Only compile tested. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/ethernet/netronome/nfp/flower/offload.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index 8e0a890381b60..46ffc2c208930 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -321,6 +321,10 @@ nfp_flower_calculate_key_layers(struct nfp_app *app, flow_rule_match_enc_control(rule, &enc_ctl); + if (flow_rule_has_enc_control_flags(enc_ctl.mask->flags, + extack)) + return -EOPNOTSUPP; + if (enc_ctl.mask->addr_type != 0xffff) { NL_SET_ERR_MSG_MOD(extack, "unsupported offload: wildcarded protocols on tunnels are not supported"); return -EOPNOTSUPP; -- 2.45.1