Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2361115lqt; Mon, 22 Apr 2024 08:39:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU84kNXXxXayK9cVXX18h0lDkbSYSxx6Sasgj5PG7y8YbV5YzA9Xgb2F8G8A0jVf2eIOHoydZZtEemIj3tAQwQJeKti3PMXsD/QDsc9Jg== X-Google-Smtp-Source: AGHT+IG+YOOKMy4eBmbGpdZ4Y30byRFFHTHEL2ioKBQvebwj4w2SA2Y6CfVrrVIyLDuEz80izW6Z X-Received: by 2002:a05:6a20:c901:b0:1ac:96c8:1310 with SMTP id gx1-20020a056a20c90100b001ac96c81310mr7557574pzb.56.1713800394737; Mon, 22 Apr 2024 08:39:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713800394; cv=pass; d=google.com; s=arc-20160816; b=MUyZ4a2xVMZd1JVKqOB0NSJ2j+R+VMGHkPj4fEW00WGr75+YOjMv12turQjpKddpQl DGEM/QqCTs2B2b+Q+DakXk3H8Ly+ciWHWZRbZz63FuX2i8L4Ydv52P/UkljIqTglBb3o fq5E6HiPh7Uj8P1OTEAugp7+ldfcSbs/J1LHGdDBVZQGlI8qHb4TBFCV8K7d8T47MAlC dRSaXLiDvqwX4yBTiAw7z1yoFcpySi5QA6DKMM8PA6PPr5xo0hKKUtDw5lM/Nr+kTNDn K2t7EaR6n3b6+zlHRukfuf9baLqYeBcRoPuDfSFeqz1Ej6RTEmfVf00F8tDEtWIdniRp s1IA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=Axf/xPib3u+vN0UPLbVW689q5XLIlkGI/ZBdgkzt5ak=; fh=57CQkbKN73D37QqlXlu7Qzq2e5L5TuxlcqmAH/I/sqU=; b=y4uVUNScM8dQYLhFs/cG4NRMIple3JFoW4DX3Ja0YqCpjPeITibdsLwDKr46119/yk QWpJ/78fCu9ysVbPS0zVMv2Obu1gyBGSG4+zUFNL2xTHszDlqnnjDNb5lYoQORFdE1r+ e6kekDEfryBjV0jk+KudJxZicJ+zLzBFXWjwMqCY8oZ8snSVazaFa40witooh+j8cO1f Kk5oFBc2lcbB2nWsXgJi4P9smQd1akjRhwUKVMjfgSkecGBdvnQc8uxNBq3pJQolNWrQ w4/F/smifk1uIxpvuTqpQ+YO/8yINQEoD7c5tlzgyMJSMT/u9bVk9OAPIeFgwRs92a0y Y8Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=LzIvlSLN; 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-153631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153631-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 x21-20020a62fb15000000b006ed5ffbafe3si7823217pfm.84.2024.04.22.08.39.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 08:39:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153631-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=LzIvlSLN; 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-153631-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153631-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 881C1286118 for ; Mon, 22 Apr 2024 15:28:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25B6D15381D; Mon, 22 Apr 2024 15:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="LzIvlSLN" 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 AB8A4153815; Mon, 22 Apr 2024 15:28:03 +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=1713799685; cv=none; b=NvgZVR15j2gOBAxugph7HJ875e0rALvrf5QP2M9fXzshTNPpqC5KKGmDUXdM9LWcCxy/ErxIqG2gzca5Fg40ZjkJztrs7QrOdYH1usFyMFO63yCDNwwd6MmUlhqFkgDJ7nJ0uGNk23rZJ85gNU+I/CRjZ65tTWUZIm+iFCU9VAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713799685; c=relaxed/simple; bh=Yxwk2rzoT3ceJNHFybYzVsfwPWlLFknDIb0RH9YnCdc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=C4YxJh1WlO03urYaWaTPYkz5Yncvzao95M5GbDDcG/quI/BWWRtVuCxBRl1EUhoY00b9FJvqZXsxuUwMOXL20BwMuzOVjrsjNwcBP6wh3qDWudVePW3P1MM8Rwx6hF73KAk8ijJNuOKjiiJvemkrF+s7gkMSfAlGq7+0Zcqn8RA= 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=LzIvlSLN; 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 892C4600B1; Mon, 22 Apr 2024 15:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713799681; bh=Yxwk2rzoT3ceJNHFybYzVsfwPWlLFknDIb0RH9YnCdc=; h=From:To:Cc:Subject:Date:From; b=LzIvlSLNdhL7UaTTqaNKdMdwqcvrycqIIaXmFSf6Jl+5mZwEeE5+zWtwkWUk1xjAl h+DYBKWK8H+aQjdJ6+gyHKgj9xCEGpjojPCv/xeXYW2C7Wvj+BuGVJo6A2mgnbslpe 2DvtBglRRAG+YuKOxfnONWbX1omtlu/NMo0W+CZ+CG5rsY8nMBHhYm3GP1byFbTE9d gXgKG8Z2uIRVqUcEZo3HrEJrP4dfnhHR4KZS72rEXZa4IVYn51MoKc3SM+UwXgitSe ck7tQcHypfOZFy0iZ/QB7Gw9JC15L48EMgnXOXi2WbDdIHFaU4MmuK5IktfObLCjym r5VuhdaQZl7xQ== Received: by x201s (Postfix, from userid 1000) id 81A89206FD8; Mon, 22 Apr 2024 15:26:49 +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 , Grygorii Strashko , Vladimir Oltean , Roger Quadros Subject: [PATCH net-next] net: ethernet: ti: am65-cpsw: flower: validate control flags Date: Mon, 22 Apr 2024 15:26:42 +0000 Message-ID: <20240422152643.175592-1-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 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 This driver currently doesn't support any control flags. Use flow_rule_match_has_control_flags() to check for control flags, such as can be set through `tc flower ... ip_flags frag`. In case any control flags are masked, flow_rule_match_has_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/ti/am65-cpsw-qos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/ti/am65-cpsw-qos.c b/drivers/net/ethernet/ti/am65-cpsw-qos.c index 816e73a3d6e4..16f192a5b160 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-qos.c +++ b/drivers/net/ethernet/ti/am65-cpsw-qos.c @@ -1008,6 +1008,9 @@ static int am65_cpsw_qos_clsflower_add_policer(struct am65_cpsw_port *port, return -EOPNOTSUPP; } + if (flow_rule_match_has_control_flags(rule, extack)) + return -EOPNOTSUPP; + if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { NL_SET_ERR_MSG_MOD(extack, "Not matching on eth address"); return -EOPNOTSUPP; -- 2.43.0