From nobody Sat Nov 30 02:56:57 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013057.outbound.protection.outlook.com [52.101.67.57]) (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 CDE5874418; Fri, 13 Sep 2024 15:29:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726241400; cv=fail; b=G9P15xNBTZGtY1ZCN/bZgNukEgeFKAiWCRTIm/uMsFc6kobWNKYZWVsOSIXKxJp50xcl2ewLj0YYQuBdZyz4RA3b3Mi2awMUEQAtwi+t9zPqLNxw26O5L914RA0y6FHKUrQ/tjg4GDx34+TKzkzdeuEWh2sDpBml6kLYOoVjQg8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726241400; c=relaxed/simple; bh=KVWVyoBg2tKcQbKCBA2erSCDIOauYYuwn4e7KjUCoYc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ZV/qQOn9I5XdrovP47ZGKDGkgTnfnmKrDDVhaJksAQio8yKBOp0auyyvYtTAyK3UHRGyHDCx5sq1NiJZQ7h3f0Yf4xmqJf8qlfNdZhnis/NezheTIR3mCuwwu8mFuCkAcUROIs8mdQDlmgL3/TOLONyoFqCRtCOpjeDmf/qcQ14= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=TLDd2ByM; arc=fail smtp.client-ip=52.101.67.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="TLDd2ByM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PL68MsaKh3VFvPuoHQATrCb7K12vdEClLyhPG8XWE1uDb0kv5zLZoi2ZQgUa0uj6Ld7e95bnFlQ8Bh8cfd/VOIJoSgn6+lxZHTAAvwVD6ODaBaKJSOATK6CAROo/kZK8/xOw0tYSWQSWIh39FWEc/47vghrLiqGof9T1sSrxoNias075mzbl8IPIZWDWx2ddz8Fa4lcge5jqw92HBuhOsqN1s2AdMA7L8/sEvFfNDKtUXOyD5b6SEtCeXwRq2CPmtBpJCY+ae5O3JREM9S3OQWxzMYrBZSjUHUA+MlKV/4XMJwhD4y/iUUpmBhkSz47KJ3RGppAwxNv+anIWPIC5HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Jiq7VkQ5r0Gt4T+SnucsAAt3eUWkpw/ZrSEdYpTcxsM=; b=QfzQfDJuM11ncuFXsmCrt4Eiu3+qMxTPpLc8qJp+DZRKDnqrLW82Zl5/mezb8+FVZPNkLu/4BfQ7pcruvI6FgFsNC6WmmwSkf8YrWriMzTgyO5R3soW4goO1WIeNxpxQTNYoNC5x7720olsmm7TA31+fFBYyJX/S9jggsG1Gk5HvvPCCZKi7AJV0666nc7ytJ6oDfuEoas55o7p4sMxCwLoStId75KmnTGan5RwzUQyB6bJawtC0Y4mVrUVBDngPZUs0qyoZBIMt7nesiIjFpxkZV3gR9CrpgEr/KL1+UQaMlAeCxgGhG7gRFRjqBlBsDSv9+XYMdNg8F+b2T4FExA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jiq7VkQ5r0Gt4T+SnucsAAt3eUWkpw/ZrSEdYpTcxsM=; b=TLDd2ByMsgUi8ZSq2UbX1S/aMAjZxXONfqxUi4NFRGFGMZabCOpRkeV/mzy1491yxSr7i0Pk+p3J9esIhOgkmyGdP6hOz+hHtNw2Wwft51XXtdycD/UEGw2RniUCaZr1HPAR0Nsd9dFAi1MdP/202WMhn9EgWw2ZvKhV5bIKnCcUaOAPWGPS3yKZnJp6O5I5nFbtzeAD+JBnK1mRkQKvyDU0xtdXifBd5lIXI9d0c8rBYxolIk/6hTFA+Snhgv52WUegXgdDoJoTgtKkU2F3itbhNK9B00e5u00hCwbC7g0amdvSZDRkXC+p1igmxA33grIlZhoAILj8wsYP462zSw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) by VI2PR04MB10859.eurprd04.prod.outlook.com (2603:10a6:800:278::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.19; Fri, 13 Sep 2024 15:29:51 +0000 Received: from AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2]) by AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2%3]) with mapi id 15.20.7962.017; Fri, 13 Sep 2024 15:29:51 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Florian Fainelli , Petr Machata , Ido Schimmel , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Jamal Hadi Salim , Cong Wang , Jiri Pirko , linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next 4/6] net: dsa: refuse cross-chip mirroring operations Date: Fri, 13 Sep 2024 18:29:13 +0300 Message-Id: <20240913152915.2981126-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240913152915.2981126-1-vladimir.oltean@nxp.com> References: <20240913152915.2981126-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: VI1PR0102CA0005.eurprd01.prod.exchangelabs.com (2603:10a6:802::18) To AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8PR04MB7779:EE_|VI2PR04MB10859:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fe90960-c944-4bda-e316-08dcd408e8e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?+Qd6tFvOJkPaz/tcruIlWHZgFP9icAK8Hnqlp1pmBxiiEk0sWYKIBLXE2sf+?= =?us-ascii?Q?7CDKkjacoSKZ4MQblgDVQiNjNZD321UrEMZtAgIzsX7fkBmxY5cCrTFvoZ9u?= =?us-ascii?Q?ZeovDu0psMSoB6acgzNzvEDxyPU/FC70nt/dg2isKhkJop/RqQv43hM34sXY?= =?us-ascii?Q?1uOtJr/AkJ7S/QjwzAIQUvYFdGJnltuYOLBWoRAwbuPm5pQJu/c2POg1GX3I?= =?us-ascii?Q?1J4I2bNyjyEpzcQX9wkXcBniMvJ6C+khPDl44rblFTBilcunt+7SI72VdzrL?= =?us-ascii?Q?TRidDC9UHas8wVgzpkgXZERQM60bG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?Q?mt2sDHacyvj1bDGb24lYcGdQ0DF3nV7RWFgeR3Bq+SHX6cJ656tIFF0wP8vJ?= =?us-ascii?Q?+1vwjBZTJ9KqdezTTSRMCooVSYv8/uoFIx04Arkh1yaZLmrbgahx7nCACW4p?= =?us-ascii?Q?Cm7xpRA2SS841AGReMTUtaqRBA0g1XZx2OJXCsBuavfnVt8a0WmwENj9C8Ky?= =?us-ascii?Q?WE8wkTkPU0ycs9Vo8GnHWOSFL1PPvS9WsRjsfJQlM435hIRMpg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR04MB7779.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(7416014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?CrGoPsej3W8IphdXvmMBAtvnRhhJemz/jen2kkBVr0iD0BXUi2yoLo7EVd/U?= =?us-ascii?Q?R23m7zzJqoVHA3y5KlLNgzIoaEUzY1sIzoD1QTE1/3FBa+hQGS59NewlnjIe?= =?us-ascii?Q?C0RLuUjPQj+DswZi1rpgGjDTsqVcUUwozfGs8XpYLhcv1pA5qnRbC2q0nvqG?= =?us-ascii?Q?UNUbclBlBzcDGaoO4+3r+qOw+s1pRN/LmgbBomQai0fU7arxJKTF2FjpT0A7?= =?us-ascii?Q?VL4F6Geko6wedNMnRQsCarwiYdiz0NwOiLsv3ufJS185IYbpSwf1UtcROsO8?= =?us-ascii?Q?1UOQj7QvW8y409mqjbWx9Baqo5O/B4P4zLgz+c2jVPUOQRyOKLuwTXEV3pS4?= =?us-ascii?Q?gytXVCRWePt8Ij9EuiaqdO09/lTK546kynvv4W3egTs0LjL1aEvIBPfMnOdl?= =?us-ascii?Q?jhFVSc9VZUtPLtpfhnOC0Sq7Uw/RVpZFORBa8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yNr2CO/33e1eZ0z482n1vhRL9BkehLYjkYtgSAZSFebg3wckkT8D6zqgJt3a?= =?us-ascii?Q?N7017MLZH2j709WNRi832FFRzRCTPtig9FH14S7QTGf5ZX6vuERGJf9IABO6?= =?us-ascii?Q?omF6If16GcQRBFxAgD5NBmfWL1CofC6I3d27su+0xAX+DfV8krX7R9bLuTvM?= =?us-ascii?Q?cGGPDIqZBptubNcX7HQ+0hQXBepTzFyX83HbHRJYTki2XvnVVPBB8WpfrE0Q?= =?us-ascii?Q?aJGpVbSX52OyPf+I7GLaHaf9kFk99V+VNDR8zX8MnoSNVK2cRsOPr8HzLFO1?= =?us-ascii?Q?xA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fe90960-c944-4bda-e316-08dcd408e8e4 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7779.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2024 15:29:51.7118 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EvRA0KN7WCsOG3LDM70EYJ12cYtTOhqgKg58AMVTxwfUxbqU20Qf2FtNN/r5X15V5AyoOCHX38KKRFLHzQlyqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10859 Content-Type: text/plain; charset="utf-8" These are not implemented but are not rejected either. Do so now. Signed-off-by: Vladimir Oltean --- net/dsa/user.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/net/dsa/user.c b/net/dsa/user.c index 42ff3415c808..c8ddbe22d647 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1401,6 +1401,14 @@ dsa_user_add_cls_matchall_mirred(struct net_device *= dev, if (!dsa_user_dev_check(act->dev)) return -EOPNOTSUPP; =20 + to_dp =3D dsa_user_to_port(act->dev); + + if (dp->ds !=3D to_dp->ds) { + NL_SET_ERR_MSG_MOD(extack, + "Cross-chip mirroring not implemented"); + return -EOPNOTSUPP; + } + mall_tc_entry =3D kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL); if (!mall_tc_entry) return -ENOMEM; @@ -1408,9 +1416,6 @@ dsa_user_add_cls_matchall_mirred(struct net_device *d= ev, mall_tc_entry->cookie =3D cls->cookie; mall_tc_entry->type =3D DSA_PORT_MALL_MIRROR; mirror =3D &mall_tc_entry->mirror; - - to_dp =3D dsa_user_to_port(act->dev); - mirror->to_local_port =3D to_dp->index; mirror->ingress =3D ingress; =20 --=20 2.34.1