svn commit: r312755 - head/sys/net

Sean Bruno sbruno at freebsd.org
Mon Jan 30 16:19:07 UTC 2017



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 returns
>>   success and a good value.  Only then try to use it and set the MSIX_ENABLE
>>   bit.
>>   
>>   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 assumed
>>   value, which meant we ended up writing to PCI register 2 (PCI_DEVICE_ID)
>>   which is read-only.
> 
> Why is this writing directly to the MSIX registers at all?  pci_alloc_msix()
> etc. handle those registers for all other drivers and proper suspend/resume
> depends on drivers using the existing PCI API for managing MSI and MSI-X.
> 

The comment above this code block explains what's up.  Basically,
virtualized environments are sometimes "lazy" about correct register setup.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 618 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20170130/d7cfb712/attachment.sig>


More information about the svn-src-all mailing list