From patchwork Wed Dec 13 12:14:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490812 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="DXUmSPSU" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A33AD5 for ; Wed, 13 Dec 2023 04:15:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ee1FOyhHOaUQu/EOEpdkisTOaRWreXEiPvhbdXn1L5U1NHdo3o8PlB3CrDCGoj2bCVsx9IntybleLnvMT0VZs8s8mJaVxNbnJIDLnqe938S1KUiY59U1o8E+PXBYcTgiw17C/wa6+qaaM+Z4Hx8576rwO0tXm0zV640kqiBNsMsmWxMzKjXZMKvJlf0xArh/kSpY6JaIoS1Q7vYwZg7RdSvUUWWOVQWf4/mTcfAvwZUlnFHSmz/OM3wVCvdfgvnmDZ7kiIV6cHe3KpjeR6ck0gWu6E8oosP9NP7hYo8OwmQMRTx8B7nPWqVKIp6bel+yhBQwObibaEtINsA366FwZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=eDogeUIRi9EZaSlWJMHVs0AQuhh8PfHgnNja3tZYgfs=; b=SjikAPt4RY1Y4IUiwakx+7dX7jdOyLwy8OQZs8rim0dMA51CNKFcaQGN00GvfvCgJf9934t4oVqSJ6cp21UySWvQqut2aye3kmmjHyfj5Ofx8hsctlW+RAQmpBOfGk/p9jAVg26n9pg77tKfW5hZ9IZYhTMS3kzL7yPFoGGHEFGmaKJTj+xvQXDJTCwxUvrvRGWuUdhUKW1UXW2/fja8bgCYZ+HmVa37zVTf6HV/y8UNYoYRmHf/fyAWZUs9RsVTjwQyaQP86ZEsJxlI5UqdCPARttm6Tms3ziVNQ5YlDJuPAd2FQX3gBKMcKz+/Pbp6sm/xDYzIgR9napG5QM++Tg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eDogeUIRi9EZaSlWJMHVs0AQuhh8PfHgnNja3tZYgfs=; b=DXUmSPSUNPXBpIkNOO2w9QX4WjnlQLlsv9Bou26Kb5Ju+9b+iq/pyaQc7ZrRQEjw7xAh0k4HcPp0eV0GsFovA6+LlqvdBIGS51Kp+PcGAwqJASvPi/HNqlbprg5NqDvZ22/xy0+SMcb4fRpIn3FHhJUE/Ivw1bRE7qvWgN+YVmg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AS8PR04MB7894.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:40 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:40 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 1/8] dpaa2-switch: set interface MAC address only on endpoint change Date: Wed, 13 Dec 2023 14:14:04 +0200 Message-Id: <20231213121411.3091597-2-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AM0PR06CA0106.eurprd06.prod.outlook.com (2603:10a6:208:fa::47) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AS8PR04MB7894:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f1a1295-80a4-45f0-9eaa-08dbfbd538f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U2YYzLlBq4Ug/Jiuodj0f8DSHXqDvdOQTvfrpsUEUBDBtsYFhMkxoM7jDPXM33ja/uzmZ1/Wg0qsjjLzEvR2SkWAn9Xlc9IK06IHU0ELnFbDJLL3F8AQ2y340TJaWISPq6rhzAu55MRZV0jfex9PN+zjzyJPtNKnbe1pW6Li6MjmJ3X0hELqMqymFtfVKu9yKLXOo4nR6/st4qi2GANuFCe8Ny1ZV4mwd4iksPJjPavvyF3IhAjHeEqtPjSsZZ5DaVjzpSUPHsjQgOvEqYz8PLFRFHU2uprufbtb6SYAJAUwYiWbEzcImy6kuT7t2TW9LgTJA+HMj4q1dL9f+1l/Ql0+vNPVd2ZVspK5VB4klTeOLQLP24w0m0vSpdARZq9xCuBZnG4sJx7QphNkEyR2q4OmVyo2x7JgGx5pBq+3DU5kfSvSlDuXiSeIYAKdHgCvWmaS/LZ/LPCnEs1aOVIPaL7ZxntA2QwDgB7SKdf67E9oZYsdzm5cNy73k25E8ESeQxFKxhule7DWtw55l/ORbuflTIiS7tOi8HPv+Rdh9cB37TO4skKkefhwlq1IqLvr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(26005)(2616005)(1076003)(86362001)(83380400001)(6666004)(6506007)(6512007)(66946007)(6486002)(44832011)(478600001)(4326008)(8936002)(8676002)(36756003)(5660300002)(41300700001)(2906002)(38100700002)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ryT3IBe+zI/VCw+w9pdAnYPExXZCS3/at4HQsrB4KX9Cn008/fkVfKXmc2cUCb0wUpqIoL3ph8V0TGmI8LfodAk5e6KZhJFrh6sxEOFasegBSIajIcq0KLwBgk1SkF4Jw72682msPXogvEdPJsr+mY5GOpY9P7GG2h+Qt6x+bc3GS7b9bw8Y+xJt5xXSYE52GVrMUBrO4ZNmAHAyTfx+mBlYgaKteXi60nl58HWW/c+S8DmZN7/3M2BRH5ezY73oLaAf+IUPbRhOigpe9cDzAETZ88vbi9FVYO0BnpMxJZoLLfxDeC8UfBEr79h316+MyHZ7AVUa07nktYFpmfymVXfJ1s/WcpJBLi7AjxscnkLdPYoVgPTxYEb4gDxg3vJceJ3ZzBxYC6K02Grz1bjQtBmuC0U8OL7+wKSdrPOp3pIeG4s1SLz6V2rgcHlQHhPLV5VuJO9v5lSVR6YaZ1foUdPUi8jxiHgGO/2jN8pPmH7+PjCVxpSw9qyxUhX1T4Su+EqWctDcgGHLCSKzPxd8fXc0zYPA3VLBtT6Ziw0IipypxBfYyUOPi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: 3f1a1295-80a4-45f0-9eaa-08dbfbd538f8 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:40.6859 (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: 0ehFwjf+eo9E/kzSxGkTjjX9ldcVNCW7cp4cnUELWBDn9vohCjme0bbVmeqB8wbtE0Q2v9QzwLBn1u+0QKBPyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7894 X-Patchwork-Delegate: kuba@kernel.org There is no point in updating the MAC address of a switch interface each time the link state changes, this only needs to happen in case the endpoint changes (the switch interface is [dis]connected from/to a MAC). Just move the call to dpaa2_switch_port_set_mac_addr() under DPSW_IRQ_EVENT_ENDPOINT_CHANGED. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v2: - none drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 97d3151076d5..08a4d64c1c7d 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1523,12 +1523,11 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) if_id = (status & 0xFFFF0000) >> 16; port_priv = ethsw->ports[if_id]; - if (status & DPSW_IRQ_EVENT_LINK_CHANGED) { + if (status & DPSW_IRQ_EVENT_LINK_CHANGED) dpaa2_switch_port_link_state_update(port_priv->netdev); - dpaa2_switch_port_set_mac_addr(port_priv); - } if (status & DPSW_IRQ_EVENT_ENDPOINT_CHANGED) { + dpaa2_switch_port_set_mac_addr(port_priv); /* We can avoid locking because the "endpoint changed" IRQ * handler is the only one who changes priv->mac at runtime, * so we are not racing with anyone. From patchwork Wed Dec 13 12:14:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490813 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="jVOyBCto" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01D64E4 for ; Wed, 13 Dec 2023 04:15:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nadpm9S46+7BknenRHHvfIzN/VAONoiHPyKBK54ZT8G+ERP8iTDVGlXqVdDYBNDrIuoElsHoxif7cHh34zupYAJJ7iUCPRygr+o5k1KDgiPR1u6OG4wZxbow/rlQ+EdKV2wEOSmxcBZFWcOSIXxSN2d/nExhPYT9UY94UkfT1iRpdA8XqYll6Dlb+FMJkoArBNsnmk+eZDVnfSVFQZmTIw5lY3MCaPMHAufpnXxNTPQR9ulWScMJXCn1inF5a5Q7BavZyYUB93M08HmzFkPpC/36b4H1JPXko/Bj7DYsPbf+Lra4yhRBubM3gl7qTorAzSkbs7/aNMNnH0qan/ZosA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=dXFL2vD03rJQ6YlgqSdPcE9cZu50QTyLqhNqXfEgCaE=; b=DDTWtviUodr0YH7dGbWj8gkr27B2I45aF4rzjABCpCj4HKRMV0hGSaQqx8GbcPGDI7s01mylZEOsDmxVdJrqTzaHS8KP4aqU8vw4iDVbavKHcB6h0iz7Nc22HIRa/uPp86RtRX0Og3SfUs5jQ194tmhKPE+/COZFqtBXx+o/s7TfD6gzRgeLzbcGBCSBGMTzQ42kwU74Ss/Y/7+WThzyYVqCnCIrbOjmMaasctPnugyqUUjeUuJzQEHc4+Pbs5V/opTDoBxIV6i8WnyirOX+k6itsp090EMM0o/kl75rekFjciMJl6gWSJXDTX9N0DrfOVJ86w0/59yvF8xg8CjqUA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dXFL2vD03rJQ6YlgqSdPcE9cZu50QTyLqhNqXfEgCaE=; b=jVOyBCtoaU1gwtMYySK1lMJQ+frqU4QIo3aXMPFnhP080z66W/aAORuyiyjjNSYhSSS9AEkz2k8MDNyMrH+a1An/xbkARhnXjX5kn7Lcg3X23giRDNkdnoMUcRQqUN0OBHJrDnoMfIxVWV3E+EkITvuHcbLNBExNrlxCxdzWxWc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AS8PR04MB7894.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:42 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:42 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 2/8] dpaa2-switch: declare the netdev as IFF_LIVE_ADDR_CHANGE capable Date: Wed, 13 Dec 2023 14:14:05 +0200 Message-Id: <20231213121411.3091597-3-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AM0PR06CA0089.eurprd06.prod.outlook.com (2603:10a6:208:fa::30) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AS8PR04MB7894:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f60671b-7030-4822-f490-08dbfbd53a11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dNXpD7MOav+dK2A7p+uGJ1WPQZGqpKhWl0EkmyDmOxztSEsdxG3ygW8kIbuKeX7lk7e/9gBh/g8Yt2QFccZn3cretahLLgh73/7a2YK4gNj8Rv/+D/UPUMTJGyTTWB26c3ZGy6XXEmKrbMKomW8nDs5ltiIftmd345TZPU8QuNO4tUMVIb0OqhlMn8+CtX+RjGJHnu60sRZJVpoND8/yvwDQ9Y5rxEL+jXAZrEMVaycaGdEd32pg6eJoxN2B8+s819nU6vYEGj8Giv7gX1+gn6RA3zepexrerfbHehwTf0uMo4aejU9cEYsaANfq+NaUF/de2TAcq0cTnSqFBy5Orytw6SGSXL8cuW/f2v3Toeqam3dpZnB2UC4R2Bb8vYaaOE7uiORQdisnPXVrRORBEDQAdPHNHVYipLk+ahTdStzdSlAuzWpti4Etjap/HGfphSgvb9bq/LkT3slxWjdNafaCPpApQBDx5rPCpZm2yQ9iEx/n0RJTmQ3xJ7Q6mgKJCNvSa33aD1wJZQzwgOKrjaC9K+ThWzToKmk/G5JEh6X8/3trv4T1ti3Xs9j20WE/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(26005)(2616005)(1076003)(86362001)(6666004)(6506007)(6512007)(66946007)(6486002)(44832011)(478600001)(4326008)(8936002)(8676002)(36756003)(5660300002)(41300700001)(4744005)(2906002)(38100700002)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CtX/EMVVC8tP8FQxThAEO2gazU7IrmPiaq6t/HKb0TqiCrVPwWF5sPqdhcIYc/Pt9R/s2g+j1GVUYHr2PnLYKxqrWz4Nx1sSHB9IVWI1rcJM3XiAHj9Rlpc0zP6/IG6kQ6wa3fPTHS4uy6GDeUt2IrdOy8fFCXPeYm23WIlmdjRhPQAvXxzBk9UpvuCZ50P+p28mgKauOh0fsX0Wi28k+RjLLn4rpKmhMS8r8q2gHUs5qcd/qaM8T1mP4Smoi7PCF6jI6UejBJQiOorFjZhlrh77cazVxijK0uilLJKKm20w9GLOf8p3AUX4DhxQIsGwnaCPB9xuoINZjzY+YuEscXuqufB1muagRRjaxO71ev0fiNpwIOM2ytSZkzdlFm11P+X9mP3zp0YJQ2NZHprYSQJdkF3YLcjrk2ukGhl4D0Xcck9tMgd/3iin9X2RC5kqVcJHZ5+b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Lt59nP/m1Iy0EFNxgaFRNWR4L3O+5iNExaqE1QcgTmdDP2c6Lws7cCi/lMDKopopRru X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f60671b-7030-4822-f490-08dbfbd53a11 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:42.5842 (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: CFoybuLEIpfdNuQW3JVBZvU86CYBOwGcXgVSH0ccKZ6fiHdWd3z0cCBBDPl9Uyh7t7jGHdCLQwWfsm9OMH5ZXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7894 X-Patchwork-Delegate: kuba@kernel.org There is no restriction around the change of the MAC address on the switch ports, thus declare the interface netdevs IFF_LIVE_ADDR_CHANGE capable. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v2: - none drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 08a4d64c1c7d..5b0ab06b40a7 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -3300,6 +3300,7 @@ static int dpaa2_switch_probe_port(struct ethsw_core *ethsw, port_netdev->features = NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER | NETIF_F_HW_TC; + port_netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE; err = dpaa2_switch_port_init(port_priv, port_idx); if (err) From patchwork Wed Dec 13 12:14:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490814 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="D0/3CqYA" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061.outbound.protection.outlook.com [40.107.20.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2024F109 for ; Wed, 13 Dec 2023 04:15:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gV+M37T6cpcJo9sBir6KU75wcZ1HMK7QC+5EL3WkSK40WLu9aJsq6Jc6SD1Oyk85cxp1y/KjgzmP2+8v+CGm/HAKB7iebJRseMYBdEJIqBLF6/MWs5OJy7n4mTgAOAH1ZhaoHJ8G1gAYUu5bwY0fy74N+1s5ywzLPUr909OKGwKGoR0TWKWpkkgaIrZUrS7CNFSEvZ+VXaaO2niLTR2pu2QRWxEmfCo2J7h2a905kiTJ+QKdPWK95E4YvWrOBcTT8uHRfXFZ1MctBlRa6ish7acYZ/pIjf+5xyNpp5d5ahdSZ2friSEEjf/SvljTIe1e9GxPZRTHFTG4UQBEeKvzew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=hqeJQ5GFw1rwAbFGp56J8F3dxold0PSHRMi+eGRXx+8=; b=BrBCKGnbgKDqs2DDZeZUtXRo8pVFcpkEJevUIVD021c/dxw/8wZaiKhLluicRTTvOkl6n9q1jUMwze0hwBL+LBLh0EP6sRt7BLAg66VuulOBHoeUDvPDwcWK2gyaMArZOv4LW0rJ9P7wq4e1wDgdpV4jNjr/kRghZkRVuuzZYXtB4wJzsoKWBdNRgzTlSKaaJDaVwmfelSPOlYcHLp9FknTtTe6qRMMMoBm3uZmtXKriFLsbH5ZwDkAew7ovnyDc0FhSAW6VCiaI0N6dscwqvY5YLg5T6sKLF+AetzMRGWkcSSYItCXd30ea4D4i91FzyrCejXTgw5mGVgJKoNtfDg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hqeJQ5GFw1rwAbFGp56J8F3dxold0PSHRMi+eGRXx+8=; b=D0/3CqYA04WJlKf2DVu42B+AYDBhGGcCwLkfptQmaOp8b0fi4n70WdYFV674CyvmOLC4aDQpjdQcha1XAG3qqr23no2Ld/bNSFD4UWpbdFSYI5BnoxxwXVgFFVev+v1ESRO8UPvBVy3ZViojr/AI3G8Re49QWmjr+Q4nswZwUxE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AS8PR04MB7894.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:44 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:44 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 3/8] dpaa2-switch: print an error when the vlan is already configured Date: Wed, 13 Dec 2023 14:14:06 +0200 Message-Id: <20231213121411.3091597-4-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0064.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::24) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AS8PR04MB7894:EE_ X-MS-Office365-Filtering-Correlation-Id: ffb16bc3-0e63-4ebc-4932-08dbfbd53b4a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZsY/wxmFnILWeMgMLzvRllbV6EitUng0+5YbJDJFcd1embQ1I7g1sVeUE6tEJg8BI7fdzdiVyrVUq/blrrentNFJGmo58lvmpvktywnL1/M/kOTqRn3PNQ22lSekmzQuj+lBl1cCnesQZMOFsz3tguw4lI8N9rWIdeWSj1/1s/d8BoJjGgcGrJMomxR5bq4+ig+6QpzPskN37aLy+GYUPS4TL3ZqsEyYLG6lPHDQoVt32RXJ6GBRHANgal6bCuhGuGjWav77zm1xGiRuQwbSfJ4AglNZon8ubDmMPHuusxiBHzLYqqHDnMTCf/zgqkv2i4AbdJ6TSR2/wS9vl2xGEBYEtkigh3KIKX8a7IaY4nVjYvQnJ9lmKY0AFPv/tswoH/CPMfBf4Du7NGHohwQ0/zhDgiXL4M6H3Gmc5MWOWBrcYrKMx4BPVk3weIIh1xsgukZMXF0EUe1jZLa/Fnre3njDD1NhnWDWvBNt/ZgOOaElMNwFXTV9M29BWTDLlHdxd6heG02ATmdv8gGvA0t8WIjixjlacbrzikRBLJgVhoico1jQsNxxWZWA1NOXdgFt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(26005)(2616005)(1076003)(86362001)(83380400001)(6666004)(6506007)(6512007)(66946007)(6486002)(44832011)(478600001)(4326008)(8936002)(8676002)(36756003)(5660300002)(41300700001)(2906002)(38100700002)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zEWCJknWdwfDa8XjLyVeGNMlfEhqPT9YaWe1Q820//Nu1MDtX8MO11jqj3KqwVIqal2tx9OmLevngNBXFnDLVo+ZFydoavqsC7J2/i6D5voxXWHvGj1wSzDzVHrWbfJpAos9qa8fLIzr4kMDEIwSnDKyRgKxxMpVzBQq3Bf2z7bfu4qlPw5EW6tZsYG4iJyslAr4aIbZk+2hDOE/StDsx1yblG6Tk+2rabiNArg8Q3nXUzyHWfzAqvy3KpqAX75rs5O++hOP0RufYLDnvku2ICPxKy8JSmUcXhh6eXyOmtVeusgWQ8KM6QJJg++HhlmbqsxartDPETOnaD4TweCa/jrN4kWvdtp0UCH9nvjpblihElBBab1D/p+s3WGssP47D4+LgywUXYcYQmFpUv8hpq4JEkimeK3gpUZzja30Kc9RtDGo4TGNREiD1BB4ewpspjSw/CDvNC6TS4Zu3E1+qxN8M/N2y5GlJco/fp/yT066t7NKly7xLzUXN0BM1PPkNCWmd+vIJWMQcGec7Mvd69K6TLHXHISJIHVCRWR4ytBiPFsFn2bxIFGHfiB3Oci+B6vobfKQHWm3A0F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c-4932-08dbfbd53b4a X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:44.6352 (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: zLNmV8sJCUZtX2Sh2yCXslWWwFrYtypTn9eDEDENb0psU8if5q+YDL5w4CMz4RdzhNxLHDpXZE6i0SbiPyUJoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7894 X-Patchwork-Delegate: kuba@kernel.org Print a netdev error when we hit a case in which a specific VLAN is already configured on the port. While at it, change the already existing netdev_warn into an _err for consistency purposes. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v2: - add a bit more info in the commit message drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 5b0ab06b40a7..654dd10df307 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -289,7 +289,7 @@ static int dpaa2_switch_port_add_vlan(struct ethsw_port_priv *port_priv, int err; if (port_priv->vlans[vid]) { - netdev_warn(netdev, "VLAN %d already configured\n", vid); + netdev_err(netdev, "VLAN %d already configured\n", vid); return -EEXIST; } @@ -1774,8 +1774,10 @@ int dpaa2_switch_port_vlans_add(struct net_device *netdev, /* Make sure that the VLAN is not already configured * on the switch port */ - if (port_priv->vlans[vlan->vid] & ETHSW_VLAN_MEMBER) + if (port_priv->vlans[vlan->vid] & ETHSW_VLAN_MEMBER) { + netdev_err(netdev, "VLAN %d already configured\n", vlan->vid); return -EEXIST; + } /* Check if there is space for a new VLAN */ err = dpsw_get_attributes(ethsw->mc_io, 0, ethsw->dpsw_handle, From patchwork Wed Dec 13 12:14:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490815 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="S5OSZqyV" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061.outbound.protection.outlook.com [40.107.20.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B730E4 for ; Wed, 13 Dec 2023 04:15:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=il3azfVh5iLE0067vX6Ieaz+lSoHg7ETsthXp+JBBz3XOr/ny2Gb/rKXpM3PtQfWBRGc8R8ksCSBQDaoTuXf+hC4rBO3pUEQDeSuDapKEHSB1YYIh14jK3rWw2CvcsEbru1d/Pkxm8AbBIV420AwPaa4F9spwbGsYm89FH1JnzMYH9aprzz5pOLIRMRQZhFf9QhuJFZqcwmNIz+5m6QkcB7Birm2sPkd+ohUw2DjG1JLAguPg8jf632FIvS3sQ8kKUFpSMN3SJNZmwInNGqGCu9m55UPA2Jn095n+6Oeaz2qfQIjEfimRNtz3xfLKFpr8dfEfmiQ0txIj3ZSCvJfCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=jIaQeGPHLwzaYEZJGYi+dVI3sJkW9Kc7OESVkhJw8ig=; b=YkbgUntt1YyYvA+xMB5T+gBcWRdVpKR4x2RQdEkP2wFsTOmse222aERF2nmM43u9zKAWP5hcgn8qp4iZIULiXDy8bnPbdWFWD3dEed8YqNHmyRUkxD3aFri3Fkt350tH+RnuuNne0PKX3uZgfFhgU3Bf9359fh+pjbby4lXHO1mtTV8oB0oIgx6vJO8+AJCDyyM7gDXo2aJ+7cqGm3dCX/rOwRedCHZlaYUjhdEpA62c44lwnYarvY2i6Vqseh1y9A/mmqeLKq58icZRTkBYagve2YV/EOEt0e83QAGYg8nlANZJd76/6/ykrVk8SWP+K3mUNWh21WQygbHiDU+uUg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jIaQeGPHLwzaYEZJGYi+dVI3sJkW9Kc7OESVkhJw8ig=; b=S5OSZqyVsrDz3QrJ/AXzD5R2g7dlHFrERs7cq80uxU3mbpSvmlmOVTkIj4EQ1QF+69tCE9ejmuO4zpLx6IHVlSSlDaYLF6gY5eyQXwRhVFuq/UsTiLFFc2vdkWrpRB1QKBA4VUrKjsgNHJWIro0hSQ1W7HpgpbKInAEF3NgYcZ8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AS8PR04MB7894.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:47 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:46 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 4/8] dpaa2-switch: add ENDPOINT_CHANGED to the irq_mask Date: Wed, 13 Dec 2023 14:14:07 +0200 Message-Id: <20231213121411.3091597-5-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0052.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::21) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AS8PR04MB7894:EE_ X-MS-Office365-Filtering-Correlation-Id: 089cb692-b215-404e-1325-08dbfbd53c98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o3Fo6syAcs1JOiG+2ryvCXvNLsu0Hs7FYyYldiMqiTizUEEKOZ/0bNVBZFCWd5mAbVTHiHzCbFnF6PCFsI7gbuASZslBM+aXaNqXHhZk0J3ndDv7vY5KfVYLOv0/N0D45ShoBJdV8z+Cx9jsL8df5FGc9dzfX2BANkBeL07upZK+Cn18wh4IfwfZy5gZYQA6m1+tWYmc11aAd6mU+0+3e+WEnOfrNTK47f+HEnY/FQMprNRPe0v+g3J9wv7RryqyT47bkzsMvSbQsTet3gXgtJzhG9scZ+cynI04MYBaMzo5kGk4D4hhT+hyirJzln3mJg25lTccnpUj4KflJdPbotosDyZVE7KqeQJGCPQ43elPZv2xkuJXKfopQfj8MaPyfzwW1UI3NConN710BcvKQYlV6lv72ni2mxtG3AujjF/8MQK9aOsyAegBXIcir4oNqWLq/trYHcbGrnE9EynZXopwwbgyKrvXjQOgRoGoOtOP2w7JVGpja9Q5Rr4G87DiKQaSqtaIQpR6Yjag7EWx9IBV3obD/vbhdcAvXljRFvobzGMgDlRxy0hrbNCjpqib X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(26005)(2616005)(1076003)(86362001)(83380400001)(6666004)(6506007)(6512007)(66946007)(6486002)(44832011)(478600001)(4326008)(8936002)(8676002)(36756003)(5660300002)(41300700001)(2906002)(38100700002)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yvzWMRTCzWFSo1qbZ6PtOCy7ZeL4iLuaLdpvM/Sa2n42P8PeQttTLeT3eFQUR3Cx/fPeBmSvUwg7i1btl6qL5GbsamLVJ4afLdOq21Wja5H0xlE99dbMlFVMaDmG9Es5Akn2HKru7Wj0MlTzk4CiYb577uY+GhYiQaVmAPVxt8HLSsBWFwhYH9gX6Z4QaiXjn/+nly0v2MbnDySGwYWgbQtDttDxqbg0+BhoEfAP7UzxFjKr6m7wfVNjalmoqjgOSOox8ddtsSOkKMD8L1WuS4Mrx766OIxlo6SFExGz/VLUfn1tCpm5dsPO11TG9AMVJsj3Gv5C7NI9UThXRP3elkTlr3pkE9Uo0kNKLLA7FVipFPKJsSVX4eSpucGNVap1Pefwh8aZiWGEtz1R072/jA9oHN9FHBFrYNdYCt2amAFExD5N/FVkEcKlUil60D08PbJE4BC2NzQDeGbRE/YzPr+FLfENNC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TaVWZlYWEi7L4j3sgQcctvRx3NIeBMNGp18LYsslOFZbM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 089cb692-b215-404e-1325-08dbfbd53c98 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:46.7813 (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: MSxuuVyn9IWOkyVDMSdNziqRwLpjx9L+OPIZHkJz0SVHjlCdv3nO6FxU9AZj3jMHr/OtG0ebuw9DeEx70FSl+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7894 X-Patchwork-Delegate: kuba@kernel.org The blamed commit added support for MAC endpoints in the dpaa2-switch driver but omitted to add the ENDPOINT_CHANGED irq to the list of interrupt sources. Fix this by extending the list of events which can raise an interrupt by extending the mask passed to the dpsw_set_irq_mask() firmware API. There is no user visible impact even without this patch since whenever a switch interface is connected/disconnected from an endpoint both events are set (LINK_CHANGED and ENDPOINT_CHANGED) and, luckily, the LINK_CHANGED event could actually raise the interrupt and thus get the MAC/PHY SW configuration started. Even with this, it's better to just not rely on undocumented firmware behavior which can change. Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support") Signed-off-by: Ioana Ciornei --- Changes in v2: - add a bit more info in the commit message drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 654dd10df307..e91ade7c7c93 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1550,9 +1550,9 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) static int dpaa2_switch_setup_irqs(struct fsl_mc_device *sw_dev) { + u32 mask = DPSW_IRQ_EVENT_LINK_CHANGED | DPSW_IRQ_EVENT_ENDPOINT_CHANGED; struct device *dev = &sw_dev->dev; struct ethsw_core *ethsw = dev_get_drvdata(dev); - u32 mask = DPSW_IRQ_EVENT_LINK_CHANGED; struct fsl_mc_device_irq *irq; int err; From patchwork Wed Dec 13 12:14:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490816 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="SMjoDvJa" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061.outbound.protection.outlook.com [40.107.20.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6476CEA for ; Wed, 13 Dec 2023 04:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O4KFeOKm8NQ6CB03B2SclEwpHPvMzxTqKBTRB+BcBA2qDoDN3Ov1V4zsAyu67zHmGyZVhVbje+cUAz1FAi0wHjY6JW/WUewRFWG3CW0oy1ah2E619qQyL6OjyP05/VE/ZlfgVs8YzQ3UWHZ0pM8G2ezka2rhruIn5XYwxwZZKPPT6YP6IG1Z8z7ihvCeJJcJXCYC0UaT6hRi4siRmG0+tU+iohwX/sSHHLtEzlJCjCWIn0c2hTPCeqQGuRJZcW7hM6SaHlIx4Q0Tfg6wAk4YKKJOePCIQxCtsWDMa3rTOOA1VUxKfiIRAz5eBcIZt+Sdi1OTxz/Uac2YJTUXjb9Pyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Pblnng4JDMhImAMffgV4XBnZaVXqkC8eoMQLbNPb+qc=; b=l9G3nTyP390u+cOcaso/wZQDhvYm2NJNybhb9EZ51t5FKyc+mGnEMUerOBYogN/11pj6MeR08q/qvXSWjTI7BPefFtkNVdxktvWVJkeDn7OGhEyIVoz3JrQnjtsMHbNpN89QVfxH17tEhjaq8AGKqWDGXW9g/kpsrSoe0QtAYFL0d6WBIOiw2Lhhii3Yk2boHQwkEhjCmIlZS3zuw1JxytVbrdgLrTN9yyKNbhrqQ+eQCtv4+MgJIBgLKoHasbSlMeIhnNPIUvX02y75YjR6k1uq2SzhMwF/QzQr2zqayWi8O/+Fdqg6Q6BpDzq63+TYkqLOJqDAN8KCsw6ODdhjWw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pblnng4JDMhImAMffgV4XBnZaVXqkC8eoMQLbNPb+qc=; b=SMjoDvJa1FVhpvvEMcmPzIkLPdtDcG0K/6jIYX17mpBx4AZODQG/0YhPcu2hcu2zX7s7oZBJ8nJAnFmAb/L4oOkDPCJ2C0sm3EnVXPxgCOhLgg0ILsBGvI6FPj9uZROfEn+aXdCdRgtbDp4QJ+wZOvCCvlehy4QgxuJjER2Btgo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AS8PR04MB7894.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:48 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:48 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 5/8] dpaa2-switch: do not clear any interrupts automatically Date: Wed, 13 Dec 2023 14:14:08 +0200 Message-Id: <20231213121411.3091597-6-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0068.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::23) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AS8PR04MB7894:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a1a69b6-f22e-493f-5346-08dbfbd53ddc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vwE4l0WJkSwgh5oAuiCiMIlxNDI3uJWpEs4YUIybFkybgg5fXqa3C0yx98PUzRyhdrQ+Ro+YNCawWVzJQy2Pa7BALmzz5WFiOms/EII24v0h6SGdQN6CFzHcKFn3pp1cuy6v1kELBcWjY/hYheEOKAZn2CQxzbpkwebJaEE/0kkqSOdubyyenjUZa0PK7MAvgnxYoTcQGfI1/XkgOCcaCgoYH3dmxJt3ccoVTKeAnfSzxmYDS51c1Ei82hV3dnj+fVJPlwnuSTOLvzDyAW6IVvcsdFLG/1mHylMi6qqMFiuRV6h969H2PrhNa0De4kqIqQYVDDeLvHJNL247Cfg2o8Z4CYIlMqPIyT/Trgq2CKTKXhmVxRhVXnjftoevCC+UJY5gKqg3EQl/m3btrK2gOkoPveBJ8XCXQKINpVwRhO7Jvr+s4JB6L/sX0VDWPeKrSqPeEgMp2D+c9IaRo62G5NtRluA6Q59bJzgv5lhtZ1k7K0bAdcspd4KPjeE0PsAc3g2Vvx5x9NKyWAefZ1oLrC37h9nVRgUl2IWOulg75FUwK2/Qb5gJEBB1D+5e1a6K X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(26005)(2616005)(1076003)(86362001)(83380400001)(6666004)(6506007)(6512007)(66946007)(6486002)(44832011)(478600001)(4326008)(8936002)(8676002)(36756003)(5660300002)(41300700001)(2906002)(38100700002)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mEHwTfXD9aO9RNaZEmzcswGwpauDet+WZdCw0IDCTBeXD0WU3W8a8EPQWpowwdTzvFKV537N3dUHYt9CIKg0qUzh2sF9DvZ0kM5mNED12MV/buLA/1UHuymuunuKgIKGMOIHD4WZkW278ZBiiFNlI/NzxOmPyKgD3SCtwqyExv8IK0cC7+Sr07tL1WIBI/CsqUGaQdCA1pvUFVeBhANkmVY1ah6gTB622MOtgHJE1ZkBuJM40/ud3d0i8GgHP5vcbQ6LPkMVGZn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hfgnH7uDWparMeg9I7YtnYiRK9PdFtpDd7mbQ/jAUWzkr/Rc+jaTC7jjFyLaIECv+e5jcxTn2H1NTcilxnwXgyyDrjCbGzSzP/IVGSiZMiznJQylLOCy4EWIQoEwagT9wA1SydfBVzinjBJ12AshetHwgD8dNMQeEs81ErVSYcqItuHCQ86CRgWRhb9Ya4M3Wi/+02HCpbY8RWzgAe5WvAjgGv0DcNJ+utDDuGfKoIOObmPBTAL9xSFdV7lUhekQx7pv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a1a69b6-f22e-493f-5346-08dbfbd53ddc X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:48.8657 (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: +NqY+X8C8M5pUfohWM3FyrAtf2UJPkpeKWr52AIiDm4G5jQK4x0g+kcn/5zktA276yTBgeN0giaFccdiL9MyUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7894 X-Patchwork-Delegate: kuba@kernel.org The DPSW object has multiple event sources multiplexed over the same IRQ. The driver has the capability to configure only some of these events to trigger the IRQ. The dpsw_get_irq_status() can clear events automatically based on the value stored in the 'status' variable passed to it. We don't want that to happen because we could get into a situation when we are clearing more events than we actually handled. Just resort to manually clearing the events that we handled. Signed-off-by: Ioana Ciornei --- Changes in v2: - add a bit more info in the commit message drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index e91ade7c7c93..d9906573f71f 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1509,7 +1509,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) struct device *dev = (struct device *)arg; struct ethsw_core *ethsw = dev_get_drvdata(dev); struct ethsw_port_priv *port_priv; - u32 status = ~0; + u32 status = 0; int err, if_id; bool had_mac; @@ -1539,12 +1539,12 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) dpaa2_switch_port_connect_mac(port_priv); } -out: err = dpsw_clear_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle, DPSW_IRQ_INDEX_IF, status); if (err) dev_err(dev, "Can't clear irq status (err %d)\n", err); +out: return IRQ_HANDLED; } From patchwork Wed Dec 13 12:14:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490817 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="oIdJ25qZ" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2084.outbound.protection.outlook.com [40.107.20.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3A7ACF for ; Wed, 13 Dec 2023 04:15:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AA934ggZjf7PCplBiuAWh+OJBMgs+plMANYBd/HiMC6iDRPPq0qHm74Of6kcJ1nQPFEffqiRGF34HCf5PfGSo1Bn6/7Z6VlYgJ8vGR1UVFt6qNPOU65Y70/e66h5eAYIa9LMOtngv0AW0eq+HTfOD8hU8YWwpUg1D6izJsk9JMPTsUlFfnyHzVWVjx4UyMDgZBkZXLbqEcUkpROpEFiRBkfCtzwgCvnx/pf+YehAoDnbUhh9v+Wvqx11FFpa1Oew8r7dNuunYhCh0fYE84/iHPjdMQNqJUQkXZi3ybj8EVE6LelWDVx3LgpwinLKZ49F1Yw7m2QprUg5ddiSB9xwqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=xdltuH3SZgiHn+mCN7QDEGebCcb4fWERK38PuZULMHs=; b=NqWm6MI6QD5zPwddA9DhrY9QQujN8sCRiDeGDJJxTeD6dGUaPLTucdqFF8W4ONj2E98h6BOcaYEMxBWxBoeq7gytS5t39pCrtt+EOsbIVKPfE59A1yz/BF32jmv/idzAwrmcvrXaam05dR/tJ+WK/9OuYZmPIKRWaOZnmiU+HQ6wkTKWKXQZTEGF/H3wlUoTuqv+sceD+GgXPLtK1pZehiEX3Q5Qqhbo0Z6jAfoi8wG4kTHQgSRlT/zTWnhFAAf59SBeED+uRHZopA5iCmDjY3KjW9fkFc0suu6AebtfcYYax5S3jZtmFYdlxs/opmBsDmG4p0S11hgP0caXJ1eiqQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xdltuH3SZgiHn+mCN7QDEGebCcb4fWERK38PuZULMHs=; b=oIdJ25qZzB9bu8c4dErmTT/6xLzbdVS2Kcrtha+JlV+eHARFo8v86EWWSlOHrkSxbCPMlajLEtEMcIgIVuEJ9rX3RcPui4ObortVJpTFLfhc6NApzOeB5anxJ7Tm5sM5poHS0nEYf4AEJUvUCWsxiwbdRrg5Qu1lKGZ5dsVGZXM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AS8PR04MB7894.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:50 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:50 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 6/8] dpaa2-switch: reorganize the [pre]changeupper events Date: Wed, 13 Dec 2023 14:14:09 +0200 Message-Id: <20231213121411.3091597-7-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0059.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::29) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AS8PR04MB7894:EE_ X-MS-Office365-Filtering-Correlation-Id: be251c65-a4c5-4b99-e30e-08dbfbd53f0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bWBxA0gCCmWSPPKo7EUaQWieIa6ZCPbQs3v1HLeBFiaed9eGghBegvBSD1UuY9fnt8mGhm3JT4smADKql9h8yrCveY8mByN/jtVmzoBi3X4oFuaC1oR4Vj1RbABRbqFSquQpeRHn7sqBSRWK6WXIZz1O5L1TyBlSBuIZWWtMx063z1u4R0JbWr9fBq/DiSdcAQA4uyMgkcXK08nvQdlc+wnjX2tWY3wJn3yrI3vF9MughJjovEVdQo+ty3jRfE/mlIqxgWrDsYC36AI/VMP1Wm4bWT5jWJ4C/btKsdAy5gSwunIogVLT7ciJn5F/o7WcJAWoye+GWPAGX2zndULoAElGqbkAe7KfVL0Y7NsGRAkJUoZd6avLoQsLaNHaU/jyMpEIHqLpTqa0Iv3xEiVnLxIEkTgAqn+L5HkJlN3rRgjQ9P1gHiyXSVFxhiciZrEFA/KXYJq+Rk43FchRsOYDd/oAZwzdyrCvOw3MyCfJcrmICr5UMFms8eqAw0xEz7PsRDTTi+USVrDaGCt0olAIZ3ksBhTIgVd7iTFSyFBADYvl0T/r0RDKx+NXzmJJj/LB X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(26005)(2616005)(1076003)(86362001)(83380400001)(6666004)(6506007)(6512007)(66946007)(6486002)(44832011)(478600001)(4326008)(8936002)(8676002)(36756003)(5660300002)(41300700001)(2906002)(38100700002)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cipKXvk+yWVi+zDLddx6/Dc7gsKKBtkI4HmB0NMCVO0om/JVPrj5aXHji60JNwKLfx3bGdGEdHJdHVWU9bGyY2f3RzX3QLEHBOnmwh+IbDZZuaQzgBXeYlkfZTQtujt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sDoEeBtEgn7lO04HF9fGFE+pjXtpOyqSrY4KM/Cp1VQsQuMjn1OymIK5pDEDo/vuvGCqFbjwgKMaKdzP6gVLOPID93mI2mqFdI8sn88Us/V2ixEBJ+kKynLBbvJacmigUHyyf/WGA9+Ie9LqrF87H9nM84jgoZ8XREZZlJL586G5nbLZFltrVv9E2mdSovLEKxtwqC403C6AIW9BgFvGeDWosaH+JXQ10rPH328UQd0cKxh8FZrcwK3WxgYizsoeYRuf4r4f/0IMfjwjcyg5ZyaWk37A5oXYl9a1vbBVkUzW8CSu+WSiv2qkY61myFb4dmo7qrdOAP0ndMj5phgKomj6hEI+Gvm4ZUDHLw5YH7hw5bTOOfG0HPv74X5kiHzZxNBc7znrTy8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be251c65-a4c5-4b99-e30e-08dbfbd53f0f X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:50.8692 (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: t9ovMtD6+eG1TEPn7eVG+bvIYEljhLIe3iFjXzYCnanq62boJiCfa0/kh3l/iej85lewrHOJIU1rzmxGidAvSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7894 X-Patchwork-Delegate: kuba@kernel.org Create separate functions, dpaa2_switch_port_prechangeupper and dpaa2_switch_port_changeupper, to be called directly when a DPSW port changes its upper device. This way we are not open-coding everything in the main event callback and we can easily extent when necessary. Signed-off-by: Ioana Ciornei --- Changes in v2: - none .../ethernet/freescale/dpaa2/dpaa2-switch.c | 76 +++++++++++++------ 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index d9906573f71f..58c0baee2d61 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -2180,51 +2180,79 @@ dpaa2_switch_prechangeupper_sanity_checks(struct net_device *netdev, return 0; } -static int dpaa2_switch_port_netdevice_event(struct notifier_block *nb, - unsigned long event, void *ptr) +static int dpaa2_switch_port_prechangeupper(struct net_device *netdev, + struct netdev_notifier_changeupper_info *info) { - struct net_device *netdev = netdev_notifier_info_to_dev(ptr); - struct netdev_notifier_changeupper_info *info = ptr; struct netlink_ext_ack *extack; struct net_device *upper_dev; int err = 0; if (!dpaa2_switch_port_dev_check(netdev)) - return NOTIFY_DONE; + return 0; extack = netdev_notifier_info_to_extack(&info->info); - - switch (event) { - case NETDEV_PRECHANGEUPPER: - upper_dev = info->upper_dev; - if (!netif_is_bridge_master(upper_dev)) - break; - + upper_dev = info->upper_dev; + if (netif_is_bridge_master(upper_dev)) { err = dpaa2_switch_prechangeupper_sanity_checks(netdev, upper_dev, extack); if (err) - goto out; + return err; if (!info->linking) dpaa2_switch_port_pre_bridge_leave(netdev); + } + + return 0; +} + +static int dpaa2_switch_port_changeupper(struct net_device *netdev, + struct netdev_notifier_changeupper_info *info) +{ + struct netlink_ext_ack *extack; + struct net_device *upper_dev; + int err = 0; + + if (!dpaa2_switch_port_dev_check(netdev)) + return 0; + + extack = netdev_notifier_info_to_extack(&info->info); + + upper_dev = info->upper_dev; + if (netif_is_bridge_master(upper_dev)) { + if (info->linking) + return dpaa2_switch_port_bridge_join(netdev, + upper_dev, + extack); + else + return dpaa2_switch_port_bridge_leave(netdev); + } + + return err; +} + +static int dpaa2_switch_port_netdevice_event(struct notifier_block *nb, + unsigned long event, void *ptr) +{ + struct net_device *netdev = netdev_notifier_info_to_dev(ptr); + int err = 0; + + switch (event) { + case NETDEV_PRECHANGEUPPER: + err = dpaa2_switch_port_prechangeupper(netdev, ptr); + if (err) + return notifier_from_errno(err); break; case NETDEV_CHANGEUPPER: - upper_dev = info->upper_dev; - if (netif_is_bridge_master(upper_dev)) { - if (info->linking) - err = dpaa2_switch_port_bridge_join(netdev, - upper_dev, - extack); - else - err = dpaa2_switch_port_bridge_leave(netdev); - } + err = dpaa2_switch_port_changeupper(netdev, ptr); + if (err) + return notifier_from_errno(err); + break; } -out: - return notifier_from_errno(err); + return NOTIFY_DONE; } struct ethsw_switchdev_event_work { From patchwork Wed Dec 13 12:14:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490818 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="iRioFqiv" Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2057.outbound.protection.outlook.com [40.107.6.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768A0E4 for ; Wed, 13 Dec 2023 04:15:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kSxPzQjIhGZx3da1duwfZeBhw23hHoDp69QTDcEd2yFuaZERD62l/1zsKAmRd4VYLtR2FOX9Dj5HDujNO+ctkMS9RHgOQ2dren4aQOOiyeoxC+Hit90LFgBai7Dju2gudZ3dR/108YUGTUv1IK/nky94pJepPkWtqQn9e52DUPYeUk8U2ICKs2Ei6lewyTAwp9kR+vA7G0dpUs0I1cwk5ClwJMztB6roUCo6RcSuqKqzDn6CWyigCEpLGQlgWmqI7bf5ER55nlAJ9N11Fwyah/D9FPtc4SqwwJnRK4AHvsDSnIrxXfx2IwbMnZfsKk8Yzjk82wlIPdtgvsQbZzaXaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=MINwNap2inbO1AOWDShHCzH8T/m/ImIfhK/QZcjGEIs=; b=d8DAsBUL9qhKyql916tFaSZeKC+qhsk5KRTyekwllqMB5bapmJEJXMo+hnkk/MHhXJZACXENINwdRSa7+kj3Zfp6sg5OSLFytKigV2csy3gWMwMV+QDrkflbZmb8le2xlW3cIFoVEVOg8AHxaNsCX5k0asuHryVP+1aJjC7OeiJgYDMp4rjKcw4+zK1U0PydyAxE234zgo9t1fy8aFcs2VK7F/W4dF6zM/TFvCL6Ybu0BTxUbv9uV90NnakcBao4bQ6RyCto5RkDNO6HQQgzHAuBC0HUpIqvE+tL8ZyPj23LBuQfeJ1lroOwk5WaA02/2+/k7E76Ui6/ZE5x/WLXtA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MINwNap2inbO1AOWDShHCzH8T/m/ImIfhK/QZcjGEIs=; b=iRioFqivzSUIds3eDrYkTzGx+Zl5Oso8NFENeqTaxecCkevuNnfTm++Okihvx4SKXbJuNTVeBfIwwVk82GvL5DwzyDmsACm/CeEIxlzSabCOwrtOJsPAbldvK6JA7yUxudu1PodTObuVz7OrBaH5nfwJyuITk5oXXGOIY9p2vNo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AM9PR04MB8455.eurprd04.prod.outlook.com (2603:10a6:20b:414::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:52 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:52 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 7/8] dpaa2-switch: move a check to the prechangeupper stage Date: Wed, 13 Dec 2023 14:14:10 +0200 Message-Id: <20231213121411.3091597-8-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0068.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::23) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AM9PR04MB8455:EE_ X-MS-Office365-Filtering-Correlation-Id: 17c7b519-45f4-4d4a-6014-08dbfbd54030 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BwshD3AououszJhTgVL6GKquUMTl+EBox7IWGyZtrS40mvoPy65RnpFFrXBgVUzmZJNxwyCrxVCSYDhztC7LqVq29u/NPGgwsy58ZesToVkbtRehcAnw7u98yT3XlvJdfo57diY+3T4a9odDaEU49rTv/u0hffAC9ab1XCeKHz8I3yVtlefDuUZv4+dMO7Xr8/gZTXy8D5BbOnYO+DJ4z2BiV0HhbbGwWxPdyq7d0GQdfVZYGa6Y+EKiO3eDUZjy3z03S8qQTYeYycB4LaPv3XDJGqXMe14yaTlBCxbqaOx12HdYs664WtIktvED8AmFZx/WEJ2R71Uj1ab0b5Rdt3jfRWOX6fvyqg6fXmhMr3Yt/36cMqeYf85spe0zo8VQJYdC68UD85L5D+VilxEB820J+FzY1fHI2wLRZDQK4yGEl8cezgOqvoGpnPbozjmSuw4odgJlzAw7M1kDq7kY8M6MoAxQYfqjiG4b5wXcHjpQJHJKzilNnz+jTM9+uSyMCvQesZ7no2RbUV6BVDXfiuOX28mg7xm6uZ++Hl+BQBCuK1eVz+nFA4/W2K5JMzGx X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(396003)(366004)(39860400002)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(83380400001)(38100700002)(26005)(5660300002)(44832011)(8936002)(316002)(8676002)(2906002)(4326008)(478600001)(66476007)(41300700001)(6512007)(6666004)(6506007)(6486002)(66556008)(66946007)(2616005)(1076003)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IsZSeF1Jw2O7NcVRK5RdStTXApR1+eWnl6sRYA3kD25XXJgkGQrbyhqD3tepRG5cfESbLitlRTG/1Q8Zc9wcm1QtCi4QXVTE3dFOPXws2Fg20yaaGbbTw2YoXVuehgQRsFceiK8vbR108EIX4kWHCu7AD2dvtNK8UJmj9DBUDM9SckbtGhcqIAo4VHRb70rdr95Agw+ClTASD64k7sX5h2LrSaZWVBlKKQFSmSUw168EvJiw9RUtNwwD5YMpVZoGSwkGZEazZJtley3L3+NpHEczuR+R5JWO4zlhhjyiXgb6/NKoR0oDwNYg9zF+yLwF5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7WJTaxlVBbD1CIWTYztMW+LRuPPHG6FM0aWxHn8A9hmxSOtNEf/6U/EHWSJDCnKYhWN/3/7+smPUFuu1uWUPqaPH7RT/paWkDW2u4iEPcMvXl+ldy/MFECiUf4EZm7NwuuBVD/T+J0mlNqzltJlnuCcYSxpcIUkOBK4qMabl64g+TQkprZ1DMt+Po1bdc9P9PFDFGJfu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17c7b519-45f4-4d4a-6014-08dbfbd54030 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:52.7698 (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: 4/rMenSYSCsxUOpHzvmK7ORn3yGKdI0OEE1UV/suffqD7m3gh1pqqNBCw6yZADKDYwLvxce61gj9uGCjfZpNlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8455 X-Patchwork-Delegate: kuba@kernel.org Two different DPAA2 switch ports from two different DPSW instances cannot be under the same bridge. Instead of checking for this unsupported configuration in the CHANGEUPPER event, check it as early as possible in the PRECHANGEUPPER one. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v2: - none .../ethernet/freescale/dpaa2/dpaa2-switch.c | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 58c0baee2d61..dd878e87eef1 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -2008,24 +2008,9 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev, { struct ethsw_port_priv *port_priv = netdev_priv(netdev); struct ethsw_core *ethsw = port_priv->ethsw_data; - struct ethsw_port_priv *other_port_priv; - struct net_device *other_dev; - struct list_head *iter; bool learn_ena; int err; - netdev_for_each_lower_dev(upper_dev, other_dev, iter) { - if (!dpaa2_switch_port_dev_check(other_dev)) - continue; - - other_port_priv = netdev_priv(other_dev); - if (other_port_priv->ethsw_data != port_priv->ethsw_data) { - NL_SET_ERR_MSG_MOD(extack, - "Interface from a different DPSW is in the bridge already"); - return -EINVAL; - } - } - /* Delete the previously manually installed VLAN 1 */ err = dpaa2_switch_port_del_vlan(port_priv, 1); if (err) @@ -2163,6 +2148,10 @@ dpaa2_switch_prechangeupper_sanity_checks(struct net_device *netdev, struct net_device *upper_dev, struct netlink_ext_ack *extack) { + struct ethsw_port_priv *port_priv = netdev_priv(netdev); + struct ethsw_port_priv *other_port_priv; + struct net_device *other_dev; + struct list_head *iter; int err; if (!br_vlan_enabled(upper_dev)) { @@ -2177,6 +2166,18 @@ dpaa2_switch_prechangeupper_sanity_checks(struct net_device *netdev, return 0; } + netdev_for_each_lower_dev(upper_dev, other_dev, iter) { + if (!dpaa2_switch_port_dev_check(other_dev)) + continue; + + other_port_priv = netdev_priv(other_dev); + if (other_port_priv->ethsw_data != port_priv->ethsw_data) { + NL_SET_ERR_MSG_MOD(extack, + "Interface from a different DPSW is in the bridge already"); + return -EINVAL; + } + } + return 0; } From patchwork Wed Dec 13 12:14:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490819 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="g+VWdHiS" Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2055.outbound.protection.outlook.com [40.107.104.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80711F5 for ; Wed, 13 Dec 2023 04:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GO6nslCUkY7usTx5vEaMP4N0Ysy4ZAViQj0vvJYX3S2R3G5UWBjOlqoP7ZA9A4rmQrlyqhPzAWcn2W85OwAqO8OJr4pehwJ6MQkQUcWlV4+gclnY58g6dCikLxgbACb5kgV5qdZq0rGaXr/OmZsdfIhUQaR7I0wcrizw8HijzZLxBQhqfh5FbWr8fWJHY1lfsC6r+Q+/x9GtYKM8vbSkpfbHQnSxboHn5/5lHzQFoqcnaooEqhtLXHzD/4+BuFxBK2C0Hn1RgBgoZGpqwafY+oZOFplWH9EG0pTsGQci28SYRYiXLkM60oM/yoqp451jC5F0hvgmu/kNXMR1wTXXHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=OzMkaaypMABxiT86bVIRC984Oc5rAq4qwGC0p6Z6ugA=; b=Vj01tx19t2IRo17nxoiHakcAhzL19zQTXPMOb1BoTzqR55bq89HLxJrxLyJvTlS8RUXkbeZYSFY/NoJYCjdh2NpnR+vdHR9ZwNq9Yww0lIHjCPs2T0G1I1QbrpmjJfzhoSV7/2yMn+hMU0QcSxqc8ynPSvW0ON5cyHvIbuGlEd7RRKnhFcTsDZwVWEjYNzUAatQhRm1gCafnVFd1caRTpMgBhlQYZBgA612wmvvpzEgeMmzAb1F3e+pN2Rz+Rwv9ozrJiWvfk5n/0WZ8vYfZJ7bsmwH9pru5O1BIYa5eZk415EvTiF2g1aKgtwicotCVJVGz4vfNpg8o0ksdPCplNg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OzMkaaypMABxiT86bVIRC984Oc5rAq4qwGC0p6Z6ugA=; b=g+VWdHiSZbOICy6TdgbX51YnzxzYVZtCEMSOAhDqVP69hO+8XgWtGp3W/eOHjqJyWjMKpvIvRQDi+WIOOtUMDzGdwxBxNL5npfhilA6j66m+PbuFSSBpDf3jQZuD6yf4FloIty3mr67Q2Uq43slXLxtk/TgA5mLlgt2d4RiZUos= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AM0PR04MB6785.eurprd04.prod.outlook.com (2603:10a6:208:189::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:55 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:54 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 8/8] dpaa2-switch: cleanup the egress flood of an unused FDB Date: Wed, 13 Dec 2023 14:14:11 +0200 Message-Id: <20231213121411.3091597-9-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0063.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:659::13) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AM0PR04MB6785:EE_ X-MS-Office365-Filtering-Correlation-Id: 588849ed-116b-4105-53da-08dbfbd54147 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fsbNTPIbEEBrLjxNG7yixyULVaDmBUjAwrynZDNLC1FBRTDoxC8Bi0SFCfBvkL0eMH9JYzI1b+MxfGxtNz6BwiKCUZ8huIiBq0HzCrKyND2yL2qMagM8/ewt4S+JJrNN4yciSv+gWBye7KxEfntlQtfDq54M8WFSRanrDUcW5DSUSsLHWKK0Sm31j5vMtsVptDbctKEZ1vjYfd9DErhi2CyJ4Mfe4wMZHDmfjwaZfnQ7/eHz63NtDbsKERE2yok47MW8Jpkk0v9248hpobL9MsZSQrpdS0/uE+o58FBBFFk3g/pmJfi0DUP8Z/CuNGritl1rogvrrOmTv7RRBFjxdJXjW+mpQWteku3m42oGOizvfU3LwJqZ3HIPbQ46QwKhI+Yt2VeE1NO3vyPEt8G5kglfEnM+SMyYxEh1wWHBDScFeCGllExHSHRAs5cDn9JZlZRQ7ct3Rgy5kqybs+lEY0ZUZDRKjxCwrUbamDDWS5zQ348OaNxcekW6NYFmLJ3b6YybV2Mo5SVL7YxJEaq1oTCNruR5KW5IcKVyVwvA4Q59X0AT8dzOGVuL5zKjPv2e X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(396003)(366004)(39860400002)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(83380400001)(38100700002)(26005)(5660300002)(44832011)(8936002)(316002)(8676002)(2906002)(4326008)(478600001)(66476007)(41300700001)(6512007)(6666004)(6506007)(6486002)(66556008)(66946007)(2616005)(1076003)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qIFSuVBmg7VDbvuchBh9HgBqvt+44cLFjDA1rF/IpwzznCyqhra9JVTidpsOcJI/kF4/qsyhfDKE+Q0xYMnmhGjxpWtvtYCjnjLxsjHhxgHE4l0i+1r2/QFRqmPwdpLGnvnXSoR8RLN5k68iKguKQep5rqLQIEPZ7+IyIskMj1Ig9hFNt666RVVatBDJray0nagF3SaqDyjjXysl5NpKDxkFNnp69MiD2VgHD10QE5koly3kZvTO3SCIGv9012SW8m9Isg6OAJU1bUyOu64JAAVNTqRqVfHsfsVxli+XysiYQtAvSMfYCQUd3kfJ/FO9OvCKAgNvTvf7ddEex8AJnMW1v1Zt4Fr8DlOSCIZyMU8wO3NLyTTF95k/NBlQoB/s39L5ppA1SL6BDg2dqoI02fPft5pspXQUtoR7nIpy65Y2Ur3MkJUBKTJClrYu+arDAJpzYKrx7bs3qHu+/45+3C0a1ohqDyXwwkHKD4hHt+nmg7eL9e4n73JnZ7M70tKzlUF4yYY21Ttv+GlmCFwftlyM8LexNaucg71Hw6uDpS9+0hIXx2Qrp0AlRm8KIUxdwYWPskQqJOJLmSL7sQoxvv/t42P8pxeFCo70895LEJ2AV5mDUApIt6+zMcYWF0MQ5qrAnUv/OhSIispYS+DnH9VEGBpoOyF3gmdFfq4nNcA6FggNtJmuGBq5ZZ4c3UYrSI+8MxibCsgjrxSQQddic7wGhnuj/TUI6n+k0b2TD9v3Cj7lG+Pvjpwy6obfU+VgqcPmb/J9MBF+T00wDwYopHfaRcP/ZV2i7jSInNOWizHPoYEGAMR64f+Linpv/hpE1dSh+0oQXMSHpY7Tk3f95Laum3AaWwk5+YBA59gkJTwYsMLHwQYgzG2MPgtEmyKycrdRFxUs1TSErCvS7ModzLLZJn6FsqidwDSAooIHQmdZNhoVOrXIUTEk4jKU/XKkI5r1r1iC0/M9XlqJNJjV6ZUgdnOIsVQ+ILPN5DR6l2JkFGFZ9IjZCTzIY5WKF0wI885UuBHgmHwH0QbYEdc+4vkFPMGgeqqCEPAwhXWhjWW0lz6JjIyCt96qHjS1r1f5XOdiwEpDMwmBasGssDmfzZcpJOxjLSP01UnIhNTT+2dau/iLM09k0L4IYRLt0W9IUPF3xU5zIwZ4Oi1xPUVYYEhovjAYjrZzviikxIQ3Y+Bm7wzSKGxPbuKYvyRivQ4E3XJp2jbLgihyiknfOpVaXOsehbIgUud2w/W0Wp5pRo4bhaVDx5NmNMd0bxA4OA4+Nvjv9/XAH9P5IevmmDH2bJYaoDbawZc5tkMwmzmx/IQfLyXweavm0dghGp7aQQIbAzBMIEub+4quFsH3d9T0Nak9dgpyrJRK220DlMzTX8yTHJVygS6BrZfdTueMEt8x2ipVoNk8W3dqNIzwVnLFxSmfYvs2v/nrqTmotsqlqwna/bVg6VFWh6aee4xuLWirIvfdFpZbbNvDClCKoJalmlIvIZjEyCdBylnceRR/NtiVl4ttHxedZfeQAcl9CNk3YAcJntdtsja5eWywy5U2cLDKVaOgs7yTh/HG+XUQnEFv6qbmAgu15kPCIEy+yN88 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 588849ed-116b-4105-53da-08dbfbd54147 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:54.6007 (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: SnmPQCKyoU2yeM/uL30Q9vfS3xSmJ1BzenrP9MT22b0n4O5/0bfWSYRsfyGKdPNxkou2WM3LKUJPKhNVl8dqqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6785 X-Patchwork-Delegate: kuba@kernel.org In case a DPAA2 switch interface joins a bridge, the FDB used on the port will be changed to the one associated with the bridge. What this means exactly is that any VLAN installed on the port will need to be removed and then installed back so that it points to the new FDB. Once this is done, the previous FDB will become unused (no VLAN to point to it). Even though no traffic will reach this FDB, it's best to just cleanup the state of the FDB by zeroing its egress flood domain. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v2: - add a bit more info in the commit message drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index dd878e87eef1..7ff678c759e4 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -2007,6 +2007,7 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev, struct netlink_ext_ack *extack) { struct ethsw_port_priv *port_priv = netdev_priv(netdev); + struct dpaa2_switch_fdb *old_fdb = port_priv->fdb; struct ethsw_core *ethsw = port_priv->ethsw_data; bool learn_ena; int err; @@ -2028,6 +2029,11 @@ static int dpaa2_switch_port_bridge_join(struct net_device *netdev, if (err) goto err_egress_flood; + /* Recreate the egress flood domain of the FDB that we just left. */ + err = dpaa2_switch_fdb_set_egress_flood(ethsw, old_fdb->fdb_id); + if (err) + goto err_egress_flood; + err = switchdev_bridge_port_offload(netdev, netdev, NULL, &dpaa2_switch_port_switchdev_nb, &dpaa2_switch_port_switchdev_blocking_nb,