From patchwork Tue Dec 19 11:59:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498183 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2048.outbound.protection.outlook.com [40.107.8.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F62E171AF for ; Tue, 19 Dec 2023 12:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="EysnXaLB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dkG9lxOinWb11iOsNsTZP+tEcFYBXWCEMRxFMjghJZUq4Ln2ySaqjouF4HOQdgjLGd5QXfTptFOLKiPIaOzUWtgFcq2AjZcaTTf4OIZTk04Z2T6pY7X19nCFHewRlAuAm9PLbEcgSiWYKo+mOiYRK58u7oZTTo8yhRVaCymEUCxkn59P7l3Q/YTy/NcETKAUWXE/7wh8USrl3+3gxAO6KKNZ5R9V6eOJvO9PGAFWU3qrdqBnorkWcPwzOdT4OjwN+ogVsY1/ToXCJ4g9pwk44dQ7dMHLGrj6IiVMu9RzWqW/NA89y5jPLt/JWGiGSCgDVkrwvC5bQuHpMIUlqDLCRQ== 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=9eo9z29urSqhljxJRrc6QpnFmcGjCqK5/Yb9pRH4c9A=; b=ZS1QDpRTMIOnAbUJCZe3WqYr3Vvft3E5Edlcylx/TpwwXMroYJQ/jAs+UXC2d2iGOKn+0ySUCAy3Jd4Ley9a7+NqnSzMHCB8hlSyMoBU/KGtT3WDhi9TJgsZDfNXHfzBZlM/fhgQRjGz8cSwIPjmNwfgU7eKaVjmRkuHSyVRRerRFaPa8jZZBxVXIFoD2kLdbf+fpOnKQOrE0y2RuJeGAviSAxlwqKNQsnwjmygV0MbDizWF29u9uoHh2uulojx1s+KMTT4HpJEYX84eHqaiD8H97J0Gv4wuIxYW6XQgdqoees562HGh69RUqkdy7D6Au4GzkEq1ElUOVskq+aYb0g== 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=9eo9z29urSqhljxJRrc6QpnFmcGjCqK5/Yb9pRH4c9A=; b=EysnXaLBRpdb5rYR86S0tLFFxFku9f9GRlic8yBpKHtXm2ejPS6RPt5oi3ftgQDOb+23jEGMQJaJItm+lpxcxYWpk4oE7uL2b6ug2ugQAub+OSXbYTkac2xX3zByxRIG/fw+axXzQ82WCL4RNrX36KAqYdJaBqHo4+4nrkKcN1E= 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 AS8PR04MB8786.eurprd04.prod.outlook.com (2603:10a6:20b:42d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 11:59:58 +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.034; Tue, 19 Dec 2023 11:59:58 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei , Simon Horman Subject: [PATCH net-next v3 1/8] dpaa2-switch: set interface MAC address only on endpoint change Date: Tue, 19 Dec 2023 13:59:26 +0200 Message-Id: <20231219115933.1480290-2-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0009.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5d7::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_|AS8PR04MB8786:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a1a7383-4998-4853-c510-08dc008a055b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5RBu2Dq6q4KzEPgbcQzT0Rvm1AILc4FIS3KIVMfy7EXuU7rRwekvl7aUKlkCapuu9jyson4HX4qZOlMZvPNSzKgD0s3dv/7AAZO3nyiC7OJkpn91I6RnWtdhl+j7vcxuC+WGfCf5zErfgofWRrabsIeZYGTqGHpPMBFt0mMMfXW1K3MSugBe5CIbhlkmLjL0xfDnaQSaUMbWTEQwWYLjo2zfO96ZPcGUVa/atLGhDyBvPAIxMndCtzcaSt9xyN2XKIlV3UjvrmuacsObdzGnOnPNA/NuKH21JXAm8yh4D1rvEqO3cWvGFUDncGoDejbzLkRFmbl18iuRv3yMTTfCCwIcuxOG4Y6BlQjEIiSB1Dc2CBpDbGTKT3L783nUzFT1Crp0I2qXsvDUfRZv6MTGCcZnkBM+Bi80GdLvYLu3NSk3AA4C4RVzrj9Xtg1DBtlK3DWklOhRCwvuu660XZQgrvbAUR7Oo9uU0iK8c4ZbYKPNea2SXv8LdebDCyBbabT1b9+qlmf0+yz8caKMCkSoXXPQb3XcywbrWhy1UXhFWr5gLVsCBwkCNYTPEyqdVrqq 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)(39860400002)(136003)(346002)(376002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(26005)(8676002)(316002)(4326008)(86362001)(8936002)(44832011)(6486002)(478600001)(66476007)(66946007)(66556008)(54906003)(41300700001)(2906002)(36756003)(5660300002)(38100700002)(6512007)(2616005)(1076003)(6666004)(6506007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EJKvjpOORV0E9Ugc/C9c21ZNQEMJvKTvKSaCTbFykSTSNBK5GowubE05BOzGH3ZyudJqfKL883Gn8kb1wKYIEHp5aHGuYNHfdBHEmyLAJWR9FvoxgADZo6RA+2OhHJmMkjpEGVyRDuoEaFTFbTIdojTVMCKTqj/gjIB8NijacQeygeamNIj311V1QUjs4UhQCYOvuIsZrNB3KN6Q6b0/Hb3lhiic+94Mp/SI9EW5eXu6yUaxbJpztN2qibFLIPrm2K2J7gg8R5mlnIqecO55rvwBtrDWcADiuFZSUwKqGMb9O8JlVocz+lYF8c4OihM5ryVDldIjnp8bZ1lM9SoAWJUmYdO+CbPF+3mlKh+NN3VIn3gnLh3DTY3k5yejiIzw4haDa3pQlMp4v2PipZrraxNn4NitvjTkIAn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/EjCSti5/mdjiq3cMFHiNY6H7AEF4ls/NdMtOi26+1Gr/1Sd6/dehE/PDwNP9cUivV9NB2MSXE6kpw9chi/cLGwF+IraEd4fZCD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a1a7383-4998-4853-c510-08dc008a055b X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 11:59:58.0934 (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: KkRWpC0sJHIIF61b4oRgeMgkQhOWK5oQWzp7zCgzWXNcZi7HjD91u/7fJxrHfHZ6jvnpkjcrOOpMR7krKH2W9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8786 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. Reviewed-by: Simon Horman Signed-off-by: Ioana Ciornei --- Changes in v3: - none 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 e01a246124ac..811e2cfe6c93 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 Tue Dec 19 11:59:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498182 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E6F2168C5 for ; Tue, 19 Dec 2023 12:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="LONXTg3l" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=APEJpFMEKu5kCUqFf5rqCH4RgiPuJp9uIp+Aa+NQnAZXK2+1KF7oT/My306JG5iR5OBZcg4jD1DYryVVcaxIYN+GjvoiXEosCQtJEI+NA5WiDeJTxZ/UOwFRg7I2S8WtHdCDuymRTE1X3iNvsIKJFuUhCY9muX247YeL9YzfJZiW47C29oJdw8HfRCXzJgDNcyXT2IovKSdwOhRkG/noXnakcjXQL+0xHTi+4Bd18V+eajd+lIZn/NMXFzBQieIYJ6MIoKl9frCw1LES1kid+GkfARRTjhUWwl0vkCpnr/sCzDUbK86xEJEowCdaDKB3cpuNdFR73RLCKqoxZh2Cnw== 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=1dgF/63d3qSSplgp/EVJW74AB/STl3usbIE/0lTk2ic=; b=ESUnQzSOomBAmCGDNgoOhuRoQdhHazDkhuf1JH2hjC9hsIFcaHOmRql6D9POUfrlgYVH7y+/YV5VDM6rG2DAW3FhEDyFibI3w5YS+VHySVHzm/F6nJTMm36IebdnEjDwCg3JofVFAUXL4mn+NxOp92IHkAC053CmDwdkqk/2vMd4iTfz34AF5DgpxIEykHEPe9VA3RoT4iUVVsGG+EJIMXsJM5WwYJ6uR3b7Y07NcK8Nnkp6pmkAEKnTozlkM++MgN5gKw9zHxxi1t4mC/EhF6nA7OES0cEyS2Tg1JKWy5hx1qV/2vc4SzSx2C6M872OHbYnOv8Jg8uDf+lh2iCnNw== 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=1dgF/63d3qSSplgp/EVJW74AB/STl3usbIE/0lTk2ic=; b=LONXTg3l4oLD2vw3s4bxQDTxkH27Y7Szoopb1CTNa1khJKIlOgQx4ojOdu1Ju8yYAyUGzjPbWXBDGdriPnAyoginbPykKkO4+gRrGFPh+Mz4ERTEGvT3YmK9n0sfhQjc1QG+gvHuJNu9uS6RaWW5+VQ7k/R9tqumtiICIO8LdmY= 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 AM8PR04MB8033.eurprd04.prod.outlook.com (2603:10a6:20b:234::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:00:01 +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.034; Tue, 19 Dec 2023 11:59:59 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei , Simon Horman Subject: [PATCH net-next v3 2/8] dpaa2-switch: declare the netdev as IFF_LIVE_ADDR_CHANGE capable Date: Tue, 19 Dec 2023 13:59:27 +0200 Message-Id: <20231219115933.1480290-3-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0004.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5d7::7) 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_|AM8PR04MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: d2334d4a-3ba8-4b66-b655-08dc008a06b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4aDTMlCCLiThqUhFPk5CT2zxo6pAL7cUpZCGeq2fezVHBXlJCWaoWTDUCMsTIz1pTMsY+IZiwMchmaYfvy6zGxuPttr5MYU4DjnQp1WLiEz8kiqV/EGUJd1Yomcl++N+w1PuE3eIxjXsCbxH3B+fdn6jFsFSJDyVvnck/DzxiQoOjGnvMB9lyxxsMdm2VipQ45JbL39wZ6fSE+vlrRkcf4P7mvEC4Im84IR7sbRGfGUXtkjOZISPMyPlgpcR9cQ4sVaOnj7QXsgYzMHUA8l+lBGH4wszFNzF8d4KypSLeZk/7fWwm3MHfuIPJsfE/GDIWDS4G85OEikGqVuwFliW5/pDhbFzTeB63oFi5lTH5ns3LzH68TJq0Y3ZTVDEUZrkHIlOJFVSZu3VZnz0fG8cexcGwu9aRJC2oalafr5S+BxJzXLAOwyVOzQc81Pn6/hKMNDqIjQh/G91ml/zKTJ2Sv86XvyY7Mz1McK1OYJ00EHmYeuyx2HvKcI1xAvB1yhZcGDh2CG2FOsKKKfKh9izFLLlZjGrfx/XIPIe1CalNNaT17PsjUZyIUaqDibxFs2n 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(1076003)(2616005)(26005)(38100700002)(8936002)(8676002)(5660300002)(44832011)(4326008)(41300700001)(4744005)(2906002)(66476007)(6506007)(66946007)(478600001)(6512007)(6486002)(54906003)(66556008)(6666004)(316002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EIq/T8q+2CdV/s1ZE+3HwNbSLKapK60r45VyaVoqHz6AzUaddLVd28CSSd2kCrd9KxheptEPFXWVCINm2SbPEsLZTJe/MKPR8RdfyRU+8ALLvfNoOLoHmVFFC/ToxCIxgjR2ABV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NSaAUfJzwZ+uA2BBxM1/fNaqukanSkHPzznX74lh3gdBnYmxwl/iQjnl3qgaAn1O69Jwsg0MOkx6pEptwLYESayiL9DBg/Ffm2MOpqQBi5KV+mLjyzcPlCTO3AJc3+zBPpLdWvBERJ+FERXndRPHRJ7j4H4MSROytpgTrE2GjLHJa8UQ5ZnQto8qqNw9+CVfe6XautHodnWThnDe+IjhP2ZCCAS6a1H6E4tARrGSeKMnWwJv8v5zSvoJ2IAZn1olzEHy4iIUm+Lur13NFKwdg9jdVMPIFbccpeh+AlohXPAs4VRYBHcgNT7GPtF9e4Z8z4KUroCw+5zkDzyvDkuOkmj5DrjuPO7Ior1lkP/TyH3CWaDjV7xnH+7E4vo3xBnpy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2334d4a-3ba8-4b66-b655-08dc008a06b0 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 11:59:59.8877 (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: LsIslvMYSEgU8yCsyWGvQACa2UDwJVPVgrVd9vGVvVrqUIEcNXUqz+J7UD4wleF889z84S19vTTvrhHxktO+ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8033 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. Reviewed-by: Simon Horman Signed-off-by: Ioana Ciornei --- Changes in v3: - none 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 811e2cfe6c93..a41d5c7428ab 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -3293,6 +3293,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 Tue Dec 19 11:59:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498184 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05943168CB for ; Tue, 19 Dec 2023 12:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="sFW8Lu9+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cvHljDO1bzhyMpglO6E7Fw01Vz+n+eQ8n+fs3WAxq5bhzJZ/B6fFOyPgzdzOPcMfA0T0fjkydOwuNjtUoE4/Lsy3Sa3VQI9Img8tHWdqbsn3Jny1kIsRy7CJOT7h5WL2UCzzAAAXSz+V2ccZyFEH5mHA7L0CFOt3WGVCXPX1DcwZIqs5CowiGRLuCnNSFR6RwNH2hGDILwFz+tSuQ18R2nygYM0rIEtEoufsw8S0WraQTygFVY/aFPXErv1DSBia0fbZZIB6XYzonUxBsR42Tt89HZwj4tkPiIxnJdQ0aDwsj9bpt3sHFV4jKDBpG8EjO0tvec14bEXPw/q/U8I/cg== 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=jKv9V1sdLPZ7IpF3xTZC2Xs7ndL+giaaHY/Q7ZXuGUQ=; b=YI37K7dmht+bMsfpuxv/b+4/4gVEr2lZURjFngWEQlQ5LGlUevyVnSiEouKKuYVbEkqynHOgt4kWEouBuorQLy5HOEuF5EgegrrPJiFSP3LiSjkoEnXo9a3r5HT4iFc0TrWIh5BL4vlmnZq9r1Dym58pyPfFzmovnxZQvct1sODSgcyjSDgL5zqPgxT8sJx0aPQj7YRx951cZRYwwbCTWJK0/1kxIMLRXq443nZURMQhhHSheMnJgpmQmk+x0lmGGrDDqgVxy/81Gx6+IJaiQSTBWk6xobctVgiFPqez6qYcwzQrFYZPjuo23XOs1rC3RhcVK9oMmw3VdI1xGohc5Q== 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=jKv9V1sdLPZ7IpF3xTZC2Xs7ndL+giaaHY/Q7ZXuGUQ=; b=sFW8Lu9+hDH5x6R6ve42LCHREkoBUgqCShQL1j/pVJfunqOK8puH5pe7aeSmxbEQCsfLSUasRlg9zfUlOhyAnxc26qejpUiZ/RZa+U7fT+X4lRTYZrzBkELKlU3QkVQI7S+OFen+UNIrCUUc2I1HiEUMbfEeVnXWcepA50W3W0Y= 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 AM8PR04MB8033.eurprd04.prod.outlook.com (2603:10a6:20b:234::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:00:02 +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.034; Tue, 19 Dec 2023 12:00:02 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei , Simon Horman Subject: [PATCH net-next v3 3/8] dpaa2-switch: print an error when the vlan is already configured Date: Tue, 19 Dec 2023 13:59:28 +0200 Message-Id: <20231219115933.1480290-4-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P189CA0007.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5d7::18) 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_|AM8PR04MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: 000a5569-ec6a-4db2-0d82-08dc008a07ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xbyOAZNaCctGmdUXjHnSCmxrzkrRae0JCjuqYbgdbHY+czzMYyL/9JorFN4aJAqlrTpAvuHTPA7B0vau2HitH6S9THV0CZtdt0NQchKj892APGJmTl1/KgRKa1RMyZDwrLStxPUlqNXlEs0njXzda4ZuH+zR1DN5yxLhdqWvliBWGDSsDljpHSQNpjDovbTLBLNmaDE70Z1FGtXbcnwPdA3BloPfnXMuUn4N7ogXzrWm42Ucb7nenXeJVtLpmftqHC0QHV3QGTzZszRN2vHxiAvlhT5mVCIq3p6EAuT2Sm/kyuZCLjFdoHso6J1z0CHJR5QAERUprJKGg1OCxjw6KMmxw4iUAsa6aT+wpX2fJ8hyisNViYJH30xC03h9RlBwe3faiY9ZRnnMwlb+OZBvJ9ttzBpwL6Tk8ivYPHxvIPp0Oe+rA7/o58BNHr5qwbDKKEICd/Sgn6rmQ9nqSQHTy2XqDW8rDTiXheQVvdlMxTI/+fUXj1bYNjNAi/zJHQxD4IedEK+UgMZ/1sV2bZ5ZrDufiKLSKLes5suy1WTAA2Ios1LWKoD1NLRbldsvRJml 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(1076003)(2616005)(26005)(38100700002)(8936002)(8676002)(5660300002)(44832011)(4326008)(41300700001)(2906002)(66476007)(6506007)(66946007)(478600001)(6512007)(6486002)(54906003)(66556008)(6666004)(316002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fCn6FlEuWQGkmdlu8wGMYcMrl8nsmnil2/5os2bwzXDzUhQ9pryAie84nKBnLazSAhDCUXYVQk6Y8/wRU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W6OP5ivAuIwmNz2K67pIRNWgNKyKUs0QnM4bHPS7e3WCNoTiF/8P7tl2Hdsdbb6kXtBvpBKUmFFFFNvEa+6rQpcLjmJ0db8uYS/eBHFowsy2fZq/tX1fBLUcwoZlYcs4uhAkq/PEhHZdTv+7mdSta/SoLTUG0BfHuZ647Ch94vUOBtOV/zLbhdQ4wV220hFaBsldYQ1itOVgPyZVkjHM2N2pMt6CEcQ49oaPVdrUsJIPV9rhEL9QnVmIXtTd0++9OtkO2aJDOhY3Urh9ofGpJb5ywyJjQlhzh6ZCnzXHft8BEIlAChgLkKB2DzH6grHepMAE0vIMCixsrJr16TgmZw0ny6SzQ/kg91cBT5mAu8C0i4I2LZfcNImBNsV0y3u63s0X377qMJqMTWvht7IeDKz9y9PD1DPRRVSQz8HJ9tM3EmiinHbegSR/8vnk0EQ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 000a5569-ec6a-4db2-0d82-08dc008a07ab X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 12:00:01.5751 (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: gDN16xKCmcEsiGz29Co0RGiJQEWnW4aaiinpCB4205bzNfbf3+jpUAzZboI0tJh9EmlTJ1PytMF8faaUrjPLVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8033 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. Reviewed-by: Simon Horman Signed-off-by: Ioana Ciornei --- Changes in v3: - none 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 a41d5c7428ab..0f9103b13438 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 Tue Dec 19 11:59:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498185 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBF5118626 for ; Tue, 19 Dec 2023 12:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Xu8G1bJe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NymTkx8OI2XqxcLV4dPht8TahjQ1DtHP/SrkeiaN281DcTnxMKXTGfNQJDDty5YfUGkMw5jWyRmqDKGrD6+lkczO2HVSvSPzFreUgvzdRYxAQuIbGcIqZ9rMgqJEF7rKCRk2MrxAeoFU8Rl3bKNM1CpYDnqdw4IC8x34PFS6ItwwUlX5rC3GJPZ/A7EgoycSgyp7D0VPOQq4p6DNwEoLm+mO3EA1SNkSbZ05BrQ5kbLCy3tayW+kHcST/tewGI7Pi/E6QxheNoa5NHqXRfTrb3OeC03M2y9zwQbij3wObCfceVVpmdPe2Dw1VK4wiU4E0zwvYLTC1dMdURKUpyXqKA== 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=ml/QR8p71UGT4txDZYHWWQ2kQryVnc0IASNACy26S2s=; b=dRXrPpieSL6/ihUWsFJ3bFvSSr7PdgbMec4lFe2iMZakQm0S/Bk5FPMnB4qmn05heZSVdBg3r5WbU6OdV8LXfCvos5K5kazN33FwORtjuWo+TIgJtX1XY5oBgGrFKZ0N5G6mASnLgWVyrU/j3KaqAkhC4NrVgzhNLgDHSk6ykmseCeWWTlvGcHn9T4BCxmhjfdwVqy/6NtmphFouCQQNONO5dINHhbS8l2RmRuQANmvbgrnTthgZZZGwV/if08upVIJlF6lRsfFN4BjcK3PR1XKVqgH/PHAYXeNKRlpgyoMQP19bAgzk9B705O6Ojlm+FIuTCQM2aSagFo70w9fxqg== 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=ml/QR8p71UGT4txDZYHWWQ2kQryVnc0IASNACy26S2s=; b=Xu8G1bJevvvENIaFQN5Fh4J1xztHtzqFvFDStxa+g6X8PAoHPVDi7VEaBFJjx1Plwtyb6QOFKHh/NK+SDOhbvWX0Gs1ZHE6f8cD3+K9cw8mfRQwAXdgF/HbETVZ6iv3XQ4kGjxyhtIGxCsAC1NSFdjakqKpy91d6wKgbnkE5jU4= 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 AM8PR04MB8033.eurprd04.prod.outlook.com (2603:10a6:20b:234::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:00:03 +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.034; Tue, 19 Dec 2023 12:00:03 +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 v3 4/8] dpaa2-switch: add ENDPOINT_CHANGED to the irq_mask Date: Tue, 19 Dec 2023 13:59:29 +0200 Message-Id: <20231219115933.1480290-5-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P190CA0008.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::14) 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_|AM8PR04MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: e4a02911-2681-4b55-c46e-08dc008a08e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fg2If8gNFWEkcD7PzQuh8odE2uKPnL6hfHoAPUP/PLo3np7ca9IDM7H2m2jQ/YmiP2rYtK24HWmcxDCs2TZP2XL0gOCNo2y91Y304TPPnilARDmeMjyJN9Q9EEiyaJiS0ZAsiejP9t8vzjYiLuiZ61Yl+uzPVNVcZx1Fp1z0dSJftHsbuN2GVr1dBzgIPRICvt8jnHSf9h/AHQXz+8TKFxkvB4hHyESmVXyjd/kyR/DOOmZEJhTUoWSXhaLHdJ39Hx1PVmisIvXIqJI9eZ+dZQLrw/1lcezq6S7n5srVdPsRKOxsBUgAIm4jIb2/yEJ6HaT7qxQJqEVdHYe5Ry6Kj/rPW/5Rcos3V7o8WFJVxbkLXschEN+ZPpnmzQppCv5qKJ1JhlStw/V9T6UAOKhd/CJLqhkRBdrJNYvZnMo/KzJelbunFyz/om2dYCeXgkRqMYNyTzi1Z9O7i+FLhmivaFSY590v3uTEsOcGlJLQfagQXzcSxTpW4XeFsI4KxTyCbPPnl3tXnC5/epux/PELH0BR84dexews+k3GMZr9zoAJAt+HRpqF/ImQ/iXoF510 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(1076003)(2616005)(26005)(38100700002)(8936002)(8676002)(5660300002)(44832011)(4326008)(41300700001)(2906002)(66476007)(6506007)(66946007)(478600001)(6512007)(6486002)(66556008)(6666004)(316002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w41bamxl7LxTo6UE7g34H7rxxynoTucDTXJ4oYkhY3XSTao//xyHrljCg5EK/hMUW4zYzDkEx+4BXj7WggnFD4ihGg6jNXphzVysFTh/PzjHRJGMowWYOREo0iHS0YomqMLh2qYHF3kxHjw0P513Jl1x1jbF3+WTRcpohbU4x8GeYLQ4ORHExr7wvFXlY1hr99+dxlNP+XRo2tPEuvn1uO2y/ruU6IJXwA3tLGhidGkdpDNriXSAReZEUWjJdQXeMwwKaDXZwoBB0odiw0WcA1E7/b2Oh8rtcQt6P59OlQzT90zmUCmbPZEHQ94nUjUxbJrHuhJ9mEgxCgCIVtL54OyCwoKErQRkD74mSq2ymSQCxpbY5FfWIjbhJ6diBTLQyVGK18J9T9/ARNLtpG6cEuOd9KUvLumLsSzyM8HQtQ+TMD8J6vcn7Fu0Sb622YPsuW0lOBEZqvlx60SJC3oYfSxwEj4en/+53OHVasFhGZ7Bb8hVzC6RaAqvLu3Ia+q24n7t1TZEhaDbsU4SsJhmmtuwbJJ5FoLpPKcuCSwfdNXF6XvmOhy+8swj7h57svPZ2bnKkPDDXuXNfSEMhlxENI2j5Vvkrqg2aDQNXsWcafbFEp6AGstOjHNIjdpV1iZrZB9WQpn68QrCCiEF57Oeo6GZTWiEzdYtBn6hq8nLmbBRFCMPVp/NxNzTTCGULP7e3mrpvtu+AG54gkwMr/Xje8areepb+PPvNQ818JXjz4e3O3Pr5CJTUwQr6d0IkF6e2lZOaE24OIz1br74Rzw4fqK7WjDBVMiI+nXW+ap6d+LgLRuTK2sx972zQLW3mr8lLb3OmKJSUAVrAn4r1JbmErY+ZUyF1cFPJE0RTAlwJyKKrQIr/2G5RDWMsxZGXD6svA+OV0TLPfBYy65Yl4Be1bISRfmR3ugJh5XXEEaV+RmPzZAMqYTEhONoUlfDxvfPG3UBwNvWdg9ksrhINYnqw+mbQNTbsoslLvH65+bgTNQfhPtet+L7ytIZeH16vAH97IS3UjwXttwtoGs58lXIzYmwY1JuayN0faL1X6dUcE1JAuNtj6A0gW/uyZ1flcfENWGee/TG7/FitVtGC9dcUFYX6dymYtEMW1PQ0J+iYBQKzKBomIJavg+FL7wFdIvGOWyVL6FkGzAYbZh0gFqbGxkZWQjLCzJQLFFLbgkOdv3cU191RvTteaTb44GKJMQou4pGSvJgetXevNHDeuDzkb65aUpmDN1TIUxTawDtW0vguQD47RstsLbaeeh9IDQBm8/9RjmqliP6KCSvWKxbJ2phGp+La2YAcM+pvAwWyQFXgVWgAjvDtrSzsUnW6kpCkRW7TaF3bV4M9G3HPYBMlnohjttVPhNh+jQCP8n8ZUOIwGSUfdiFAd6cqpB3+xl1o5K1vxutYyAtaPKWwWM+s944CHgJbxM2oz4VKX0gogc3YkAl/YO1reaxe4Oz2pu475sMft4Bb6KFMcstxj/LRSne+mCwp5lcfuSTMXvLVIewUh56vF/+4+GBwBgVOqIHUz6p1htIpchC+J2a1FA+U6VZ0xYANaFY7x9Pyzmxi1vd0gc4KC2QfI9SO9+Ypr7L X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4a02911-2681-4b55-c46e-08dc008a08e5 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 12:00:03.6070 (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: kp0kv7R8ezJKJdR4UdAjpm0YifTOdt6EYGvyEau6P+GHj9L4wEXWPXFrigu82Wzt1i4EsHvCI3TZUt3uyML5kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8033 X-Patchwork-Delegate: kuba@kernel.org Commit 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support") 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. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v3: - removed the fixes tag 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 0f9103b13438..a355295468bd 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 Tue Dec 19 11:59:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498186 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D854617988 for ; Tue, 19 Dec 2023 12:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="nZWUXEP6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JjbGOztRGI0jhYQd7kx3OcniVgdfY+v/ZsOkh/TRKAXTusLIX3hQypuouex60RUj/4wDLOpa3XC3fLZ+xW77BLOjTT+qjK+oMy280ocdUPRFbKkiA95Pnthh4p0SoMm8UvodJDsLhIYxLvwCF9Q6QzwNFZJtyhi6vRvexuXZ7o6jaPg8XFAcNn+LDitNtWyLW7qu+figGeJiD9Bj9YzTcnYHWRo14vJfqkVZTze4ZJArZncw64hgAIlj2h8BESaPvf7lKS7kzWtWsFob8AU7KmFKUU+spvzJ4cWBfdEqvtirxMhksZtbW+ZA7LpWwvmgfAQhMvbsuoL0FKQ6tTNFmA== 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=sSgle2XRst8VNAK7pCBeEyuIXKqNdGgX62wBHn0eWYk=; b=lJmXRJ8PRRs7PiOMU9bOffMa4ZIY1wpU45vHrPV7wj0iGI0IXVSNj1Nte338jgWhacERNrO2jLtrAhtNPSHpDxFjUQEbJr1BCAxScIlMHYvE8Culp4lma7nyBND6jo6PsSJ21pac2/VMY7mARD/NdwbubODqnYgvVnzB4Kjq6lar14ctt97FTYCP/5x5ODbGDVOpt+ja8pzfb4LEPpGiyyCNUDhhKjrIb0FUeDvnbtf4np1WJIWuXqN+e87vUTk0OcfrMyJa6H9Pbt5S6ozCoK/lmd2/DIEw1LST0mejJ3a7fOhXqGxHlsYrzRRyuMjDXqpM5ogB5QgoI7yokBZOMg== 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=sSgle2XRst8VNAK7pCBeEyuIXKqNdGgX62wBHn0eWYk=; b=nZWUXEP6HjKfVki2d4cNDH5dvn+8DNyH9ZTSr9/hKn0O4VLqisEqxylhqoguBkzxQ28SNiZtfcOMrXRgxh0uH1dMJG++3RsJO76kNyBGDs9QZmj0VXiyjG54pS4OCyi3TOeWVxnrSS88G3EDFuzV5bXP0boUgvhIP6Fpip212xM= 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 AM8PR04MB8033.eurprd04.prod.outlook.com (2603:10a6:20b:234::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:00:05 +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.034; Tue, 19 Dec 2023 12:00:05 +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 v3 5/8] dpaa2-switch: do not clear any interrupts automatically Date: Tue, 19 Dec 2023 13:59:30 +0200 Message-Id: <20231219115933.1480290-6-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P190CA0004.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::10) 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_|AM8PR04MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: aed94f55-f9ba-4b6c-07a8-08dc008a09ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I3P+7VcBl/t4vS6l38bsA0HCbuawdbY9muqjk++3XpLOgowXhqLRkJcS7hfOsykZXbENV7/iIRGjy8VhlhB38nqMxtImCardKqQD9ht0PzYRAH++XEVQat3qZE2GNfPe/+3osBcMHqwy6ZH/Lhn7PskuWbyT3z/4eRDOBY8JTwMSFC4IdsMaPDVgSA/Az2QJQYz7NldlgtOIyzR2Dt7zaSdUUU7YIvOG1gjKl9/oqtAkhAK5DR+W+i+xublkAjXJ8DvzvoxMbmCF2qSZXCxUHNco5drdg0+6UFLOf+ZbyUAnPGWcdl+KOf2i89lyVAIuU9Bqhih+z5Btlh7OV31GuJzTcxZhTvunK9AWEF+4A0NW1EHx06DKxT/YVdE/GGOzSE5JmiZUownJp8gyruAKSsy97yloAK6m0E0UI/RtnLoHWmeoH/EU0xEb+zK4NQeSBM4bIOtvOpCt2cVPrnm8KIF0WmfUXSljS8htQi2t9JcPZfWzz3PQAXU1aqBsYyJWmjbEkn2K0LpSK8fm1438yLesVNg+i6/7KS7dO9W4DOsNisN4VLDqjbnrrT02Znj0 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(1076003)(2616005)(26005)(38100700002)(8936002)(8676002)(5660300002)(44832011)(4326008)(41300700001)(2906002)(66476007)(6506007)(66946007)(478600001)(6512007)(6486002)(66556008)(6666004)(316002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cEhrCO48V6wAaTkDaN2AbL59PGvyLb5MCHPK1e4B488Ak4Qg4Nnfsbfy/pdX6Lmlt2OgvbLrpWQ0dmghm62rpkvl4fb1TPp7fPuuB5rVDTHkvjeaOHxJ5tm+AWAQtoyhTtKd9AJnwogelgOX8sWl3SUS8+TDuMijERj51teUFG+03IKRbxlizIO8/4Vo705upW7QdOtAO4msvdkKtfIANSlQU3H1FlWpbFetXxptcokHYGalOCBzdOzTaDE3OffyTraEAEuGdJU+7f+hlByvxOx9CItB+UighMRdq8pvDMHhN9wQyEFt9XG8Gqoa/PGUmYoNQs+yYDryJfpEGdqBWjqjhYwaAtOYT9zwB4rE3hQ8p+ns7pqRVm7hjBJPgWL/Jd6XPihxt22BRg/LSMhvnZ+Wzc/nl4tj/hk1Q9HcGegNjYqdr4123R4l9fgDryD5vwkkcoMsVoiXzNDqiD4WR6waRJ6FtOsKIwZwi32mZvodlqUUufYvQKepEMLfke4h1XWTfNCK44at3MCdmRIGg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nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aed94f55-f9ba-4b6c-07a8-08dc008a09ec X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 12:00:05.2977 (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: hiz6ukuyk9wfvsAkhsFzSsPOS78GfTsMVSKqxRB4odUEuXWqYZvvEhMOs0B8K0mwz/y03PqRZSFNKpqn6P1vrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8033 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. Also, since status is not used on the out path we remove its initialization to zero. This change does not have a user-visible effect because the dpaa2-switch driver enables and handles all the DPSW events which exist at the moment. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v3: - mention that the change does not have a user visible impact 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 a355295468bd..1b8d233e0802 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1509,9 +1509,9 @@ 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; int err, if_id; bool had_mac; + u32 status; err = dpsw_get_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle, DPSW_IRQ_INDEX_IF, &status); @@ -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 Tue Dec 19 11:59:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498187 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0AFF1864E for ; Tue, 19 Dec 2023 12:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="nKDuRacB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RyvIbY0ySuRBrPLAe20LHHzgonPaPAXZjo8D6+op5RKsCEAKhRpeUlhu/M3yuBPa7YJB64JRRc+aFePRCt9YOiZJBi8GBfb4CCCfrWu3WWvX+/Daaxuj0NcCbWhd7H38BEGZ9tiJIy/6Ls4p6Hb9NennLnu5oiPuM+WoaEdAVhSYJaWtfmE6QUPG/xpUtXpU2Pejh8uJxzUqRXV7WVKojFW5XnbrYBgW1S/Msl/uJMj5i8qxh9F+TeThyKsFSjYTE3n9iQTIgDAC7NmKid8f7AdJ+1lUu0wtnnq9vaBa/atHTarHWwcuDh2BU1XgaPPpQneohBsPDgy1KU4b9pQOqQ== 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=bfOVslG5kHJHnbfw25FqC6IeSxt07JdmjQp0B9v0JyQ=; b=k4julQl+9ZFLI4UUWmpdOphP+3E5rQiGkFmNT8ur4ivZbLsJzdMAu1KhZlvZinhfIl6B9Y6I1wUZYjfjxoW4xzmnoK5DFStXSrqUEy84N87Ll4hJxk7xMad0pj1pufxMJuy4ECz9aHpVutm3rT0pRdVvC/vxa3EUOo6Mk2wPM28P0bOyvTtsXn32DKf0KfQNWMJis/wXPmPLsVQLXyU13IHC0emgqYrWYzEa+xuc42dsKnrp7D7CuLEb5W7Jtks7ICXJx9pYpkhU0QRdp+28H7SkypRJIYw9HBgdOcSPiUdj6/TQwaymCUAbRtK9Bml3YGGnDesm+pJ0LW7HwMkqxQ== 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=bfOVslG5kHJHnbfw25FqC6IeSxt07JdmjQp0B9v0JyQ=; b=nKDuRacBalaUfPogL0mJYty4HICzoSqVho3zfh0CDi8qPr5CP7sHA1vLoF0K+iAY7F9g9rcBtNt75wHJoAdbCotpwDFLdjKoDPFDbrU/7DZBpGoFpG6LEhfoj0snY0by2Eu09MRaCCwdAHNQJfLV6C87IENs4KRnfTh3nu6b1yw= 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 AM8PR04MB8033.eurprd04.prod.outlook.com (2603:10a6:20b:234::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:00:07 +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.034; Tue, 19 Dec 2023 12:00:07 +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 v3 6/8] dpaa2-switch: reorganize the [pre]changeupper events Date: Tue, 19 Dec 2023 13:59:31 +0200 Message-Id: <20231219115933.1480290-7-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P190CA0015.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::19) 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_|AM8PR04MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: 535cf932-031e-4eb2-23c6-08dc008a0aeb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m8s4A+7BqDMlNYt337JeHB+eJZ29qE/DGcBG2qSZvRVhCu+KHZBuOHsb9goojhu8wCeyhBm9M42rPTuHuEhGpKrzvf6ZVB4xR3VzI02p6c3PFssga9E4aMhD4BRdIeHtRzgPFP2sB6aTzqnw0KgbOzXGjAc8M91XceMUyRWb3Uvgk/1eDXDWozcqTIYacZ1ObAthvhGbDJZPQj00UYnanGIyXswyaJjrbC8Eu1z6kiMY3BBNSHwnIKMo1cP0X9UzHeuh0ZT19IOQDLd7gKThGsHd0cVQ3oY9nGIZibtHZh0wC8g2In1sqIievV05iCXcKjzxsSmZr3jfbDrGY7wcKmHCPIH2XM2+dzJCUiGelj7z5TrjE2TyPGxLNgImQORvbDOz03y4MmzZvEUHVo1cL2r1OQHHRdyK2BwhnoLd6jitG/84UPz4h0xiYieERH0NrUydXgn/0ujxXaH7wJvuaJbk+3eQhClab4ruj5wBip2Fm7Pq3cDp9eIEcMosoZym3sJltbzqOX2OAhzxfq06/cuT+h3ZIvxKbNpyoVOGH1tjri+puRH6xap/F7iila8a 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(1076003)(2616005)(26005)(38100700002)(8936002)(8676002)(5660300002)(44832011)(4326008)(41300700001)(2906002)(66476007)(6506007)(66946007)(478600001)(6512007)(6486002)(66556008)(6666004)(316002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DpRndWZHhkwKXDbtcjamRDrfWOK60qE3qFrnzN7TPVAr7guANJB0p1dbcf6KiEaK4V8KhAGw4Uv4sT1T6CgJvx5c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0MGqImWxPO3LP1BceNh1gxP3jaMdyHrGwbNZVnQ28C9xBTSO5djmt7KrsgW3tRkpS4/fERtS9f3bvbac9O1+Qwei1YgXFBYkxtfUruBkNnZpRoTAh0mZtwrD/hXa93f+P+QjE2wDj4UcOKmqM6ByDmkS8W/d4WfSo27trWDmgkekSSzPb+8Afbo+XKaxw9UIoLwk/xlA/YmE1YaZPxwJuFd4H4kHyQm8zRdWAp6sU135LnZMiRssdCWN/kCuvD/fnTQeKski95xnZkwGn/TNTNhacDnopmM3b0gmg3GyQs81nhXRv7sKusqTbJvQ1tBKuXAZkWCr8VoBpcCidx5IkfcYSeh6l3lVM9lThcbbgyCQffycQMglPrkgsP6+6sSCF1slxhtocY7+pmKeaixPaNYU7GK+u5RtxYYCa74+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 535cf932-031e-4eb2-23c6-08dc008a0aeb X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 12:00:07.0718 (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: NWrInTpRGSMYVkYOvl0nVT5IB0WlDXx7rAyncUbiaqD2c1c26WVZURI2/m8KFSKqxzdwj3bDt+ZwNBaVk2bQpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8033 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, for example, with bond offload. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v3: - removed the initialization of the err variable Changes in v2: - none .../ethernet/freescale/dpaa2/dpaa2-switch.c | 77 +++++++++++++------ 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 1b8d233e0802..a9a76d640bc8 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -2173,51 +2173,78 @@ 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; + int err; 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; + + 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 0; +} + +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 Tue Dec 19 11:59:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498188 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6C2B18023 for ; Tue, 19 Dec 2023 12:00:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Wnqt1Jxs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RMoYFPX6rnK31dbKBtBrHvJvyF/MYBH+qMRbO3Mnm6dMCKkKQncJHhVbEbzR0Z9GGj1ou4fyYCVmj0HbW8KrYWog+zQPBt3yY3W7ICOOAbhNDR9NPZzqktMmL/DwAUr0r+Uf5UE2aO2KJuNlf8sv/NCJVTiwBJmy4ki/qIeOnAXg87XG9VATAmwEAtpRYRII903q/UBR7II9T4Ew45UKZO/Ifpkg+UIJ7xSzpIeGvj13WDc0txYrvZEa/mJsOBw4MrgkcAoG3m9xk9r5Q/tmtVkBQwFdzjV5BS9dt59p8LqcPZoCTWBMqrvwM+GxW1ouKXzunmsHuJ0cXBV6Q3haVg== 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=0YFwNfO/cl6DqDp7BBjQmDETEr7rX+MJiZ36U4wGM4A=; b=BlpIz9Rg9zXbwfDHB5jvxanfxLsdw7mnaD/UVcGkm5iFHEpabnBzZPl3jXIV0BdRCqIimtNeh0rqq3Xi3+2RfknMGS/slMsOlDxWPn+eWHWWxpYDf4Y/xvVKY7SJYBeyecKsCJoxvNit9DTD5K0LKk6A9FbTDDf+6Wq5vbBmWe22wyrVDPX+TeZlSFZT1/XeDkZXpwWyJs+R2+M4V3ul5WJB/AhH6tpuon8dPhyytn/1yGVqTxWsqpRbfj1H9Sz3sshjqwK/o0jI6YNX1TKWgUejLS6gwXODIFptLHu1X71r1FARpIPrMDgqULvk3HnYJqbIvuyhZAJxN1Gqwd1rVA== 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=0YFwNfO/cl6DqDp7BBjQmDETEr7rX+MJiZ36U4wGM4A=; b=Wnqt1JxsbF5rOQUksxxyxrQPlNi+BX56anh0lhJCNERa9buoSwn67XBoJ1r2/MV8ySvGvMYILp6rTazgGvjCElUkrj5nyWx7E7+MrKI90A5NPI5XRGswgVWtMEP4yr4UK1RWqb2YpcEjmBACqL5ErLOqOZH2EAe1B2AnIic6d4c= 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 AM8PR04MB8033.eurprd04.prod.outlook.com (2603:10a6:20b:234::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:00:08 +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.034; Tue, 19 Dec 2023 12:00:08 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei , Simon Horman Subject: [PATCH net-next v3 7/8] dpaa2-switch: move a check to the prechangeupper stage Date: Tue, 19 Dec 2023 13:59:32 +0200 Message-Id: <20231219115933.1480290-8-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P190CA0011.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::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_|AM8PR04MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: 95ef4b9e-aac4-4ef2-b516-08dc008a0bff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xyjOpwH3sXJBI5NRSnTieTM9EpRuQNn5Sqph1x3xsTtjn5kLheyQ6wqY5N4hvOCIcmfY7pc9s5WhBOVlPIszlg9z4A2pH+qIggbcCyV29QMOr4BqzA921XNPrMQVhoTqfcUJ+Y7W7aEeGi5brng+GwYRfzFo97ZzcepWmTaXFwlMxpVDgtED9v5Y06vlCJMkyJzxf8z7xDKTx0Hcj6zOhbBvgRMxvTxRGiXIuVfcyATDJhZH1lj7XtC2za0hSuvaeR6hqSGTvLTzyZmZhdB6zRGcw5tmNkseJFZRxnWSk+Qulfiu4Rmz2o0sGAOwMFvXb2Km62S+8ZMweFAif9Lq61ITRr4xPPhN2ON3nVa7AC5aWUsvoRi8X10K1Iy0jJNDPqtP/u9Fmuah/rvtDu+93fPQOyWze1l1rUBPg5GmF4eGJvNYS+FtUrQF1ol7D0UZFEawF5MrLQOiRJS3Fok/5c9qY98qMciOBAL19uJPm2DeEzISR8W2xTn6AKG3HFq/QAkXzJtjfqMpCBif6GX4JqTxZuWRQjNAI4NhOXllHTAKU6M0t28fChOHi2RPegs2 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(1076003)(2616005)(26005)(38100700002)(8936002)(8676002)(5660300002)(44832011)(4326008)(41300700001)(2906002)(66476007)(6506007)(66946007)(478600001)(6512007)(6486002)(54906003)(66556008)(6666004)(316002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SxYbc/QibF5SfDM7PgpFAR6hpTZKQO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TRHlsMZHRtnOZZLQP9jG0Fb6Z5seHSAJ50PFRMfp2SEKV066EFvu84N3iTp/mUsH8/eDwASW2fw5u93RsXszxjqMUzLd9I/rP8cBZuHT0zpil+Izh4In1g9I9hoQcjGn6hxodJkKqxUEiCabFRlOPuOFvNwKUTvKY5EZbsnl8V6emHPez2wv61Bp0PRmi4399l/9l3XZecdVdkfP7sDJ/RRBH/I0A7uGONR3xdA54cR/A2OjjoSkgAFwPIvxjt9mf+ORw7Yf+LLQEEhcCCu3rcsA3/Iqrj+6OZdC4WtVhYIxT1KuCX28KUcy6e7SyiV1i0wsCCPvshf8yfBWsnU6hw1FVR8dYyHZpIuq+yw62sFYYUHD8U+LCyhbuX7/HoDdacVCdGWzjehKp+WO9e7gAwagn+IeNE/BRpDl5WYeFvVm40bPLgD+TqbouGhhR9xPf49tTgAkLMH1zO/X9CdxhNTJNlPmhxcr+gqfeZVmIfFPshKI5IA X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95ef4b9e-aac4-4ef2-b516-08dc008a0bff X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 12:00:08.8255 (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: AZQlxWfjeV2NzaF2L2N8v+XFqYEmNjt4XGb277J3yDbuMrer81nLShN/iwOysKw3fIMForgNEHEzCNmjz7xt8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8033 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. Reviewed-by: Simon Horman Signed-off-by: Ioana Ciornei --- Changes in v3: - none 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 a9a76d640bc8..bccdaaaf5ea1 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -2005,24 +2005,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) @@ -2156,6 +2141,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)) { @@ -2170,6 +2159,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 Tue Dec 19 11:59:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13498189 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6FE716423 for ; Tue, 19 Dec 2023 12:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="CTErAHYW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZ76IVcOqmpjBtaNWD6VAMGhJAxbCSYymVNaFMXhpsCo15pwGws+vn8AGZ+xjMpMOMtpgXSep8KZM/bibmI9pKdeB4YCFzGlMckudV60twb02/4TAV5M8eGL7riutwHjc4tnUChZ4dApg+H8Xkl3NCSGjuFq2CxlDzwyeNXLymTXO5cE012pL7zeRxWcr2CMfG4oqPp60hYwaPYWnuJN8pMlJd8r72a0j+GJ9LlKiKd9V+z++ep9odlbJBbDW8yEK0xTyuj/9FYgJBprxOddMCPoM93hDOxvkRYpAiDlKFeWnC5BP9DWTSRcNjtmdjvJdxpThSjVGW94v3txGwjaeg== 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=j56tiUg+QQRSMpOIxwL2QVnsNYrYNkzTU56xK45evqQ=; b=k0BPbnVu0pt/UUE9sFZ6KY34lsKl4d2PpW26x1JAhHxKnJn9Hc5WerfTj4I6lNGrvp3kg7kOCkQCvMx+bD6Oj/CXa5Nw9X0tPKxOoL784MTEW0008svJb3UzYb5F0LWoOVxlIV9XEvJ3FNlWi/3E8Xuq8Bkq4HIcbDtb/G2a+BHrsXz/QOQ7jK+gL/jUcsgc0W1GLnZFEdCU+upXd/SrnKIyHjzEEIjEDVmdwl9okEp6NYbOWAjHO70siwHG1soUEpkDgsDyjD0Eo3yfIAi18iac40RbMvMHcNsQF4ncVJwE1ti5HEncbn56zP0lSSd8jdYtGv8BEccl5EWGw77aVg== 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=j56tiUg+QQRSMpOIxwL2QVnsNYrYNkzTU56xK45evqQ=; b=CTErAHYWrUfqahrvsLgwVEI44d+kOjgped9Kbh6FP4hSrrJdFz5wZrZ+sWmb6ui+N30BtcYoEo9medstPd1WjK6RIq1WTcWf8progAgHmhuH+G2kWAHCJTqqEnK/bYZNYYgtHpd8QugPfuU/ziCVGZJkYaBqb+hyrBln9UUvBmI= 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 AM8PR04MB8033.eurprd04.prod.outlook.com (2603:10a6:20b:234::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:00:10 +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.034; Tue, 19 Dec 2023 12:00:10 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei , Simon Horman Subject: [PATCH net-next v3 8/8] dpaa2-switch: cleanup the egress flood of an unused FDB Date: Tue, 19 Dec 2023 13:59:33 +0200 Message-Id: <20231219115933.1480290-9-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231219115933.1480290-1-ioana.ciornei@nxp.com> References: <20231219115933.1480290-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AS4P190CA0014.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::18) 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_|AM8PR04MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: d03bbfd9-353c-4efa-4668-08dc008a0d14 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ylle8TVWEj5fNsqlyjxP+GPSM0Zqz0/bqSNLdk46sZh3hUpGntmcvHLPFNQD7Vu0V3zwPHC2THoY+xveOjwSBFVj1b0Of4f0G06f/SUT2tFGA91+idZjT+FKWwarAoLrLEG238yqg8/hM6OOiY2BXgSxOi5TN8coUmlW7t7Hd/IvaZdmH9WujGly0h2vY8xCxjvp0JlY9TBRKb8v69hDNio9AAJEXpTzW2N9w/SRTQ05SeotwiQBGbZ1+MYVkdfkESRMTcIvFsUZe5JC/At0c5U0OAkDc7zOX7YcD/MSs1BI37CNquEifPdOskWmGiPfpyPlZDRF8ENVeQ2mu0JQ7D0cIT8CckXirTNSYju0OZootEf7Q1h+qvERJIEEnqGyLvZc8YGlgbaD1AJJVQsxOOBqhzBmJCEIuC7qYL4A8VyafZSoZg7aivDSPv5lBaTGBA1u10uhQG7MWyoxuCFQydm2Tp9AdnhcHqCPjHjYEro95T3d0D6z8MK11DpWnwyqusg0d2WdQ3Ez9H9UY++Sfz24Y+k+6QuZagT2g/Bl5vaXug3xHesOWcsJ7/P4lB28 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)(366004)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(83380400001)(1076003)(2616005)(26005)(38100700002)(8936002)(8676002)(5660300002)(44832011)(4326008)(41300700001)(2906002)(66476007)(6506007)(66946007)(478600001)(6512007)(6486002)(54906003)(66556008)(6666004)(316002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xg8Qx7irs1CQ60ccIgfbW/QtQHTnDYgB4TOAddb4rf0CYZuISVG0oVp6UC5etl9eDkp8YbHIcaogWt8gLAjXJZMTmIfzUtA7zAgEFXzGdUOUkyYsTZ0btZ8Iv3Hr8P8Jwyf5t3H8dp8pzMyTPsSyS42Acnqv84G8KIcffzw7dmUQJr0hPUjaqjD9vHmtipcYnTo0SK9s0JMUgq+XDL/LHhnD3JqAzji1RWMpkbI3OizqgMLAI1hp7EIV7VbRgtElz7DU2y3DCfrWJR0l8U8gaekaj2SNETHquDphvthycva3RU58q7EcVVMnH7RV1AhVc/+oGwGSqR2iwfJyFbfohJrbxBIgLmk6pH8HeD/sbxL4gwXZV6jRzFQeb24L4MzB16hjX/pq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yygR2CsrkoGlZLK2vWdkRXx3oH0q3s+SMOa+CCaBnYhVCSJvzzJGRih9PhCYSyqLYaDSHZyLMF8Ty1SaIdcQClc/UO6No9hshfD83L1LyBuS5tHVHZqu9C X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d03bbfd9-353c-4efa-4668-08dc008a0d14 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 12:00:10.5916 (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: UTNJIe+rRVf/E1xK7dZF5QpAd4mBKKL9zsCJ8K9b9JMkmPoZR9wFv8qEPw340RG64tC1NxYJup/oChJFr2AODg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8033 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. Reviewed-by: Simon Horman Signed-off-by: Ioana Ciornei --- Changes in v3: - none 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 bccdaaaf5ea1..f3543a2df68d 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -2004,6 +2004,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; @@ -2025,6 +2026,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, NULL, NULL, false, extack); if (err)