[Hyper-V] Legacy network adapter is not detected

Bug #1440072 reported by Chris Valean
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linux
Unknown
Unknown
linux (Ubuntu)
Fix Released
Medium
Joseph Salisbury
Vivid
Fix Released
Medium
Joseph Salisbury
Wily
Fix Released
Medium
Joseph Salisbury

Bug Description

Issue description:
Attaching a Legacy network adapter to a VM will not be detected on the VM side.
This is not the case with synthetic adapters, which are properly identified.

Steps to Reproduce:
1. Add a Legacy Network adapter to the VM
2. Boot the vm
3. Verify the identified network adapter, the legacy NIC is missing

Versions details:
Windows Server Host Edition: Microsoft Windows Server 2012 R2 Datacenter build 9600 and Microsoft Windows Server 2008 R2 Standard SP 1 build 7601
Distribution name and release: Ubuntu Vivid Vervet
Kernel version: Linux ubuntu31 3.19.0-11-generic #11lp14233432v201504021617 SMP

Hyper-V side:
PS> Get-VMNetworkAdapter -VMName vivid1

Name IsManagementOs VMName SwitchName MacAddress Status IPAddresses
---- -------------- ------ ---------- ---------- ------ -----------
Network Adapter False vivid1 external 00155D06332D {Ok} {IP, fe80::215:5dff:fe06:332d}
Legacy Network Adapter False vivid1 external 00155D063336 {Ok} {}

On the VM Side:
root@ubuntu31:~# ls /sys/class/net/
eth0 lo

eth0 has the MAC of the Network Adapter, which is the synthetic interface.

This has been verified with also 1 vCPU or with irqbalancer daemon disabled, as that is a common requirements when using legacy adapters.
---
AlsaDevices:
 total 0
 crw-rw---- 1 root audio 116, 1 May 6 08:17 seq
 crw-rw---- 1 root audio 116, 33 May 6 08:17 timer
AplayDevices: Error: [Errno 2] No such file or directory
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
DistroRelease: Ubuntu 15.04
HibernationDevice: RESUME=/dev/mapper/ubuntu1504--vg-swap_1
InstallationDate: Installed on 2015-04-23 (12 days ago)
InstallationMedia: Ubuntu-Server 15.04 "Vivid Vervet" - Release amd64 (20150422)
IwConfig:
 eth0 no wireless extensions.

 lo no wireless extensions.
Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99
MachineType: Microsoft Corporation Virtual Machine
Package: linux (not installed)
PciMultimedia:

ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 hyperv_fb
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.19.0-15-generic root=/dev/mapper/hostname--vg-root ro crashkernel=384M-:128M console=tty0 console=ttyS1
ProcVersionSignature: Ubuntu 3.19.0-15.15-generic 3.19.3
RelatedPackageVersions:
 linux-restricted-modules-3.19.0-15-generic N/A
 linux-backports-modules-3.19.0-15-generic N/A
 linux-firmware 1.143
RfKill: Error: [Errno 2] No such file or directory
Tags: vivid
UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
Uname: Linux 3.19.0-15-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

_MarkForUpload: True
dmi.bios.date: 05/23/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 090006
dmi.board.name: Virtual Machine
dmi.board.vendor: Microsoft Corporation
dmi.board.version: 7.0
dmi.chassis.asset.tag: 6473-7986-1993-5777-7899-0719-77
dmi.chassis.type: 3
dmi.chassis.vendor: Microsoft Corporation
dmi.chassis.version: 7.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr090006:bd05/23/2012:svnMicrosoftCorporation:pnVirtualMachine:pvr7.0:rvnMicrosoftCorporation:rnVirtualMachine:rvr7.0:cvnMicrosoftCorporation:ct3:cvr7.0:
dmi.product.name: Virtual Machine
dmi.product.version: 7.0
dmi.sys.vendor: Microsoft Corporation

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1440072

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Chris Valean (cvalean) wrote :

A few more details on this, on 14.04 the legacy adapter seems to be handled through the tulip driver. However, on Vivid the PCI device is still recognized, but not shown as handled through any kernel module:

#lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA
00:0a.0 Ethernet controller: Digital Equipment Corporation DECchip 21140 [FasterNet] (rev 20)

Ethernet controller info:
00:0a.0 Ethernet controller: Digital Equipment Corporation DECchip 21140 [FasterNet] (rev 20)
        Subsystem: Device 0a00:2114
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64 (5000ns min, 10000ns max), Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at ec00 [size=128]
        Region 1: Memory at febff000 (32-bit, non-prefetchable) [size=4K]
        Expansion ROM at febe0000 [disabled] [size=64K]

On 14.04 the last command reads also this line:
Kernel driver in use: tulip

Changed in linux (Ubuntu):
status: Incomplete → New
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1440072

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Chris Valean (cvalean)
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: kernel-da-key kernel-hyper-v
Revision history for this message
Chris Valean (cvalean) wrote :

