Summary: | igb link status is not updating properly when configured as VF driver in guest OS | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Gokul <gokuljnpr> | ||||
Component: | kern | Assignee: | freebsd-net (Nobody) <net> | ||||
Status: | In Progress --- | ||||||
Severity: | Affects Some People | CC: | emaste, erj, gokuljnpr, shurd | ||||
Priority: | --- | Keywords: | IntelNetworking, patch | ||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236724 | ||||||
Attachments: |
|
(In reply to Gokul from comment #0) What is the configuration you are using to host the FreeBSD VM? (In reply to Sean Bruno from comment #1) Its a 64bit linux >>3.10.100-ovp-rt110-WR6.0.0.31_preempt-rt #1 SMP Tue Mar 13 01:59:51 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux Driver details : root@:~# modinfo igb filename: /lib/modules/3.10.100-ovp-rt110-WR6.0.0.31_preempt-rt/kernel/drivers/net/ethernet/intel/igb/igb.ko version: 5.0.5-k license: GPL description: Intel(R) Gigabit Ethernet Network Driver author: Intel Corporation, <e1000-devel@lists.sourceforge.net> hypervisor : QEMU root@:~# /usr/bin/qemu-system-x86_64 -version QEMU emulator version 1.7.2, Copyright (c) 2003-2008 Fabrice Bellard root@:~# (In reply to Sean Bruno from comment #1) Its a 64bit linux >>3.10.100-ovp-rt110-WR6.0.0.31_preempt-rt #1 SMP Tue Mar 13 01:59:51 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux Driver details : root@:~# modinfo igb filename: /lib/modules/3.10.100-ovp-rt110-WR6.0.0.31_preempt-rt/kernel/drivers/net/ethernet/intel/igb/igb.ko version: 5.0.5-k license: GPL description: Intel(R) Gigabit Ethernet Network Driver author: Intel Corporation, <e1000-devel@lists.sourceforge.net> hypervisor : QEMU root@:~# /usr/bin/qemu-system-x86_64 -version QEMU emulator version 1.7.2, Copyright (c) 2003-2008 Fabrice Bellard root@:~# Additional Info: If we make link down from host via command > 'ip link set down ethX' , guest will get reset indication and link status will update as 'DOWN' . But if actual physical link is down then it will not update properly For eg: 1) When physical link is up , VF will show as link 'UP' root@/# ip link show eth2 6: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000 link/ether 00:a0:c9:00:00:01 brd ff:ff:ff:ff:ff:ff vf 0 MAC 02:01:01:00:00:05, spoof checking on root@/# 2) When physical link is down , in this case , vf link status will be link 'UP' as per current source code. root@/# ip link show eth2 6: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000 link/ether 00:a0:c9:00:00:01 brd ff:ff:ff:ff:ff:ff vf 0 MAC 02:01:01:00:00:05, spoof checking on root@/# 3) make link down using software , in this case VF will get reset indication and link status will be updated as 'DOWN' root@/# ip link set down eth2 root@/# ip link show eth2 6: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000 link/ether 00:a0:c9:00:00:01 brd ff:ff:ff:ff:ff:ff vf 0 MAC 02:01:01:00:00:05, spoof checking on root@/# |
Created attachment 193773 [details] patch file to fix igb vf driver link issue When we use igb driver as Virtual function driver , link status is not updating once after link is up. Because of the same , if physical link went down , the status will not be updated at freebsd VF interface if its present state is link UP. Following patch should resolve the issue . gokulcg@/$ cat igb_link.patch Index: sys/dev/e1000/e1000_vf.c =================================================================== --- sys/dev/e1000/e1000_vf.c (revision 334275) +++ sys/dev/e1000/e1000_vf.c (working copy) @@ -546,10 +546,11 @@ * or a virtual function reset */ - /* If we were hit with a reset or timeout drop the link */ - if (!mbx->ops.check_for_rst(hw, 0) || !mbx->timeout) + /* If we were hit with a reset or timeout or physical link is down drop the link */ + if (!mbx->ops.check_for_rst(hw, 0) || !mbx->timeout || \ + !(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) { mac->get_link_status = TRUE; - + } if (!mac->get_link_status) goto out;