** Changed in: linux (Ubuntu Bionic)
Status: In Progress => Fix Committed
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1761534
Title:
"ip a" command on a guest VM shows UNKNOWN status
Status in linux package in Ubuntu:
Fix Committed
Status in linux source package in Trusty:
In Progress
Status in linux source package in Xenial:
In Progress
Status in linux source package in Artful:
In Progress
Status in linux source package in Bionic:
Fix Committed
Bug description:
[Impact]
"ip a" command on a guest VM shows UNKNOWN status.
[Test Case]
* Environment : Running a guest VM with a virtio-net adaptor interface,
running on DPDK.
* Perform "ip a" inside the guest VM shows state "UNKNOWN" as follow example:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UNKNOWN group default qlen 1000
.....
[Regression Potential]
* Regression is low, the patch fix the operstate logic for virtio when no
VIRTIO_NET_F_STATUS.[1]
* The patch has been first accepted in net-next, then move into Linus's git.
[1] - VIRTIO_NET_F_STATUS
Allow the host to inform us that the link is down by adding a
VIRTIO_NET_F_STATUS which indicates that device status is available in
virtio_net config.
[Other Info]
* Linus:
https://github.com/torvalds/linux/commit/bda7fab54828bbef2164bb23c0f6b1a7d05cc718
* Net-next:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=bda7fab54828bbe
[Original Description]
It has been brought to our attention the following bug :
------------------------------------------------
Environment: The guest VM is using a canonical ubuntu image, and the eth0 is
a virtio-net adaptor, running on DPDK.
Background: "ip a" command relies on the operstate variable of the
net_device structure maintained by the kernel. This is based on the
operational state as defined in the IF MIB (RFC 2863). Device drivers
are expected to update this member. But many older drivers don’t seem
to be using this. So in general, IF_OPER_UP and IF_OPER_UNKNOWN are
treated as equal, in some sense, to maintain backward compatibility.
Even if we look at https://elixir.free-
electrons.com/linux/v4.15-rc2/source/include/linux/netdevice.h#L3468,
the function to check if interface is up, is written as follows, which
says that OPER_UNKNOWN is not something to be alarmed about, and just
reflective of a state that some drivers don’t care to update about.
static inline bool netif_oper_up(const struct net_device *dev)
{
return (dev->operstate == IF_OPER_UP ||
dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
}
Code Ref:
1.
https://elixir.free-electrons.com/linux/v4.15-rc2/source/include/linux/netdevice.h#L1739
2.
https://elixir.free-electrons.com/linux/v4.15-rc2/source/include/linux/netdevice.h#L3468
3. https://www.kernel.org/doc/Documentation/networking/operstates.txt
Now, for traditional kernel mode network adapter drivers, this state is
supposed to be manipulated by the driver. And we can safely assume that most
current kernel model drivers do keep this updated.
------------------------------------------------
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1761534/+subscriptions
--
Mailing list: https://launchpad.net/~kernel-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help : https://help.launchpad.net/ListHelp