From: Hangbin Liu <hidden> Date: 2021-01-20 11:21:10
Set the link down before enslave it to a bond device, to avoid
Error: Device can not be enslaved while up.
Fixes: 6374a5606990 ("selftests: rtnetlink: Test bridge enslavement with different parent IDs")
Signed-off-by: Hangbin Liu <redacted>
---
tools/testing/selftests/net/rtnetlink.sh | 2 ++
1 file changed, 2 insertions(+)
On Wed, Jan 20, 2021 at 06:29:47PM +0800, Hangbin Liu wrote:
quoted hunk
Set the link down before enslave it to a bond device, to avoid
Error: Device can not be enslaved while up.
Fixes: 6374a5606990 ("selftests: rtnetlink: Test bridge enslavement with different parent IDs")
Signed-off-by: Hangbin Liu <redacted>
---
tools/testing/selftests/net/rtnetlink.sh | 2 ++
1 file changed, 2 insertions(+)
But these netdevs are created with their administrative state set to
'DOWN'. Who is setting them to up?
Would you please point me where we set the state to 'DOWN'? Cause on my
host it is init as UP:
++ ls /sys/bus/netdevsim/devices/netdevsim10/net/
+ dev10=eth3
++ ls /sys/bus/netdevsim/devices/netdevsim20/net/
+ dev20=eth4
+ ip link add name test-bond0 type bond mode 802.3ad
+ ip link show eth3
66: eth3: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 1e:52:27:5f:a5:3c brd ff:ff:ff:ff:ff:ff
# uname -r
5.11.0-rc3+
Thanks
Hangbin
But these netdevs are created with their administrative state set to
'DOWN'. Who is setting them to up?
Would you please point me where we set the state to 'DOWN'? Cause on my
host it is init as UP:
++ ls /sys/bus/netdevsim/devices/netdevsim10/net/
+ dev10=eth3
++ ls /sys/bus/netdevsim/devices/netdevsim20/net/
+ dev20=eth4
+ ip link add name test-bond0 type bond mode 802.3ad
+ ip link show eth3
66: eth3: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 1e:52:27:5f:a5:3c brd ff:ff:ff:ff:ff:ff
I didn't have time to look into this today, but I suspect the problem is
either:
1. Some interface manager on your end that is setting these interfaces
up after they are created
2. A bug in netdevsim that does not initialize the carrier to off.
Maybe try with this patch (didn't test):
But these netdevs are created with their administrative state set to
'DOWN'. Who is setting them to up?
Would you please point me where we set the state to 'DOWN'? Cause on my
host it is init as UP:
++ ls /sys/bus/netdevsim/devices/netdevsim10/net/
+ dev10=eth3
++ ls /sys/bus/netdevsim/devices/netdevsim20/net/
+ dev20=eth4
+ ip link add name test-bond0 type bond mode 802.3ad
+ ip link show eth3
66: eth3: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 1e:52:27:5f:a5:3c brd ff:ff:ff:ff:ff:ff
I didn't have time to look into this today, but I suspect the problem is
either:
1. Some interface manager on your end that is setting these interfaces
up after they are created
This must be the case, the kernel doesn't open/up devices by itself.
2. A bug in netdevsim that does not initialize the carrier to off.
Maybe try with this patch (didn't test):
Yeah, but that's fine, SW devices don't have to manage carrier state.
But these netdevs are created with their administrative state set to
'DOWN'. Who is setting them to up?
Would you please point me where we set the state to 'DOWN'? Cause on my
host it is init as UP:
++ ls /sys/bus/netdevsim/devices/netdevsim10/net/
+ dev10=eth3
++ ls /sys/bus/netdevsim/devices/netdevsim20/net/
+ dev20=eth4
+ ip link add name test-bond0 type bond mode 802.3ad
+ ip link show eth3
66: eth3: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 1e:52:27:5f:a5:3c brd ff:ff:ff:ff:ff:ff
I didn't have time to look into this today, but I suspect the problem is
either:
1. Some interface manager on your end that is setting these interfaces
up after they are created
This must be the case, the kernel doesn't open/up devices by itself.
Ah, yes, My bad. I found NetworkManager enabled it by default.
Thanks
Hangbin