ifup service of network device stay active after driver stop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Tim Gardner | ||
Yakkety |
Fix Released
|
Undecided
|
Tim Gardner | ||
Zesty |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The network device systemd service stay active after unload the module of this network device, that call close port (ndo_stop).
once we try to load the NIC driver again, it try to start the ifup service of his NICs and due to the service is already up, so it fail and we didn't see the interface with the static configuration =.
below simple reproduce with the Mellanox ConnectX4 device (driver name mlx5_core).
Also we see this issue with Azure system, Ubuntu 17.04 guest over Hyper-v, the VF failed to start after re-enable SR-IOV from VM's vNIC.
For now we have a Work Around that to add a udev rule,
echo DRIVERS==\"*mlx*\", SUBSYSTEM==\"net\", ACTION=
Example:
#:/lib/
DRIVERS=="*mlx*", SUBSYSTEM=="net", ACTION=
*******
* More info and reproduce *
*******
# ifdown ens1f0
RTNETLINK answers: Cannot assign requested address
# ifup ens1f0
# ifconfig ens1f0
ens1f0: flags=4163<
inet 123.12.23.1 netmask 255.255.0.0 broadcast 123.12.255.255
inet6 fe80::268a:
ether 24:8a:07:a1:fb:dc txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17 bytes 1392 (1.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# ethtool -i ens1f0 |grep driv
driver: mlx5_core
# systemctl status ifup@ens1f
<email address hidden> <email address hidden>
# systemctl status <email address hidden>
* <email address hidden> - ifup for ens1f0
Loaded: loaded (/lib/systemd/
Active: active (exited) since Sun 2017-03-12 09:40:04 IST; 2h 26min ago
Main PID: 1608 (code=exited, status=0/SUCCESS)
CGroup: /<email address hidden>
Mar 12 09:40:04 qa-h-vrt-039 systemd[1]: Started ifup for ens1f0.
Mar 12 09:40:04 qa-h-vrt-039 sh[1608]: ifup: interface ens1f0 already configured
root@qa-
rmmod mlx5_ib
rmmod mlx5_core
# modprobe -rv mlx5_core
# ifconfig -a |grep ens1f0
# lsmod |grep mlx5
# systemctl status <email address hidden>
* <email address hidden> - ifup for ens1f0
Loaded: loaded (/lib/systemd/
Active: active (exited) since Sun 2017-03-12 09:40:04 IST; 2h 27min ago
Main PID: 1608 (code=exited, status=0/SUCCESS)
CGroup: /<email address hidden>
Mar 12 09:40:04 qa-h-vrt-039 systemd[1]: Started ifup for ens1f0.
Mar 12 09:40:04 qa-h-vrt-039 sh[1608]: ifup: interface ens1f0 already configured
# modprobe mlx5_core
# ifconfig ens1f0
ens1f0: flags=4098<
ether 24:8a:07:a1:fb:dc txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# cat /etc/network/
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eno1
iface eno1 inet dhcp
#ens1f0
auto ens1f0
iface ens1f0 inet static
address 123.12.23.1
netmask 255.255.0.0
mtu 1500
*******
* Another repto and investigate *
*******
once interface is created the system starts a service that is responsible for activating it (basically runs ifup).
so, at first shot everything works.
at the second driver reload:
Good flow (on good setup 4.9.0-rc5+):
1. driver is unloaded and the interface’s “ifup” service is shutdown:
Feb 23 00:54:09 reg-l-vrt-206-006 kernel: [67777.790189] mlx4_en: enP43508p0s2: Close port called
Feb 23 00:54:09 reg-l-vrt-206-006 kernel: [67777.868484] hv_netvsc a2be13bb-
Feb 23 00:54:09 reg-l-vrt-206-006 kernel: [67777.868487] hv_netvsc a2be13bb-
Feb 23 00:54:09 reg-l-vrt-206-006 kernel: [67777.869575] hv_netvsc a2be13bb-
Feb 23 00:54:09 reg-l-vrt-206-006 systemd1: Stopping ifup for enP43508p0s2...
Feb 23 00:54:09 reg-l-vrt-206-006 ifdown47196: Cannot find device "enP43508p0s2"
Feb 23 00:54:09 reg-l-vrt-206-006 ifdown47196: Cannot find device "enP43508p0s2"
Feb 23 00:54:09 reg-l-vrt-206-006 systemd1: Stopped ifup for enP43508p0s2.
2. driver is loaded again, and a new instance of the service is started and it activates the interface.
Feb 23 00:54:15 reg-l-vrt-206-006 kernel: [67783.130286] mlx4_en: a9f4:00:02.0: Port 1: Initializing port
Feb 23 00:54:15 reg-l-vrt-206-006 kernel: [67783.130853] hv_netvsc a2be13bb-
Feb 23 00:54:15 reg-l-vrt-206-006 kernel: [67783.137848] mlx4_core a9f4:00:02.0 enP43508p0s2: renamed from eth2
Feb 23 00:54:15 reg-l-vrt-206-006 systemd1: Started ifup for enP43508p0s2.
Bad flow (on problematic setup 4.10.0-Jack):
1. driver is unloaded, but close port not called?
and ifup service is not shut down!!
Feb 23 00:54:15 localhost kernel: [54441.503703] hv_netvsc cbedec5e-
2. driver is loaded again
Feb 23 00:54:23 localhost kernel: [54449.948686] mlx4_en: bbda:00:02.0: Port 1: Initializing port
Feb 23 00:54:23 localhost kernel: [54449.949306] hv_netvsc cbedec5e-
Feb 23 00:54:23 localhost kernel: [54449.956623] mlx4_core bbda:00:02.0 enP48090p0s2: renamed from eth2
Feb 23 00:54:23 localhost systemd1: Started ifup for enP48090p0s2.
CVE References
Changed in linux (Ubuntu Yakkety): | |
assignee: | nobody → Tim Gardner (timg-tpi) |
status: | New → In Progress |
Changed in linux (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Yakkety): | |
status: | In Progress → Fix Committed |
Does "The network device systemd service" equal to "sys-subsystem- net-devices- *.device" ?