Date: Mon, 30 Jan 2017 09:18:56 -0700 From: Sean Bruno <sbruno@freebsd.org> To: John Baldwin <jhb@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Matthew Macy <mmacy@nextbsd.org> Subject: Re: svn commit: r312755 - head/sys/net Message-ID: <aa86cad1-7a3c-e0d9-ee26-edde528c112d@freebsd.org> In-Reply-To: <6817684.C985jk9qCN@ralph.baldwin.cx> References: <201701251437.v0PEb5D7047773@repo.freebsd.org> <6817684.C985jk9qCN@ralph.baldwin.cx>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HFqjPIwvv10aPjluuAjqto8MMfcn16jEE Content-Type: multipart/mixed; boundary="42evHKNlMPM6UtKtjBbTOdhvqFOqofU90"; protected-headers="v1" From: Sean Bruno <sbruno@freebsd.org> To: John Baldwin <jhb@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Matthew Macy <mmacy@nextbsd.org> Message-ID: <aa86cad1-7a3c-e0d9-ee26-edde528c112d@freebsd.org> Subject: Re: svn commit: r312755 - head/sys/net References: <201701251437.v0PEb5D7047773@repo.freebsd.org> <6817684.C985jk9qCN@ralph.baldwin.cx> In-Reply-To: <6817684.C985jk9qCN@ralph.baldwin.cx> --42evHKNlMPM6UtKtjBbTOdhvqFOqofU90 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 01/27/17 12:28, John Baldwin wrote: > On Wednesday, January 25, 2017 02:37:05 PM Sean Bruno wrote: >> Author: sbruno >> Date: Wed Jan 25 14:37:05 2017 >> New Revision: 312755 >> URL: https://svnweb.freebsd.org/changeset/base/312755 >> >> Log: >> Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is re= turns >> success and a good value. Only then try to use it and set the MSIX_= ENABLE >> bit. >> =20 >> With the current em(4) driver we have observed failures in this case= in a >> specific environment when pci_find_cap() would not return the assume= d >> value, which meant we ended up writing to PCI register 2 (PCI_DEVICE= _ID) >> which is read-only. >=20 > Why is this writing directly to the MSIX registers at all? pci_alloc_m= six() > etc. handle those registers for all other drivers and proper suspend/re= sume > depends on drivers using the existing PCI API for managing MSI and MSI-= X. >=20 The comment above this code block explains what's up. Basically, virtualized environments are sometimes "lazy" about correct register setu= p. If MSIX caps aren't set, try to enable them. If that fails, assume MSI. Later on the code does the proper pci_alloc_msix() calls in the proper sequence, IMO. sean --42evHKNlMPM6UtKtjBbTOdhvqFOqofU90-- --HFqjPIwvv10aPjluuAjqto8MMfcn16jEE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEuq1GMucSHejSCZfdEgHvyh5yfmQFAliPZ3BfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEJB QUQ0NjMyRTcxMjFERThEMjA5OTdERDEyMDFFRkNBMUU3MjdFNjQACgkQEgHvyh5y fmSI0gf/d+zpOy+MJvENkQhw88p52UOyAmubJbWsLifVwxlRpUv89t+rAHM54rKF kE8Vx1045CZCmU1jEiajrW9DOSnmZZvWAjjI3jWqK4TYNL1AFRayhKZwzpG4x41k e/2rCgy3NhpZWK7rRkDRy7Qqb7DtU+BvZCcIpp4uqb1bMdbCNiFhYkzgRr4SgNje YHuSBmD9CIfCJQnbj9p+rDs6t26iyCIViCppZzEaJpnk1BivyYOrR3mOZVj3b8Wi 2tkEKF1PZRakF5tT8dpuwRgglppxYaUImect8yT+uwCkqlVHDz2CtEkQvPLzc8Cl oTKz9fCVOZ2oMNz5Oz3qBFeLWLVhFA== =lj4B -----END PGP SIGNATURE----- --HFqjPIwvv10aPjluuAjqto8MMfcn16jEE--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aa86cad1-7a3c-e0d9-ee26-edde528c112d>