Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2019 09:40:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        virtualization@FreeBSD.org
Subject:   [Bug 222996] FreeBSD 11.1-12 on Hyper-V with PCI Express Pass Through
Message-ID:  <bug-222996-27103-0ImStafM29@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-222996-27103@https.bugs.freebsd.org/bugzilla/>
References:  <bug-222996-27103@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222996

--- Comment #16 from Wei Hu <weh@microsoft.com> ---
There are two issues.=20

1. For FreeBSD R12 and current head branch, the passthrough support on Hype=
r-V
Gen VM was broken by commit r330113. No devices work on these releases. I h=
ave
informed Andrew@freebsd.org to take a look of this problem.

2. On 11.2 and earlier releases, passthrough generally works on Gen 2 FreeB=
SD
VMs. I have checked one Intel NIC with using ig driver which works fine.
However, Dmitry reported it doesn't work with Intel 82583v NIC, which uses =
em
driver on FreeBSD. I don't have such NIC so I am using a VM that that Dmitry
provided to debug this issue. Looks it fails in the routine reading NIC's M=
DI
control register:

/**
 *  e1000_read_phy_reg_mdic - Read MDI control register
 *  @hw: pointer to the HW structure
 *  @offset: register offset to be read
 *  @data: pointer to the read data
 *
 *  Reads the MDI control register in the PHY at offset and stores the
 *  information read to data.
 **/
s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
{
        struct e1000_phy_info *phy =3D &hw->phy;
        u32 i, mdic =3D 0;

        ...
        /* Poll the ready bit to see if the MDI read completed
         * Increasing the time out as testing showed failures with
         * the lower time out
         */
        for (i =3D 0; i < (E1000_GEN_POLL_TIMEOUT * 10); i++) {
                usec_delay_irq(50);
                mdic =3D E1000_READ_REG(hw, E1000_MDIC);
                if (mdic & E1000_MDIC_READY)
                        break;
        }
        if (!(mdic & E1000_MDIC_READY)) {
                DEBUGOUT("MDI Read did not complete\n");        <--- saw th=
is
message when driver's debug flag is on.
                return -E1000_ERR_PHY;
        }
        ...
}

Looks the register status never turned ready. Here is some dmesg output when
the debug flag is on:

em0: Lazy allocation of 0x20000 bytes rid 0x10 type 3 at 0xf8000000
em0: in em_allocate_pci_resource, bus tag is 0x1, handle is 0xfffff800f8000=
000
e1000_set_mac_type
e1000_init_mac_ops_generic
e1000_init_phy_ops_generic
e1000_init_nvm_ops_generic
e1000_init_function_pointers_82571
e1000_init_mac_params_82571
e1000_init_nvm_params_82571
e1000_init_phy_params_82571
e1000_get_phy_id_82571
e1000_read_phy_reg_bm2
e1000_get_hw_semaphore_82574
e1000_get_hw_semaphore_82573
e1000_read_phy_reg_mdic
MDI Read did not complete             <--=20
e1000_put_hw_semaphore_82574
e1000_put_hw_semaphore_82573
Error getting PHY ID

Will update more.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-222996-27103-0ImStafM29>