Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218095/?format=api
{ "id": 2218095, "url": "http://patchwork.ozlabs.org/api/patches/2218095/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260331113025.1566878-13-wei.fang@nxp.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20260331113025.1566878-13-wei.fang@nxp.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260331113025.1566878-13-wei.fang@nxp.com/", "date": "2026-03-31T11:30:23", "name": "[v4,net-next,12/14] net: dsa: netc: add more basic functions support", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": false, "hash": "b8e7422acd24ec157ee0fdd4a45171c8ff087256", "submitter": { "id": 84380, "url": "http://patchwork.ozlabs.org/api/people/84380/?format=api", "name": "Wei Fang", "email": "wei.fang@nxp.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260331113025.1566878-13-wei.fang@nxp.com/mbox/", "series": [ { "id": 498181, "url": "http://patchwork.ozlabs.org/api/series/498181/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=498181", "date": "2026-03-31T11:30:11", "name": "Add preliminary NETC switch support for i.MX94", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/498181/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218095/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218095/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19077-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=bp9z3mvy;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19077-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=pass smtp.remote-ip=\"2a01:111:f403:c207::3\" arc.chain=microsoft.com", "lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=bp9z3mvy;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=permerror (SPF Permanent Error: Void lookup limit of 2 exceeded)\n smtp.mailfrom=nxp.com (client-ip=2a01:111:f403:c207::3;\n helo=mrwpr03cu001.outbound.protection.outlook.com;\n envelope-from=wei.fang@nxp.com; receiver=lists.ozlabs.org)", "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nxp.com;" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flQsH1Ktkz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 22:30:27 +1100 (AEDT)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4flQs964FKz2ymg;\n\tTue, 31 Mar 2026 22:30:21 +1100 (AEDT)", "from MRWPR03CU001.outbound.protection.outlook.com\n (mail-francesouthazlp170110003.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c207::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange secp256r1 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4flQs83Ptqz2ydn\n\tfor <linuxppc-dev@lists.ozlabs.org>; Tue, 31 Mar 2026 22:30:20 +1100 (AEDT)", "from AM8PR04MB7284.eurprd04.prod.outlook.com (2603:10a6:20b:1dc::8)\n by DU4PR04MB12064.eurprd04.prod.outlook.com (2603:10a6:10:63f::18) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Tue, 31 Mar\n 2026 11:29:57 +0000", "from AM8PR04MB7284.eurprd04.prod.outlook.com\n ([fe80::9cd6:51bd:82b:98dc]) by AM8PR04MB7284.eurprd04.prod.outlook.com\n ([fe80::9cd6:51bd:82b:98dc%5]) with mapi id 15.20.9745.027; Tue, 31 Mar 2026\n 11:29:57 +0000" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1774956621;\n\tcv=pass;\n b=ciG1MetHOvkjMlGHWbiO3P9devz5S9aKjZcm2lBATHPA6pALTia9j1UfNZXRghYeebZqhFjF3YLcS/fHWGtPjy+2EvbClas0KvFt7yKsL50ZgJG6rKVonnahLBS4B2FwzH2yQrhjLrmDIDzjS60xyjStKm/pxNSmFNG8tYfUaIA1h7edMOwplmNZMVS2pcYOqT1U5S7jL4XGYulSQh4XK3s8jyg1wvlt0TGGJr95x+jdzNA4Yu93hPYqiQFsQPUsz6inVr9GfOOvwz4c7EOQakJCUxedLMpxvIqzUcZ2F2OVaEpB55s9nRumXvc4U+A85xtHrxHovrRQnev5Bi5U+A==", "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=i/FZNa8lgU1YRcDl2VtToij/SwxfqGiiFqvod27aZ5M/YomfyqO7ZV6+HOd1ZXtue3+3xIY90qq29cfI3rah936JKsqnyYafRZC0nXsw5n21CxJSOWub0JtVw5/lsOFwSwe+YZSrcWrOZImJ7dKC6o0MYkjy2io4gcfC79ta1eIE6hFbrpMDP0MtOQIyoFJH4os+iOBHXSmIQlvo/P9ee/f8iysAQ7PnX7IqrF0OEkegJVRUYgc39t5e9NsH1qGlVnMGxasT69Krg6G1VuSd98hLcQfSI72iZa7HKfkGHb6lt07A6xip76he40dMG6KwzQJbyukT/V+kEwcmwM3seg==" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1774956621; c=relaxed/relaxed;\n\tbh=xmHvBUmVU20yc5EpzfL97T4Jip0rZQBOGpCZeBwrrfo=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=LWH3HTbKUhn5m4cvDhd+GewcxpJ7pvuWHfeI5G7n+6xrBJxbbSLmhQjJgoa6hr59Xrrlb9OMJQjjXfiElK3D0VP4LN+heFjWt80VfsEZPBAHifwKH/53kSjdP6kHHTLdRATpddwLaGXsUUl7Nkbu2yLlRu2QCpa48Djz6zGuHl3qpC04rOwIBgC/D1rDgEVEIbiTOTNQsaRzbIGrdtQqkkZZV+ubQm/+I5p+f4XeVZQriv44oHb3qNPl2GOmdlPjaw3rPrahtMUvSDgKIDBlcuQ1uxtjh1RT/MXv3GDXtMEnjXGgwuzUFnbxuB/Evf4DCKtbqYDJlmMdW6yDoohQpg==", "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n 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;\n bh=xmHvBUmVU20yc5EpzfL97T4Jip0rZQBOGpCZeBwrrfo=;\n b=ZMXU8jD4lRGR7eik3wcYLnpywJdSzX0Xtw6DfKjXUvZRXZxC1PV7DEYFH3Bvr94zmcrCg8weoF7GidQkGn6Huqumx+jz3DbY521RaZXZ4bS+qy6RA+B+I/Wai0W1GBvFNdrfjykOxBNCkVisML8l1KwvVpLo216yBEUeM9i/PJE4tjH+1tKzCepYeOthSIvIk0P7GrVUV+XnrBmPKf7nDvY/KLkDzxgKIBAwIrYz8UqsFT8e9zS84e7bNGotn3uopRs8x9hMRBDrPRP2l6XJwJwIPQ7ZI04BdZWbgCQ2bWwtqo2aEcOs7Ul5u6abQWMcFW5ZgHn/ki0wsBFIqYmowA==" ], "ARC-Authentication-Results": [ "i=2; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=nxp.com; dkim=pass (2048-bit key;\n unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256\n header.s=selector1 header.b=bp9z3mvy; dkim-atps=neutral;\n spf=permerror (client-ip=2a01:111:f403:c207::3;\n helo=mrwpr03cu001.outbound.protection.outlook.com;\n envelope-from=wei.fang@nxp.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=nxp.com", "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass\n header.d=nxp.com; arc=none" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=xmHvBUmVU20yc5EpzfL97T4Jip0rZQBOGpCZeBwrrfo=;\n b=bp9z3mvyj4CDCPx/xSglIwZM5AYqZJAN1e/jGWSbDWXcVlVwrSyqyJ1RYl8FjqoQJPnbDxPd/WRv9lgzr5K0Q8adRecP8J5XJ7tiz9n7kJ8Koe3xQ7IoPQ5zDy/+E92+43sYArvFtPEWZWEY+ueqBAVBImyvg8S+IoZZ5hjHW8Wc2V7niaM8Ae7bk8POGMPi+z3KuvSE9SMcwCV0KBOI1wtYQQJGmUVYrA16EVcIXH1WWALtkNEdlFHsi4jOsam0Sm6dcXXJRnP6c1Fk7RKtR9Dc+OwFjeLRiohV7Bay+2hWn8ZvkV8ifddovHq5Z9KNgRJDGjPD2pJ0TOqNnaf5LQ==", "From": "Wei Fang <wei.fang@nxp.com>", "To": "claudiu.manoil@nxp.com,\n\tvladimir.oltean@nxp.com,\n\txiaoning.wang@nxp.com,\n\tandrew+netdev@lunn.ch,\n\tdavem@davemloft.net,\n\tedumazet@google.com,\n\tkuba@kernel.org,\n\tpabeni@redhat.com,\n\trobh@kernel.org,\n\tkrzk+dt@kernel.org,\n\tconor+dt@kernel.org,\n\tf.fainelli@gmail.com,\n\tfrank.li@nxp.com,\n\tchleroy@kernel.org,\n\thorms@kernel.org,\n\tlinux@armlinux.org.uk,\n\tandrew@lunn.ch", "Cc": "netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tdevicetree@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\timx@lists.linux.dev", "Subject": "[PATCH v4 net-next 12/14] net: dsa: netc: add more basic functions\n support", "Date": "Tue, 31 Mar 2026 19:30:23 +0800", "Message-Id": "<20260331113025.1566878-13-wei.fang@nxp.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20260331113025.1566878-1-wei.fang@nxp.com>", "References": "<20260331113025.1566878-1-wei.fang@nxp.com>", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-ClientProxiedBy": "MA5P287CA0151.INDP287.PROD.OUTLOOK.COM\n (2603:1096:a01:1d7::14) To AM8PR04MB7284.eurprd04.prod.outlook.com\n (2603:10a6:20b:1dc::8)", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "AM8PR04MB7284:EE_|DU4PR04MB12064:EE_", "X-MS-Office365-Filtering-Correlation-Id": "1f2725fc-3d1d-43e2-6f7f-08de8f18d647", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "\n\tBCL:0;ARA:13230040|19092799006|366016|1800799024|376014|7416014|52116014|38350700014|921020|56012099003|22082099003|18002099003;", "X-Microsoft-Antispam-Message-Info": "\n\tjG8l6ekWSfDlmAsfD9xEMDNIEM1w0uWf7UXSuYPjc88Ax88J2xOEwUE0RRPX/4YJAhLG9k5Ju0tNTthqnkNqLUI8XmW3jdVzisJUK6lWNjlxSt23at5DmM3hWZ2/6TQHkuFNvTUKOcdBYGT1qWKlBMWiraiPpGBuE6qUQ62B2xEX22oxF+Sgw6hBo6Xb8wg6w+qpIK6Pt+PMdRrQqyt6jV4SnctARxGIumFoFYJ10rIzPBrmM7Hcm2LH+oYe5S+zvcGnw5+Q3icUyy71qXQIm+8fn6xhMvd1Bct1xCLTc9ohnErkpbTBvoemX3CNdJ+glypru8BvDW51VOKWwe/8r3OUl/bWcRR/tqmPH5QNvyRtFsQG9mDgQjRbcDaDV1Jl1CVPw2c7btm3cXeEaFE7Q/KgSwilRYryscIzSNs+GWd74ux/cstKyeEP+/scWUCRTRrFP1AvpjPsmDTw/JjgbPxqHIbyfkWbXJVaAYj23DBZ0RH2KYIcA02NMD/R+Y3Yp+o8a8eLjjZSGA219nauAPL8z35WnaJeO5Um94OPk36XdUHwM5deTlo4mfZrYhPh66HR8JtkGLBnok9oFK33mLNy/veMKof1rE4BEywEUB8J75yNcKCAu/wmFvJGrSLOZ5LxSam6Onusf81RgDjEFOYTPMKCkZDAbWQ2tmBdNGwS4nk74bqKurt24DWoos02spQnVSz5O3wB9uEOthDcUAnNwFjU7yl9OkRPoYjXVKk5gnCmiezQnh7hC4n/a0owoKEmN5pf3UkLWe02VFgEaF5M0bFFiO25CPGaCDgOdYbgi/bsNCUTFXYuk7cccX2M", "X-Forefront-Antispam-Report": "\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR04MB7284.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(19092799006)(366016)(1800799024)(376014)(7416014)(52116014)(38350700014)(921020)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "\n 72uy+q0W1rtUmFrAITFzczEGKTMJeewXijE1fPVBUC1Ch8jnpu6WH/EwEmF8XPkzIzd6aVCTD15TIBDp8u2iboProphhY8/N1r3VNSZBrqL/hTvDa3Gs1/laUia4/a5W8Q/qVk6ktSIP6QVZibgVrpgiiosIFT4o9H8YRt/s9DEW8u+LQxpBetFAylpV9SHbl6PYBTA6QNSqSbkdxU+yqY54yoaybKT2rNBJ0OWAgtADfYhyTh6/56lQ1m9bNmmbH5O9bx2dNRXEVkVMe/evDwIXYgYVWtQPT3bpNXrUbC7ub4m91aAgE4g9EdQmMbEZaO6yKJvllAScp/yEYWM9P0iqRtvnPf/jCQsj3sn7gH1CShgpM9B7i4BMKfxHVJRwu9yUf9E1bx3VbScBvJBPyEz3K1R7I/3UzexZa9au5c03EVVaxFcMX/2TSSfKfHzrAxoUgSN3wQeX3zKQuAKkwX1ZyOMT51N9CfegcEtEseUNiIhUFWaHfnJLcd1xmMe925bcicsemPCgDBZKUVuPzjXPzbCSYFZ3I9SSQ8DkTFlRcYez5fOagC8eIGUAUgRo1Xhusi717NWEyhM11dIZG8vwiSN88TyobXyXakoxHa5jj8zQO4Rzz6w8YDpF3UEAFqO0fX9nRcP0Ub9ns+6dcNojbdkPBTmAnVdgE90DB1m755FIsEEX86HceIJGkeaveFFqfN3u4VyKj1lb+IQRAMkV95DProIweeUnq66C2UWDTg+8TKczGx5y7AReOIhIgKiQ0anuCokAL0s+rNJuY4DEdELJPQnpXJx4IUWJQpnDiDmvTNchBwnaNmWVnrdV3j05Z9xDAkAsoLLyxPC3/gPqb6aMLou6QIFB7lhR5SRFEU1qHuyMO4HCxz+QoMh3gMdlaDnLGeDIKkjzG4mOSHnX4L35GRIwECSFZzqox5GCuP1BObj1XIkoV8Zm2k2+PQhJU1zxG92qwMJVlMksCpdLVLBAjgC7cSKaFR/eHmz212c58nhBagVgwZGgFLI4cdrJBo0Op2UQxvToDe84qXciXkTg9S3fcQy6vHPUMqa82+YnxuBYf4pG+s8LHDGo16Cs2k/uBLrccEpfy/rALdiIGTViTOVT8dBLGtV4xB+iaVwpQQzpx8pJeSrQSy7FT03+ilJK5RZaqRFXKG+cCyXoCEmRXjyaMcrqKL4pTVbnFQkShV+OX7Hf+AABYGzAEeG8JQg/dLjJd8SoMpaxieqKRxgpqowG+0jYt9rhdmR2k6kaWcqvZ4r56fRyxKDWTf374KcgVitqo7KCMjfGTtNA0n/h0638nNusWGLzebmLBYj/T52NZfLpxx53giqHVfhdfGChAIBvKKiFrjQW+15nEq1KwgpRJvg+qZgTz3kROolatgw7JKzMcJBX3KkYsYge6P/lY5IuA5X/KQ6SQMRGT5Ep6jv/zp1CtyM5XVOI5nIaQ8ECBnMAdCOiECOdQm+rUufIQ9MBwTuKOmDM1TdE/VKctF3wO9hf9CROOspfWtDH0K+l5LuImu/LzuuANaFqJuJrZTx0RCBBmPMIEwevaJm5+lBuEsMjdtg0A9crMv0GVJbAugTtYdMaPD3zGwGAEQ5kvJthJFJzqO8XbUiFY82cmYL8QMBtvl5uRAaeI29S9UsrHShJMuy7XFw9BDnBxyLhe+0GQnO7BjxYTv10F8Iw11zT7dWl0YHB7ssPm9wzgW9xJxlReZ0i56LmYbFu+xgvuYUCaoTIwMcD5g==", "X-OriginatorOrg": "nxp.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 1f2725fc-3d1d-43e2-6f7f-08de8f18d647", "X-MS-Exchange-CrossTenant-AuthSource": "AM8PR04MB7284.eurprd04.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "31 Mar 2026 11:29:57.2796\n (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": "\n zPrWAvft1mjYRxajfANWm2Y3dz152AaUZ+v6a/UcwrZGY8AzIQoNUU5ts5qgWxo5HPpX/yd+tfUsiyQ74P2D+A==", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DU4PR04MB12064", "X-Spam-Status": "No, score=0.8 required=3.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,\n\tSPF_HELO_PASS,T_SPF_PERMERROR autolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "This patch expands the NETC switch driver with several foundational\nfeatures, including FDB and MDB management, STP state handling, MTU\nconfiguration, port setup/teardown, and host flooding support.\n\nAt this stage, the driver operates only in standalone port mode. Each\nport uses VLAN 0 as its PVID, meaning ingress frames are internally\nassigned VID 0 regardless of whether they arrive tagged or untagged.\nNote that this does not inject a VLAN 0 header into the frame, the VID\nis used purely for subsequent VLAN processing within the switch.\n\nSigned-off-by: Wei Fang <wei.fang@nxp.com>\n---\n drivers/net/dsa/netc/netc_main.c | 540 ++++++++++++++++++++++++++\n drivers/net/dsa/netc/netc_switch.h | 33 ++\n drivers/net/dsa/netc/netc_switch_hw.h | 11 +\n 3 files changed, 584 insertions(+)", "diff": "diff --git a/drivers/net/dsa/netc/netc_main.c b/drivers/net/dsa/netc/netc_main.c\nindex f11f5d0f6a6d..3609d83ac363 100644\n--- a/drivers/net/dsa/netc/netc_main.c\n+++ b/drivers/net/dsa/netc/netc_main.c\n@@ -7,11 +7,36 @@\n #include <linux/clk.h>\n #include <linux/etherdevice.h>\n #include <linux/fsl/enetc_mdio.h>\n+#include <linux/if_bridge.h>\n #include <linux/if_vlan.h>\n #include <linux/of_mdio.h>\n \n #include \"netc_switch.h\"\n \n+static struct netc_fdb_entry *\n+netc_lookup_fdb_entry(struct netc_switch *priv,\n+\t\t const unsigned char *addr,\n+\t\t u16 vid)\n+{\n+\tstruct netc_fdb_entry *entry;\n+\n+\thlist_for_each_entry(entry, &priv->fdb_list, node)\n+\t\tif (ether_addr_equal(entry->keye.mac_addr, addr) &&\n+\t\t le16_to_cpu(entry->keye.fid) == vid)\n+\t\t\treturn entry;\n+\n+\treturn NULL;\n+}\n+\n+static void netc_destroy_fdb_list(struct netc_switch *priv)\n+{\n+\tstruct netc_fdb_entry *entry;\n+\tstruct hlist_node *tmp;\n+\n+\thlist_for_each_entry_safe(entry, tmp, &priv->fdb_list, node)\n+\t\tnetc_del_fdb_entry(entry);\n+}\n+\n static enum dsa_tag_protocol\n netc_get_tag_protocol(struct dsa_switch *ds, int port,\n \t\t enum dsa_tag_protocol mprot)\n@@ -386,6 +411,212 @@ static void netc_port_default_config(struct netc_port *np)\n \tnetc_port_rmw(np, NETC_POR, PCR_TXDIS, 0);\n }\n \n+static u32 netc_available_port_bitmap(struct netc_switch *priv)\n+{\n+\tstruct dsa_port *dp;\n+\tu32 bitmap = 0;\n+\n+\tdsa_switch_for_each_available_port(dp, priv->ds)\n+\t\tbitmap |= BIT(dp->index);\n+\n+\treturn bitmap;\n+}\n+\n+static int netc_add_standalone_vlan_entry(struct netc_switch *priv)\n+{\n+\tu32 bitmap_stg = VFT_STG_ID(0) | netc_available_port_bitmap(priv);\n+\tstruct vft_cfge_data *cfge;\n+\tu16 cfg;\n+\tint err;\n+\n+\tcfge = kzalloc_obj(*cfge);\n+\tif (!cfge)\n+\t\treturn -ENOMEM;\n+\n+\tcfge->bitmap_stg = cpu_to_le32(bitmap_stg);\n+\tcfge->et_eid = cpu_to_le32(NTMP_NULL_ENTRY_ID);\n+\tcfge->fid = cpu_to_le16(NETC_STANDALONE_PVID);\n+\n+\t/* For standalone ports, MAC learning needs to be disabled, so frames\n+\t * from other user ports will not be forwarded to the standalone ports,\n+\t * because there are no FDB entries on the standalone ports. Also, the\n+\t * frames received by the standalone ports cannot be flooded to other\n+\t * ports, so MAC forwarding option needs to be set to\n+\t * MFO_NO_MATCH_DISCARD, so the frames will discarded rather than\n+\t * flooding to other ports.\n+\t */\n+\tcfg = FIELD_PREP(VFT_MLO, MLO_DISABLE) |\n+\t FIELD_PREP(VFT_MFO, MFO_NO_MATCH_DISCARD);\n+\tcfge->cfg = cpu_to_le16(cfg);\n+\n+\terr = ntmp_vft_add_entry(&priv->ntmp, NETC_STANDALONE_PVID, cfge);\n+\tif (err)\n+\t\tdev_err(priv->dev,\n+\t\t\t\"Failed to add standalone VLAN entry\\n\");\n+\n+\tkfree(cfge);\n+\n+\treturn err;\n+}\n+\n+static int netc_port_add_fdb_entry(struct netc_port *np,\n+\t\t\t\t const unsigned char *addr, u16 vid)\n+{\n+\tstruct netc_switch *priv = np->switch_priv;\n+\tstruct netc_fdb_entry *entry;\n+\tstruct fdbt_keye_data *keye;\n+\tstruct fdbt_cfge_data *cfge;\n+\tint port = np->dp->index;\n+\tu32 cfg = 0;\n+\tint err;\n+\n+\tentry = kzalloc_obj(*entry);\n+\tif (!entry)\n+\t\treturn -ENOMEM;\n+\n+\tkeye = &entry->keye;\n+\tcfge = &entry->cfge;\n+\tether_addr_copy(keye->mac_addr, addr);\n+\tkeye->fid = cpu_to_le16(vid);\n+\n+\tcfge->port_bitmap = cpu_to_le32(BIT(port));\n+\tcfge->cfg = cpu_to_le32(cfg);\n+\tcfge->et_eid = cpu_to_le32(NTMP_NULL_ENTRY_ID);\n+\n+\terr = ntmp_fdbt_add_entry(&priv->ntmp, &entry->entry_id, keye, cfge);\n+\tif (err) {\n+\t\tkfree(entry);\n+\n+\t\treturn err;\n+\t}\n+\n+\tnetc_add_fdb_entry(priv, entry);\n+\n+\treturn 0;\n+}\n+\n+static int netc_port_set_fdb_entry(struct netc_port *np,\n+\t\t\t\t const unsigned char *addr, u16 vid)\n+{\n+\tstruct netc_switch *priv = np->switch_priv;\n+\tstruct netc_fdb_entry *entry;\n+\tint port = np->dp->index;\n+\tu32 port_bitmap;\n+\tint err = 0;\n+\n+\tmutex_lock(&priv->fdbt_lock);\n+\n+\tentry = netc_lookup_fdb_entry(priv, addr, vid);\n+\tif (!entry) {\n+\t\terr = netc_port_add_fdb_entry(np, addr, vid);\n+\t\tif (err)\n+\t\t\tdev_err(priv->dev,\n+\t\t\t\t\"Failed to add FDB entry on port %d\\n\",\n+\t\t\t\tport);\n+\n+\t\tgoto unlock_fdbt;\n+\t}\n+\n+\tport_bitmap = le32_to_cpu(entry->cfge.port_bitmap);\n+\t/* If the entry already exists on the port, return 0 directly */\n+\tif (unlikely(port_bitmap & BIT(port)))\n+\t\tgoto unlock_fdbt;\n+\n+\t/* If the entry already exists, but not on this port, we need to\n+\t * update the port bitmap. In general, it should only be valid\n+\t * for multicast or broadcast address.\n+\t */\n+\tport_bitmap ^= BIT(port);\n+\tentry->cfge.port_bitmap = cpu_to_le32(port_bitmap);\n+\terr = ntmp_fdbt_update_entry(&priv->ntmp, entry->entry_id,\n+\t\t\t\t &entry->cfge);\n+\tif (err) {\n+\t\tport_bitmap ^= BIT(port);\n+\t\tentry->cfge.port_bitmap = cpu_to_le32(port_bitmap);\n+\t\tdev_err(priv->dev, \"Failed to set FDB entry on port %d\\n\",\n+\t\t\tport);\n+\t}\n+\n+unlock_fdbt:\n+\tmutex_unlock(&priv->fdbt_lock);\n+\n+\treturn err;\n+}\n+\n+static int netc_port_del_fdb_entry(struct netc_port *np,\n+\t\t\t\t const unsigned char *addr, u16 vid)\n+{\n+\tstruct netc_switch *priv = np->switch_priv;\n+\tstruct ntmp_user *ntmp = &priv->ntmp;\n+\tstruct netc_fdb_entry *entry;\n+\tint port = np->dp->index;\n+\tu32 port_bitmap;\n+\tint err = 0;\n+\n+\tmutex_lock(&priv->fdbt_lock);\n+\n+\tentry = netc_lookup_fdb_entry(priv, addr, vid);\n+\tif (unlikely(!entry))\n+\t\tgoto unlock_fdbt;\n+\n+\tport_bitmap = le32_to_cpu(entry->cfge.port_bitmap);\n+\tif (unlikely(!(port_bitmap & BIT(port))))\n+\t\tgoto unlock_fdbt;\n+\n+\tif (port_bitmap != BIT(port)) {\n+\t\t/* If the entry also exists on other ports, we need to\n+\t\t * update the entry in the FDB table.\n+\t\t */\n+\t\tport_bitmap ^= BIT(port);\n+\t\tentry->cfge.port_bitmap = cpu_to_le32(port_bitmap);\n+\t\terr = ntmp_fdbt_update_entry(ntmp, entry->entry_id,\n+\t\t\t\t\t &entry->cfge);\n+\t\tif (err) {\n+\t\t\tport_bitmap ^= BIT(port);\n+\t\t\tentry->cfge.port_bitmap = cpu_to_le32(port_bitmap);\n+\t\t\tgoto unlock_fdbt;\n+\t\t}\n+\t} else {\n+\t\t/* If the entry only exists on this port, just delete\n+\t\t * it from the FDB table.\n+\t\t */\n+\t\terr = ntmp_fdbt_delete_entry(ntmp, entry->entry_id);\n+\t\tif (err)\n+\t\t\tgoto unlock_fdbt;\n+\n+\t\tnetc_del_fdb_entry(entry);\n+\t}\n+\n+unlock_fdbt:\n+\tmutex_unlock(&priv->fdbt_lock);\n+\n+\treturn err;\n+}\n+\n+static int netc_add_standalone_fdb_bcast_entry(struct netc_switch *priv)\n+{\n+\tconst u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};\n+\tstruct dsa_port *dp, *cpu_dp = NULL;\n+\n+\tdsa_switch_for_each_cpu_port(dp, priv->ds) {\n+\t\tcpu_dp = dp;\n+\t\tbreak;\n+\t}\n+\n+\tif (!cpu_dp)\n+\t\treturn -ENODEV;\n+\n+\t/* If the user port acts as a standalone port, then its PVID is 0,\n+\t * MLO is set to \"disable MAC learning\" and MFO is set to \"discard\n+\t * frames if no matching entry found in FDB table\". Therefore, we\n+\t * need to add a broadcast FDB entry on the CPU port so that the\n+\t * broadcast frames received on the user port can be forwarded to\n+\t * the CPU port.\n+\t */\n+\treturn netc_port_set_fdb_entry(NETC_PORT(priv->ds, cpu_dp->index),\n+\t\t\t\t bcast, NETC_STANDALONE_PVID);\n+}\n+\n static int netc_setup(struct dsa_switch *ds)\n {\n \tstruct netc_switch *priv = ds->priv;\n@@ -404,19 +635,61 @@ static int netc_setup(struct dsa_switch *ds)\n \tif (err)\n \t\treturn err;\n \n+\tINIT_HLIST_HEAD(&priv->fdb_list);\n+\tmutex_init(&priv->fdbt_lock);\n+\n \tnetc_switch_fixed_config(priv);\n \n \t/* default setting for ports */\n \tdsa_switch_for_each_available_port(dp, ds)\n \t\tnetc_port_default_config(priv->ports[dp->index]);\n \n+\terr = netc_add_standalone_vlan_entry(priv);\n+\tif (err)\n+\t\tgoto free_lock_and_ntmp_user;\n+\n+\terr = netc_add_standalone_fdb_bcast_entry(priv);\n+\tif (err)\n+\t\tgoto free_lock_and_ntmp_user;\n+\n \treturn 0;\n+\n+free_lock_and_ntmp_user:\n+\tmutex_destroy(&priv->fdbt_lock);\n+\tnetc_free_ntmp_user(priv);\n+\n+\treturn err;\n+}\n+\n+static void netc_destroy_all_lists(struct netc_switch *priv)\n+{\n+\tnetc_destroy_fdb_list(priv);\n+\tmutex_destroy(&priv->fdbt_lock);\n+}\n+\n+static void netc_free_host_flood_rules(struct netc_switch *priv)\n+{\n+\tstruct dsa_port *dp;\n+\n+\tdsa_switch_for_each_user_port(dp, priv->ds) {\n+\t\tstruct netc_port *np = priv->ports[dp->index];\n+\n+\t\t/* No need to clear the hardware IPFT entry. Because PCIe\n+\t\t * FLR will be performed when the switch is re-registered,\n+\t\t * it will reset hardware state. So only need to free the\n+\t\t * memory to avoid memory leak.\n+\t\t */\n+\t\tkfree(np->host_flood);\n+\t\tnp->host_flood = NULL;\n+\t}\n }\n \n static void netc_teardown(struct dsa_switch *ds)\n {\n \tstruct netc_switch *priv = ds->priv;\n \n+\tnetc_destroy_all_lists(priv);\n+\tnetc_free_host_flood_rules(priv);\n \tnetc_free_ntmp_user(priv);\n }\n \n@@ -569,6 +842,261 @@ static void netc_switch_get_ip_revision(struct netc_switch *priv)\n \tpriv->revision = val & IPBRR0_IP_REV;\n }\n \n+static int netc_port_enable(struct dsa_switch *ds, int port,\n+\t\t\t struct phy_device *phy)\n+{\n+\tstruct netc_port *np = NETC_PORT(ds, port);\n+\tint err;\n+\n+\tif (np->enable)\n+\t\treturn 0;\n+\n+\terr = clk_prepare_enable(np->ref_clk);\n+\tif (err) {\n+\t\tdev_err(ds->dev,\n+\t\t\t\"Failed to enable enet_ref_clk of port %d\\n\", port);\n+\t\treturn err;\n+\t}\n+\n+\tnp->enable = true;\n+\n+\treturn 0;\n+}\n+\n+static void netc_port_disable(struct dsa_switch *ds, int port)\n+{\n+\tstruct netc_port *np = NETC_PORT(ds, port);\n+\n+\t/* When .port_disable() is called, .port_enable() may not have been\n+\t * called. In this case, both the prepare_count and enable_count of\n+\t * clock are 0. Calling clk_disable_unprepare() at this time will\n+\t * cause warnings.\n+\t */\n+\tif (!np->enable)\n+\t\treturn;\n+\n+\tclk_disable_unprepare(np->ref_clk);\n+\tnp->enable = false;\n+}\n+\n+static void netc_port_stp_state_set(struct dsa_switch *ds,\n+\t\t\t\t int port, u8 state)\n+{\n+\tstruct netc_port *np = NETC_PORT(ds, port);\n+\tu32 val;\n+\n+\tswitch (state) {\n+\tcase BR_STATE_DISABLED:\n+\tcase BR_STATE_LISTENING:\n+\tcase BR_STATE_BLOCKING:\n+\t\tval = NETC_STG_STATE_DISABLED;\n+\t\tbreak;\n+\tcase BR_STATE_LEARNING:\n+\t\tval = NETC_STG_STATE_LEARNING;\n+\t\tbreak;\n+\tcase BR_STATE_FORWARDING:\n+\t\tval = NETC_STG_STATE_FORWARDING;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn;\n+\t}\n+\n+\tnetc_port_wr(np, NETC_BPSTGSR, val);\n+}\n+\n+static int netc_port_change_mtu(struct dsa_switch *ds,\n+\t\t\t\tint port, int mtu)\n+{\n+\tu32 max_frame_size = mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;\n+\tstruct netc_port *np = NETC_PORT(ds, port);\n+\n+\tif (dsa_is_cpu_port(ds, port))\n+\t\tmax_frame_size += NETC_TAG_MAX_LEN;\n+\n+\tnetc_port_set_max_frame_size(np, max_frame_size);\n+\n+\treturn 0;\n+}\n+\n+static int netc_port_max_mtu(struct dsa_switch *ds, int port)\n+{\n+\treturn NETC_MAX_FRAME_LEN - VLAN_ETH_HLEN - ETH_FCS_LEN;\n+}\n+\n+static int netc_port_fdb_add(struct dsa_switch *ds, int port,\n+\t\t\t const unsigned char *addr, u16 vid,\n+\t\t\t struct dsa_db db)\n+{\n+\tstruct netc_port *np = NETC_PORT(ds, port);\n+\n+\t/* Currently, we only support standalone port mode, so all VLANs\n+\t * should be converted to NETC_STANDALONE_PVID.\n+\t */\n+\treturn netc_port_set_fdb_entry(np, addr, NETC_STANDALONE_PVID);\n+}\n+\n+static int netc_port_fdb_del(struct dsa_switch *ds, int port,\n+\t\t\t const unsigned char *addr, u16 vid,\n+\t\t\t struct dsa_db db)\n+{\n+\tstruct netc_port *np = NETC_PORT(ds, port);\n+\n+\treturn netc_port_del_fdb_entry(np, addr, NETC_STANDALONE_PVID);\n+}\n+\n+static int netc_port_fdb_dump(struct dsa_switch *ds, int port,\n+\t\t\t dsa_fdb_dump_cb_t *cb, void *data)\n+{\n+\tstruct netc_switch *priv = ds->priv;\n+\tu32 resume_eid = NTMP_NULL_ENTRY_ID;\n+\tstruct fdbt_entry_data *entry;\n+\tstruct fdbt_keye_data *keye;\n+\tstruct fdbt_cfge_data *cfge;\n+\tbool is_static;\n+\tu32 cfg;\n+\tint err;\n+\tu16 vid;\n+\n+\tentry = kmalloc_obj(*entry);\n+\tif (!entry)\n+\t\treturn -ENOMEM;\n+\n+\tkeye = &entry->keye;\n+\tcfge = &entry->cfge;\n+\tmutex_lock(&priv->fdbt_lock);\n+\n+\tdo {\n+\t\tmemset(entry, 0, sizeof(*entry));\n+\t\terr = ntmp_fdbt_search_port_entry(&priv->ntmp, port,\n+\t\t\t\t\t\t &resume_eid, entry);\n+\t\tif (err || entry->entry_id == NTMP_NULL_ENTRY_ID)\n+\t\t\tbreak;\n+\n+\t\tcfg = le32_to_cpu(cfge->cfg);\n+\t\tis_static = (cfg & FDBT_DYNAMIC) ? false : true;\n+\t\tvid = le16_to_cpu(keye->fid);\n+\n+\t\terr = cb(keye->mac_addr, vid, is_static, data);\n+\t\tif (err)\n+\t\t\tbreak;\n+\t} while (resume_eid != NTMP_NULL_ENTRY_ID);\n+\n+\tmutex_unlock(&priv->fdbt_lock);\n+\tkfree(entry);\n+\n+\treturn err;\n+}\n+\n+static int netc_port_mdb_add(struct dsa_switch *ds, int port,\n+\t\t\t const struct switchdev_obj_port_mdb *mdb,\n+\t\t\t struct dsa_db db)\n+{\n+\treturn netc_port_fdb_add(ds, port, mdb->addr, mdb->vid, db);\n+}\n+\n+static int netc_port_mdb_del(struct dsa_switch *ds, int port,\n+\t\t\t const struct switchdev_obj_port_mdb *mdb,\n+\t\t\t struct dsa_db db)\n+{\n+\treturn netc_port_fdb_del(ds, port, mdb->addr, mdb->vid, db);\n+}\n+\n+static int netc_port_add_host_flood_rule(struct netc_port *np,\n+\t\t\t\t\t bool uc, bool mc)\n+{\n+\tconst u8 dmac_mask[ETH_ALEN] = {0x1, 0, 0, 0, 0, 0};\n+\tstruct netc_switch *priv = np->switch_priv;\n+\tstruct ipft_entry_data *host_flood;\n+\tstruct ipft_keye_data *keye;\n+\tstruct ipft_cfge_data *cfge;\n+\tu16 src_port;\n+\tu32 cfg;\n+\tint err;\n+\n+\tif (!uc && !mc)\n+\t\treturn 0;\n+\n+\thost_flood = kzalloc_obj(*host_flood);\n+\tif (!host_flood)\n+\t\treturn -ENOMEM;\n+\n+\tkeye = &host_flood->keye;\n+\tcfge = &host_flood->cfge;\n+\n+\tsrc_port = FIELD_PREP(IPFT_SRC_PORT, np->dp->index);\n+\tsrc_port |= IPFT_SRC_PORT_MASK;\n+\tkeye->src_port = cpu_to_le16(src_port);\n+\n+\t/* If either only unicast or only multicast need to be flooded\n+\t * to the host, we always set the mask that tests the first MAC\n+\t * DA octet. The value should be 0 for the first bit (if unicast\n+\t * has to be flooded) or 1 (if multicast). If both unicast and\n+\t * multicast have to be flooded, we leave the key mask empty, so\n+\t * it matches everything.\n+\t */\n+\tif (uc && !mc)\n+\t\tether_addr_copy(keye->dmac_mask, dmac_mask);\n+\n+\tif (!uc && mc) {\n+\t\tether_addr_copy(keye->dmac, dmac_mask);\n+\t\tether_addr_copy(keye->dmac_mask, dmac_mask);\n+\t}\n+\n+\tcfg = FIELD_PREP(IPFT_FLTFA, IPFT_FLTFA_REDIRECT);\n+\tcfg |= FIELD_PREP(IPFT_HR, NETC_HR_HOST_FLOOD);\n+\tcfge->cfg = cpu_to_le32(cfg);\n+\n+\terr = ntmp_ipft_add_entry(&priv->ntmp, host_flood);\n+\tif (err) {\n+\t\tkfree(host_flood);\n+\t\treturn err;\n+\t}\n+\n+\tnp->uc = uc;\n+\tnp->mc = mc;\n+\tnp->host_flood = host_flood;\n+\t/* Enable ingress port filter table lookup */\n+\tnetc_port_wr(np, NETC_PIPFCR, PIPFCR_EN);\n+\n+\treturn 0;\n+}\n+\n+static void netc_port_remove_host_flood(struct netc_port *np)\n+{\n+\tstruct netc_switch *priv = np->switch_priv;\n+\n+\tif (!np->host_flood)\n+\t\treturn;\n+\n+\tntmp_ipft_delete_entry(&priv->ntmp, np->host_flood->entry_id);\n+\tkfree(np->host_flood);\n+\tnp->host_flood = NULL;\n+\tnp->uc = false;\n+\tnp->mc = false;\n+\t/* Disable ingress port filter table lookup */\n+\tnetc_port_wr(np, NETC_PIPFCR, 0);\n+}\n+\n+static void netc_port_set_host_flood(struct dsa_switch *ds, int port,\n+\t\t\t\t bool uc, bool mc)\n+{\n+\tstruct netc_port *np = NETC_PORT(ds, port);\n+\n+\tif (np->uc == uc && np->mc == mc)\n+\t\treturn;\n+\n+\t/* IPFT does not support in-place updates to the KEYE element,\n+\t * so we need to delete the old IPFT entry and then add a new\n+\t * one.\n+\t */\n+\tif (np->host_flood)\n+\t\tnetc_port_remove_host_flood(np);\n+\n+\tif (netc_port_add_host_flood_rule(np, uc, mc))\n+\t\tdev_err(ds->dev, \"Failed to add host flood rule on port %d\\n\",\n+\t\t\tport);\n+}\n+\n static void netc_phylink_get_caps(struct dsa_switch *ds, int port,\n \t\t\t\t struct phylink_config *config)\n {\n@@ -751,6 +1279,17 @@ static const struct dsa_switch_ops netc_switch_ops = {\n \t.setup\t\t\t\t= netc_setup,\n \t.teardown\t\t\t= netc_teardown,\n \t.phylink_get_caps\t\t= netc_phylink_get_caps,\n+\t.port_enable\t\t\t= netc_port_enable,\n+\t.port_disable\t\t\t= netc_port_disable,\n+\t.port_stp_state_set\t\t= netc_port_stp_state_set,\n+\t.port_change_mtu\t\t= netc_port_change_mtu,\n+\t.port_max_mtu\t\t\t= netc_port_max_mtu,\n+\t.port_fdb_add\t\t\t= netc_port_fdb_add,\n+\t.port_fdb_del\t\t\t= netc_port_fdb_del,\n+\t.port_fdb_dump\t\t\t= netc_port_fdb_dump,\n+\t.port_mdb_add\t\t\t= netc_port_mdb_add,\n+\t.port_mdb_del\t\t\t= netc_port_mdb_del,\n+\t.port_set_host_flood\t\t= netc_port_set_host_flood,\n };\n \n static int netc_switch_probe(struct pci_dev *pdev,\n@@ -792,6 +1331,7 @@ static int netc_switch_probe(struct pci_dev *pdev,\n \tds->num_tx_queues = NETC_TC_NUM;\n \tds->ops = &netc_switch_ops;\n \tds->phylink_mac_ops = &netc_phylink_mac_ops;\n+\tds->fdb_isolation = true;\n \tds->priv = priv;\n \n \tpriv->ds = ds;\ndiff --git a/drivers/net/dsa/netc/netc_switch.h b/drivers/net/dsa/netc/netc_switch.h\nindex eb65c36ecead..4b229a71578e 100644\n--- a/drivers/net/dsa/netc/netc_switch.h\n+++ b/drivers/net/dsa/netc/netc_switch.h\n@@ -30,6 +30,8 @@\n \n #define NETC_MAX_FRAME_LEN\t\t9600\n \n+#define NETC_STANDALONE_PVID\t\t0\n+\n struct netc_switch;\n \n struct netc_switch_info {\n@@ -43,6 +45,11 @@ struct netc_port_caps {\n \tu32 pseudo_link:1;\n };\n \n+enum netc_host_reason {\n+\t/* Software defined host reasons */\n+\tNETC_HR_HOST_FLOOD = 8,\n+};\n+\n struct netc_port {\n \tvoid __iomem *iobase;\n \tstruct netc_switch *switch_priv;\n@@ -50,6 +57,11 @@ struct netc_port {\n \tstruct dsa_port *dp;\n \tstruct clk *ref_clk; /* RGMII/RMII reference clock */\n \tstruct mii_bus *emdio;\n+\n+\tu16 enable:1;\n+\tu16 uc:1;\n+\tu16 mc:1;\n+\tstruct ipft_entry_data *host_flood;\n };\n \n struct netc_switch_regs {\n@@ -58,6 +70,13 @@ struct netc_switch_regs {\n \tvoid __iomem *global;\n };\n \n+struct netc_fdb_entry {\n+\tu32 entry_id;\n+\tstruct fdbt_cfge_data cfge;\n+\tstruct fdbt_keye_data keye;\n+\tstruct hlist_node node;\n+};\n+\n struct netc_switch {\n \tstruct pci_dev *pdev;\n \tstruct device *dev;\n@@ -69,6 +88,8 @@ struct netc_switch {\n \tstruct netc_port **ports;\n \n \tstruct ntmp_user ntmp;\n+\tstruct hlist_head fdb_list;\n+\tstruct mutex fdbt_lock; /* FDB table lock */\n };\n \n #define NETC_PRIV(ds)\t\t\t((struct netc_switch *)((ds)->priv))\n@@ -91,6 +112,18 @@ static inline bool is_netc_pseudo_port(struct netc_port *np)\n \treturn np->caps.pseudo_link;\n }\n \n+static inline void netc_add_fdb_entry(struct netc_switch *priv,\n+\t\t\t\t struct netc_fdb_entry *entry)\n+{\n+\thlist_add_head(&entry->node, &priv->fdb_list);\n+}\n+\n+static inline void netc_del_fdb_entry(struct netc_fdb_entry *entry)\n+{\n+\thlist_del(&entry->node);\n+\tkfree(entry);\n+}\n+\n int netc_switch_platform_probe(struct netc_switch *priv);\n \n #endif\ndiff --git a/drivers/net/dsa/netc/netc_switch_hw.h b/drivers/net/dsa/netc/netc_switch_hw.h\nindex 881122004644..c6a0c0a8ff8a 100644\n--- a/drivers/net/dsa/netc/netc_switch_hw.h\n+++ b/drivers/net/dsa/netc/netc_switch_hw.h\n@@ -67,6 +67,9 @@\n #define PQOSMR_VQMP\t\t\tGENMASK(19, 16)\n #define PQOSMR_QVMP\t\t\tGENMASK(23, 20)\n \n+#define NETC_PIPFCR\t\t\t0x0084\n+#define PIPFCR_EN\t\t\tBIT(0)\n+\n #define NETC_POR\t\t\t0x100\n #define PCR_TXDIS\t\t\tBIT(0)\n #define PCR_RXDIS\t\t\tBIT(1)\n@@ -122,6 +125,14 @@ enum netc_mfo {\n #define BPDVR_RXVAM\t\t\tBIT(24)\n #define BPDVR_TXTAGA\t\t\tGENMASK(26, 25)\n \n+#define NETC_BPSTGSR\t\t\t0x520\n+\n+enum netc_stg_stage {\n+\tNETC_STG_STATE_DISABLED = 0,\n+\tNETC_STG_STATE_LEARNING,\n+\tNETC_STG_STATE_FORWARDING,\n+};\n+\n /* Definition of Switch ethernet MAC port registers */\n #define NETC_PMAC_OFFSET\t\t0x400\n #define NETC_PM_CMD_CFG(a)\t\t(0x1008 + (a) * 0x400)\n", "prefixes": [ "v4", "net-next", "12/14" ] }