The errors are originating from the tulip driver, as you can see below. Will also send the full apport-collect logs.

[ 2.659387] tulip: Linux Tulip driver version 1.1.15 (Feb 27, 2007)
[ 2.712279] tulip 0000:00:0a.0: PCI INT A: failed to register GSI
[ 2.717659] tulip: Cannot enable tulip board #0, aborting
[ 2.735031] tulip: probe of 0000:00:0a.0 failed with error -1

tags: added: apport-collected vivid
description: updated
Revision history for this message
Chris Valean (cvalean) wrote : CRDA.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : JournalErrors.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : Lspci.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : ProcModules.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : UdevDb.txt

apport information

Revision history for this message
Chris Valean (cvalean) wrote : WifiSyslog.txt

apport information

Revision history for this message
nmeier (nmeier) wrote :

The tulip driver fails to initialize in a Linux VM running on Hyper-V.
The following messages are logged in syslog when trying to load the tulip driver:

  tulip: Linux Tulip drivers version 1.1.15 (Feb 27, 2007)
  tulip: 0000:00:0a.0: PCI INT A: failed to register GSI
  tulip: Cannot enable tulip board #0, aborting
  tulip: probe of 0000:00:0a.0 failed with error -16

The tulip drivers initialization function tulip_init_one() calls pci_enable_device(). The call to pci_enable_device() eventually
results in a call to alloc_isa_irq_from_domain(), which returns -EBUSY (-16)

The message "tulip: 0000:00:0a.0: PCI INT A: failed to register GSI" is
logged by acpi_pci_irq_enable().

The flow of calls to the error is returned is:

acpi_pci_irq_enable() - Logs the message "PCI INT A: failed to register GSI"
  acpi_register_gsi()
    __acpi_register_gsi() is afunction pointer -> acpi_register_gsi_ioapic()
    acpi_register_gsi_ioapic()
      mp_map_gsi_to_irq()
        mp_map_ppin_to_irq()
          alloc_isa_irq_from_domain()
            Returning -EBUSY when mp_check_pin_attr() returns false.

            mp_check_pin_attr()
              data->trigger = 1
              data->polarity = 0
              info->ioapic_trigger = 1
              info->ioapic_polarity = 1
        mp_check_pin_attr() returns false because the two polarity values do not match.

acpi_register_gsi_ioapic() is setting trigger and polarity to:
    trigger = 1
    polarity = 1
mp_check_pin_attr() is calling irq_get_chip_data(irq) which is returning a mp_chip_data structure with
    trigger = 1
    polarity = 0
Since the two polarity values do not match, mp_check_pin_attr() returns false.

Broken in 3.19.0 kernel
Works in 3.17 kernel.

Using commits to arch/x86/kernel/acpi/boot.c as reference, the commit where the issue appears is
    cd68f6bd53cf89d1d5ed889b8aaf65e9c3574a079
    x86, irq, acpi: Git rid of special handling of GSI for ACPI SCI

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.2 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.2-rc2-unstable/

Revision history for this message
nmeier (nmeier) wrote :

Tested the v4.2-rc2 unstable kernel. Problem still exists.
Added tag: kernel-bug-exists-upstream.

tags: added: kernel-bug-exists-upstream
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I built a Vivid test kernel with a revert of commit cd68f6bd5. Can you test this kernel and see if it still exhibits this bug?

The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1440072/

Thanks in advance!

Changed in linux (Ubuntu Vivid):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
nmeier (nmeier) wrote :

It works!
This build successfully allowed the tulip driver to load. I was able to bring the interface up and acquire an IP address.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Great, thanks for testing! I'll ping the author of that patch and see if we can get some feedback.

Changed in linux (Ubuntu):
assignee: nobody → Joseph Salisbury (jsalisbury)
Changed in linux (Ubuntu Vivid):
assignee: nobody → Joseph Salisbury (jsalisbury)
Changed in linux (Ubuntu):
status: Confirmed → In Progress
Changed in linux (Ubuntu Vivid):
status: Confirmed → In Progress
Revision history for this message
nmeier (nmeier) wrote :

I opened bug 101301 in the kernel.org bugzilla on the same day I post comment 14 above. It looks like I left this bug number out of comment 14.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Some information requested from upstream in the bugzilla bug:
https://bugzilla.kernel.org/show_bug.cgi?id=101301#c2

Revision history for this message
nmeier (nmeier) wrote :

Following information was provided to the kernel.org bug:

    1. Researching if Tulip GSI is shared with ACPI SCI.
    2. acpi_sci=low works! Tulip driver successfully loaded.
    Attached is the output from acpidump when VM was booted without an acpi_sci option.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Thanks!

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Feedback and update to the upstream bug:

"The ACPI MADT table includes an interrupt source overridden entry for ACPI SCI:
[236h 0566 1] Subtable Type : 02 <Interrupt Source Override>
[237h 0567 1] Length : 0A
[238h 0568 1] Bus : 00
[239h 0569 1] Source : 09
[23Ah 0570 4] Interrupt : 00000009
[23Eh 0574 2] Flags (decoded below) : 000D
                                   Polarity : 1
                               Trigger Mode : 3
