Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2844153lqt; Tue, 23 Apr 2024 03:28:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1CMX4VEm2tf9KeTa2sd+zL42zg1mGPwFiMvgsm7g7nOp1mm2cUIxNRENubM/T+WS+EA7vVvIPGo0StzNeueckhHzl65YySLjUkhYmOg== X-Google-Smtp-Source: AGHT+IE6F2nWSSetHX6rI1SuNHA5q3LJ3WvHsazjWLncYfsJoGOPb0GEFSJT3DtYXa5ZF0kLl/al X-Received: by 2002:a25:c712:0:b0:de5:5037:8884 with SMTP id w18-20020a25c712000000b00de550378884mr1694663ybe.12.1713868137275; Tue, 23 Apr 2024 03:28:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713868137; cv=pass; d=google.com; s=arc-20160816; b=YTNKXFSwe1kAx/0WSinPbzmXhmAAjJuJWLJwbY68g23Vu2kBwpDdrBTPBS8MAqgBA+ ZFqjP/PNhf2RrKlixBRe/i4XoTxC6zRALn7gYPI0O6SfVEuHzdaM4p5pnVVZmXyW4YWU UujxjOsaXUTlQM9x7F0VB/NEHlZw62eHp35BIM/nQsYVr50MQcbhNNo3Bc7jEPHXnQLG OVFsDJOUEhze88SBDgh5WdMqlVbCuyLFxrVToeEynqz6sPMZEgSmjWPPeK9jBWWYR3Ro YxdO3GkEeAE+56Z2PuhEIVRxSTy40hX8b7RGcdYF+3XVshyjx7W2syKIng7Mk8SSRvir 4jBQ== 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=Gb2urAC4J0+x1u3Nc14DivRvTyMKEHdX4C/ZGgfiG2s=; fh=H55gNw+1hb+/1gs6PFLX5z/jE2YzPsD8zDM+jpdqhyI=; b=C2e4mzlpfKo3hlHIZ8XbvA+sP6vs9/UKImD3CrQ4Pk7cVbXCHKDaJRKqwYxa2d7wuK ku5zFZjVgOUXv7RFjo17XX4KwDLA+NsAksjBW3BHpsTAcraORNx1q74zmMCqYUviGEuI b1l4njP69zRUXtltLlHYLliq5pOgEay9EoruKsodwzWVRw2rE3Dfds09PgPjutfpV2NZ AeBabgNRXxqPfemBU6c6XQ3m9gksCmda3QZG/vsDM0O1M/lUpnLlZbmjT4Sn5i3Jk4Os mUhZvV/iZOZ+EV8084krZBMmbTEeF6oJbPnJndXTZQpoGkL1LwP2E/K0oIv2iBEI+YpQ OuFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=uTiOqInZ; 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-154864-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154864-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 kj7-20020a056214528700b006a048e55a10si12324232qvb.580.2024.04.23.03.28.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 03:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154864-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=uTiOqInZ; 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-154864-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154864-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 03C141C2167A for ; Tue, 23 Apr 2024 10:28:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 331F97E10B; Tue, 23 Apr 2024 10:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="uTiOqInZ" 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 0AE0163099; Tue, 23 Apr 2024 10:28:15 +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=1713868097; cv=none; b=uxGmiRkYVKqnXEcR7Y4fAs0qx6uH8QTiIHfcpJoVlhnmDFt/YK+OfFmgXMxBQmFvQzxn73+tgTIntwwh1ShmKw7PlzCQatyrT+blcCzEiiVszGwzz0d61PrfB785Z1ZJhBPNTfA2iHAIyp/jXtv9LWOedkyNGA5k8kLTHI+GlTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713868097; c=relaxed/simple; bh=6KXD0oeK4Ss5GHj0EJM6H4ROKzmr2ymo8levWGdF1ZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RzruVgWlJxFp6FXjCTmJwDKG3SeaW+HA9IZ3xtNXoyMAMIrdybQokDtJyBFxHPo6qTQAZZc4vUXW0cyQGRuMAO0ya4vVAWNxjpfbXkUXzAlm5qxxXJ6RJeBMl3QUn8BIrmwguWxXHk2P/QdHa8Rrp2iADzNL5RZlYfkUBXYbaMc= 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=uTiOqInZ; 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 7EBF4600B1; Tue, 23 Apr 2024 10:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713868087; bh=6KXD0oeK4Ss5GHj0EJM6H4ROKzmr2ymo8levWGdF1ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uTiOqInZY5CjiGeY9wc7nv9OVyi+q3o3i/3szMxy/g2GwwdSdha8NTWXY1oVviXYX Rc8/ol+2oS05mjKjZCGcrBVKz53S3TBydH17KWcVwLNvn8Ql8oUq+Jmm4Fb9qUAhqj GVOzRC/mh/O+VhMIv9XFdAlKBplc/NbO1wZgg8DfTqX4oQRTFQ9w6H926cVLwJuT27 zAkkK3tw1fYr2dep0Sz24J5XhtLvYrka+zCsgofgqO4YpwbQ8sWLAUjdnSHDpHyNuZ Oy6mBaack3mxyd0O6CJK7uZMnkGSMMoTXDDBDHApy5lA5sxolxoVzbf7HwhffINzLV 4D0je5lQlJZhw== Received: by x201s (Postfix, from userid 1000) id 679AA216B8F; Tue, 23 Apr 2024 10:27:21 +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?= , Horatiu Vultur , UNGLinuxDriver@microchip.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2] net: lan966x: flower: check for unsupported control flags Date: Tue, 23 Apr 2024 10:27:18 +0000 Message-ID: <20240423102720.228728-2-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240423102720.228728-1-ast@fiberby.net> References: <20240423102720.228728-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/lan966x/lan966x_tc_flower.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c index 8baec0cd8d95..43913d6204e1 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c @@ -76,6 +76,11 @@ lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) goto bad_frag_out; } + if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT | + FLOW_DIS_FIRST_FRAG, + match.mask->flags, extack)) + return -EOPNOTSUPP; + st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL); return err; -- 2.43.0