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)
Nov 20 2024, 1:26 PM
Unknown Object (File)
Sep 27 2024, 7:25 PM
Unknown Object (File)
Sep 27 2024, 12:58 PM
Unknown Object (File)
Sep 17 2024, 12:21 AM
Unknown Object (File)
Sep 15 2024, 6:30 PM
Unknown Object (File)
Sep 14 2024, 6:10 PM
Unknown Object (File)
Sep 14 2024, 6:10 PM
Unknown Object (File)
Sep 14 2024, 6:10 PM
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.