Commit cbcd1fa7 authored by David S. Miller's avatar David S. Miller

Merge branch 'dsa-next'

Florian Fainelli says:

====================
net: DSA fixes for bridge and ip-autoconf

These two patches address some real world use cases of the DSA master and slave
network devices.

You have already seen patch 1 previously and you rejected it since my
explanations were not good enough to provide a justification as to why it is
useful, hopefully this time my explanation is better.

Patch 2 solves a different, yet very real problem as well at the bridge layer
when using DSA network devices.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5bdc7380 8db0a2ee
...@@ -436,10 +436,16 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) ...@@ -436,10 +436,16 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
int err = 0; int err = 0;
bool changed_addr; bool changed_addr;
/* Don't allow bridging non-ethernet like devices */ /* Don't allow bridging non-ethernet like devices, or DSA-enabled
* master network devices since the bridge layer rx_handler prevents
* the DSA fake ethertype handler to be invoked, so we do not strip off
* the DSA switch tag protocol header and the bridge layer just return
* RX_HANDLER_CONSUMED, stopping RX processing for these frames.
*/
if ((dev->flags & IFF_LOOPBACK) || if ((dev->flags & IFF_LOOPBACK) ||
dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN || dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN ||
!is_valid_ether_addr(dev->dev_addr)) !is_valid_ether_addr(dev->dev_addr) ||
netdev_uses_dsa(dev))
return -EINVAL; return -EINVAL;
/* No bridging of bridges */ /* No bridging of bridges */
......
...@@ -209,9 +209,9 @@ static int __init ic_open_devs(void) ...@@ -209,9 +209,9 @@ static int __init ic_open_devs(void)
last = &ic_first_dev; last = &ic_first_dev;
rtnl_lock(); rtnl_lock();
/* bring loopback device up first */ /* bring loopback and DSA master network devices up first */
for_each_netdev(&init_net, dev) { for_each_netdev(&init_net, dev) {
if (!(dev->flags & IFF_LOOPBACK)) if (!(dev->flags & IFF_LOOPBACK) && !netdev_uses_dsa(dev))
continue; continue;
if (dev_change_flags(dev, dev->flags | IFF_UP) < 0) if (dev_change_flags(dev, dev->flags | IFF_UP) < 0)
pr_err("IP-Config: Failed to open %s\n", dev->name); pr_err("IP-Config: Failed to open %s\n", dev->name);
...@@ -306,7 +306,7 @@ static void __init ic_close_devs(void) ...@@ -306,7 +306,7 @@ static void __init ic_close_devs(void)
while ((d = next)) { while ((d = next)) {
next = d->next; next = d->next;
dev = d->dev; dev = d->dev;
if (dev != ic_dev) { if (dev != ic_dev && !netdev_uses_dsa(dev)) {
DBG(("IP-Config: Downing %s\n", dev->name)); DBG(("IP-Config: Downing %s\n", dev->name));
dev_change_flags(dev, d->flags); dev_change_flags(dev, d->flags);
} }
......
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