* [PATCH] bonding: set carrier off for devices created through netlink
@ 2016-07-13 16:25 Beniamino Galvani
2016-07-14 23:18 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Beniamino Galvani @ 2016-07-13 16:25 UTC (permalink / raw)
To: netdev; +Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, Phil Oester
Commit e826eafa65c6 ("bonding: Call netif_carrier_off after
register_netdevice") moved netif_carrier_off() from bond_init() to
bond_create(), but the latter is called only for initial default
devices and ones created through sysfs:
$ modprobe bonding
$ echo +bond1 > /sys/class/net/bonding_masters
$ ip link add bond2 type bond
$ grep "MII Status" /proc/net/bonding/*
/proc/net/bonding/bond0:MII Status: down
/proc/net/bonding/bond1:MII Status: down
/proc/net/bonding/bond2:MII Status: up
Ensure that carrier is initially off also for devices created through
netlink.
Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
---
drivers/net/bonding/bond_netlink.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index db760e8..b8df0f5 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -446,7 +446,11 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev,
if (err < 0)
return err;
- return register_netdevice(bond_dev);
+ err = register_netdevice(bond_dev);
+
+ netif_carrier_off(bond_dev);
+
+ return err;
}
static size_t bond_get_size(const struct net_device *bond_dev)
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bonding: set carrier off for devices created through netlink
2016-07-13 16:25 [PATCH] bonding: set carrier off for devices created through netlink Beniamino Galvani
@ 2016-07-14 23:18 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-14 23:18 UTC (permalink / raw)
To: bgalvani; +Cc: netdev, j.vosburgh, vfalico, gospo, kernel
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Wed, 13 Jul 2016 18:25:08 +0200
> Commit e826eafa65c6 ("bonding: Call netif_carrier_off after
> register_netdevice") moved netif_carrier_off() from bond_init() to
> bond_create(), but the latter is called only for initial default
> devices and ones created through sysfs:
>
> $ modprobe bonding
> $ echo +bond1 > /sys/class/net/bonding_masters
> $ ip link add bond2 type bond
> $ grep "MII Status" /proc/net/bonding/*
> /proc/net/bonding/bond0:MII Status: down
> /proc/net/bonding/bond1:MII Status: down
> /proc/net/bonding/bond2:MII Status: up
>
> Ensure that carrier is initially off also for devices created through
> netlink.
>
> Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-14 23:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 16:25 [PATCH] bonding: set carrier off for devices created through netlink Beniamino Galvani
2016-07-14 23:18 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.