Message ID | 20211019150011.1355755-4-kuba@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 3d9c64ca52d5a94a49df900e53ff1e60895720dd |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ethernet: manual netdev->dev_addr conversions (part 3) | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Series has a cover letter |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 4 of 4 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | No Fixes tag |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 19 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | No static functions without inline keyword in header files |
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c index 3e8a3fde8302..0775a5542f2f 100644 --- a/drivers/net/ethernet/tehuti/tehuti.c +++ b/drivers/net/ethernet/tehuti/tehuti.c @@ -840,6 +840,7 @@ static int bdx_set_mac(struct net_device *ndev, void *p) static int bdx_read_mac(struct bdx_priv *priv) { u16 macAddress[3], i; + u8 addr[ETH_ALEN]; ENTER; macAddress[2] = READ_REG(priv, regUNC_MAC0_A); @@ -849,9 +850,10 @@ static int bdx_read_mac(struct bdx_priv *priv) macAddress[0] = READ_REG(priv, regUNC_MAC2_A); macAddress[0] = READ_REG(priv, regUNC_MAC2_A); for (i = 0; i < 3; i++) { - priv->ndev->dev_addr[i * 2 + 1] = macAddress[i]; - priv->ndev->dev_addr[i * 2] = macAddress[i] >> 8; + addr[i * 2 + 1] = macAddress[i]; + addr[i * 2] = macAddress[i] >> 8; } + eth_hw_addr_set(priv->ndev, addr); RET(0); }
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(-)