* [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR
@ 2018-12-13 11:54 Petr Machata
2018-12-13 11:54 ` [PATCH net-next 01/13] net: dev: Add extack argument to dev_set_mac_address() Petr Machata
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
Spectrum devices have a limitation that all router interfaces need to
have the same address prefix. In Spectrum-1, the requirement is for the
initial 38 bits of all RIFs to be the same, in Spectrum-2 the limit is
36 bits. Currently violations of this requirement are not diagnosed. At
the same time, if the condition is not upheld, the mismatched MAC
address ends up overwriting the common prefix, and all RIF MAC addresses
silently change to the new prefix.
It is therefore desirable to be able at least to diagnose the issue, and
better to reject attempts to change MAC addresses in ways that is
incompatible with the device.
Currently MAC address changes are notified through emission of
NETDEV_CHANGEADDR, which is done after the change. Extending this
message to allow vetoing is certainly possible, but several other
notification types have instead adopted a simple two-stage approach:
first a "pre" notification is sent to make sure all interested parties
are OK with the change that's about to be done. Then the change is done,
and afterwards a "post" notification is sent.
This dual approach is easier to use: when the change is vetoed, nothing
has changed yet, and it's therefore unnecessary to roll anything back.
Therefore this patchset introduces it for NETDEV_CHANGEADDR as well.
One prominent path to emitting NETDEV_CHANGEADDR is through
dev_set_mac_address(). Therefore in patch #1, give this function an
extack argument, so that a textual reason for rejection (or a warning)
can be communicated back to the user.
In patch #2, add the new notification type. In patch #3, have dev.c emit
the notification for instances of dev_addr change, or addition of an
address to dev_addrs list.
In patches #4 and #5, extend the bridge driver to handle and emit the
new notifier.
In patch #6, change IPVLAN to emit the new notifier.
Likewise for bonding driver in patches #7 and #8. Note that the team
driver doesn't need this treatment, as it goes through
dev_set_mac_address().
In patches #9, #10 and #11 adapt mlxsw to veto MAC addresses on router
interfaces, if they violate the requirement that all RIF MAC addresses
have the same prefix.
Finally in patches #12 and #13, add a test for vetoing of a direct
change of a port device MAC, and indirect change of a bridge MAC.
Petr Machata (13):
net: dev: Add extack argument to dev_set_mac_address()
net: dev: Add NETDEV_PRE_CHANGEADDR
net: dev: Issue NETDEV_PRE_CHANGEADDR
net: bridge: Issue NETDEV_PRE_CHANGEADDR
net: bridge: Handle NETDEV_PRE_CHANGEADDR from ports
net: ipvlan: Issue NETDEV_PRE_CHANGEADDR
net: bonding: Give bond_set_dev_addr() a return value
net: bonding: Issue NETDEV_PRE_CHANGEADDR
mlxsw: spectrum_router: Generalize
mlxsw_sp_netdevice_router_port_event()
mlxsw: spectrum: Add mlxsw_sp.mac_mask
mlxsw: spectrum_router: Veto unsupported RIF MAC addresses
selftests: mlxsw: Test RIF MAC vetoing
selftests: mlxsw: Test FID RIF MAC vetoing
drivers/net/bonding/bond_alb.c | 9 +-
drivers/net/bonding/bond_main.c | 44 ++++--
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 15 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 4 +-
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 86 +++++++++--
drivers/net/hyperv/netvsc_drv.c | 4 +-
drivers/net/ipvlan/ipvlan_main.c | 14 ++
drivers/net/macvlan.c | 4 +-
drivers/net/tap.c | 2 +-
drivers/net/team/team.c | 2 +-
drivers/net/tun.c | 2 +-
drivers/usb/gadget/function/u_ether.c | 2 +-
include/linux/netdevice.h | 13 +-
net/bridge/br.c | 13 ++
net/bridge/br_if.c | 9 ++
net/core/dev.c | 29 +++-
net/core/dev_addr_lists.c | 3 +
net/core/dev_ioctl.c | 2 +-
net/core/rtnetlink.c | 2 +-
net/ieee802154/nl-phy.c | 2 +-
.../selftests/drivers/net/mlxsw/rtnetlink.sh | 170 +++++++++++++++++++++
21 files changed, 385 insertions(+), 46 deletions(-)
create mode 100755 tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
--
2.4.11
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net-next 01/13] net: dev: Add extack argument to dev_set_mac_address()
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 02/13] net: dev: Add NETDEV_PRE_CHANGEADDR Petr Machata
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
A follow-up patch will add a notifier type NETDEV_PRE_CHANGEADDR, which
allows vetoing of MAC address changes. One prominent path to that
notification is through dev_set_mac_address(). Therefore give this
function an extack argument, so that it can be packed together with the
notification. Thus a textual reason for rejection (or a warning) can be
communicated back to the user.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/bonding/bond_alb.c | 9 +++++----
drivers/net/bonding/bond_main.c | 15 ++++++++-------
drivers/net/hyperv/netvsc_drv.c | 4 ++--
drivers/net/macvlan.c | 4 ++--
drivers/net/tap.c | 2 +-
drivers/net/team/team.c | 2 +-
drivers/net/tun.c | 2 +-
drivers/usb/gadget/function/u_ether.c | 2 +-
include/linux/netdevice.h | 3 ++-
net/core/dev.c | 4 +++-
net/core/dev_ioctl.c | 2 +-
net/core/rtnetlink.c | 2 +-
net/ieee802154/nl-phy.c | 2 +-
13 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index e82108c917a6..9431127bbc60 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1031,7 +1031,7 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[],
*/
memcpy(ss.__data, addr, len);
ss.ss_family = dev->type;
- if (dev_set_mac_address(dev, (struct sockaddr *)&ss)) {
+ if (dev_set_mac_address(dev, (struct sockaddr *)&ss, NULL)) {
netdev_err(slave->bond->dev, "dev_set_mac_address of dev %s failed! ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n",
dev->name);
return -EOPNOTSUPP;
@@ -1250,7 +1250,7 @@ static int alb_set_mac_address(struct bonding *bond, void *addr)
bond_hw_addr_copy(tmp_addr, slave->dev->dev_addr,
slave->dev->addr_len);
- res = dev_set_mac_address(slave->dev, addr);
+ res = dev_set_mac_address(slave->dev, addr, NULL);
/* restore net_device's hw address */
bond_hw_addr_copy(slave->dev->dev_addr, tmp_addr,
@@ -1273,7 +1273,7 @@ static int alb_set_mac_address(struct bonding *bond, void *addr)
bond_hw_addr_copy(tmp_addr, rollback_slave->dev->dev_addr,
rollback_slave->dev->addr_len);
dev_set_mac_address(rollback_slave->dev,
- (struct sockaddr *)&ss);
+ (struct sockaddr *)&ss, NULL);
bond_hw_addr_copy(rollback_slave->dev->dev_addr, tmp_addr,
rollback_slave->dev->addr_len);
}
@@ -1732,7 +1732,8 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
bond->dev->addr_len);
ss.ss_family = bond->dev->type;
/* we don't care if it can't change its mac, best effort */
- dev_set_mac_address(new_slave->dev, (struct sockaddr *)&ss);
+ dev_set_mac_address(new_slave->dev, (struct sockaddr *)&ss,
+ NULL);
bond_hw_addr_copy(new_slave->dev->dev_addr, tmp_addr,
new_slave->dev->addr_len);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6b34dbefa7dd..06039be63034 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -680,7 +680,7 @@ static void bond_do_fail_over_mac(struct bonding *bond,
}
rv = dev_set_mac_address(new_active->dev,
- (struct sockaddr *)&ss);
+ (struct sockaddr *)&ss, NULL);
if (rv) {
netdev_err(bond->dev, "Error %d setting MAC of slave %s\n",
-rv, new_active->dev->name);
@@ -695,7 +695,7 @@ static void bond_do_fail_over_mac(struct bonding *bond,
ss.ss_family = old_active->dev->type;
rv = dev_set_mac_address(old_active->dev,
- (struct sockaddr *)&ss);
+ (struct sockaddr *)&ss, NULL);
if (rv)
netdev_err(bond->dev, "Error %d setting MAC of slave %s\n",
-rv, new_active->dev->name);
@@ -1527,7 +1527,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
*/
memcpy(ss.__data, bond_dev->dev_addr, bond_dev->addr_len);
ss.ss_family = slave_dev->type;
- res = dev_set_mac_address(slave_dev, (struct sockaddr *)&ss);
+ res = dev_set_mac_address(slave_dev, (struct sockaddr *)&ss,
+ extack);
if (res) {
netdev_dbg(bond_dev, "Error %d calling set_mac_address\n", res);
goto err_restore_mtu;
@@ -1818,7 +1819,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
bond_hw_addr_copy(ss.__data, new_slave->perm_hwaddr,
new_slave->dev->addr_len);
ss.ss_family = slave_dev->type;
- dev_set_mac_address(slave_dev, (struct sockaddr *)&ss);
+ dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, NULL);
}
err_restore_mtu:
@@ -1999,7 +2000,7 @@ static int __bond_release_one(struct net_device *bond_dev,
bond_hw_addr_copy(ss.__data, slave->perm_hwaddr,
slave->dev->addr_len);
ss.ss_family = slave_dev->type;
- dev_set_mac_address(slave_dev, (struct sockaddr *)&ss);
+ dev_set_mac_address(slave_dev, (struct sockaddr *)&ss, NULL);
}
if (unregister)
@@ -3732,7 +3733,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
bond_for_each_slave(bond, slave, iter) {
netdev_dbg(bond_dev, "slave %p %s\n", slave, slave->dev->name);
- res = dev_set_mac_address(slave->dev, addr);
+ res = dev_set_mac_address(slave->dev, addr, NULL);
if (res) {
/* TODO: consider downing the slave
* and retry ?
@@ -3761,7 +3762,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
break;
tmp_res = dev_set_mac_address(rollback_slave->dev,
- (struct sockaddr *)&tmp_ss);
+ (struct sockaddr *)&tmp_ss, NULL);
if (tmp_res) {
netdev_dbg(bond_dev, "unwind err %d dev %s\n",
tmp_res, rollback_slave->dev->name);
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 18b5584d6377..91ed15ea5883 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1247,7 +1247,7 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
return -ENODEV;
if (vf_netdev) {
- err = dev_set_mac_address(vf_netdev, addr);
+ err = dev_set_mac_address(vf_netdev, addr, NULL);
if (err)
return err;
}
@@ -1258,7 +1258,7 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
} else if (vf_netdev) {
/* rollback change on VF */
memcpy(addr->sa_data, ndev->dev_addr, ETH_ALEN);
- dev_set_mac_address(vf_netdev, addr);
+ dev_set_mac_address(vf_netdev, addr, NULL);
}
return err;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 0da3d36b283b..fc726ce4c164 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -744,7 +744,7 @@ static int macvlan_set_mac_address(struct net_device *dev, void *p)
if (vlan->mode == MACVLAN_MODE_PASSTHRU) {
macvlan_set_addr_change(vlan->port);
- return dev_set_mac_address(vlan->lowerdev, addr);
+ return dev_set_mac_address(vlan->lowerdev, addr, NULL);
}
if (macvlan_addr_busy(vlan->port, addr->sa_data))
@@ -1213,7 +1213,7 @@ static void macvlan_port_destroy(struct net_device *dev)
sa.sa_family = port->dev->type;
memcpy(&sa.sa_data, port->perm_addr, port->dev->addr_len);
- dev_set_mac_address(port->dev, &sa);
+ dev_set_mac_address(port->dev, &sa, NULL);
}
kfree(port);
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index f03004f37eca..443b2694130c 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -1113,7 +1113,7 @@ static long tap_ioctl(struct file *file, unsigned int cmd,
rtnl_unlock();
return -ENOLINK;
}
- ret = dev_set_mac_address(tap->dev, &sa);
+ ret = dev_set_mac_address(tap->dev, &sa, NULL);
tap_put_tap_dev(tap);
rtnl_unlock();
return ret;
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 93576e0240dd..afd9d25d1992 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -59,7 +59,7 @@ static int __set_port_dev_addr(struct net_device *port_dev,
memcpy(addr.__data, dev_addr, port_dev->addr_len);
addr.ss_family = port_dev->type;
- return dev_set_mac_address(port_dev, (struct sockaddr *)&addr);
+ return dev_set_mac_address(port_dev, (struct sockaddr *)&addr, NULL);
}
static int team_port_set_orig_dev_addr(struct team_port *port)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index ea528248d7d0..72577aa35b06 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -3202,7 +3202,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
tun_debug(KERN_DEBUG, tun, "set hw address: %pM\n",
ifr.ifr_hwaddr.sa_data);
- ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
+ ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr, NULL);
break;
case TUNGETSNDBUF:
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 0f026d445e31..737bd77a575d 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -879,7 +879,7 @@ int gether_register_netdev(struct net_device *net)
sa.sa_family = net->type;
memcpy(sa.sa_data, dev->dev_mac, ETH_ALEN);
rtnl_lock();
- status = dev_set_mac_address(net, &sa);
+ status = dev_set_mac_address(net, &sa, NULL);
rtnl_unlock();
if (status)
pr_warn("cannot set self ethernet address: %d\n", status);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 36ca5f50f822..d89875ec21ac 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3628,7 +3628,8 @@ int dev_set_mtu_ext(struct net_device *dev, int mtu,
int dev_set_mtu(struct net_device *, int);
int dev_change_tx_queue_len(struct net_device *, unsigned long);
void dev_set_group(struct net_device *, int);
-int dev_set_mac_address(struct net_device *, struct sockaddr *);
+int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
+ struct netlink_ext_ack *extack);
int dev_change_carrier(struct net_device *, bool new_carrier);
int dev_get_phys_port_id(struct net_device *dev,
struct netdev_phys_item_id *ppid);
diff --git a/net/core/dev.c b/net/core/dev.c
index 754284873355..7250a3a73fa4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7759,10 +7759,12 @@ EXPORT_SYMBOL(dev_set_group);
* dev_set_mac_address - Change Media Access Control Address
* @dev: device
* @sa: new address
+ * @extack: netlink extended ack
*
* Change the hardware (MAC) address of the device
*/
-int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa)
+int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
+ struct netlink_ext_ack *extack)
{
const struct net_device_ops *ops = dev->netdev_ops;
int err;
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index da273ec3cc57..31380fd5a4e2 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -246,7 +246,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
case SIOCSIFHWADDR:
if (dev->addr_len > sizeof(struct sockaddr))
return -EINVAL;
- return dev_set_mac_address(dev, &ifr->ifr_hwaddr);
+ return dev_set_mac_address(dev, &ifr->ifr_hwaddr, NULL);
case SIOCSIFHWBROADCAST:
if (ifr->ifr_hwaddr.sa_family != dev->type)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 3b6e551f9e69..f8bdb8adab2c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2444,7 +2444,7 @@ static int do_setlink(const struct sk_buff *skb,
sa->sa_family = dev->type;
memcpy(sa->sa_data, nla_data(tb[IFLA_ADDRESS]),
dev->addr_len);
- err = dev_set_mac_address(dev, sa);
+ err = dev_set_mac_address(dev, sa, extack);
kfree(sa);
if (err)
goto errout;
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index b231e40f006a..0c25c0bcc4da 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -242,7 +242,7 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)
* dev_set_mac_address require RTNL_LOCK
*/
rtnl_lock();
- rc = dev_set_mac_address(dev, &addr);
+ rc = dev_set_mac_address(dev, &addr, NULL);
rtnl_unlock();
if (rc)
goto dev_unregister;
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 02/13] net: dev: Add NETDEV_PRE_CHANGEADDR
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
2018-12-13 11:54 ` [PATCH net-next 01/13] net: dev: Add extack argument to dev_set_mac_address() Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 03/13] net: dev: Issue NETDEV_PRE_CHANGEADDR Petr Machata
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
The NETDEV_CHANGEADDR notification is emitted after a device address
changes. Extending this message to allow vetoing is certainly possible,
but several other notification types have instead adopted a simple
two-stage approach: first a "pre" notification is sent to make sure all
interested parties are OK with a change that's about to be done. Then
the change is done, and afterwards a "post" notification is sent.
This dual approach is easier to use: when the change is vetoed, nothing
has changed yet, and it's therefore unnecessary to roll anything back.
Therefore adopt it for NETDEV_CHANGEADDR as well.
To that end, add NETDEV_PRE_CHANGEADDR and an info structure to go along
with it.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
include/linux/netdevice.h | 8 +++++++-
net/core/dev.c | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d89875ec21ac..1d5ad053ccf7 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2450,7 +2450,8 @@ enum netdev_cmd {
NETDEV_REGISTER,
NETDEV_UNREGISTER,
NETDEV_CHANGEMTU, /* notify after mtu change happened */
- NETDEV_CHANGEADDR,
+ NETDEV_CHANGEADDR, /* notify after the address change */
+ NETDEV_PRE_CHANGEADDR, /* notify before the address change */
NETDEV_GOING_DOWN,
NETDEV_CHANGENAME,
NETDEV_FEAT_CHANGE,
@@ -2512,6 +2513,11 @@ struct netdev_notifier_changelowerstate_info {
void *lower_state_info; /* is lower dev state */
};
+struct netdev_notifier_pre_changeaddr_info {
+ struct netdev_notifier_info info; /* must be first */
+ const unsigned char *dev_addr;
+};
+
static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
struct net_device *dev)
{
diff --git a/net/core/dev.c b/net/core/dev.c
index 7250a3a73fa4..01497b7d1bdf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1589,6 +1589,7 @@ const char *netdev_cmd_to_name(enum netdev_cmd cmd)
N(UDP_TUNNEL_DROP_INFO) N(CHANGE_TX_QUEUE_LEN)
N(CVLAN_FILTER_PUSH_INFO) N(CVLAN_FILTER_DROP_INFO)
N(SVLAN_FILTER_PUSH_INFO) N(SVLAN_FILTER_DROP_INFO)
+ N(PRE_CHANGEADDR)
}
#undef N
return "UNKNOWN_NETDEV_EVENT";
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 03/13] net: dev: Issue NETDEV_PRE_CHANGEADDR
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
2018-12-13 11:54 ` [PATCH net-next 01/13] net: dev: Add extack argument to dev_set_mac_address() Petr Machata
2018-12-13 11:54 ` [PATCH net-next 02/13] net: dev: Add NETDEV_PRE_CHANGEADDR Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 04/13] net: bridge: " Petr Machata
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
When a device address is about to be changed, or an address added to the
list of device HW addresses, it is necessary to ensure that all
interested parties can support the address. Therefore, send the
NETDEV_PRE_CHANGEADDR notification, and if anyone bails on it, do not
change the address.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
include/linux/netdevice.h | 2 ++
net/core/dev.c | 24 ++++++++++++++++++++++++
net/core/dev_addr_lists.c | 3 +++
3 files changed, 29 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1d5ad053ccf7..811632d4d8b1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3634,6 +3634,8 @@ int dev_set_mtu_ext(struct net_device *dev, int mtu,
int dev_set_mtu(struct net_device *, int);
int dev_change_tx_queue_len(struct net_device *, unsigned long);
void dev_set_group(struct net_device *, int);
+int dev_pre_changeaddr_notify(struct net_device *dev, const char *addr,
+ struct netlink_ext_ack *extack);
int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
struct netlink_ext_ack *extack);
int dev_change_carrier(struct net_device *, bool new_carrier);
diff --git a/net/core/dev.c b/net/core/dev.c
index 01497b7d1bdf..ed9aa4a91f1f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7757,6 +7757,27 @@ void dev_set_group(struct net_device *dev, int new_group)
EXPORT_SYMBOL(dev_set_group);
/**
+ * dev_pre_changeaddr_notify - Call NETDEV_PRE_CHANGEADDR.
+ * @dev: device
+ * @addr: new address
+ * @extack: netlink extended ack
+ */
+int dev_pre_changeaddr_notify(struct net_device *dev, const char *addr,
+ struct netlink_ext_ack *extack)
+{
+ struct netdev_notifier_pre_changeaddr_info info = {
+ .info.dev = dev,
+ .info.extack = extack,
+ .dev_addr = addr,
+ };
+ int rc;
+
+ rc = call_netdevice_notifiers_info(NETDEV_PRE_CHANGEADDR, &info.info);
+ return notifier_to_errno(rc);
+}
+EXPORT_SYMBOL(dev_pre_changeaddr_notify);
+
+/**
* dev_set_mac_address - Change Media Access Control Address
* @dev: device
* @sa: new address
@@ -7776,6 +7797,9 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
return -EINVAL;
if (!netif_device_present(dev))
return -ENODEV;
+ err = dev_pre_changeaddr_notify(dev, sa->sa_data, extack);
+ if (err)
+ return err;
err = ops->ndo_set_mac_address(dev, sa);
if (err)
return err;
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 81a8cd4ea3bd..a6723b306717 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -498,6 +498,9 @@ int dev_addr_add(struct net_device *dev, const unsigned char *addr,
ASSERT_RTNL();
+ err = dev_pre_changeaddr_notify(dev, addr, NULL);
+ if (err)
+ return err;
err = __hw_addr_add(&dev->dev_addrs, addr, dev->addr_len, addr_type);
if (!err)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 04/13] net: bridge: Issue NETDEV_PRE_CHANGEADDR
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (2 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 03/13] net: dev: Issue NETDEV_PRE_CHANGEADDR Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 05/13] net: bridge: Handle NETDEV_PRE_CHANGEADDR from ports Petr Machata
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
When a port is attached to a bridge, the address of the bridge in
question may change as well. Even if it would not change at this
point (because the current bridge address is lower), it might end up
changing later as a result of detach of another port, which can't be
vetoed.
Therefore issue NETDEV_PRE_CHANGEADDR regardless of whether the address
will be used at this point or not, and make sure all involved parties
would agree with the change.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
net/bridge/br_if.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 3b945d6369c4..41f0a696a65f 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -650,6 +650,15 @@ int br_add_if(struct net_bridge *br, struct net_device *dev,
if (br_fdb_insert(br, p, dev->dev_addr, 0))
netdev_err(dev, "failed insert local address bridge forwarding table\n");
+ if (br->dev->addr_assign_type != NET_ADDR_SET) {
+ /* Ask for permission to use this MAC address now, even if we
+ * don't end up choosing it below.
+ */
+ err = dev_pre_changeaddr_notify(br->dev, dev->dev_addr, extack);
+ if (err)
+ goto err7;
+ }
+
err = nbp_vlan_init(p, extack);
if (err) {
netdev_err(dev, "failed to initialize vlan filtering on this port\n");
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 05/13] net: bridge: Handle NETDEV_PRE_CHANGEADDR from ports
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (3 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 04/13] net: bridge: " Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 06/13] net: ipvlan: Issue NETDEV_PRE_CHANGEADDR Petr Machata
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
When a port device seeks approval of a potential new MAC address, make
sure that should the bridge device end up using this address, all
interested parties would agree with it.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
net/bridge/br.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 4e7cd993ce94..a5174e5001d8 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -31,6 +31,8 @@
*/
static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr)
{
+ struct netlink_ext_ack *extack = netdev_notifier_info_to_extack(ptr);
+ struct netdev_notifier_pre_changeaddr_info *prechaddr_info;
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct net_bridge_port *p;
struct net_bridge *br;
@@ -56,6 +58,17 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
br_mtu_auto_adjust(br);
break;
+ case NETDEV_PRE_CHANGEADDR:
+ if (br->dev->addr_assign_type == NET_ADDR_SET)
+ break;
+ prechaddr_info = ptr;
+ err = dev_pre_changeaddr_notify(br->dev,
+ prechaddr_info->dev_addr,
+ extack);
+ if (err)
+ return notifier_from_errno(err);
+ break;
+
case NETDEV_CHANGEADDR:
spin_lock_bh(&br->lock);
br_fdb_changeaddr(p, dev->dev_addr);
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 06/13] net: ipvlan: Issue NETDEV_PRE_CHANGEADDR
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (4 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 05/13] net: bridge: Handle NETDEV_PRE_CHANGEADDR from ports Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 07/13] net: bonding: Give bond_set_dev_addr() a return value Petr Machata
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
A NETDEV_CHANGEADDR event implies a change of address of each of the
IPVLANs of this IPVLAN device. Therefore propagate NETDEV_PRE_CHANGEADDR
to all the IPVLANs.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ipvlan/ipvlan_main.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 723a3f663c06..19bdde60680c 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -759,10 +759,13 @@ EXPORT_SYMBOL_GPL(ipvlan_link_register);
static int ipvlan_device_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{
+ struct netlink_ext_ack *extack = netdev_notifier_info_to_extack(ptr);
+ struct netdev_notifier_pre_changeaddr_info *prechaddr_info;
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct ipvl_dev *ipvlan, *next;
struct ipvl_port *port;
LIST_HEAD(lst_kill);
+ int err;
if (!netif_is_ipvlan_port(dev))
return NOTIFY_DONE;
@@ -818,6 +821,17 @@ static int ipvlan_device_event(struct notifier_block *unused,
ipvlan_adjust_mtu(ipvlan, dev);
break;
+ case NETDEV_PRE_CHANGEADDR:
+ prechaddr_info = ptr;
+ list_for_each_entry(ipvlan, &port->ipvlans, pnode) {
+ err = dev_pre_changeaddr_notify(ipvlan->dev,
+ prechaddr_info->dev_addr,
+ extack);
+ if (err)
+ return notifier_from_errno(err);
+ }
+ break;
+
case NETDEV_CHANGEADDR:
list_for_each_entry(ipvlan, &port->ipvlans, pnode) {
ether_addr_copy(ipvlan->dev->dev_addr, dev->dev_addr);
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 07/13] net: bonding: Give bond_set_dev_addr() a return value
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (5 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 06/13] net: ipvlan: Issue NETDEV_PRE_CHANGEADDR Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 08/13] net: bonding: Issue NETDEV_PRE_CHANGEADDR Petr Machata
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
Before NETDEV_CHANGEADDR, bond driver should emit NETDEV_PRE_CHANGEADDR,
and allow consumers to veto the address change. To propagate further the
return code from NETDEV_PRE_CHANGEADDR, give the function that
implements address change a return value.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/bonding/bond_main.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 06039be63034..66d9a6c7b9c5 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -609,14 +609,15 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
*
* Should be called with RTNL held.
*/
-static void bond_set_dev_addr(struct net_device *bond_dev,
- struct net_device *slave_dev)
+static int bond_set_dev_addr(struct net_device *bond_dev,
+ struct net_device *slave_dev)
{
netdev_dbg(bond_dev, "bond_dev=%p slave_dev=%p slave_dev->name=%s slave_dev->addr_len=%d\n",
bond_dev, slave_dev, slave_dev->name, slave_dev->addr_len);
memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
bond_dev->addr_assign_type = NET_ADDR_STOLEN;
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);
+ return 0;
}
static struct slave *bond_get_old_active(struct bonding *bond,
@@ -652,8 +653,12 @@ static void bond_do_fail_over_mac(struct bonding *bond,
switch (bond->params.fail_over_mac) {
case BOND_FOM_ACTIVE:
- if (new_active)
- bond_set_dev_addr(bond->dev, new_active->dev);
+ if (new_active) {
+ rv = bond_set_dev_addr(bond->dev, new_active->dev);
+ if (rv)
+ netdev_err(bond->dev, "Error %d setting MAC of slave %s\n",
+ -rv, bond->dev->name);
+ }
break;
case BOND_FOM_FOLLOW:
/* if new_active && old_active, swap them
@@ -1489,8 +1494,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
* address to be the same as the slave's.
*/
if (!bond_has_slaves(bond) &&
- bond->dev->addr_assign_type == NET_ADDR_RANDOM)
- bond_set_dev_addr(bond->dev, slave_dev);
+ bond->dev->addr_assign_type == NET_ADDR_RANDOM) {
+ res = bond_set_dev_addr(bond->dev, slave_dev);
+ if (res)
+ goto err_undo_flags;
+ }
new_slave = bond_alloc_slave(bond);
if (!new_slave) {
@@ -3545,8 +3553,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
break;
case BOND_SETHWADDR_OLD:
case SIOCBONDSETHWADDR:
- bond_set_dev_addr(bond_dev, slave_dev);
- res = 0;
+ res = bond_set_dev_addr(bond_dev, slave_dev);
break;
case BOND_CHANGE_ACTIVE_OLD:
case SIOCBONDCHANGEACTIVE:
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 08/13] net: bonding: Issue NETDEV_PRE_CHANGEADDR
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (6 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 07/13] net: bonding: Give bond_set_dev_addr() a return value Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 09/13] mlxsw: spectrum_router: Generalize mlxsw_sp_netdevice_router_port_event() Petr Machata
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
Give interested parties an opportunity to veto an impending HW address
change.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/bonding/bond_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 66d9a6c7b9c5..a9d597f28023 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -612,8 +612,14 @@ static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
static int bond_set_dev_addr(struct net_device *bond_dev,
struct net_device *slave_dev)
{
+ int err;
+
netdev_dbg(bond_dev, "bond_dev=%p slave_dev=%p slave_dev->name=%s slave_dev->addr_len=%d\n",
bond_dev, slave_dev, slave_dev->name, slave_dev->addr_len);
+ err = dev_pre_changeaddr_notify(bond_dev, slave_dev->dev_addr, NULL);
+ if (err)
+ return err;
+
memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
bond_dev->addr_assign_type = NET_ADDR_STOLEN;
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 09/13] mlxsw: spectrum_router: Generalize mlxsw_sp_netdevice_router_port_event()
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (7 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 08/13] net: bonding: Issue NETDEV_PRE_CHANGEADDR Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 10/13] mlxsw: spectrum: Add mlxsw_sp.mac_mask Petr Machata
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
Prepare mlxsw_sp_netdevice_router_port_event() for handling of
NETDEV_PRE_CHANGEADDR. Split out the part that deals with the actual
changes and call it for the two events currently handled.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 3 +-
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 37 ++++++++++++++++------
3 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 6929dbf04a1f..0fb7772c7a00 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -5326,7 +5326,7 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *nb,
err = mlxsw_sp_netdevice_ipip_ul_event(mlxsw_sp, dev,
event, ptr);
else if (event == NETDEV_CHANGEADDR || event == NETDEV_CHANGEMTU)
- err = mlxsw_sp_netdevice_router_port_event(dev);
+ err = mlxsw_sp_netdevice_router_port_event(dev, event, ptr);
else if (mlxsw_sp_is_vrf_event(event, ptr))
err = mlxsw_sp_netdevice_vrf_event(dev, event, ptr);
else if (mlxsw_sp_port_dev_check(dev))
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index 41a5de4a0965..373d648b0976 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -454,7 +454,8 @@ union mlxsw_sp_l3addr {
int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp);
void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp);
-int mlxsw_sp_netdevice_router_port_event(struct net_device *dev);
+int mlxsw_sp_netdevice_router_port_event(struct net_device *dev,
+ unsigned long event, void *ptr);
void mlxsw_sp_rif_macvlan_del(struct mlxsw_sp *mlxsw_sp,
const struct net_device *macvlan_dev);
int mlxsw_sp_inetaddr_event(struct notifier_block *unused,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index f49a220582da..0cf641ae5e9a 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -6863,20 +6863,14 @@ static int mlxsw_sp_rif_edit(struct mlxsw_sp *mlxsw_sp, u16 rif_index,
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl);
}
-int mlxsw_sp_netdevice_router_port_event(struct net_device *dev)
+static int
+mlxsw_sp_router_port_change_event(struct mlxsw_sp *mlxsw_sp,
+ struct mlxsw_sp_rif *rif)
{
- struct mlxsw_sp *mlxsw_sp;
- struct mlxsw_sp_rif *rif;
+ struct net_device *dev = rif->dev;
u16 fid_index;
int err;
- mlxsw_sp = mlxsw_sp_lower_get(dev);
- if (!mlxsw_sp)
- return 0;
-
- rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev);
- if (!rif)
- return 0;
fid_index = mlxsw_sp_fid_index(rif->fid);
err = mlxsw_sp_rif_fdb_op(mlxsw_sp, rif->addr, fid_index, false);
@@ -6920,6 +6914,29 @@ int mlxsw_sp_netdevice_router_port_event(struct net_device *dev)
return err;
}
+int mlxsw_sp_netdevice_router_port_event(struct net_device *dev,
+ unsigned long event, void *ptr)
+{
+ struct mlxsw_sp *mlxsw_sp;
+ struct mlxsw_sp_rif *rif;
+
+ mlxsw_sp = mlxsw_sp_lower_get(dev);
+ if (!mlxsw_sp)
+ return 0;
+
+ rif = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev);
+ if (!rif)
+ return 0;
+
+ switch (event) {
+ case NETDEV_CHANGEMTU: /* fall through */
+ case NETDEV_CHANGEADDR:
+ return mlxsw_sp_router_port_change_event(mlxsw_sp, rif);
+ }
+
+ return 0;
+}
+
static int mlxsw_sp_port_vrf_join(struct mlxsw_sp *mlxsw_sp,
struct net_device *l3_dev,
struct netlink_ext_ack *extack)
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 10/13] mlxsw: spectrum: Add mlxsw_sp.mac_mask
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (8 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 09/13] mlxsw: spectrum_router: Generalize mlxsw_sp_netdevice_router_port_event() Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 11/13] mlxsw: spectrum_router: Veto unsupported RIF MAC addresses Petr Machata
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
The Spectrum hardware demands that all router interfaces in the system
have the same first 38 resp. 36 bits of MAC address: the former limit
holds on Spectrum, the latter on Spectrum-2. Add a field that refers to
the required prefix mask and initialize in mlxsw_sp1_init() and
mlxsw_sp2_init().
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 9 +++++++++
drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 0fb7772c7a00..955f7bbe1986 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -65,6 +65,13 @@ static const char mlxsw_sp1_driver_name[] = "mlxsw_spectrum";
static const char mlxsw_sp2_driver_name[] = "mlxsw_spectrum2";
static const char mlxsw_sp_driver_version[] = "1.0";
+static const unsigned char mlxsw_sp1_mac_mask[ETH_ALEN] = {
+ 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00
+};
+static const unsigned char mlxsw_sp2_mac_mask[ETH_ALEN] = {
+ 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00
+};
+
/* tx_hdr_version
* Tx header version.
* Must be set to 1.
@@ -4083,6 +4090,7 @@ static int mlxsw_sp1_init(struct mlxsw_core *mlxsw_core,
mlxsw_sp->mr_tcam_ops = &mlxsw_sp1_mr_tcam_ops;
mlxsw_sp->acl_tcam_ops = &mlxsw_sp1_acl_tcam_ops;
mlxsw_sp->nve_ops_arr = mlxsw_sp1_nve_ops_arr;
+ mlxsw_sp->mac_mask = mlxsw_sp1_mac_mask;
return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info);
}
@@ -4098,6 +4106,7 @@ static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core,
mlxsw_sp->mr_tcam_ops = &mlxsw_sp2_mr_tcam_ops;
mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops;
mlxsw_sp->nve_ops_arr = mlxsw_sp2_nve_ops_arr;
+ mlxsw_sp->mac_mask = mlxsw_sp2_mac_mask;
return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info);
}
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index 373d648b0976..64cae57bfbc8 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -132,6 +132,7 @@ struct mlxsw_sp {
struct mlxsw_core *core;
const struct mlxsw_bus_info *bus_info;
unsigned char base_mac[ETH_ALEN];
+ const unsigned char *mac_mask;
struct mlxsw_sp_upper *lags;
int *port_to_module;
struct mlxsw_sp_sb *sb;
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 11/13] mlxsw: spectrum_router: Veto unsupported RIF MAC addresses
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (9 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 10/13] mlxsw: spectrum: Add mlxsw_sp.mac_mask Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 12/13] selftests: mlxsw: Test RIF MAC vetoing Petr Machata
2018-12-13 11:54 ` [PATCH net-next 13/13] selftests: mlxsw: Test FID " Petr Machata
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
On NETDEV_PRE_CHANGEADDR, if the change is related to a RIF interface,
verify that it satisfies the criterion that all RIF interfaces have the
same MAC address prefix, as indicated by mlxsw_sp.mac_mask.
Additionally, besides explicit address changes, check that the address
of an interface for which a RIF is about to be added matches the
required pattern as well.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +-
.../net/ethernet/mellanox/mlxsw/spectrum_router.c | 49 ++++++++++++++++++++++
2 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 955f7bbe1986..5fbb4b75f472 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -5334,7 +5334,9 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *nb,
else if (mlxsw_sp_netdev_is_ipip_ul(mlxsw_sp, dev))
err = mlxsw_sp_netdevice_ipip_ul_event(mlxsw_sp, dev,
event, ptr);
- else if (event == NETDEV_CHANGEADDR || event == NETDEV_CHANGEMTU)
+ else if (event == NETDEV_PRE_CHANGEADDR ||
+ event == NETDEV_CHANGEADDR ||
+ event == NETDEV_CHANGEMTU)
err = mlxsw_sp_netdevice_router_port_event(dev, event, ptr);
else if (mlxsw_sp_is_vrf_event(event, ptr))
err = mlxsw_sp_netdevice_vrf_event(dev, event, ptr);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 0cf641ae5e9a..b33ba8b66861 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -6699,6 +6699,33 @@ static int mlxsw_sp_inetaddr_macvlan_event(struct net_device *macvlan_dev,
return 0;
}
+static int mlxsw_sp_router_port_check_rif_addr(struct mlxsw_sp *mlxsw_sp,
+ struct net_device *dev,
+ const unsigned char *dev_addr,
+ struct netlink_ext_ack *extack)
+{
+ struct mlxsw_sp_rif *rif;
+ int i;
+
+ /* A RIF is not created for macvlan netdevs. Their MAC is used to
+ * populate the FDB
+ */
+ if (netif_is_macvlan(dev))
+ return 0;
+
+ for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) {
+ rif = mlxsw_sp->router->rifs[i];
+ if (rif && rif->dev != dev &&
+ !ether_addr_equal_masked(rif->dev->dev_addr, dev_addr,
+ mlxsw_sp->mac_mask)) {
+ NL_SET_ERR_MSG_MOD(extack, "All router interface MAC addresses must have the same prefix");
+ return -EINVAL;
+ }
+ }
+
+ return 0;
+}
+
static int __mlxsw_sp_inetaddr_event(struct net_device *dev,
unsigned long event,
struct netlink_ext_ack *extack)
@@ -6760,6 +6787,11 @@ int mlxsw_sp_inetaddr_valid_event(struct notifier_block *unused,
if (!mlxsw_sp_rif_should_config(rif, dev, event))
goto out;
+ err = mlxsw_sp_router_port_check_rif_addr(mlxsw_sp, dev, dev->dev_addr,
+ ivi->extack);
+ if (err)
+ goto out;
+
err = __mlxsw_sp_inetaddr_event(dev, event, ivi->extack);
out:
return notifier_from_errno(err);
@@ -6841,6 +6873,11 @@ int mlxsw_sp_inet6addr_valid_event(struct notifier_block *unused,
if (!mlxsw_sp_rif_should_config(rif, dev, event))
goto out;
+ err = mlxsw_sp_router_port_check_rif_addr(mlxsw_sp, dev, dev->dev_addr,
+ i6vi->extack);
+ if (err)
+ goto out;
+
err = __mlxsw_sp_inetaddr_event(dev, event, i6vi->extack);
out:
return notifier_from_errno(err);
@@ -6914,6 +6951,16 @@ mlxsw_sp_router_port_change_event(struct mlxsw_sp *mlxsw_sp,
return err;
}
+static int mlxsw_sp_router_port_pre_changeaddr_event(struct mlxsw_sp_rif *rif,
+ struct netdev_notifier_pre_changeaddr_info *info)
+{
+ struct netlink_ext_ack *extack;
+
+ extack = netdev_notifier_info_to_extack(&info->info);
+ return mlxsw_sp_router_port_check_rif_addr(rif->mlxsw_sp, rif->dev,
+ info->dev_addr, extack);
+}
+
int mlxsw_sp_netdevice_router_port_event(struct net_device *dev,
unsigned long event, void *ptr)
{
@@ -6932,6 +6979,8 @@ int mlxsw_sp_netdevice_router_port_event(struct net_device *dev,
case NETDEV_CHANGEMTU: /* fall through */
case NETDEV_CHANGEADDR:
return mlxsw_sp_router_port_change_event(mlxsw_sp, rif);
+ case NETDEV_PRE_CHANGEADDR:
+ return mlxsw_sp_router_port_pre_changeaddr_event(rif, ptr);
}
return 0;
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 12/13] selftests: mlxsw: Test RIF MAC vetoing
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (10 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 11/13] mlxsw: spectrum_router: Veto unsupported RIF MAC addresses Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
2018-12-13 11:54 ` [PATCH net-next 13/13] selftests: mlxsw: Test FID " Petr Machata
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
Test that attempts to change address in a way that violates Spectrum
requirements are vetoed with extack.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
.../selftests/drivers/net/mlxsw/rtnetlink.sh | 91 ++++++++++++++++++++++
1 file changed, 91 insertions(+)
create mode 100755 tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
diff --git a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
new file mode 100755
index 000000000000..bc8b44c77108
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
@@ -0,0 +1,91 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+#
+# Test various interface configuration scenarios. Observe that configurations
+# deemed valid by mlxsw succeed, invalid configurations fail and that no traces
+# are produced. To prevent the test from passing in case traces are produced,
+# the user can set the 'kernel.panic_on_warn' and 'kernel.panic_on_oops'
+# sysctls in its environment.
+
+lib_dir=$(dirname $0)/../../../net/forwarding
+
+ALL_TESTS="
+ rif_set_addr_test
+"
+NUM_NETIFS=2
+source $lib_dir/lib.sh
+
+setup_prepare()
+{
+ swp1=${NETIFS[p1]}
+ swp2=${NETIFS[p2]}
+
+ ip link set dev $swp1 up
+ ip link set dev $swp2 up
+}
+
+cleanup()
+{
+ pre_cleanup
+
+ ip link set dev $swp2 down
+ ip link set dev $swp1 down
+}
+
+rif_set_addr_test()
+{
+ local swp1_mac=$(mac_get $swp1)
+ local swp2_mac=$(mac_get $swp2)
+
+ RET=0
+
+ # $swp1 and $swp2 likely got their IPv6 local addresses already, but
+ # here we need to test the transition to RIF.
+ ip addr flush dev $swp1
+ ip addr flush dev $swp2
+ sleep .1
+
+ ip addr add dev $swp1 192.0.2.1/28
+ check_err $?
+
+ ip link set dev $swp1 addr 00:11:22:33:44:55
+ check_err $?
+
+ # IP address enablement should be rejected if the MAC address prefix
+ # doesn't match other RIFs.
+ ip addr add dev $swp2 192.0.2.2/28 &>/dev/null
+ check_fail $? "IP address addition passed for a device with a wrong MAC"
+ ip addr add dev $swp2 192.0.2.2/28 2>&1 >/dev/null \
+ | grep -q mlxsw_spectrum
+ check_err $? "no extack for IP address addition"
+
+ ip link set dev $swp2 addr 00:11:22:33:44:66
+ check_err $?
+ ip addr add dev $swp2 192.0.2.2/28 &>/dev/null
+ check_err $?
+
+ # Change of MAC address of a RIF should be forbidden if the new MAC
+ # doesn't share the prefix with other MAC addresses.
+ ip link set dev $swp2 addr 00:11:22:33:00:66 &>/dev/null
+ check_fail $? "change of MAC address passed for a wrong MAC"
+ ip link set dev $swp2 addr 00:11:22:33:00:66 2>&1 >/dev/null \
+ | grep -q mlxsw_spectrum
+ check_err $? "no extack for MAC address change"
+
+ log_test "RIF - bad MAC change"
+
+ ip addr del dev $swp2 192.0.2.2/28
+ ip addr del dev $swp1 192.0.2.1/28
+
+ ip link set dev $swp2 addr $swp2_mac
+ ip link set dev $swp1 addr $swp1_mac
+}
+
+trap cleanup EXIT
+
+setup_prepare
+setup_wait
+
+tests_run
+
+exit $EXIT_STATUS
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next 13/13] selftests: mlxsw: Test FID RIF MAC vetoing
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
` (11 preceding siblings ...)
2018-12-13 11:54 ` [PATCH net-next 12/13] selftests: mlxsw: Test RIF MAC vetoing Petr Machata
@ 2018-12-13 11:54 ` Petr Machata
12 siblings, 0 replies; 14+ messages in thread
From: Petr Machata @ 2018-12-13 11:54 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net,
davem@davemloft.net, Jiri Pirko, Ido Schimmel,
roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com
When a FID RIF is created for a bridge with IP address, its MAC address
must obey the same requirements as other RIFs. Test that attempts to
change the address incompatibly by attaching a device are vetoed with
extack.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
.../selftests/drivers/net/mlxsw/rtnetlink.sh | 79 ++++++++++++++++++++++
1 file changed, 79 insertions(+)
diff --git a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
index bc8b44c77108..7f78b96279f3 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
@@ -11,6 +11,8 @@ lib_dir=$(dirname $0)/../../../net/forwarding
ALL_TESTS="
rif_set_addr_test
+ rif_inherit_bridge_addr_test
+ rif_non_inherit_bridge_addr_test
"
NUM_NETIFS=2
source $lib_dir/lib.sh
@@ -81,6 +83,83 @@ rif_set_addr_test()
ip link set dev $swp1 addr $swp1_mac
}
+rif_inherit_bridge_addr_test()
+{
+ RET=0
+
+ # Create first RIF
+ ip addr add dev $swp1 192.0.2.1/28
+ check_err $?
+
+ # Create a FID RIF
+ ip link add name br1 up type bridge vlan_filtering 0
+ ip link set dev $swp2 master br1
+ ip addr add dev br1 192.0.2.17/28
+ check_err $?
+
+ # Prepare a device with a low MAC address
+ ip link add name d up type dummy
+ ip link set dev d addr 00:11:22:33:44:55
+
+ # Attach the device to br1. That prompts bridge address change, which
+ # should be vetoed, thus preventing the attachment.
+ ip link set dev d master br1 &>/dev/null
+ check_fail $? "Device with low MAC was permitted to attach a bridge with RIF"
+ ip link set dev d master br1 2>&1 >/dev/null \
+ | grep -q mlxsw_spectrum
+ check_err $? "no extack for bridge attach rejection"
+
+ ip link set dev $swp2 addr 00:11:22:33:44:55 &>/dev/null
+ check_fail $? "Changing swp2's MAC address permitted"
+ ip link set dev $swp2 addr 00:11:22:33:44:55 2>&1 >/dev/null \
+ | grep -q mlxsw_spectrum
+ check_err $? "no extack for bridge port MAC address change rejection"
+
+ log_test "RIF - attach port with bad MAC to bridge"
+
+ ip link del dev d
+ ip link del dev br1
+ ip addr del dev $swp1 192.0.2.1/28
+}
+
+rif_non_inherit_bridge_addr_test()
+{
+ local swp2_mac=$(mac_get $swp2)
+
+ RET=0
+
+ # Create first RIF
+ ip addr add dev $swp1 192.0.2.1/28
+ check_err $?
+
+ # Create a FID RIF
+ ip link add name br1 up type bridge vlan_filtering 0
+ ip link set dev br1 addr $swp2_mac
+ ip link set dev $swp2 master br1
+ ip addr add dev br1 192.0.2.17/28
+ check_err $?
+
+ # Prepare a device with a low MAC address
+ ip link add name d up type dummy
+ ip link set dev d addr 00:11:22:33:44:55
+
+ # Attach the device to br1. Since the bridge address was set, it should
+ # work.
+ ip link set dev d master br1 &>/dev/null
+ check_err $? "Could not attach a device with low MAC to a bridge with RIF"
+
+ # Port MAC address change should be allowed for a bridge with set MAC.
+ ip link set dev $swp2 addr 00:11:22:33:44:55
+ check_err $? "Changing swp2's MAC address not permitted"
+
+ log_test "RIF - attach port with bad MAC to bridge with set MAC"
+
+ ip link set dev $swp2 addr $swp2_mac
+ ip link del dev d
+ ip link del dev br1
+ ip addr del dev $swp1 192.0.2.1/28
+}
+
trap cleanup EXIT
setup_prepare
--
2.4.11
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2018-12-13 11:55 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-13 11:54 [PATCH net-next 00/13] Introduce NETDEV_PRE_CHANGEADDR Petr Machata
2018-12-13 11:54 ` [PATCH net-next 01/13] net: dev: Add extack argument to dev_set_mac_address() Petr Machata
2018-12-13 11:54 ` [PATCH net-next 02/13] net: dev: Add NETDEV_PRE_CHANGEADDR Petr Machata
2018-12-13 11:54 ` [PATCH net-next 03/13] net: dev: Issue NETDEV_PRE_CHANGEADDR Petr Machata
2018-12-13 11:54 ` [PATCH net-next 04/13] net: bridge: " Petr Machata
2018-12-13 11:54 ` [PATCH net-next 05/13] net: bridge: Handle NETDEV_PRE_CHANGEADDR from ports Petr Machata
2018-12-13 11:54 ` [PATCH net-next 06/13] net: ipvlan: Issue NETDEV_PRE_CHANGEADDR Petr Machata
2018-12-13 11:54 ` [PATCH net-next 07/13] net: bonding: Give bond_set_dev_addr() a return value Petr Machata
2018-12-13 11:54 ` [PATCH net-next 08/13] net: bonding: Issue NETDEV_PRE_CHANGEADDR Petr Machata
2018-12-13 11:54 ` [PATCH net-next 09/13] mlxsw: spectrum_router: Generalize mlxsw_sp_netdevice_router_port_event() Petr Machata
2018-12-13 11:54 ` [PATCH net-next 10/13] mlxsw: spectrum: Add mlxsw_sp.mac_mask Petr Machata
2018-12-13 11:54 ` [PATCH net-next 11/13] mlxsw: spectrum_router: Veto unsupported RIF MAC addresses Petr Machata
2018-12-13 11:54 ` [PATCH net-next 12/13] selftests: mlxsw: Test RIF MAC vetoing Petr Machata
2018-12-13 11:54 ` [PATCH net-next 13/13] selftests: mlxsw: Test FID " Petr Machata
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).