Skip to content

Commit 365d037

Browse files
IoanaCiorneidavem330
authored andcommitted
dpaa2-switch: set interface MAC address only on endpoint change
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 <[email protected]> Signed-off-by: Ioana Ciornei <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d11db8a commit 365d037

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,12 +1523,11 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg)
15231523
if_id = (status & 0xFFFF0000) >> 16;
15241524
port_priv = ethsw->ports[if_id];
15251525

1526-
if (status & DPSW_IRQ_EVENT_LINK_CHANGED) {
1526+
if (status & DPSW_IRQ_EVENT_LINK_CHANGED)
15271527
dpaa2_switch_port_link_state_update(port_priv->netdev);
1528-
dpaa2_switch_port_set_mac_addr(port_priv);
1529-
}
15301528

15311529
if (status & DPSW_IRQ_EVENT_ENDPOINT_CHANGED) {
1530+
dpaa2_switch_port_set_mac_addr(port_priv);
15321531
/* We can avoid locking because the "endpoint changed" IRQ
15331532
* handler is the only one who changes priv->mac at runtime,
15341533
* so we are not racing with anyone.

0 commit comments

Comments
 (0)