Commit 93772114 authored by Jakub Kicinski's avatar Jakub Kicinski

net: xen: 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.
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 016c8946
...@@ -494,6 +494,9 @@ static const struct net_device_ops xenvif_netdev_ops = { ...@@ -494,6 +494,9 @@ static const struct net_device_ops xenvif_netdev_ops = {
struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
unsigned int handle) unsigned int handle)
{ {
static const u8 dummy_addr[ETH_ALEN] = {
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff,
};
int err; int err;
struct net_device *dev; struct net_device *dev;
struct xenvif *vif; struct xenvif *vif;
...@@ -551,8 +554,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, ...@@ -551,8 +554,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
* stolen by an Ethernet bridge for STP purposes. * stolen by an Ethernet bridge for STP purposes.
* (FE:FF:FF:FF:FF:FF) * (FE:FF:FF:FF:FF:FF)
*/ */
eth_broadcast_addr(dev->dev_addr); eth_hw_addr_set(dev, dummy_addr);
dev->dev_addr[0] &= ~0x01;
netif_carrier_off(dev); netif_carrier_off(dev);
......
...@@ -2157,6 +2157,7 @@ static int talk_to_netback(struct xenbus_device *dev, ...@@ -2157,6 +2157,7 @@ static int talk_to_netback(struct xenbus_device *dev,
unsigned int max_queues = 0; unsigned int max_queues = 0;
struct netfront_queue *queue = NULL; struct netfront_queue *queue = NULL;
unsigned int num_queues = 1; unsigned int num_queues = 1;
u8 addr[ETH_ALEN];
info->netdev->irq = 0; info->netdev->irq = 0;
...@@ -2170,11 +2171,12 @@ static int talk_to_netback(struct xenbus_device *dev, ...@@ -2170,11 +2171,12 @@ static int talk_to_netback(struct xenbus_device *dev,
"feature-split-event-channels", 0); "feature-split-event-channels", 0);
/* Read mac addr. */ /* Read mac addr. */
err = xen_net_read_mac(dev, info->netdev->dev_addr); err = xen_net_read_mac(dev, addr);
if (err) { if (err) {
xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename); xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename);
goto out_unlocked; goto out_unlocked;
} }
eth_hw_addr_set(info->netdev, addr);
info->netback_has_xdp_headroom = xenbus_read_unsigned(info->xbdev->otherend, info->netback_has_xdp_headroom = xenbus_read_unsigned(info->xbdev->otherend,
"feature-xdp-headroom", 0); "feature-xdp-headroom", 0);
......
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