That means ACPI SCI interrupt(Interrupt : 00000009) works in
level(Trigger Mode : 3), high(Polarity : 1) mode.
For more information, please refer to Table 5-50 in ACPI spec 5.a.

And in DSDT table, we have _PRT method to define PCI interrupts, which eventually goes to:
        Name (PRSA, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared, )
                {3,4,5,7,9,10,11,12,14,15}
        })
        Name (PRSB, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared, )
                {3,4,5,7,9,10,11,12,14,15}
        })
        Name (PRSC, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared, )
                {3,4,5,7,9,10,11,12,14,15}
        })
        Name (PRSD, ResourceTemplate ()
        {
            IRQ (Level, ActiveLow, Shared, )
                {3,4,5,7,9,10,11,12,14,15}
        })
which means it's also possible to use IRQ9 for PCI interrupt, but works in
Level, ActiveLow mode. And this conflicts with ACPI SCI definition.

So it's an ACPI BIOS bug. There may several ways out here:
1) Change ACPI SCI IRQ working mode to level, low.
2) Exclude IRQ9 from Interrupt Link Device A-D
3) Use acpi_sci=low to override BIOS configuration.
4) revert the patch
Thanks!
Gerry"

Revision history for this message
Joshua R. Poulson (jrp) wrote :

We would like the ultimate upstream fix to be included, rather than workaround with a boot parameter.

Revision history for this message
nmeier (nmeier) wrote :

Recent work on bug 101301 was done in email rather than in the bug. The following patch was tested on Hyper-V and then accepted into the PCI tree.

 arch/x86/kernel/acpi/boot.c | 1 +
 drivers/acpi/pci_link.c | 16 ++++++++++++++++
 include/linux/acpi.h | 2 +-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index e49ee24da85e..9393896717d0 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -445,6 +445,7 @@ static void __init acpi_sci_ioapic_setup(u8 bus_irq, u16 polarity, u16 trigger,
   polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK;

  mp_override_legacy_irq(bus_irq, polarity, trigger, gsi);
+ acpi_penalize_sci_irq(bus_irq, trigger, polarity);

  /*
   * stash over-ride to indicate we've been here diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index cfd7581cc19f..b09ad554430a 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -826,6 +826,22 @@ void acpi_penalize_isa_irq(int irq, int active) }

 /*
+ * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict
+with
+ * PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be use
+for
+ * PCI IRQs.
+ */
+void acpi_penalize_sci_irq(int irq, int trigger, int polarity) {
+ if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty)) {
+ if (trigger != ACPI_MADT_TRIGGER_LEVEL ||
+ polarity != ACPI_MADT_POLARITY_ACTIVE_LOW)
+ acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_ALWAYS;
+ else
+ acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
+ }
+}
+
+/*
  * Over-ride default table to reserve additional IRQs for use by ISA
  * e.g. acpi_irq_isa=5
  * Useful for telling ACPI how not to interfere with your ISA sound card.
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d2445fa9999f..0b2394f61af4 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -221,7 +221,7 @@ struct pci_dev;

 int acpi_pci_irq_enable (struct pci_dev *dev); void acpi_penalize_isa_irq(int irq, int active);
-
+void acpi_penalize_sci_irq(int irq, int trigger, int polarity);
 void acpi_pci_irq_disable (struct pci_dev *dev);

 extern int ec_read(u8 addr, u8 *val);
--
1.7.10.4

Revision history for this message
nmeier (nmeier) wrote :

Typo - the above patch was accepted into the ACPI tree.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

The fix for this bug is upstream as the following commit:

commit 5d0ddfebb93069061880fc57ee4ba7246bd1e1ee
Author: Jiang Liu <email address hidden>
Date: Fri Aug 21 15:36:23 2015 +0800

    ACPI, PCI: Penalize legacy IRQ used by ACPI SCI

This commit was also cc'd to stable, so it should make it's way through the stable releases.

Revision history for this message
Chris Valean (cvalean) wrote :

Joseph, please also mark this for inclusion on 15.10 - Wily Werewolf as we found that this issue can also be found on the recent daily builds with the 4.2 kernel.

Changed in linux (Ubuntu Wily):
status: In Progress → Fix Released
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I confirmed with the upstream 3.19 kernel maintainer that the fix for this will be in the next upstream release(3.19.8-ckt7).

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

The fix will land in Vivid when it gets the upstream 3.19.8-ckt7 updates.

Revision history for this message
Ovidiu Rusu (orusu) wrote :

I've tested a Vivid with this kernel version: 3.19.0-31-generic. I've attached 2 legacy NICs and both are detected by the VM and both are getting an ip address.

Please mark this as fixed.

Changed in linux (Ubuntu Vivid):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.