diff options
author | David S. Miller <davem@davemloft.net> | 2017-01-20 18:22:27 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-20 18:22:27 +0100 |
commit | e9f3a685a2b7685a730d990b4e87248b513907a0 (patch) | |
tree | c2e4ed1163126ecc3416d9510f98322a8b27f343 /drivers | |
parent | fq_codel: Avoid regenerating skb flow hash unless necessary (diff) | |
parent | macvlan: use netdev_is_rx_handler_busy instead of checking specific type (diff) | |
download | linux-e9f3a685a2b7685a730d990b4e87248b513907a0.tar.xz linux-e9f3a685a2b7685a730d990b4e87248b513907a0.zip |
Merge branch 'rxbusy'
Mahesh Bandewar says:
====================
use netdev_is_rx_handler_busy() in few known cases
netdev_rx_handler_register() was recently split into two parts - (a) check
if the handler is used, (b) register the new handler, parts. This is
helpful in scenarios like bonding where at the time of registration there
is too much state to unwind and it should check if the device is free
before building that state. IPvlan and macvlan drivers don't have this
issue however it can make use of the same check instead of using a device
specific check.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 4 | ||||
-rw-r--r-- | drivers/net/macvlan.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index b5c390f0f2b3..95b18f4602cf 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -102,8 +102,8 @@ static int ipvlan_port_create(struct net_device *dev) return -EINVAL; } - if (netif_is_macvlan_port(dev)) { - netdev_err(dev, "Master is a macvlan port.\n"); + if (netdev_is_rx_handler_busy(dev)) { + netdev_err(dev, "Device is already in use.\n"); return -EBUSY; } diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 440ab3d8adf7..cbfc1be23a0e 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1110,7 +1110,7 @@ static int macvlan_port_create(struct net_device *dev) if (dev->type != ARPHRD_ETHER || dev->flags & IFF_LOOPBACK) return -EINVAL; - if (netif_is_ipvlan_port(dev)) + if (netdev_is_rx_handler_busy(dev)) return -EBUSY; port = kzalloc(sizeof(*port), GFP_KERNEL); |