Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2843941lqt; Tue, 23 Apr 2024 03:28:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfkLfMhi+IgbsSdlZ0mUkvYqFBqrSxJ7ZzJoc5qQr9t8QGpM3VssV3qFcMF8032QLN5zZuHKrCpOTi65uRDJvw/o/aGjlcxk9HurC4Mw== X-Google-Smtp-Source: AGHT+IHH99l6SkblnN6ubLlfUQxr7t6XEe4rX2LexSoj5toLOF0xX9w0zj3DPKnsI9TLDOsJNIQI X-Received: by 2002:ac8:5813:0:b0:439:dfd8:5d96 with SMTP id g19-20020ac85813000000b00439dfd85d96mr2704192qtg.39.1713868106383; Tue, 23 Apr 2024 03:28:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713868106; cv=pass; d=google.com; s=arc-20160816; b=jCoo5AlmtzwEsB5cV6bRylXkevU8gjg+ULXimsmm768PmUmW5giJKSik42T+JQQDAE nMbsRsRtRuotAw2dF34xkrngO+5N0BaO2URVZtNs7vn2bDlaxBJBbBo6XxTA1dnDD9Lz zOmpTskWJlS0sOJzFwVwCHFd7eNLNVWkSxNl5B+BhDv7LYHofxG2nbv8bad9/gdV7Nek U2enUOqnpP5ELKIbcpFHn00JyLQRESj4jpJRH12Qjo9y6lSTObqjh5YX7P8/zecu67Ef hDgQq20BYGK+3B6SZkb5ekpVEQKbsRhl5fApaRh4utscfLSwTTNbpLD6OWCpK/IT//Ti 0bJg== 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=U4+Z04VE2kvhDEyWoqoaI8RWWCcw0Q9dpgsdm8dl/hQ=; fh=VaGZNRtL2a8L+IBErWotuWnhUHCanI2uY5tbzuzsMD8=; b=urNIKCv7u3j/8IQi+ej82PesHYajW013lsl/Y6v4ftvPM/8k1mu8i9+8Cl7gKfoBhD 2y8QLaw+OK0H0uvJj56XWOf647RcwIQOpstD9jajjARXBNbRWw8ATE9bAVF6cD1ate8Q L5OtwF3+Xdp8ouX1bZj6GSNgax/7n4HVSEuGDzwM7knjgRCEQzibTe6yizIBnwrYMqaM xLs/rIWYAJIaOkirzTkBV0nVMEyEDkdDwnrjCzBKVihLH8QOXuVXNeWcO/+iiAqw2Mix 2cUH2Me6nL2HvkptWJmf5mUjWxB6cQCeT34VKE6277/pGU6qJBW6ovy9X/FtGKTtEr8s PRsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=DRopk1Cb; 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-154861-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154861-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 f28-20020a05622a1a1c00b0043762cc556bsi13028560qtb.111.2024.04.23.03.28.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 03:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154861-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=DRopk1Cb; 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-154861-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154861-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 217131C2160C for ; Tue, 23 Apr 2024 10:28:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94E22651A4; Tue, 23 Apr 2024 10:28:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="DRopk1Cb" 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 04E9560267; Tue, 23 Apr 2024 10:28:12 +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=1713868095; cv=none; b=tf+YotlAzGDpjTxS5Z8RxtbUzjBhs6aNKLxiWoqYNGF1STiUh5Gg/+yJIWLdIWu1bOxPiDdgGUSxcYOByClvMDyZ08l6uandIFs2ZT5w9+3YZnKqF9Ck6D6b9FSYdelj//Qn6sv9mv+OycJYBNdXIcT7nHsdQcOOhk+uqolzbzI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713868095; c=relaxed/simple; bh=39WhF6eCSOF/ZCUdao6fmDVARxWuHqpggCtYOqxbRdc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f3IAcp5c6a7S4XHfMWDuILc32rM+IKvqoPnaT0DGm6GmSd0zOkv7/U1NMhlaG5o7xdgdHlkVYOipMFZAMw8U0lDDcI9kV35+Cw+5g7KJtuNemAYbgaOlFCXKtlBU9g59c7FwgrvZUzO4lreRdbV0mSouLmu1O1D95cT1URfaxk8= 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=DRopk1Cb; 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 29706600A7; Tue, 23 Apr 2024 10:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713868084; bh=39WhF6eCSOF/ZCUdao6fmDVARxWuHqpggCtYOqxbRdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DRopk1CbxQFpR7TwvdM4LduXW51OoycFf176Xzt0GSHWRVRlo9Sa+0GfjFY3CopnG tLAyQFME3G2F3goHqEyYYyjrxDVNSURLwnTsRa678RL1cgZMh+eMTtPLlZlgZO5IHw R9epoP7Li6mTiNjf1ns9eO8YfP/6J5dLkdRiuURfFFpwUv1FxJCV5mzpN1OHt2UMyz HsmMyu2SLZ12JRIpB+4R+tJ0qrDwz5gXFU2EZBro5v7TiKYKem3y3ndNGi3Uyvb2FL av/uwjNBrdv4GXtyAlY1FHLoE087RSPnHgFT9pXq6teEA4leaqRQYNPafcGHCpo0MD I2KEwvAYaSHTQ== Received: by x201s (Postfix, from userid 1000) id 61B34216B93; Tue, 23 Apr 2024 10:27:29 +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?= , Steen Hegelund , Lars Povlsen , Daniel Machon , UNGLinuxDriver@microchip.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Jacob Keller Subject: [PATCH net-next 2/2] net: sparx5: flower: check for unsupported control flags Date: Tue, 23 Apr 2024 10:27:27 +0000 Message-ID: <20240423102728.228765-2-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240423102728.228765-1-ast@fiberby.net> References: <20240423102728.228765-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 Use flow_rule_is_supp_control_flags() to reject filters with unsupported control flags. In case any unsupported control flags are masked, flow_rule_is_supp_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/microchip/sparx5/sparx5_tc_flower.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c index d846edd77a01..f81d89f8f620 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c @@ -197,6 +197,11 @@ sparx5_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) } } + if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT | + FLOW_DIS_FIRST_FRAG, + mt.mask->flags, extack)) + return -EOPNOTSUPP; + st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL); return err; -- 2.43.0