Commit 41edfff5 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

ethernet: enic: use eth_hw_addr_set()

Commit 406f42fa ("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.

Use a zero'ed array on the stack, then call eth_hw_addr_set().
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c9e0c79
...@@ -1098,6 +1098,7 @@ static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) ...@@ -1098,6 +1098,7 @@ static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
static int enic_set_vf_port(struct net_device *netdev, int vf, static int enic_set_vf_port(struct net_device *netdev, int vf,
struct nlattr *port[]) struct nlattr *port[])
{ {
static const u8 zero_addr[ETH_ALEN] = {};
struct enic *enic = netdev_priv(netdev); struct enic *enic = netdev_priv(netdev);
struct enic_port_profile prev_pp; struct enic_port_profile prev_pp;
struct enic_port_profile *pp; struct enic_port_profile *pp;
...@@ -1162,7 +1163,7 @@ static int enic_set_vf_port(struct net_device *netdev, int vf, ...@@ -1162,7 +1163,7 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
} else { } else {
memset(pp, 0, sizeof(*pp)); memset(pp, 0, sizeof(*pp));
if (vf == PORT_SELF_VF) if (vf == PORT_SELF_VF)
eth_zero_addr(netdev->dev_addr); eth_hw_addr_set(netdev, zero_addr);
} }
} else { } else {
/* Set flag to indicate that the port assoc/disassoc /* Set flag to indicate that the port assoc/disassoc
...@@ -1174,7 +1175,7 @@ static int enic_set_vf_port(struct net_device *netdev, int vf, ...@@ -1174,7 +1175,7 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
if (pp->request == PORT_REQUEST_DISASSOCIATE) { if (pp->request == PORT_REQUEST_DISASSOCIATE) {
eth_zero_addr(pp->mac_addr); eth_zero_addr(pp->mac_addr);
if (vf == PORT_SELF_VF) if (vf == PORT_SELF_VF)
eth_zero_addr(netdev->dev_addr); eth_hw_addr_set(netdev, zero_addr);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment