Commit 00f54e68 authored by Petr Machata's avatar Petr Machata Committed by David S. Miller
Browse files

net: core: dev: Add extack argument to dev_open()



In order to pass extack together with NETDEV_PRE_UP notifications, it's
necessary to route the extack to __dev_open() from diverse (possibly
indirect) callers. One prominent API through which the notification is
invoked is dev_open().

Therefore extend dev_open() with and extra extack argument and update
all users. Most of the calls end up just encoding NULL, but bond and
team drivers have the extack readily available.

Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fdb8b298
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1538,7 +1538,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
	slave_dev->flags |= IFF_SLAVE;

	/* open the slave since the application closed it */
	res = dev_open(slave_dev);
	res = dev_open(slave_dev, extack);
	if (res) {
		netdev_dbg(bond_dev, "Opening slave %s failed\n", slave_dev->name);
		goto err_restore_mac;
+1 −1
Original line number Diff line number Diff line
@@ -525,7 +525,7 @@ static int aq_set_ringparam(struct net_device *ndev,
		}
	}
	if (ndev_running)
		err = dev_open(ndev);
		err = dev_open(ndev, NULL);

err_exit:
	return err;
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ static int enic_set_ringparam(struct net_device *netdev,
	}
	enic_init_vnic_resources(enic);
	if (running) {
		err = dev_open(netdev);
		err = dev_open(netdev, NULL);
		if (err)
			goto err_out;
	}
+1 −1
Original line number Diff line number Diff line
@@ -624,7 +624,7 @@ static void hns_nic_self_test(struct net_device *ndev,
		clear_bit(NIC_STATE_TESTING, &priv->state);

		if (if_running)
			(void)dev_open(ndev);
			(void)dev_open(ndev, NULL);
	}
	/* Online tests aren't run; pass by default */

+1 −1
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ static int hns3_set_ringparam(struct net_device *ndev,
	}

	if (if_running)
		ret = dev_open(ndev);
		ret = dev_open(ndev, NULL);

	return ret;
}
Loading