From patchwork Wed Dec 13 12:14:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 13490812 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="DXUmSPSU" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A33AD5 for ; Wed, 13 Dec 2023 04:15:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ee1FOyhHOaUQu/EOEpdkisTOaRWreXEiPvhbdXn1L5U1NHdo3o8PlB3CrDCGoj2bCVsx9IntybleLnvMT0VZs8s8mJaVxNbnJIDLnqe938S1KUiY59U1o8E+PXBYcTgiw17C/wa6+qaaM+Z4Hx8576rwO0tXm0zV640kqiBNsMsmWxMzKjXZMKvJlf0xArh/kSpY6JaIoS1Q7vYwZg7RdSvUUWWOVQWf4/mTcfAvwZUlnFHSmz/OM3wVCvdfgvnmDZ7kiIV6cHe3KpjeR6ck0gWu6E8oosP9NP7hYo8OwmQMRTx8B7nPWqVKIp6bel+yhBQwObibaEtINsA366FwZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eDogeUIRi9EZaSlWJMHVs0AQuhh8PfHgnNja3tZYgfs=; b=SjikAPt4RY1Y4IUiwakx+7dX7jdOyLwy8OQZs8rim0dMA51CNKFcaQGN00GvfvCgJf9934t4oVqSJ6cp21UySWvQqut2aye3kmmjHyfj5Ofx8hsctlW+RAQmpBOfGk/p9jAVg26n9pg77tKfW5hZ9IZYhTMS3kzL7yPFoGGHEFGmaKJTj+xvQXDJTCwxUvrvRGWuUdhUKW1UXW2/fja8bgCYZ+HmVa37zVTf6HV/y8UNYoYRmHf/fyAWZUs9RsVTjwQyaQP86ZEsJxlI5UqdCPARttm6Tms3ziVNQ5YlDJuPAd2FQX3gBKMcKz+/Pbp6sm/xDYzIgR9napG5QM++Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eDogeUIRi9EZaSlWJMHVs0AQuhh8PfHgnNja3tZYgfs=; b=DXUmSPSUNPXBpIkNOO2w9QX4WjnlQLlsv9Bou26Kb5Ju+9b+iq/pyaQc7ZrRQEjw7xAh0k4HcPp0eV0GsFovA6+LlqvdBIGS51Kp+PcGAwqJASvPi/HNqlbprg5NqDvZ22/xy0+SMcb4fRpIn3FHhJUE/Ivw1bRE7qvWgN+YVmg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) by AS8PR04MB7894.eurprd04.prod.outlook.com (2603:10a6:20b:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.26; Wed, 13 Dec 2023 12:15:40 +0000 Received: from GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35]) by GV1PR04MB9070.eurprd04.prod.outlook.com ([fe80::1290:90d4:98c1:3d35%7]) with mapi id 15.20.7091.022; Wed, 13 Dec 2023 12:15:40 +0000 From: Ioana Ciornei To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next v2 1/8] dpaa2-switch: set interface MAC address only on endpoint change Date: Wed, 13 Dec 2023 14:14:04 +0200 Message-Id: <20231213121411.3091597-2-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213121411.3091597-1-ioana.ciornei@nxp.com> References: <20231213121411.3091597-1-ioana.ciornei@nxp.com> X-ClientProxiedBy: AM0PR06CA0106.eurprd06.prod.outlook.com (2603:10a6:208:fa::47) To GV1PR04MB9070.eurprd04.prod.outlook.com (2603:10a6:150:21::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR04MB9070:EE_|AS8PR04MB7894:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f1a1295-80a4-45f0-9eaa-08dbfbd538f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U2YYzLlBq4Ug/Jiuodj0f8DSHXqDvdOQTvfrpsUEUBDBtsYFhMkxoM7jDPXM33ja/uzmZ1/Wg0qsjjLzEvR2SkWAn9Xlc9IK06IHU0ELnFbDJLL3F8AQ2y340TJaWISPq6rhzAu55MRZV0jfex9PN+zjzyJPtNKnbe1pW6Li6MjmJ3X0hELqMqymFtfVKu9yKLXOo4nR6/st4qi2GANuFCe8Ny1ZV4mwd4iksPJjPavvyF3IhAjHeEqtPjSsZZ5DaVjzpSUPHsjQgOvEqYz8PLFRFHU2uprufbtb6SYAJAUwYiWbEzcImy6kuT7t2TW9LgTJA+HMj4q1dL9f+1l/Ql0+vNPVd2ZVspK5VB4klTeOLQLP24w0m0vSpdARZq9xCuBZnG4sJx7QphNkEyR2q4OmVyo2x7JgGx5pBq+3DU5kfSvSlDuXiSeIYAKdHgCvWmaS/LZ/LPCnEs1aOVIPaL7ZxntA2QwDgB7SKdf67E9oZYsdzm5cNy73k25E8ESeQxFKxhule7DWtw55l/ORbuflTIiS7tOi8HPv+Rdh9cB37TO4skKkefhwlq1IqLvr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1PR04MB9070.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(136003)(396003)(39860400002)(346002)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(26005)(2616005)(1076003)(86362001)(83380400001)(6666004)(6506007)(6512007)(66946007)(6486002)(44832011)(478600001)(4326008)(8936002)(8676002)(36756003)(5660300002)(41300700001)(2906002)(38100700002)(66476007)(66556008)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ryT3IBe+zI/VCw+w9pdAnYPExXZCS3/at4HQsrB4KX9Cn008/fkVfKXmc2cUCb0wUpqIoL3ph8V0TGmI8LfodAk5e6KZhJFrh6sxEOFasegBSIajIcq0KLwBgk1SkF4Jw72682msPXogvEdPJsr+mY5GOpY9P7GG2h+Qt6x+bc3GS7b9bw8Y+xJt5xXSYE52GVrMUBrO4ZNmAHAyTfx+mBlYgaKteXi60nl58HWW/c+S8DmZN7/3M2BRH5ezY73oLaAf+IUPbRhOigpe9cDzAETZ88vbi9FVYO0BnpMxJZoLLfxDeC8UfBEr79h316+MyHZ7AVUa07nktYFpmfymVXfJ1s/WcpJBLi7AjxscnkLdPYoVgPTxYEb4gDxg3vJceJ3ZzBxYC6K02Grz1bjQtBmuC0U8OL7+wKSdrPOp3pIeG4s1SLz6V2rgcHlQHhPLV5VuJO9v5lSVR6YaZ1foUdPUi8jxiHgGO/2jN8pPmH7+PjCVxpSw9qyxUhX1T4Su+EqWctDcgGHLCSKzPxd8fXc0zYPA3VLBtT6Ziw0IipypxBfYyUOPi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: 3f1a1295-80a4-45f0-9eaa-08dbfbd538f8 X-MS-Exchange-CrossTenant-AuthSource: GV1PR04MB9070.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2023 12:15:40.6859 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0ehFwjf+eo9E/kzSxGkTjjX9ldcVNCW7cp4cnUELWBDn9vohCjme0bbVmeqB8wbtE0Q2v9QzwLBn1u+0QKBPyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7894 X-Patchwork-Delegate: kuba@kernel.org There is no point in updating the MAC address of a switch interface each time the link state changes, this only needs to happen in case the endpoint changes (the switch interface is [dis]connected from/to a MAC). Just move the call to dpaa2_switch_port_set_mac_addr() under DPSW_IRQ_EVENT_ENDPOINT_CHANGED. Signed-off-by: Ioana Ciornei Reviewed-by: Simon Horman --- Changes in v2: - none drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 97d3151076d5..08a4d64c1c7d 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1523,12 +1523,11 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg) if_id = (status & 0xFFFF0000) >> 16; port_priv = ethsw->ports[if_id]; - if (status & DPSW_IRQ_EVENT_LINK_CHANGED) { + if (status & DPSW_IRQ_EVENT_LINK_CHANGED) dpaa2_switch_port_link_state_update(port_priv->netdev); - dpaa2_switch_port_set_mac_addr(port_priv); - } if (status & DPSW_IRQ_EVENT_ENDPOINT_CHANGED) { + dpaa2_switch_port_set_mac_addr(port_priv); /* We can avoid locking because the "endpoint changed" IRQ * handler is the only one who changes priv->mac at runtime, * so we are not racing with anyone.