Page MenuHomeFreeBSD

Fix nda(4) PCIe link status output
ClosedPublic

Authored by chuck on May 17 2019, 12:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 6:29 PM
Unknown Object (File)
Jan 29 2024, 9:21 PM
Unknown Object (File)
Dec 20 2023, 12:26 AM
Unknown Object (File)
Dec 6 2023, 6:11 AM
Unknown Object (File)
Nov 27 2023, 10:58 PM
Unknown Object (File)
Nov 27 2023, 3:28 PM
Unknown Object (File)
Nov 25 2023, 11:37 AM
Unknown Object (File)
Nov 25 2023, 11:37 AM
Subscribers
None

Details

Summary

Differentiate between PCI Express Endpoint devices and Root Complex Integrated Endpoints in the nda driver. The Link Status and Capability registers are not valid for Integrated Endpoints and should not be displayed. The bhyve emulated NVMe device will advertise as being an Integrated Endpoint.

Note this fix is dependent on D19904

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks good. The multiple printfs give me heart-burn, but that's for another day. This part of the code they should be safe, but they aren't safe in a future where we do device discovery in parallel.

This revision is now accepted and ready to land.May 17 2019, 2:21 PM
In D20282#437333, @imp wrote:

This looks good. The multiple printfs give me heart-burn, but that's for another day. This part of the code they should be safe, but they aren't safe in a future where we do device discovery in parallel.

It would be easy to turn this into a series of snprintfs() and then a single printf(). Would that clear the heartburn?

In D20282#437333, @imp wrote:

This looks good. The multiple printfs give me heart-burn, but that's for another day. This part of the code they should be safe, but they aren't safe in a future where we do device discovery in parallel.

It would be easy to turn this into a series of snprintfs() and then a single printf(). Would that clear the heartburn?

Yes, I think that would be better. The unfortunate thing is that multiple printfs often end up interleaved in the logs. A single printf should be done in one contiguous chunk.

At some point we should also implement the announce_sbuf() transport function for NVMe.

Convert to using sbuf to avoid log messages from being interleaved once the discovery is done in parallel

This revision now requires review to proceed.May 18 2019, 2:47 AM

thanks for going the extra mile and fixing the printf thing too.

This revision is now accepted and ready to land.May 19 2019, 9:18 PM
This revision was automatically updated to reflect the committed changes.