From patchwork Mon Dec 4 16:35:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13478764 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="d6sEnK7Q" Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2089.outbound.protection.outlook.com [40.107.8.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9218CCD for ; Mon, 4 Dec 2023 08:35:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RY+E4kh+et4pE8MXDb4ZyneDbyOQY/6gLCLiC7mF7AFzE22MYJCGrS3Gx5ASm0PgQqgsokx3UGDtPB8Nu/Y3hj4u821wd89a9kig5CD9Rnifr98G5fSTMtUm0Ev7hWjUzE4s+m1Ltdr63a2da81MTET6eVpOkgU3gSacUczbec5GyTRz4L46n568O3FLyswuObFOuqrJ2rvbKl2vMAsF+7rT2ztGudN1EgDDhqq/5q84yGXmdtCWghXRzieCbNcKsQzmd96RICYF2eHRGiRG6xrPeuo2cIP8+SwqRqiBH5YqicBGQonDYuKQ/JRyVoFC4edvxCAtDsT+uwM/3sPLqw== 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=gvUkgOduqs89pgFDg5vnLX/qQEvizjapYX8Gf2ZgoTs=; b=SqhiiGPzTpfIiGtoBvj0CAAWDUzlV2Qf3f+9/9gLS+PIPKnZ8NpjvNmA1wSwZy7fjMJBthScIzeBYJ7pDm45FAu3FGPhJTgJTmu1iC8LeJEH1rOFLqJGz6iy+rzgJQGT1yNDoIhD0CkaXtLSCN0vzkJRZdJ4cbUWkIt4kZekSZGkNt/DNJI94u0ojeUjKJCwljN9H2vYEfWTmBMaRsca81255cFSF549N2McfjcUqHFIdZxFLi8QND6b4sJ6cggopEbhw4a52DTkWqpOlAugpvJVGE5+z1ga8h3LXg9evtKPU0EKuJnNW+ONpd50JK9No6lG8RJAeq5dYEaLvMRNQA== 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=gvUkgOduqs89pgFDg5vnLX/qQEvizjapYX8Gf2ZgoTs=; b=d6sEnK7QcqK1FqnPG/5Lvjk6qyzSIfQ8jYEup2j18DFY5D+urpW3GHCZG/hiKDK7uVSoRvI6menb4+onLGYBhBFiLbNIBLXoIJHZFZ2i/v4oFFB4lU+Lka09ztGAIX+HOIYiPMDVLN/+uNccwvfXNWPJwHEYLkKB9j5MdcqfDVk= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:35:56 +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.7068.022; Mon, 4 Dec 2023 16:35:56 +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 1/8] dpaa2-switch: set interface MAC address only on endpoint change Date: Mon, 4 Dec 2023 18:35:21 +0200 Message-Id: <20231204163528.1797565-2-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR4P281CA0260.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:e8::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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: a2fb31e4-c398-4210-19cc-08dbf4e716e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xbqr/++Vn92c397p7GF+kEHRmFYlB797jOrYSDtxTVm/tGBV5qJNmOdcdrFw/tRcaywigMixMjqOXif2luopgd/Yxs9hIB5rkweIfBQ/kQwjRTkPGoPYBKZtYMcBhFXPEWMOisplihveolaBdOXdddywjpl5VOTfYFji+3eoEiaO9VsNKqCViIDgA5Vu8vlIrETZabB3vJYbXL1mOMl7md7nBQJJfH8/+OZY43trXopYeVfxO/8N4f7kMMmomi/F5xhb1U5cWJqfLI0UWdi3eWH6n0qJs1n4sXHnLPbDo+p8F6Uv75v+ZQa3BQTM6bgZMqn+VGgcqJzGdTiYvRGYu6QaVjefgMh8h0MHMrNtY8I4TAbknG+QxOho5aT+CDuzMYYprCs71rrsZeEwub/9DgZhGYe8NZjfcu4gBLbOBmqlS3qZTalxdxG7Jf/e5JOrWkDQkwByxn6GK1piPCnt94arThCbYhhZVb+gBXAmCeuOGTL3GvJ2lc+fISpC7QpfnX6OfiKy7v2SPSBgm4TfTDqGSw3ju9L1Do3zCKxyAyuwwd3QbwHRmWgYRwjBtsHH 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hucAyfeebiFo8ckD9041rBApF+oD8SSoRqwssE/HRCGXKsRug6V0kb/yvN6pwEZf4dfAWt2L5Y7fU22G797ITqM4YBrMDDY7JHyjpftyeqyJVL32d2Z+4QVU40IcHHEoPoYLvEKCPxGYW3Tgb06auh1PXHfWGBIgVZrVxvIcKwz5/6bBWR9T9qGpuxvm8BRDT5Cw9AQS0AKGP3i3NfCfIeqxcs4JFXsaSokoIRQOL9tV9q9J9RW4fX6NL6qEQwvUf3BE/138B8at+QqPgirAXDLbqM2KfOh03aGvNy8Ospj/UDWecdP9432UeCNR0cyw8zIHWZcUl6NMnIz1WgWqSom9wWO3xwUBzdFtAoZnBPv3+qP6vOr0XsUlbSRLLqVc7cP68BgJSNJ2ykEEAc2ilixVr1oUi5NeHN3UumQi4JY+dUrdPCk7qyTQm3Ev81HmBtokV26kZaVqX5uBd40jnlznIxy4WTgPe3PZ48un895t2UujGwjXi4SnjImOM+A76S+d2Ncxox5+lFVNCTaGt+idXFuW4QmR+TXuPZXZfEcWwUMIICkve9gy5pedAYyFZoopJv2cm0F3wbYog7WWoK5LG9z/AkR6YZ7MywYtxaQruX47tjsKfsMWGJIqJ2nGy39UfCzdJ/l7zSiTNQLRLJ16dSyq4DIjSVQBvUS9ONxpL/fZNE6mB/F3zrVlUUZdrSiDyD4Q/0IktWsWNooHFmw19E9YSNRLsTdL5CeUGyOOTinNSgm8woa2FeHuq5zareYHngWLSztYXdjM76ahLYRaIrnKPOQLjyr6unYglItHgNpRTXNyTHycNdX7RX0jf1aYNDCnCWP1l/PyLAsUcN9BTAFHhxu9oCRCMIJv9a7d3m5I2qX3mgG+N/m3NMDN6zT/PHsg3y6GYC+RDDI0n5vU5Mp/wHcFzULH/NyR8mrVaR9HmBbic10Hs+coB7qa+HSCTgZqC8aoJ7fGmCii0/7vP20ysqExifsjZRU3abN+vNu6AX2sZUtpoIsnglZJnz498VEyiYAmEixXHlZkRHKkIQmkjBt1WL6WTe7ro5AZpAbydvmINtRJQenldewzaYyF5ZZrKYJkXqy96UrSRJJxy7lxPf8pqyae9tO1hF8XMtVDF0WPuOhAmtfzH3rxK+Zu4I3KpFBClvwHelcB4wBrVVtU8Xe7KfNdwOAh/kmFDOqnp65mwL8Xmdteg4KNjagOcP0bafRFp2J2Cjl+0BhBgWt7Hkq0CEyOKdAtmsTuv2e2pU/FswvzAsrypJoiEPjNfrRHsMy1gcSd3FbnZel9M+JwFKx5SXS2Njo2Q3XKx+yWKS2NLtvOJQCqj3Z0GJRxng6EZ4JZuj/0P3Svf+lN5AAGNt9hEAmMZcX8nd26dP3pLTlB5fS1tD+GB+WRAyh205uBuFQ1tqKWfD5kAvDq5Kj/Aox4CGyUTv8soTCnxbRDQ3O5cblAFnzOiFMGGKG6IdmWDea2gY0jKtTd+DxsEgvZuAGUAq63SErhDYpI1/9FymTsv6e5L7FHTK3a7BjOQlYFshsVyMyS2JoVcT/SJZh2YYuDRJK0d05EDmy3ovc/GtSYGnlw10OERJLr X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2fb31e4-c398-4210-19cc-08dbf4e716e5 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:35:56.3312 (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: CS0y43M3tiTgJguhah4Q+3NrGF7HgCUkk8E3UdnxYHm5ZZCD/5D4ySvCIy+Z6wbVq9t3G+2vlPhMbEAUKHVMpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 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 --- 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 Mon Dec 4 16:35:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13478765 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="oijplLuh" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88B7DCA for ; Mon, 4 Dec 2023 08:36:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O9KB2S0ZX6H9gup4wknP1XQ6tIuYFBTC7aCY4OlEM8965zhAeR2AvQ5W+cyVrQ+nJyL0hIo2Xcx5w1ITvELT82GEU22CmGLkSIhfthxQ/Y8of8pf6aHWkiJcih++Xmt9V8bYrqSVYH0K2hvchBrn/qJLe6UsAtHnIN/u43cPXXLcZv1ameRh8akXhrEII1bNghL6WWSTy3FWZX5uXiOxEJGVOfG0aYoGU1hm31G4S5I1lOPpQuNG8G955iVCUK6JHJfu9+Mjn/TuId/+S1AOelYBclX7VcypxhLzW/hnrGDR5n/+lZy3omdf9vCnjyy+a3RcLR14P9IUa8JXLHY6Lw== 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=rUE8GZ68xTTOVoU/v90/Cl6JJvcrftiS15qiYb3QFj0=; b=KL+/7jflE9WJzuDuod/5s+DZSmPO9ZGsfM0tkBlObj6lt5THnyovjDDDW0QGVj0yF/zk2WNZwF9vgvxnR7+05S4NVx4OpB9KaEqvPL7dbskrrRNeFkSaHT9gVx8/o+HSKqkbOkvyfHOdv0HJkLZ/dbpX9+KpAgWCN11f1C93FVYq8COTK6zw1rAh6VCYpzsXagaMz1bXKeEglE/ypqoaTVujKMPBndRGccXOBa5DgZBTSpjP2txuhTLwdeQKa+AxYVxaR8FKMIDDF2lYq/1gpYxeJPJ3YKQhargDtHKXeW1L0UrYXFUkzuB06YTHU0oYba5DqkTi0I7fShQbz0RYPA== 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=rUE8GZ68xTTOVoU/v90/Cl6JJvcrftiS15qiYb3QFj0=; b=oijplLuhy2lM/vZD5/+sR1onxCCtNTjZV+JdrajVp5R2vTdUYwxx51rkVcYvHSDbBTkymgZMpipiHLQzhn+HvuYVbMsUdeSjd3uSbfV65PnDqcUvMEsX3nTTCLNIFOmUJhQpVZmJJZez1i3iHt3EQCtD1Gut5DwmSCpENKNl9iI= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:35: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.7068.022; Mon, 4 Dec 2023 16:35: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 Subject: [PATCH 2/8] dpaa2-switch: declare the netdev as IFF_LIVE_ADDR_CHANGE capable Date: Mon, 4 Dec 2023 18:35:22 +0200 Message-Id: <20231204163528.1797565-3-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR2P281CA0060.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:93::16) 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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: ce96b9a5-8948-462d-926a-08dbf4e71862 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eh2XNjrDJaK5g65Q20ATT6buZYKcVXEERxLA9QnBpg2y6YJYZWcFHE61yfdib0UrfBZURlKIX/B7n68CCo6sf30MGnUuEdkDrzWG6n8nhnR7S0eDT/4a7Zgzx2CiXUqwxJWm23YTinbIx3Ed2W/DITY9mqy+xp+lpOMh8tW/vHYEsDgut7w23sYl3sX1cg1lKwsI/xs++olBv8PCcXgMGk1LurbWCSZQMHrlc/O06UjgdQncWcxU+/qZ76YLWIot3LEmYYmp/QckU0AGHswcuyRYNNcc9ikSepg0h7JgtcKterqb3wpcJDMOiby5vtp6fJCawnwy3PnGnBMbGnKFJD1diUJBnEN9bTpxvSGQxFbdZZWZ0N9ngTjS1q04VvNvuoJTnPXlLQnYZ6vDCE3wRFBi9+qFGTo/T0NyDv6k0BBsUaUzn1+uB4bhNSmeTkLwAVclLlSRSf/RKeIgQ20zVNTpoDrq5HmSS7SXRojQq53yUzUD/8PMVg7+rDwa9uz4SKipTF34w92HvwjqdcxEZQTGh66s/sNXFqPtKaBrAT5NGju9tojpaf9sAl7k6Y1x 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(4744005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DtN2xxFxyLuNiwnadSzflnIqiplVS9as3wKiNDmIJZTVPqTp6wp3SCd0UzW3Pf8/rD1MDpnVyCI3yUheMzbSMkl5ypZlqWgg1hgva1rqkpF1ussrolYmKpdFjkribKJ9REhiVUeyElZvD/qpPGjcJgcHyk6TWOAlZimWukluOEQG/6hJxyksycVh1pb2MpY2wZN3v1PUfQgPEkQdkP4em7S8KUbNOPVAqP3V0L6nIhCqiMNllNKfgsZdR/ZZXQ7+ZKqZ3XOuDYlzpkwKVwZ/CEMhGIbnNHSRqwN5HUlbVV1eCnmLXOC8VVQDP4MRtTeFw8C2PsDeg/5U8yCgTFEs51Fa5nOeyngWf+OZXFfgmODIfAgJvIQz9XYPA8mtteP7wlTIS27RSlWIRUR0Z6iHLWg3g8dmWMpBOIh5/kL+vehtTv3WYoC3meTzZyNmgysrMZqe9244TjBKku57hQiUDQ83uACKCJUq56hL6tg075sQzDPnBihMagZQmAEDLmPJ3805fji7/u134wAF0e85J4jGCf4Uxl1UVUlfR3J/5HwIai3VBt6FnFP1JF8yXDYuvWKTiG2DiC4xMT0sAG/OJfaZQlyS3rsSdpNr9kUXMm2YO4vNrlX3tY3ePhy1NuV3rPd8NmkYXk2YFcS5piWxChMI3sEDjNZLTrZAiY9d8kPqnHUDeThNejIn7yhXqkXo3eY+TNn8+GWsYCXLNxTUKc3+gudKlpZhNBg/Uv9u9UCP2wCHZJiA0fkBZMru3g2DUZr+cZMGr4pIVNts1C+IAKksG5L1weApi4Gn/1fADcVmB42wQ4qTwU9K4Ayq3gZYHl/D55C5jTM8cOAhHO/hxQaEZVt9TnMQHxYT/4fXz9HBz/MFXGdlnGByg+heOWZrrAuI+jjVmoThmiq33KMGchI/NrD8566ZwmPUY0W3hscMkK+JBtNn1lzH5oNmB97zqGIgirjTuT7Ttlqf6p5jwBzOTa0MdFxsDGuZvzEVMFUEXEAcl/iionT7MtKIF4wqLXSwlW7+yt4a2XIL6CE4j8AlG+Bd9Mr9H/zMW7gCZUw3XYhpJ7H8Y4kH0Mda29HNAJP0hs2jyXyDqAygTqb+g7Wc+g06fuc69hYgKqV2q445oeEFoq7jqJHanI99fwfm31GSJ1+IO4iNPjZZLXAZdh6O9KtjCIvrIdVTD3PlsR3EaH23hykgIxWGaaJ+clrp3GBd63e5CF3/3R7p0Wtbk4sjmmWr1uEIl3EtdfvmJGSAtW8oGj60ZNpZqJueY/JJMuAPL4jaPWvOyCx00aI+JghuCmEHL4U15yTYpRRoCfpGIBzqONLmfNN1Yef9qZzAHEnp4IyQWBj4TRxJwTxt6aYsPPy8utv3RU0uXI9l1Pmos8DOVRFho6iWdAosmDejoJEvzjFyoSC8PQbYNG0imkk765p0gkEuUQoNY74Vh9o5TeQNlmgLo2DhcDYifGyKF8Ls8BIRuh5I1HDVAWHQ2uan0dulvaa+f5PPCJuwyx2XDFb/MEQKhirZPTGW0+7AmN8Tux8nMKABpr+njtPJH6r9hLSta7lxoP+NUkgBoGFPVzdz8Cd/hq1cefmQaZWW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce96b9a5-8948-462d-926a-08dbf4e71862 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:35:58.7818 (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: kS2YqbHQE3jDrnJXq0K60AaMD6VY5tkYmWYT37s2b7PRgxsRqhn7nkwtgEZUduK4QUTZgdQM5AeDEyGCGE7Ldg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 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 --- 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 Mon Dec 4 16:35:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13478766 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="CSajtSau" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C589FFF for ; Mon, 4 Dec 2023 08:36:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DJJguXoWbHO99gkprBO1OMTCsH+5f9WWRlJ0SBZQpuiNKNyK6bDaWFpNdUiiOkwWgd3GqCR5uFQEMJncVGLPJZIAIlpfXwkTr+iJG7e+Rh5Rnm4VR4QY/J2J68IWS0STV+afMwxLZmsYr1Sfu2ARUBWLXeCt/8QBw8Tkmmi2vXXyFuEXgtGLKSeWkwv3HxNlHnw8BMR9OkUUBKIb3ZZVyy1nDda8nmvKr/IwBt4PEPn/0h1zAwMWqXtOqmBT/02cxlwb6EM4PesjE2jAaNe882UTtr/jPCaIgFrkGc/4aDfY2zJcB4KGHzOd0cV5o93BZkqvF7GIc9blL2kz18vN7w== 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=dPSzyBb7IY4KN1FJSY514GEdmSffSJ/0pCmlKMg/BXg=; b=FPC5MgRkRATxPtCf/gv3exU/VF44yrCc9bQrKeGpGDto394ooE0uylTG5oeGk2hTtU1o63g5JyhIXFoMm3zmjkaYnCFhnvqayI91mB/SM1r+GWqM3ekwnORumMBxYz4anmaZKYZUdbmEYNQkWIEhqhZdA1bh6pIabBvH/EJYSa0wh/J8DYGWJcPih6043Pos/93mg+1qaf19mGFjyRNeSHcL8P+4kPqELJ9OAa5yrnc6bS+0VMHQjSr1cHHsfxuSFLVZlBa7NfasyywXu8IhkBarwh5It5V8vKjTDGZLHuGXVpnrb496qnyZ/npqIz/c6FrC6D0xtdgHEbN4/yOb8g== 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=dPSzyBb7IY4KN1FJSY514GEdmSffSJ/0pCmlKMg/BXg=; b=CSajtSauwKXy4oD7mJEBvSNJgGluvOxZ7ecFMqn1i3HmbqJYi5uObrI2fKiyKaXvJwn1bSPh6lGBB6vDQiyOgOIxwo7HaMyiPdgIO5tqiM9gY8eK7S+mHpH6YzqrsuYxCTtmJBaIQTy0t0SQ3aJj9jRSEdKooZdNBzX/t9LAamw= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:36: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.7068.022; Mon, 4 Dec 2023 16:36:00 +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 3/8] dpaa2-switch: print an error when the vlan is already configured Date: Mon, 4 Dec 2023 18:35:23 +0200 Message-Id: <20231204163528.1797565-4-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR2P281CA0054.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:93::8) 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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: ea628f32-2c73-4ea8-8611-08dbf4e71979 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 212TiGSzyt8TT1Q/aTRLbEUAxOJk8kc7VQ+9f4TiWO9KdJdvlQ5XFftedQiTxwgGMAS+DQ0d0hJyox8S4wUpo6q47orEvQ0VVqZaj8r09XsdJJXNpGoLpUXrI1SsOJa/KO/0I5/8Ba2zN7TXHWnU9KJrrfQwYgPdhetqVUlyUFRRVtXR+dlpge671zrMCFDq9UxSVPm/pr+slkIOS9X9ZB7eL42sLU7kTGfCBeh9eZ/9+XgDfKtOMZq/VQRKo+KPbOZHkQGi97UE1fLCuB49AOps9wakjfWRw3SGSqW8TyniCPmlOltoiS7zJPnxQlEKYAACvm99Q9viNAYhCgh8lyvZJUzivhiRANHqvbzvJKvXOYmNno0sIWWZyL0lebtmcCjirYx+FPK5WNVsjkQ+W8tmvL+Q8Myz5Set8RSbe4izhAvly8LLAgF7pEkqYpJTtOHJEx0q0rtMGFRQGuCssoFwUI1dc594KdwZCqWW1ipsSrxhu4n23bX5SLBctVqPxLvUYTCFX5PgvtOM+OfRrRmLpCqYibGPpO1+RqIPa3AyblkRPo8fzQdeVPj96S7+ 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4BOhpyL0Ys4NTWeAW+RMzGY9SNmfAw+/WGYaNIi4cQA2QQz1Sg/a8K1KFpo3t9+ZqimULWtrIiWaLnlYZlbmG+x5dh4yEV8rq7y7cNzYIe6aiVqq7N8j0y1yJWFE/DvhQKQhacU9XWEfn3gvS+2XXrAZIP3hRmw4Y11h3U0ztQhfOmMhWaZTE7t0RHnPKsGIaNxqsXYZIA1SfJi3ZLJJddsK1CMFFBPOXDA1SqHcaF3TUyERGJDifnA6AFxgcx8kiJfnBF/l7JiTTPviLci/j05jKCDPCxbnVlMBoU35wsSv773Jejp5r+0vAVSY8O7rndfHGdVRMFX1OE2p2WzC5DcHKnEDuMx97x62ch0LFtLlYvEGX90UBeRNTO5Xt11b99ShG2oDdoEcl2MrXU9gq373undGuSIYWOxGXk79yu2UoCWpTSDAyT227YpZqYiFxpQAzD0/bUidWPxgntaIHGnoPLFdOeGhRvPlSZxDY3GnN6+0R7ka/t8Zhrhf/68e6wuKLA1b3HWP1WrWIfRMUxcd+RfVzC3652fTAUaq4CC4juqU/0mQjdkMvdkEUS5x5Ht2atTcmKox6qfUoUmmna9GsLH3Xl1YojvUXtM4OukqKC2b7gQc8XoEowAK5d2agHI0cUCqVtR5xh5p9NbrgnUkjcZV8r5/QA2u2G2AAqUpDfoapIrdtJzHY7rAOHmf0fRGOCDgXjIEui9OmhyEIZ0wg5OYDf94UMnzlmJDgA2AaPwy1ixrxkNMDvak+hc+Ds49n7CeBII7xxtDSRsbAvI9d5+dTWcn5F/8n4j71KDlexWgXB9VeQEza81D3BDBmg0BE9cHTbu9wYCzrCU3lSLaxeOb53pVWhjNBjkkI/fXkzZmmGjyZFrkl+A6BznnyenVzqG5rO5Q+90HBf7EfBmsaDp5otKuK4S1WQT/3T/7wLcwfnXGXfbo3rZKhhWrrA/jCiuBjJVJO78PptH1lyvtvYKLEzbmbERGoTzVdCijxHRQmSCpfmCps6Wu4aKFJLH6kE2r7tieV0Fl9BDWu6eR/hZ1aKW2je72in2PECe0laVnZ4gZ6rbubOhP1j6dk/NkfTAcWbKpaI5iCgNq6JWCwmdirzeaalZDdWJUc6YKATRoJZhP3vybDbNg8sdKKCpNQ35XHijI+w+saZgN7KzLfM/F/zTA5i1YaE3TPf/rmeSLunmlRDMpRNy5JsztC2rKnPVc0d41NijqPwWPSXeoy/4b70vuSRSQbI1Utf/FjHK8WjD2Zsy7p9HHTtHqgjmxdDwyKQ7phwLjfBv4tV8q9rcQi6zQf45PkttIX1zHo7tXQv5OwyUKhyHhDJioY6qMeLCrE2BgUItXitYdIkv8Q058lvsXfXewkdbB4o5SEHpLC7/2XlkBTwczjPuEduLuv4fkQZabmadYBF6Yl7pcTGGUtHU7TzgGgZNwlM2rJpoF6i7E1net1VVgzoawVUe37DzWPW2PqlCSMl0aucoxpPACHNCm3Z9WLpgKuRFcasXMEqit8kSAL3+AFK9NDWxQF8+ZUgAiIOVGnp+MxPhicmM8/3Uabjz2peVO6PsS4Bgbcc4LeN75rTu8jIoS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea628f32-2c73-4ea8-8611-08dbf4e71979 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:36:00.6726 (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: 8LrJuwb4wxFwgKYuwwqkIKXj8mtL13Dbeac2FWbtHoq3a7LybgilEf2n54bTzvgPRN6t7S4u9/IMZoNP4feqeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 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. Signed-off-by: Ioana Ciornei --- 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 Mon Dec 4 16:35:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13478767 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="U0tQVLAF" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 175309A for ; Mon, 4 Dec 2023 08:36:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gZjRDl9iJZNYIlfUgKah3+zrdO6TuSTH6YUs8f2wbEhjvoqrA20YWn0HsHdUo9wcGcSAM92N8wx0zryWnu5prNGHqRgOPUkd1roEP+aDcRCOBf/Is8wKxo5GwXKMnNZe5DLGSG5//FtJgzb2/PzY3Wfk1wFVDtkxzcg9tMFefl9JRd1n/n5SQpX3MXlEHydXHobsLx2bkO23VsEZKG24juKmwTOZDzkj4o1dTwjQ2klOhzHrrq9yLqfW7B8Q+GmJXQDfV8F+SN9dtumw/8NVueyKdutDIlOiDTfCwfoqi4XvnI/fk81R7602oIgm07RDDzwI2tMY1WRP49Sq5HV7YQ== 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=8ZCF1I4gb7hhdiMaWHGzKdRL8CZko9JD4K8fbasLbGE=; b=LoE8HnlhnBEz/R5uEqa7qCPPYUvCnXhjRAUiSWZVfmB52yV5q90um/TAcysB9pqXwLfEQ6lFxBL8QEuk8LMd0qntRomzfwN56QtUq9hLJ6XCmvENUO7+BWIoNziyho5trIs2cvqnRJiUF13aim8fnfUhvfrmZykG1e+gwUG1W1NJwWojuWo8T0V0+gRacMQUhPgwq/6GYB8RDHXg/BqUDrP8wfp+H7Ap43pHlSNoA4jRK1JvvC5KU1Xd8JSJ5xwtjWutpPb9rUs31I40V4OFdQn/zgNc5iPRcZNnGrwvR5M6sO0gSPQUOLD6nhYvCtOsNJZJYmKPSaJimGVcoR3tbg== 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=8ZCF1I4gb7hhdiMaWHGzKdRL8CZko9JD4K8fbasLbGE=; b=U0tQVLAFrZRDhVOXtd7yArirm0+7QAxFrQ364fYGKfpr86yyuj5MolIjv5NLtpv6GtPKIoLgMn+325ASMoR8eKCCNR0gLG9YKuxwoTR7oDOHZqPQjYihlyO/zrzopdUk7yk4LUpOqyg2gGQN13uoHjrRqRSbQzAXuK6K8lYtN1A= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:36: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.7068.022; Mon, 4 Dec 2023 16:36: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 Subject: [PATCH 4/8] dpaa2-switch: add ENDPOINT_CHANGED to the irq_mask Date: Mon, 4 Dec 2023 18:35:24 +0200 Message-Id: <20231204163528.1797565-5-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR4P281CA0216.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:e4::20) 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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: 873f7bb8-6958-427a-8c5b-08dbf4e71aa3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d39AV7oYaT+xIqXEHtK3g0RiC7y4GumvcyI7yH5STbtNxnTZClFGNLLlkn/vnwQ6ZpLmMQndHQjGtb4e/BCk+Q1oWPX2RvDElbmU2UzKIBprQnalsB6O3k2wLGOW5ZxRiexcGWdLIJF0gph77+hqMOca5xuhck6ZiDucg5IY4QR4Y1qgj5RRxAL2TgdtWwL70yu7glMfZUeQHabkhLMhLcegB462osG/BkifJ8izt2hAHbrizVKQSi+0i+SObX66gNvU3SSl1/6y99FDUZP4kL14oRBP2b7iytrqjFLLKR8pJym08XRQs/X31y/NMdI2GmE0tS0zdowm3ed4WMQxuC+yM0/Fu5PUWAvdVcTLG+JgjyZUHfE6KxHgLBATiPkJyOGPNt4PEtrWkYPMpd+FZvBtXYqMm0gRXvDPHT/MIj1+kt7JNnVMOZGRH4pzv26YYD7VBYU4dyrTC7drHhGxKT4ZRTpbh4uNymCcXel4KWYanTDnfBMbGYj9lD0awzJXIM1jgPQf24m8u4BbZxsj5cz6uOD/44Jr/dfvYqUhB1agUwv6ZqlI+Bbh+AbjTQ9U 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rV4YMfG3nPrsNIjhRXrq0HUQst5HO1IP4LUtN3vaaSwWtnFhFPs53ISi+OjhzC0nIpIOxgRM3mn5R5EPYsC2BbAMGPzN0qqg2K09+ISv4YJquY2g+Ldudxo2nurkcXw9MGd4iJsMFtc/eDN4yruGUdVxX5Vd0IZb82D/YIeFRAZkcLdBMREXsWQ416I8xtixEF8w0t49t0ydCR6hGTXy3CXOlYGi6lwQfVD4W1YuYlkdli8mblSsKqF/nZpQ96PICQ6Tj8JVRW6DuXVw3flvhMgKZvOn0mKrZ4cUl31gjkfsMt5Cl4okD58+/PGBiRjBJYB1C087ClDfGliUPRWF8DsAMAbpksvRVKDLgWU8sUeXfWhtEV7p1xEqqcAJqHFoE8xzWBPYaEXU7PgEluOorcVS9GuPCOZEuWf6Kv1z1xYSdcfsN4lFNhy/jxVwzkVpb31/XRAgGELsC3f2d1omYc18W9Jqgtx6UuJ9eto2iR238lFTa6frR+GupHq0IN/2T3FMebYU4a+JEl7hm7v0t6q+SkMRawHjSaeN//QdWF2W7HUX47yAmsB0qVATpm1D5vbGKdCLG+6pV5SQ/Y8J5DJz0QigaFrvWcAJ9B5S8mmE80lpoAcAs2W57dhMBVXWtghKzNENe2fxxwZgrNBY+wdBEJSjxh5K/Rbyl4xyH4PhIsvVljzME+PZz5EtDAolBUvoech3qgxe42Rw3RPDgGG2aQTBRvl1GWbxHAvZIrUe7tN+tWkcDZbbykP75dCUl3ApfEnBAgTBH95Y9cG8obfiOYndyg4DYpkhYajAzYXnU3O/u0yJRwoJMIT87Q39R7K0Ix9sf+w1bLPcdnG8SHaaEF6bmPBBrY8CF+gZmd/tvxPXZuxML4DuBrJrecI+q3DFLpFF3iIaub2e/mrubvhAvH4xPNfheS4r51Ktfbtu4Sy31QfyvPYxQO4Gk+4ySqOjnjk64VSuxqwVpJkScktIk+mkDg3uDxAdNEhKaz5tM/++9Jk3Xv/qCI3YCnYiBlvOnfD5gy2kxRLNh1rKIb9/KMhO9Ex+Xy1wAe/kwJ59MYeyokest+P5DL277bLuhRpacBBvJClJkyVRZZWewsq9iNMum63JfvJ5sNLzC4DEu9oc/E57RdUWL3YMAieWsLUL+nqZM5Lcjml43CtMWFXMvR9f47nm3+/64o2xPu5uA7WG8aC2TWfuUNvH20ExRk/mDnwblMYKnS+ToaKtoR7wVxFYkI28yRh3Bg31xhYfaaOPQAw/tOp+2hnKr4dX9toLIS0mocvPIheRuWk9UoNQ3Ia3A/GsyepxmsGbtqPYldddvToTGMos7M13wMHGJLBOv1ErR7SRnQ9jGJu5iPZQNDlS7azsEMFHMd63KuSQg3jTuHl3oJk8c9l3w6f0qa7w+qt3phZJyE6g7rVjZysixLx0DAeLqdXMcVKKMLWFE8p4Ohh/Q+gYCURwpWmdk47mPc6nSTAFbdvkaiLtfWHGlfGIKeuKkVzic0fzTbE3CFFjlB4cubp3j3OpUwTxG0GGkxo9/u5wlttM9KfWTCQmdTm4IPfaIs+Sr9FucpFcdo3CORaqx6e3XttgZpIA X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 873f7bb8-6958-427a-8c5b-08dbf4e71aa3 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:36:02.5607 (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: TiOSxPUX0Hf/tgB530vDuudIw4mBMPo/hOxmaR850OMtDVDodZfdSpV355ayedw1hsECPNaH6FnFbsaAqR8TBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 X-Patchwork-Delegate: kuba@kernel.org Add the ENDPOINT_CHANGED irq to the irq_mask since it was omitted in the blamed commit. Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support") Signed-off-by: Ioana Ciornei --- 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 Mon Dec 4 16:35:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13478768 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="Q785ubS3" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58081CD for ; Mon, 4 Dec 2023 08:36:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ckk3KLd3yYSZLQ8Y8XLoagI/dysYopJppJmXaHIIj/me5kXo/Q0b2tAurGTyslmJC/eNnZZQAnOZv0OWUdiV7VSit6MFYDViBxg+JVXWgqKU3xNnDvVU2/O25RA64bzwLM/BYkHxyntF+ISwrjBNm7CH3EHPKDVqAZre4LldqcAZOy6lYdSIy7H0EmqANR4E0MNzvlQi9seta8M6Zaw9RaKCT38sRJ5bLr9jk1UJ2Yc4YtZ38ZwNQCwsnCRppmrz6yT4UuuYMwaGXC+AaAyqLB7CO66uH4/kf2p6/ddvdhRAWfw5zo8i2rLcCc2CcWE6xy5RFgWjuic4LRJ62PiFrQ== 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=MIZ4cHOTZxFG39i+ojGcFcTf1WaKuU0eGJDOEcMb+FI=; b=YRiAykk+iRAIEDE7nlq1VYdZOtHzYO0BKHPyGgkjX2zDb2jphNkLb/s7Pat6zjA4Q0iHjaTivtpoKO74q4ynxI8Fv2iD1cnOvsxW9rcPy2Xj0SoLmlJ77sOoLJhzuixi6a2zvL88u9nrQMs1D0+uLlYae9x2wNbJZHpZYEdEns/ccR+UNCcUM1QA9qAjsq5rg3GwOs8PHGi0mhsaAts8VieD+xvGcfsBe2DIkZXza+cefHNpuonMI8ZP2Myp8klZmR+bsG0tzB9pmmgIE6pxqD2JdKQMmy9Oct0WXd8FDAxXIfZXt1A55TnQhci5Jytb0rLmfq+Lnjejk678loBU9g== 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=MIZ4cHOTZxFG39i+ojGcFcTf1WaKuU0eGJDOEcMb+FI=; b=Q785ubS3Kk0XNfBzgQq6Lp6kqJ5f5MByHK4MeXYYhUb1MYXb/6nELzDRJnrcI2tnD+b3ZqaGJ36tGwIpj4/H4/9ER6o+JP3skk7vVMysO1gtWeu5HjKlNjKxXpBgzdt9YKoZDyA1+4pXVajUANE0wYlFKI/cpjuF78CNkqXAzDg= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:36:04 +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.7068.022; Mon, 4 Dec 2023 16:36:04 +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 5/8] dpaa2-switch: do not clear any interrupts automatically Date: Mon, 4 Dec 2023 18:35:25 +0200 Message-Id: <20231204163528.1797565-6-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR4P281CA0143.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b8::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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: 461de506-e405-438d-ce2a-08dbf4e71bc8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Kh0JT7anvxKnlFzfs1ug4J30oMZTMz5c33idSpgJ+YMojE8WqWjh7sovshJsPeD3cKv5FwFNElvci1z1JSvPmEqSwi1oms5Byr7oXB031ojtwd+bVLg/eW8QVQqa7Qp77NlnbNZ4+BmF9iS4PBloTMqJAYE/CUp6hw52DYiuoCIp+ZDSNduuC9Y4JPxy3RRSYpYBjRKQX+9Y48gvM2MWXcmimWNz94Iptj2Y1PZS90S3QWkKaq7AJSVlqB6l5kpF/WFFlqW9pgBNIMgBdscgwGEzex4MP3I5p3fEqKUr0UQErf63MoK+5GJ6ZJg54ypQajZbeER3a62M0u5k7RFWTojzIQf/70WLw4HEB1yQkxngZ9EnNedd2utuMEfK/PkD7sXmjCEM0eePibFRQ/2scWMlGyH1KMsOIyUy7D9v5bz7M9kX+gdnjWOwMuStDlAFV43r/GoSjmR4iQHbfbL7ZB2uMTXZ2OUftGvtsLtgpvDfRwMfwfkwzRIfka9+r/OuoYEwG9BpY1cqVQ3bff0OIMLbaQi0BzOW0rUaHG6+UKKNp1+xBhX3VWYhCnDrXj9 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1Zn11VgpkxPg6233qpJPmBWgU10skp0b06zbHGGb9hP3baGZgpAtfDBF0K71y8zfq9IU9X1hO1aiI0C7u1izRFsunIjypY6XAfcgbwspwGOMGkt02J9oxU1cR8O8ROH1NevKJVQm3VJS5tOEIxhyAYs4Zk/wbYVHT69EO4RznrxGv0DNnyqiZ6eSTd1BlCAN3ejZAtU0QgAJ7dF50modt9xs3TLZv6YeCMhimg0Bxw0bX8c9kXV4bn+SsJJProTlvr4fFslbZTG3xWrl6xSvJdCMkRYF6Hr+UF9xJrGeuJ5dhgC5UL49wjwRdXPe3PjkeXXfViE02Ml3zG1JiqzY5wg5Z9Sy7vAGZQpNUonI6P4dHRxdQDy/hElkwuk9s4spPIVdhYLlLzSKpcUC5bM0d6vx5ENZs6S0EfE6usd+lFt8KH7lfBHF1cvuxmaBnBtJo3Il8bdDgfHQgZ2KzowT1G2kUQUBc+gaaFMmNfpZ/VtL2wCYxLNs8bKrIa/EplezSWcjQCirt61No5uE/O0yywcHOjczXnm8YwDxN7EUjEdm5c8kNEksNMAiqtcqFmnu9pU6xRHrQlLCYtHbl1bTuD6XNEZCs1pY54jt9bkoR7+mTuP9/WmlLztGCAkAzUPw4PYJ7T38DyCmJltzJTgddy/QcIBQ4nMziYI+kPeV7pg/8egnfUnpTRrKoI6cksl9xUYFaMNTcLceDo2ej7uLISTjc5FeYbmYBZAmkYOzx3Br7X8+dEcr5BEU4/sA40jnQfvH1Uuy4KRF73XHZMo1qu1kkGYNW9e1CmNoroaQu+p/I2+NagoThPzhBDQFGtfsHz+Y5xTnOI4dQaqRicLwJXzafyxwE0aCzi1B0p7DJKagyD0ojYqanCKDTVRZsKeRUZcI57fdxkcMDzNRUQME9oUhGkqya6ndQui/o3ztGYUBoIvwvKGZCPcW8BUJk2iFcUnlcUhpQD7Z8emDFPpSPQbebMGB4rYVPboE1kna4ESTx6uHKBo1zcTMebmj1BMJjzbMh07s9awDdeLgqmhGCqeqaqJYd5LqmiHZvsJdnd+tfG8UxyTcml4ZevXhcBspSForH0aXPFnMgPjZoJj9rtPYsr8Rng0Ti+aGGSb7IsKl8bBrtsdO2xZjKcjLdz6XGw6X+yADWNJk4mTLhmBO1K3yPP/zzyNKOYOf6OqwAueB00MOlHdvPNAHapvKrGuMZigAVv9KA2louvlyplI+1QR9laUYCbirUITANhxHA9RCpjuw2JDZ2NtXCclVwGswJ2hX5NFWOpK9l8tImIGuhjwvMsZUqyBXzUEbDvB96lhtIXvWixJ8NrBIGv4BuUXEHX+4uJaJAEwRfTyP4zmbe5ihnpsjWkRTENtCwFDClN3z4iTClBWYAcR3tSRWSydfEtyc8JJIFgGsb7pjjBeqlzyo3421NJ9han5tKLyc68nhj7OrdOJkQ9QQ/oJKHuv6tY2Y+LZ0iwcd/TgMdyugoDGj04D7J4bdkk++9yoBD8rzacS3B+5pWyt1HlpdcNub3ZmjdmsV51puRM26+IaWRnIKWCN8sV8DQ9Wb05fcOY3R+36Xo1+E7V1WMQOBXP09 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 461de506-e405-438d-ce2a-08dbf4e71bc8 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:36:04.4860 (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: WkiYIxZBoWqxuQTsDmvZMy4ro8wlg9Nx4dm+LK6zsqT7f40Hj6wkXZLUEf4FxF8tz1ANdjtYrPZetXRRFA6XRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 X-Patchwork-Delegate: kuba@kernel.org The dpsw_get_irq_status() can clear interrupts 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 interrupts that we actually handled. Just resort to manually clearing interrupts after we received them using the dpsw_clear_irq_status(). Signed-off-by: Ioana Ciornei --- 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 Mon Dec 4 16:35: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: 13478769 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="HmsKDJRk" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2087.outbound.protection.outlook.com [40.107.7.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9099EAC for ; Mon, 4 Dec 2023 08:36:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bFleXATEdiXfLXlPj9B/qYxrDkAx6zi2swZN3CkG1Xp39YrSh/E3NhxipAwlQhnSGjQxEjJt91TOKc+nIIX4sXWtK/7PhH8eIODCgA9HxitwoeI2JC+zVzfnqCGW0Pdk7C9AP+AeAtFp/lxsqGQrllwCTijeBTS7lxILdm9J3nHtgiIGVbbgb+2w7bRYyf6cRWdHD8C+lHL0uvlF/WQWEf9cDfI48/yAIKcybbSQrFmjlmHrxdpw5XO4KIzjmS9om/WgKCZ4UXNNhwePonedxD4j39uPQJA1dfHPHOMv+L9OjgKubYq8MVkMFTHpMN+ePeUWSRoxkf7SK01nxPzg9A== 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=LcH5EAKh5BjgC+Tt1rK3hkC5bPjXvBqe9aoF4ipsv0Y=; b=RKDIXOSPAk2gJ48duudilDvkyhXAw+gcTPTm0TQAuo42Oc3OEqdRBH+BnXWdYU5s16tFLGmMlbSAYANG6fOFxKdIczNoHiCO1BNsaPByqZUNegv+XKc1MTiIBlH4de1d5RRRNaEPenTjGgHC6IdtuYAiVAS4sd9WVxk9+O4wXO/Um0MUqjB7wRxoRyQbqMIxZZ38JJfENxPwswICClOTA19K1FUKK6mPPf3q5hBwdOAucdg+DK5ioP9ODXS+oCgak57G0niwhI0/r1l0ybKMHLK88+NZwoX9iT1B4anwlq+RcS4OmhDsnr+wcUVdV56H6EemGNfL8h+DhiAywY6yUw== 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=LcH5EAKh5BjgC+Tt1rK3hkC5bPjXvBqe9aoF4ipsv0Y=; b=HmsKDJRkaX4q4satx9WKjcKkGb3UVu/UN4F1YId47rmKw1F7oDL406ViI/bci/hueqLkvujfBRSK51eYGir1ifRStHaOxXyl/stP6gN4mhpsyRHSUb3Vyo9/AOjg+XBtURhR/H2Vjw4hdF3Oh9MQAwaOFXXfLA1RjaJkKOAt1jo= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:36:06 +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.7068.022; Mon, 4 Dec 2023 16:36:06 +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 6/8] dpaa2-switch: reorganize the [pre]changeupper events Date: Mon, 4 Dec 2023 18:35:26 +0200 Message-Id: <20231204163528.1797565-7-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR4P281CA0149.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b8::15) 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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ac0a760-e387-415b-3842-08dbf4e71cd6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KcipSOOTkmJjU/+cEfowSmCm6WERotvNlVQdCe0vskFtkTciaSJRew6hyBDbAWprtxQw9G9eS/A+y7J1KBabXofzpKbfDC/loncyDDW/o34dKT70q/uVNW0You1qCYZrHd5UED6uFkmNGCtwKKVqBy1TDRsBad2taDAAujv4Gdwekxh8ANkE3VQoL/ZQZo2KPBIDmwTnE1/UE4kYwiiPrZikJ6k2Dw161W81sL/YOWsnmwTJ5dcPx5RB19jotBmy6RdxfH5hV6XN4NYZn+9DYk6HwkxHBfuj9UW5RgE2SR1ySD158K1RZgqGB68Efee0HhJc9EWaPPGHDv0Y5UzGWv0Q0EjnV1UwmoanDIW97EVfdc2TOG7CKso1CQy9nOMC1HyeaqbS/F30DTVJKlWITxUNVJiaI4AgVBsLFkuJx2VVCXkjBwH9ggzLMQ5uWQfSWgvKYAyEEmZ5FkDDabTy9CvARl4jHHDEWQnrYFz5U4GMFBFuEkCK4vgXSZlE2sU2QjvaKDosFBvLrs+PwQNqMaPB5nEyZM0t/mTAqaLFD5EHvhRVVCR8I5ChfXzMK4Ka 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FTLDFRlFEg2hmNim8sGaroM59he3wWHeJmCz+lhr/hAaEQnh0HIOMunltUtgRL6H/wY+/VvrINU1ee44Q9n2iFhMLXQRV3CaHq4obE4E2wSGimnaYIwHLjLPFv8U0NceVvSWDKZAVDYqTCCHS4JE/1bjtGseI4kn9/A2drqcE5DeAcySxANXAnHM44k6oRmhUJqI8v0Zi+0g4LZ4amSx6DnBO1qLSuDjw1vyLz7zpHyEZbwW//NZtg6v3hXv6jxFiHz1BU6dAjnVIhDW1kT/wGMJo+au/HDi/+2Peji0Mre5SkBGOsJqIYxM8Sk6WE/J3xdI5PflYeX1vJ8bmPLFC1mBdsMEHrk4quskJbGAoHAsGg93dlCsUonfTGToYfjw/u7zdUM8numwzIOMGGdwytH4LNZSdZiPFKvHJMthqnhIQCLCbzDGwLm54pfvJ/gH3kPnLqCWMlLnTtt6OwIZ9SGs5K+e7ORxG1UOBgOgtHimu17j6zTDKNz1GdMKLiRtytoocYT53vzfG6iiT1ooMYb6LNWKwTH0wzCP8djuLR+32kF7P8jnAHLNXH9yhzU5zhHlcSj+N/+Fn8XRYr83FGcDAOrqGWQXh5FiVNk1NlpzS4fpNkNF8V45nJ4lxlk1HgSF/SOSHCJEnS/+tGJZNmeFZxbLw3x5bka8t+gqhptOSVttb15mcPSr9SsLEVCXYwlk25LZzIG8MwfAFDzJPl7DpbaJ5MQXQlkgFN/op/M4mqsSRVw7CPh4rKWSDoLZ4zTXUaWJ/6FIgVpCFsczXZogDGYCWEleolYpnqGPl6nBdeAiyXFC1r+4+Z4TFeNwCiB1eJ36qnkZMqo4/HM2fee+IuCX0FlDlVLHwFBvLVsmGXyz2H5AeeI0GlS26lgHDm0ek7+JXWv1hDthkoTRnN5M+2xgFWhxHsbRsf1adIqycqhIOQIchX+nLquVgSY+kro7L0xXxLON6rOhEB7QuXGkHFkKXiPHcECi4tqIQIXPwBohfd0uD7GF+Jrh8m6JgUZs451qDHV1C223inUuXYkAVMKA07dKr8YkLtOaIogz84mHp/eiRt85P6vTwPlVTC2cKuXMKe/mRI3JYHqM9NjEbwVGNVtEDiDijrd0b3e1PJgaNKR/nfdwQUQlPPGLpNbxnOVHZDCQUNEZClliMzs0sM1JdXMTXs/ExNjgj9pyGgJlHX/RNuH/yqQz6X9F+RDEiU/tzkyS4JFr0LdVTb7X3z7s48y5ItaQw2SjMPG4lCQuxEpchxOwbbsHpapbg0ojcMg2JvsZPXqOkpKtJ5plGgT+F4vbhdvv+cMa4ZMUxB8wnSIhTctT6atTVDitM7QBdkm+wHyQvBwbNac5IFn6Uoxl+AnI3zhs14TaHZlqZaOJuUUDdDVhLQgnEu65dSkXbUAalrAJSIXNdZ7Aw5YyPd1cATdkTjZkZCoqCVGO3ZT6r9fn9wPmGFeV7dY9z7cS9GLlq88lrE4mHuDvhBWudINdyX6HWUVTcqCUauNXk5CXgRrbMm5nzytqu2G3mSxXCqSeAFDcpP7bB0y8Bgcochbz0udNdq7shXfbNNS7VEBpd85A0i8g9pzqUljJ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ac0a760-e387-415b-3842-08dbf4e71cd6 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:36:06.3101 (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: /teOqqEI4mVny+2AX/yWmi2MvfzSHswQhgDFzE9ceNIa1w+jhNGrY+UUoia+sOrWisz8pcZEi0A/Gy+pG0yL8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 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 --- .../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 Mon Dec 4 16:35: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: 13478770 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="lHm1mMQb" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2048.outbound.protection.outlook.com [40.107.7.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 706059A for ; Mon, 4 Dec 2023 08:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jtoffRw3m4ktJUn5Ckjy39dicKfEj8bPFRB19Ggg0MAij1PoAK2rqRdvSOHpuw/VvUT4lBpfuaM1eI2nBuvSrF5bg1O/WPZVnZGzm5fp2wmdwcuGosp2Wt91plMmGjJweGHQsRov4mRA/QvxEA+OfQ9j2COIvZtIcz0jANxqyDcRvx4A6PNRqhhwAD0cIF09+qwso7JTdn5j7hDW+kxYc4+RXYZcLrxnupqh1Dkat4izQqOoLLVqxUb/a4Ityg2iIpWUV64YQxtpld+xHugyvtFv8ub/sz4MdHvKZ1zGD7XN1o308dFntoSmY9KKXiRr0N8wvRIHCxLzWZvUCLRCvQ== 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=aTC+LOuF0e72iWOWgE7tfXPmldx7jJAEsDXJV3JjePA=; b=g/7KW+VliyLcgPohPNhoo4C5+tNy/mlZETCvqIfZ8TqaQIxC9J6HZpXQB5tmJIU+o2hjmryskixh8Abgf+q2t+ycbWFxMckxFBZw7lb5pnz/8j9sKcpqHHT7rJbrhI6uAYjmjZPvyiq+6wvlJukLxqkeRSsnEF6AmNArdOKtfOakOLN2XvVUaETlQKjlfs1sBGWl2PGbP8S/3zdF/q79dLO/P/ec+NpkWCougkk2aCjPxtVEMi8XrnUynMWwFgXu6KJBDSwP5I8enjVbKEAAsbWNfQE4GtPzaXH+q47r9v3WKCkSy5p716Z68lLVpwafBkCyCblc8hzY+IBN3cr0sA== 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=aTC+LOuF0e72iWOWgE7tfXPmldx7jJAEsDXJV3JjePA=; b=lHm1mMQboiWF3zCNDW8BtAgiegiNHstbKmQUscDo3tEA/r0yztjeVBra03USOPkdXKg+jeuWYilKcwwMuepVgYfTyiJnn4IL8Vgl6IXFvwYsYn1qgV4URaixj8G1fCJ5Y4cQ4SQ5+sFvW0yxReZVcwJSB4vO1JfkMewWgvp9gps= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:36: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.7068.022; Mon, 4 Dec 2023 16:36: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 Subject: [PATCH 7/8] dpaa2-switch: move a check to the prechangeupper stage Date: Mon, 4 Dec 2023 18:35:27 +0200 Message-Id: <20231204163528.1797565-8-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR4P281CA0291.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:e7::17) 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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: cb3e0580-3342-4c88-f086-08dbf4e71df1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3s/hAFk0Jk5YwsvjTGY+KD5sI2n4vNmJD7/0oRoydDmptLHJF35I5lLBeuFwfeQUPgPHR8kiT/gjYNBTmvXYJp7wJxa7+nAJvpUXXnMrW7Bv49CYqVdN5k2zTwVRMyI2zCkdU0jT3LSaGQbpiz5ta/g+LRjdAkAqClh1DotsWRgvLRGH7vnONnQv+hyF7tf+8njOWANXlQ1YQqeQZleYzLO7/X8oM9b1+QaEY50pK2/AqiXHJQdNftLJtwRVYCQ903vYe8l1hlcc91/fJMATKXKewvRYVZSZf3ChXIUi4Gd75mKIuB3firjGXeR8iITolAu9lsOhmytUsSCVuzLHB/yk71md7RRRA/Sou448HjI2GsaK4469tKlf48RXabIml5NTrHvd7TY0wPUlJi4Qo1id9JXH8u6jBj2f0S94V4ieH1N//Ia/gbKRgFPo0UiKMRXfUd1fBHvMlxLlpMVrOjvnc428XLIz3xWoaBPUYt6C38utJ7YclDmUr6iIyTVdPvehiCHnclpSDsYTJauw+MjTjEwoxfkj95vVScIsG/uIjMqypmgA7J8p+GezoC1b 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XiyUlrdMOH2FwoPFF3DAUO0c4rzO60TyzUOAQ+B8eHypu6FDPqNEE7swFgKkPoCMBlIkYPRr6NVPcVmrteiF0R6xO5tdo1L1fXz/B4Sdz23AlJvGBWoTJ689JVx2qrwVhC8rtsRMOv9hoD+yPg/rGsW2jTSPFLjYOtO4j59kTW/oktN1hB/DXj5q1EwoDy3zPvfnTTrkPFiWby+b6/u463c+Mhbz4jZNU6dv195aSsEw4FD91/PlGzBtcnpPUphjx6g7n6X68CEOLu6RHRy8gJUmEzf7476X8czUpY2nK1lsJfiCND5Jiafh8szFnowgB1KCpX1alJolkDpmu5zKiQHBH+0mYxAVD83P3g9IlYB/ZL7XQQTK0S3sifto9pgSaXZ7idYvlkuYKIl1yI1Sm4xHuK51fTIRJdAtjsed2VqXu5MuE841PCJGZti8kvNby0uDWCdE9oXnd8xa1vuzx9OzerFutaqvQo/oSNqfGs+vTvfp/tCVgqvRFBoa1EnRCZfC5Nm5MjGJ5ngBq+klEjSR2yWDcxU1qN+OR77gR/1A0NQaSw75W0bigwox7lGoKEHRtqFmkNPiw1OKUl/H1/aoT0vQDpWaXH4DwDGvzmRZLqpqT2MAvOZPWZ5oQDnvU+Pu6DHV6LH7Mu25a4bGZclydLWxBwRzjaAJecOquXT4U4zoYNkcSvEgTElcMKRxmxxwcLmrqbTkgXNlBxodDy38ycJs03oVKFL6kXzC6VDilLcJNHu+GFZdo6EYU1A598vSU5toV7V2kghgUP4BoduMvjZuMLG51tq9t3Ifis13wVwxZEOBCHYcvxVBTbAWSoiJbCl8jZW8bFP0Rg3k4ZT7Tnt0fcyZfcntyXaNnrIl5OoSG19XDc992RF3syEw/fPsms8VCQonUB1fMz+g8KruLW3xelwsuaVuMmEVVbZK2O+r2ORV2B4GU/94/JJl77IB8XoAE5qg9Eu5hussybMFdYm+PYBJxwXIVh4WylH1okSaCPkbsquwHc/MZgIQMa+AVlzMXl2jiopyYucNioEwHKfxzvEuIbYnPLRzLTrudUWKUeTj9FGHrIYBvmKBB4T1B8VXULhPuftnCKRLe4ZqvpidD/DKxYiHMj+H3gdHm0YH8B7cPA2qvKW5zGFdFqC4UFW/cPnkWyEx2nabVd7DLBPp8rQyJZph3uHbmKVDb2T9X91r5V1f6zUxZpHYvzAo5cNQa7ak0erfjTSyp28H03JTEzYJsRWar7syWPH9KzgjYO+uM5IWwzgwM5PTw+RMHOS0ZxjyfUPDI4Oq6dw9DxTGoP777GaxHv4MCO9obyUUgtHuEGYfqqoEhsgPHEv2iGbjAqz6o9B9OwAxrxPeV4exBC7XhJ0sw09JtEcqFpuwXdf4zzF/GqrYOMvw4Rs4U6NMI6CV39lYtIdCVhrJoeQ7mVZU6l/DPcVYVTaO3TOJEa6tQA2caqOvzENEs2oEkmcyqQpBAGc1aHchsloXBG+p7XCiGCXpNUHm6hb425WG3AzZebDXw6VNhjCrPOEcYOXUW4aa4EQAzdPLJWbL6IgxbdCOM6Lo8BJv9L1BnQI75bevy7B1RRoWlI3t X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb3e0580-3342-4c88-f086-08dbf4e71df1 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:36:08.1470 (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: TQTKCrm0eFdDGJplsmb9a1O7nM/mZ5pjSNLELwVB9FpDlQmEnDCaFUV4oO9GXioHaphVOkIxC0Y+Ut5DL7A5Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 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 --- .../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 Mon Dec 4 16:35: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: 13478771 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="Hqp1KtIG" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2048.outbound.protection.outlook.com [40.107.7.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B5E9B for ; Mon, 4 Dec 2023 08:36:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ArAC/tJgVxB27cVDnqnhwXkZYQRv1p5xIHhUI7KmGTbgGyaKhnKKA30co3FyRspfNgZKOxlcGugSBmz9LzkwzY6TWhnVOMUkwb+8xyAHduy8VUOOUVEwbbto9MttFWCgcEY7eM293hy8UQeNozkzEBP/CVYZpGyEdx6T2FLY0I3fqrlqGQE/vLYB+xc2RPFLg4jzD9nwlR2EaODLntX5BOWip5jmiYzoVn4XMvBGsj6z/udpaLmUyH62v9XHJR4lOB3smGHplJu0duvCifH/tnKtc2/3fHeZREXChtriEh3h/VlkQg0+Spa178VEsMIq6m15pd3JBViKv5foBPYCog== 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=6xqYtUYrZxCEaQKnzG9+YfLrmnMxc3AKXSS5EYeyANk=; b=fCB7Fbdr66btgInvMfR2OTC4lzRlgFy2reF4WedvUAyr+QwESifvs9uUObUecF0gTMK5a2gkSLbBeHMR/+n/63hoGeASB7c8Ghoem8iI/1A37+2VAhasLkxWkUPExiUVxQdPsOLRQtRC07ww7H0sFyoU/eJYQhQvy4/4wp5oqoWloXF+lr6vf/tVXCXB9K//+sJ+FgWUROTZPRX6Gp8G5VOslg2aIBVqNpUHA6f0w91EXBOE1wJEBfZnHhqzxuo2svnOi/30f3DeQ3aC/7pwS5UiQs/nZPF8bMetwirsiyZE4oSAJL1ym0BTr4p1nuiLl8rcP2ovyfNEFJKp2RKJOA== 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=6xqYtUYrZxCEaQKnzG9+YfLrmnMxc3AKXSS5EYeyANk=; b=Hqp1KtIGNdMg7uhY+aHzbOGSeXQLFPPwrZ+RHn4qnUdyY+WBNgZJTxGHFf4Gw5dSlvOF8wfep0Zk4rpP/mtPB6F+A62Y00ty7UPIN9cULKb4oYvf2Qq29PetfQelBZSwP3JjTVz08vfwKSwHwm0FA2rxGzcFxH/Xjv6zXK6iR40= 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 AM9PR04MB8356.eurprd04.prod.outlook.com (2603:10a6:20b:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.22; Mon, 4 Dec 2023 16:36:09 +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.7068.022; Mon, 4 Dec 2023 16:36:09 +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 8/8] dpaa2-switch: cleanup the egress flood of an unused FDB Date: Mon, 4 Dec 2023 18:35:28 +0200 Message-Id: <20231204163528.1797565-9-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204163528.1797565-1-ioana.ciornei@nxp.com> References: <20231204163528.1797565-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: FR2P281CA0182.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9f::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_|AM9PR04MB8356:EE_ X-MS-Office365-Filtering-Correlation-Id: eced5242-d31b-44c3-d134-08dbf4e71ef5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FjkxY+99sapnmUBFCz23jc2HlM0NOKHZB/zmVJehU1KbEmffdVpdu4aNp3Tgqv+Cl1M32VwvkFno8Eyh4Vz0SK4fkUciMcqoMh1h3pwXhPiVOIvsl2o5I8yfS6h6E/ZcilMdriAcDsKNCyCEti1CsktF/MtFnnCTOsGcrrqHtCPuSikawfF4ndln4RSo4oj5qcoCsJMg+d+vu6mvf4fpRVRMf3EgvP8RS/pPpQwTaurJcXn264lff9vO5C4rH8GlOy00BTFPYxZJWeWyTkV/EbmajrLsJUBss8/rxQxuCFH1tCTroRgRIPqvXzKaRNU0JHDVlcfPb8hoQ+aKNhjGb7gi09fMwsSdx9bWd13OxzSGvjiPP6WEP2epvdyGT1YY18Dn4fUzrAWCdpT6HBqkgopa2Ld0uDEzQ/AJAuKKt282SCixu5XEV4wEG2xoObh6RQKI+kisU1Cft0R8rKpxKkIOVkcE5R5uo769R+xW75u6CKnj4D7SAE80ProHNF73WsvV/ubbhqN9t3SHyDFDJfk7URgPVoKzlm3LwF1tc+wpLeUW8lbIK7XbLn/Oo0dI 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)(39860400002)(136003)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66476007)(44832011)(316002)(66946007)(5660300002)(4326008)(8936002)(8676002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2906002)(6666004)(26005)(2616005)(6506007)(6512007)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NCB2SZN6Kd0xNMR+daNxr9Bt4Qhq8F2gDmAcogSZmcqv62QylIxzkjz4cnP/8GPeOasPdtImRkVmmQjjOXdkKzzbctnrzfscgA8LCEsCC1LH38ueZPgPv4axkzGeH0xmXzGT9mhQ877Cl/lFNTJob/Q8IZXAMVs6MdgQNG9Oo/ykoJcrY4K4g1cz80wf/OkImkXDcGx4d41Im6oLPaqcgNHE5X6p9Lt2RPXuxbaFZ/GvMA+RDrGGe9uOui0aEXOKlImFV6dfRkescjIB+zK857F8kY9KOGVpnCACVFaqvLjm5CU3NfHgKNO3mgr4KYIrYmOMnpZTvYiQdd+3YWly8DRjhXJK+hslt07DoVIpjZlIij8wmNKaqUU20a8H3uoouDuVPb46BnlOaird07n2Hm6768i5TX+30/8Qg7fTv9SEKV6sLOPiRkJWXGZfAyKm1uuVEe1BVBU54nIyMMegFeg7rBp78Sw46RIHbq8ne4LiqwvB5ngU3vRm08SlBJycvnS7vIOJCdZ8X7qbJyCbuWKBTwbZsspwEiv39x4kgtn3d46C7gvaSTXwXKBodpkY03nfny0V8Lym8e+Oy38ECZsCt4E3YwbxCZv18YatAQYoskqQkEHiRfBinQkHQ8Z5h+3D+3upQfJs9zv2yDdrHnGKj+XVUUrDx3nOK6FHUl89AGyXiJx7c5OgpRFZk4CUrThovcaMbFSYCPaKxpxzPbwy/IeuAC+4V39TDFAcLP+acdpV4fu7C4l9HVRnFfN7v6Cjr5e8vaQpmC+atO5Bb2BLFnTNT0c+0wA/Dv7Flo0as1HC0eEQ8TNoHgigo/dOaAZ3apol+c9kFrJoZzcrodxBmVjznH1QwSH+3xnXNd7xY05hlwXp1tUYkpDKW5CxGC0yo9QiOZ47sbTiMjX+OknwpnO9aPbIdVRutxme+1k/bi4pr6x7i27AQE6bHoKsn4EMgNNCTAmhnrwwIKo2QggYNDAIZVqgPlxe2jgwR93Rv2Tk/YY9WYjWVjkwnRqeFnVQd5vvzB7mQUMiPvGBRJklPJsma3SrTx9m0nq1EgYkS5lwbOLJ1evKQJg4VvozGiwt7BZg/Z9AkVZbFLK2Er70d9Y0B0k2VclUwmukOjyDPozn18IlAl8nOFwh60wZ62jhKz2Oz+byVT2C3Dz+8IHOku4peOVaZSpVnajPUbiblh5G11MxOkxLGlUUaZlxLE6uf3w5UJao9iuXzShDZYWhyHWXIYliZnDBJ95OWvW74d317t6H8080+ZhmpTd90blcP6muUB2SZpvCVLKejS6h4dHEIfbrbgOf4OM3l21/I1Oc5k8t9pagS8M687PgBAaMjGcadfTpukY+Us+36PcbJslAlfNWTw/waT7aD4qwQlNrehP+3QiV3xN4t5u8IlOgjQB6TidcThbuUuQ7dOCnNqGLAoP89iuy/aOPWfir6yinrw2OVRIND9nfoZdgUP4movXTB0Wd2ls1cxlKkklxH7fu2GGXgx35LpVKnzYFUPPfG2X5VUJrArC6rfRrPogXT7uC2aTUA4WLnh4PGqiTwkchP21GQNWhsLYV+ZJ4m/u+QvRI3J8tKuQcM/bi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eced5242-d31b-44c3-d134-08dbf4e71ef5 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2023 16:36:09.8480 (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: E3yH0KPHNf9iHuxDyN6M61WMpYJ+5JrspVByMiDsuhty+nSoafN2bJ3EoL2vu/n1hTg4hX4V8EQRUtCTxGq5Hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8356 X-Patchwork-Delegate: kuba@kernel.org In case a switch interface is joining a bridge, its FDB might change. In case this happens, we have to recreate the egress flood setup of the FDB that we just left. For this to happen, keep track of the old FDB and just call dpaa2_switch_fdb_set_egress_flood() on it. Signed-off-by: Ioana Ciornei --- 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..35f71c3668ba 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -2008,6 +2008,7 @@ 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 dpaa2_switch_fdb *old_fdb = port_priv->fdb; 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,