From owner-svn-src-all@freebsd.org Mon Jan 30 16:19:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C31DCC8B0D; Mon, 30 Jan 2017 16:19:07 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F78BEA8; Mon, 30 Jan 2017 16:19:06 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-248-244.albq.qwest.net [67.0.248.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 0337C1928BA; Mon, 30 Jan 2017 16:18:59 +0000 (UTC) Subject: Re: svn commit: r312755 - head/sys/net To: John Baldwin References: <201701251437.v0PEb5D7047773@repo.freebsd.org> <6817684.C985jk9qCN@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Matthew Macy From: Sean Bruno Message-ID: Date: Mon, 30 Jan 2017 09:18:56 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <6817684.C985jk9qCN@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HFqjPIwvv10aPjluuAjqto8MMfcn16jEE" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2017 16:19:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HFqjPIwvv10aPjluuAjqto8MMfcn16jEE Content-Type: multipart/mixed; boundary="42evHKNlMPM6UtKtjBbTOdhvqFOqofU90"; protected-headers="v1" From: Sean Bruno To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Matthew Macy Message-ID: 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--