get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2216221/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2216221,
    "url": "http://patchwork.ozlabs.org/api/patches/2216221/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260326062917.3552334-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": "<20260326062917.3552334-13-wei.fang@nxp.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260326062917.3552334-13-wei.fang@nxp.com/",
    "date": "2026-03-26T06:29:15",
    "name": "[v3,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/20260326062917.3552334-13-wei.fang@nxp.com/mbox/",
    "series": [
        {
            "id": 497537,
            "url": "http://patchwork.ozlabs.org/api/series/497537/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=497537",
            "date": "2026-03-26T06:29:03",
            "name": "Add preliminary NETC switch support for i.MX94",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/497537/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216221/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216221/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-18807-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=mBLDHws7;\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-18807-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=pass smtp.remote-ip=\"2a01:111:f403:c201::6\" 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=mBLDHws7;\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:c201::6;\n helo=am0pr02cu008.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 4fhDQ31ys7z1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 17:29:15 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fhDQ037j6z2ykf;\n\tThu, 26 Mar 2026 17:29:12 +1100 (AEDT)",
            "from AM0PR02CU008.outbound.protection.outlook.com\n (mail-westeuropeazlp170130006.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c201::6])\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 4fhDPy5T6Mz2yVB\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 26 Mar 2026 17:29:10 +1100 (AEDT)",
            "from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7)\n by AM9PR04MB8355.eurprd04.prod.outlook.com (2603:10a6:20b:3b7::20) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.20; Thu, 26 Mar\n 2026 06:28:47 +0000",
            "from PAXPR04MB8510.eurprd04.prod.outlook.com\n ([fe80::b476:c19a:24cd:3694]) by PAXPR04MB8510.eurprd04.prod.outlook.com\n ([fe80::b476:c19a:24cd:3694%3]) with mapi id 15.20.9745.019; Thu, 26 Mar 2026\n 06:28:47 +0000"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1774506552;\n\tcv=pass;\n b=SCFW3RxNLnVa1xYsFIlyHcztZ5dj0PQ4iFo2ZP5Oyv+X6ARGTLjubzPDoFIdsl3sSvH37Danv7Ihg8BT0YhCvfq+1KwFIlPZA+xGR1nDPa9XJ+oWB6VGXidCLyYe1dxP1dwl5dSyq9jq8bXIzCgdUUfFhFU7ZCs3LdWpCvOrGt7Sv0SMsWQUxhIgycwm801sb25+nxDR+/YQyOgl7RXu0nsiopsD5cYuquOtgFkJPnwFgg2wikCB2t1MpPT095LF5+Wm5fTQdPp895VppP4akWZ3ms5rrUKKY3A37yPHa7+gIBHnsuEYF/MzP8UDmYRJyMLRvzuuSy8arY/j5hvsOg==",
            "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=tvDRD1S0qCWUeTmU3o1p0lN4sMZ0OcyVFw2pyrrtEWoqt7X+FKt2B/gOXO6sZ/Pj79C9Y/nn02whlfXzs2JNRkkzf2AfWqTj/TlNRW6jBJxd0xWcBfnERGxVjDJx5IU2NXm8kqqqaZ0nxp1JdQ+a3IEtP0ceGOinpyDGvwVNTQ3HgWTNPSjXGrrFQenUP6hnuNUDciiYq+zhhRTa4EoydvBJLJSkRykf28h5LeQFzB1HSyZqSd4xKjGA04F7IzU19MEdxmfGDgXlxlwv1utDNTUm9Tmj8dvYoTWmbWzH0S0YUm2thV2MRH7gFKUuW2DsbFY3VPqAXBzWgspM33g8cg=="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1774506552; 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=eEnxijQLftb+LWBNGUC3/ZnzePzfkaamqEUVwjT7thE21/nhArrQuheNnCMAlq684nZ9zFJ9q6GETmiX9Bxt69Dzw7MXD5LW9sEqw25GWSNaFtse9lP8UBG8FKtRzDMawc6ZWRHLnhMkHeVJ5pCBd3MpNjw/b4gOtYBMd8n77qKUlibQaeE7nzs6ZilQsCWWQ0popnqfesvA0qUJz7TSYtjk/pQ1C6WUiyaYfZWfHCw8JX352vse5Duorl2pL9KYTIRxfthh1W34d3hb2dnmBNofZ1OtbF9day8ZJ4CnUAiBkA+pWzrc9ODDzfYxcd4GvgT7+/K/6MFyt44n65HaiQ==",
            "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=IiIg2YaNMQa0KeNaUzn97jsYNSkB5OoTFU5YVxvB/MCdmzy2MyrR6gH5XVO7THBkaAjCJSwJc+Ewgo0qZyoy4auWINCCb5gHY/bW1m6hMmk6hMdk6c+TiQ3BKcQCLRbwJptLHpKcnXbd61gB015IdXCHXJC9HUZ0kb1+jUi1lO9O46VSYYOMviWG87wMWEmTxmjVTXBNp16bOrIkaGjeN/jSJFHNAjhvconHBuIpRHjVped4JWXr7gYuuapHvvuN2LMD5LGvWnGPwzCRgajjnexkjPaKbzs8E1a9l6bqvK+gfPmXo8h8QzFl8R8RtoTyhhkxX+Foi3ZYqpO19l95HA=="
        ],
        "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=mBLDHws7; dkim-atps=neutral;\n spf=permerror (client-ip=2a01:111:f403:c201::6;\n helo=am0pr02cu008.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=mBLDHws7PMZvuLa8a2Er9hSbS0uWngW9ay8XrKCGeUKnsSmWp1uv7G6CMMv16H8cXMSaj6VH56vWreYz5XyAnaMWmR7Z81Fcq/D+wXHyjowG4OmtLHgnuFMzIR9q2kGndb/bTuHXppQ15xSPVJS74NHIHeXD/jdleIsC2cAjkOByMwlH3Kz661hR01UEj2Y4Lz4iP7HdkquGM3tmMV+ujLbzyHnzlhlessQ89TeBGG5j6UGv61AaXRdRI2HP7xub4qYNPHyNna2tp7WlnXz6NgGZep1bonQ+uQ8WQyGXs6MVCdXIUwuy0Ckds/QBYhYwu/6LtUIJcuZFA9AUYwAQSw==",
        "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 v3 net-next 12/14] net: dsa: netc: add more basic functions\n support",
        "Date": "Thu, 26 Mar 2026 14:29:15 +0800",
        "Message-Id": "<20260326062917.3552334-13-wei.fang@nxp.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20260326062917.3552334-1-wei.fang@nxp.com>",
        "References": "<20260326062917.3552334-1-wei.fang@nxp.com>",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "MA5PR01CA0046.INDPRD01.PROD.OUTLOOK.COM\n (2603:1096:a01:1d6::15) To PAXPR04MB8510.eurprd04.prod.outlook.com\n (2603:10a6:102:211::7)",
        "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": "PAXPR04MB8510:EE_|AM9PR04MB8355:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "1ff00937-f224-4e4c-9ea7-08de8b00efb1",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "\n\tBCL:0;ARA:13230040|1800799024|366016|19092799006|376014|7416014|52116014|38350700014|921020|22082099003|56012099003|18002099003;",
        "X-Microsoft-Antispam-Message-Info": "\n\tIU8q47AFpZsk35KABLELgB1qh3w/sv+PYJ96i+D0vZA7fufWoiikL143Ur77NAX0A34y0uT/FOdz68YUVIURvEwxF8UFotqmWib4mZ2ji+/okUKBSSFBOo7eDiY+FSekXeXWu0Fp6DAgP2GXJvSNywC+Ls6MtNEaGh9b71RRbyMg3cEUKAfjOXNrRGEPKqb8ojHEQFA0SEO6rqk+rewkd2+6kglG3nbjGll1rr/Eo9PwP+1mq1LwXrByF6zeevMKAIgCFXnFHfYLaAqkJaB5lWP5tMtQJFxWO0AYUTV/o6Skby0h4anBGlT871PdVvLy62oWsXQbzC6ju60wl/b8f+7i4aT84b58XR0mYcw4IcWEvS/qM7faSkmJssNsbHZbJD5uvYIVvdx4ank1o4dj3stWoBb/9L3FYZs9o1GxfVwTGdSovm2MHtoFO0Qqytg7BzzGyobHulbzAmY8Ph5ZlE87vPtJNU2JPdp0Jh6IcVDQrZaubRvUnc6F95QeL/0Uily4YfRgPThdaZhTw87WYzOaRKx3SWAf+xyjKlGL5L1/V9+HA/RS33y+bfqQmE1PZrh6IG8UrhPSch3GVvxPLxszHKUBKOf28JZgoEj4PvxFlJXIaZHSHekbSASDzHPtR0+tMYhMCaJexDKFpU1aRIX8ZxJIobvo0WwUK6gfehg8ePEB+k8KCmhBzw1+DyWW8sygcq9MNN0zE0hDGa97296yguJ+aT4Pg6DjXXg312ofcd52HAsA1BS84h0zzc8Xla6GWx7imgvRWWSYPXpwwN9Pas79rNE115p74Xj5T4itPWezFsiTITd4Ta/sNX1F",
        "X-Forefront-Antispam-Report": "\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(19092799006)(376014)(7416014)(52116014)(38350700014)(921020)(22082099003)(56012099003)(18002099003);DIR:OUT;SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n QkwG6ZBjEJ/BFfrneg/0HCD+AX0ch5aa4oSuiZ8+yusx6LvR4kRGJUc3dOGwMJshaPisrzipk3unWV9tvM/1YTST8OHxXhh4hZAuciFETmugtIe3sZue0gnUF00kDnLWhwa2s0Gle28gMNAFRBurZOR1rl3yKrglx9/MAzUh6UoBx4Mk/BEaEscs81qFIhLalxW7fjexkyxgmvInOmsGXXdPTFmIf2s1i3ES7DZvMVN1j8Yt3ZStTvOTzsHmgFCNE8XzERYHq+TC55hC+PYKvX3L//Cyiofq4LlZok4WqARqNpMu3RH7eW/Kh7Syza8A0EG4NeLNKv7Vz0mgwKfLXbN91g7kpPGr7atlMwIRMrc7ds9jU3hkf3kB6GacKSWtwUGHkhw/oByS0YCJuNRrKkhlAU+BMDpOShpl6361XowTochhg7aAloRcLsHqR1lT0WvSDmy1oJftOcfmrWjaGdm4PurKbS7j1+68wZ/WR2HF96q4HuFEHTexBIKT5BcGtJW8bhvc8D0X2pEh1HGXGvthYH8SzV28gTNIFPD7EpngTmOV54i52FTjF6U4sN9YhiIyebaFWbf46tCWsYtWxtMKTMEHIkXjoRg79clG4jIoZWVsFJ0+wYaOU0z4wAOlOwNehK2qmKDskVa54m5yhPgIxo3fkgpvRZWtCtPi2yjZUA9ABwcuVGujTK/ZT6Bikhcp5qob3pq8+u7Ws0IMcBJlEBHFca6PN1NGM0sP5FD43Kbj33LIHsy87aa1kM8MurlEAeW0onGg8w4PDfF7yJFd5JVoI7UWVhSXBMGdr1I7yKe8TiXb58mOYJ22QK2A+KyjYdd6cQuE2kbOb2dQVvdwT1UlTebP4BvahUZ+RTVVFaKucsJrmDOTBCc42OeLW7iPA9kgAVxDUYUx4freenS88P9Ur3NMpi3T3AHzwmP7KIt/jjATrEoeuqa0GTjlltQoqda/9plswb2lE6Ci7jDPA6BzPcrlUq7o3UP+aSmfXFnM8DWBufhMKz/z42t5Kqz9Ot+J+OBoXeFM8uWndxx8E7806dUe5o/+4WIQZpzFrAq4TENgkfbTjRUCQ31lvq+otlsS3lrYEAhUR8Z21Dx7EqmEFPNF5T74mKsA6vXIJKhB8AIBbm+zznBc3pTaTSDC0KM4MAh4Er7f/GUR1iOHeSuhEyVicuGQoZ+/opafHC/+7ryLHs0mFOhyjzq29OQAPA/BLqclDqEfR8JaTtUd5N+kvNO9Aufw40St6hIq+U+pxaxBWMjvhg+CBcFlgz2dORf7IZi2KlNzF6B83ADZy/gez/+IGf/6BJPLd4BopHAuI4hqat3T+1sa+HgnKqCfVK1QNCMUpH0oo+P+2iZ/bW7SBoV1nUqoi5uO11zGpHNblZO7p1YDSq8K/MRKhOigDPxdICPiXCHYb1RP0ArOMg2hLIVQ54Esvvt/JZ4MaJORApmh4MTyruppkJ7gM1oFjYdvrPrUFZj3o2T0l6dFwfYSmSa/hdSUAdlGbqPr+uEZopvN4APJFI6o6NfcCihGzkFa/ivrT57lsPUJ9+TYnz7HMrB6MKa4wgTHEdtsWNgH0bVecgqziX3GkTLiwN/+v7pCyAKiSR/9r4r4KKbcwoFiH9+ShrD3cozDly4M6ZE+8JBfsUko1i6FlaR9JuVRGfG0UC4cSYBNDrKJNmG2hvcel3jZlBMy82gLwfi9pFdtLmblqvalaYFbDw9I5wnnA3iGV+mtl7D71Fcd2Q==",
        "X-OriginatorOrg": "nxp.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 1ff00937-f224-4e4c-9ea7-08de8b00efb1",
        "X-MS-Exchange-CrossTenant-AuthSource": "PAXPR04MB8510.eurprd04.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "26 Mar 2026 06:28:47.3034\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 TtpQRg9PUTkJ5R8Xz4YKhNvq7YyoFEWE+kSc7gtYsTEZugbS5fcA/yz8Wt3igTt+E8lmZpIXOI8KuKKnsFIgbg==",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM9PR04MB8355",
        "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": [
        "v3",
        "net-next",
        "12/14"
    ]
}