Date: Tue, 23 Oct 2012 14:40:44 +0200 From: Harald Schmalzbauer <h.schmalzbauer@omnilan.de> To: freebsd-stable@freebsd.org Subject: Possible to reset PCI device at boot? [Was: Re: msi-x enabled igb works only if module loaded twice] Message-ID: <5086904C.3020409@omnilan.de> In-Reply-To: <50866839.5090204@omnilan.de> References: <50859F7F.2080308@omnilan.de> <5085A323.8030501@omnilan.de> <50866839.5090204@omnilan.de>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigEE634B028EB53CF4C392AB55 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable schrieb Harald Schmalzbauer am 23.10.2012 11:49 (localtime): > schrieb Harald Schmalzbauer am 22.10.2012 21:48 (localtime): >> schrieb Harald Schmalzbauer am 22.10.2012 21:33 (localtime): >>> Hello, >>> >>> when using igb as module, no packet is received. >>> If I send out anything, I see the packet with tcpdump, also the swit= ch >>> learns the MAC address, but nothing comes back in - total silenc, no >>> boradcasts, nothing. >>> If I unload the module and load it again, everything works as expecte= d! >>> No matter if I load it by 4th loader, or later, I always have tio unl= oad >>> first then load it again. >>> I'ts late here, I'll see tomorrow if things change when compieled int= o >>> kernel. > It doesn't matter if igb is loaded as module or compiled into kernel. > >>> Maby somebody has an idea what the source of the problem could be. >>> Please find atteched some info, the OS is 9-RC2-amd64 on ESXi5.1 and >>> nics are pci-passthrough. >> I found one possibly relevant difference: >> >> Non-Working state: dev.igb.0.link_irq: 0 >> Working state: dev.igb.0.link_irq: 2 > This is only true with msi-x!!! > If I disable mis-x, the problem itself vanishes. igb just works fine > from the initial loading (with dev.igb.0.link_irq=3D0!). > So dev.igb.0.link_irq is only relevant with msi-x. > But what makes me curious is why it also works mith mis-x enabled after= > the second kldload!?! =20 I think I found the root cause: When ESXi powers up the guest, the passthru-devices are intialized with: VMKPCIPassthru: 2565: BDF =3D 02:00.1 intrType =3D 2 numVectors: 1 intrType=3D2 seems to mean MSI. I guess, IOMMUIntel is instructed to remap one irq-vector for the device. But igb uses MSI-X and wants 3 vectors. If I unload if_igb and reload again, the ESXi-log shows the following: VMKPCIPassthru: 2565: BDF =3D 02:00.1 intrType =3D 4 numVectors: 3 intrType=3D4 seems to mean MSI-X. After that initialization, if_igb works fine and saves 25kIRQ/s! I haven't found a way to change the power-up behaviour for the guest with ESXi. Is it possible to re-init a pci device from userland? Thanks, -Harry --------------enigEE634B028EB53CF4C392AB55 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAlCGkEwACgkQLDqVQ9VXb8hw1QCaAwgB2JrUv1VbvfkC+Wk1HpIc YDQAoMuhBJqde3gHrF8prBxmSK3o2C31 =8FRZ -----END PGP SIGNATURE----- --------------enigEE634B028EB53CF4C392AB55--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5086904C.3020409>