From: Jakub Kicinski <kuba@kernel.org> Date: 2021-10-19 15:00:27
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: jaswinder.singh@linaro.org
CC: ilias.apalodimas@linaro.org
---
drivers/net/ethernet/socionext/netsec.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-10-19 15:00:28
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Break the address up into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: andy@greyhouse.net
---
drivers/net/ethernet/tehuti/tehuti.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-10-19 15:00:29
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Read the address into an array on the stack, do the swapping, then
call eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: chessman@tux.org
---
drivers/net/ethernet/ti/tlan.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
@@ -817,6 +817,7 @@ static int tlan_init(struct net_device *dev)interr;inti;structtlan_priv*priv;+u8addr[ETH_ALEN];priv=netdev_priv(dev);
@@ -842,7 +843,7 @@ static int tlan_init(struct net_device *dev)for(i=0;i<ETH_ALEN;i++)err|=tlan_ee_read_byte(dev,(u8)priv->adapter->addr_ofs+i,-(u8*)&dev->dev_addr[i]);+addr+i);if(err){pr_err("%s: Error reading MAC from eeprom: %d\n",dev->name,err);
@@ -850,11 +851,12 @@ static int tlan_init(struct net_device *dev)/* Olicom OC-2325/OC-2326 have the address byte-swapped */if(priv->adapter->addr_ofs==0xf8){for(i=0;i<ETH_ALEN;i+=2){-chartmp=dev->dev_addr[i];-dev->dev_addr[i]=dev->dev_addr[i+1];-dev->dev_addr[i+1]=tmp;+chartmp=addr[i];+addr[i]=addr[i+1];+addr[i+1]=tmp;}}+eth_hw_addr_set(dev,addr);netif_carrier_off(dev);
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-10-19 15:00:29
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: romieu@fr.zoreil.com
---
drivers/net/ethernet/via/via-velocity.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -2767,6 +2767,7 @@ static int velocity_probe(struct device *dev, int irq,structvelocity_info*vptr;structmac_regs__iomem*regs;intret=-ENOMEM;+u8addr[ETH_ALEN];/* FIXME: this driver, like almost all other ethernet drivers,*cansupportmorethanMAX_UNITS.
@@ -2820,7 +2821,8 @@ static int velocity_probe(struct device *dev, int irq,mac_wol_reset(regs);for(i=0;i<6;i++)-netdev->dev_addr[i]=readb(®s->PAR[i]);+addr[i]=readb(®s->PAR[i]);+eth_hw_addr_set(netdev,addr);velocity_get_options(&vptr->options,velocity_nics);
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-10-19 15:00:30
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: kevinbrace@bracecomputerlab.com
---
drivers/net/ethernet/via/via-rhine.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -899,6 +899,7 @@ static int rhine_init_one_common(struct device *hwdev, u32 quirks,structnet_device*dev;structrhine_private*rp;inti,rc,phy_id;+u8addr[ETH_ALEN];constchar*name;/* this should always be supported */
@@ -933,7 +934,8 @@ static int rhine_init_one_common(struct device *hwdev, u32 quirks,rhine_hw_init(dev,pioaddr);for(i=0;i<6;i++)-dev->dev_addr[i]=ioread8(ioaddr+StationAddr+i);+addr[i]=ioread8(ioaddr+StationAddr+i);+eth_hw_addr_set(dev,addr);if(!is_valid_ether_addr(dev->dev_addr)){/* Report it and use a random ethernet address instead */
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-10-19 15:01:45
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: peppe.cavallaro@st.com
CC: alexandre.torgue@foss.st.com
CC: joabreu@synopsys.com
CC: mcoquelin.stm32@gmail.com
CC: linux-stm32@st-md-mailman.stormreply.com
CC: linux-arm-kernel@lists.infradead.org
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Hi Jakub,
On Tue, 19 Oct 2021 at 18:00, Jakub Kicinski [off-list ref] wrote:
quoted hunk
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call
eth_hw_addr_set().
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: jaswinder.singh@linaro.org
CC: ilias.apalodimas@linaro.org
---
drivers/net/ethernet/socionext/netsec.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
Hello:
This series was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:
On Tue, 19 Oct 2021 08:00:05 -0700 you wrote:
Manual conversions of Ethernet drivers writing directly
to netdev->dev_addr (part 3 out of 3).
Jakub Kicinski (6):
ethernet: netsec: use eth_hw_addr_set()
ethernet: stmmac: use eth_hw_addr_set()
ethernet: tehuti: use eth_hw_addr_set()
ethernet: tlan: use eth_hw_addr_set()
ethernet: via-rhine: use eth_hw_addr_set()
ethernet: via-velocity: use eth_hw_addr_set()
[...]