Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vioscsi] Extend VioScsiReadRegistryParameter() #1216

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

benyamin-codez
Copy link
Contributor

Adds capability to do per-HBA registry reads.

This permits, e.g. PhysicalBreaks_001, PhysicalBreaks_002, etc.
This is an alternative to \Parameters\Device(d) by instead using the format \Parameters\Device\Valuename_123.

Includes FIXME NOTE regarding StorPortGetSystemPortNumber().
StorPortGetSystemPortNumber() should return ...
...before HBA-specific registry reads can successfully use \Parameters\Device(d).

Coincidentally updated the following in VioScsiFindAdapter():
adaptExt->dump_mode (new tracing)
adaptExt->hba_id (new tracing and new definition)

The HBA ID that determines the "123" in Valuename_123 of ...
...the registry path \Parameters\Device\Valuename_123 is the HBA slot number minus 1.

Adds capability to do per HBA registry reads.
This permits, e.g. PhysicalBreaks_001, PhysicalBreaks_002, etc. as
an alternative to \Parameters\Device(d) by instead using the
format \Parameters\Device\Valuename_123.
Includes FIXME NOTE regarding StorPortGetSystemPortNumber().
StorPortGetSystemPortNumber() should return before HBA-specific
registry reads can successfully use \Parameters\Device(d).

Coincidentally updated the following in VioScsiFindAdapter():
adaptExt->dump_mode (new tracing)
adaptExt->hba_id (new tracing and new definition)

The HBA ID that determines the "123" in Valuename_123 of the registry
path \Parameters\Device\Valuename_123 is the HBA slot number minus 1.

Signed-off-by: benyamin-codez <[email protected]>
@benyamin-codez
Copy link
Contributor Author

If anyone knows how to get StorPortGetSystemPortNumber() working, that would be helpful...

As we're using a SAS BusType, we might need to set the adaptExt->wwn, port_wwn and port_idx before calling it...
Or some other technique...
See the FIXME NOTE in the commit for more hints...

@benyamin-codez
Copy link
Contributor Author

@vrozenfe

I was minded to think how this PR might be of benefit to the Jira issue you previously mentioned.

Firstly, the issue mentions enabling SG_IO. You can probably speak best as to whether or not this would still work, as vioscsi is largely a StorPort miniport driver now. It's also possible the fault lies in how the IO was produced.

Anyway, as for this PR it would mean such disks could co-exist with disks of a variety of backing characteristics because each HBA could have it's own NOPB and MaximumTransferLength.

The solution that I imagined, would require a PR for new NOPB calculations, like the one I mentioned here.
This will expose adaptExt->scsi_config.seg_max, which is populated with data reported by QEMU.
FYI, I intend on raising a PR for this soon.

The final part of the solution would be a PR for QEMU to set scsiconf->seg_max to the correct value based on backing device characteristics. These are noteworthy mentions as to how this currently works:
https://github.com/qemu/qemu/blob/ea9cdbcf3a0b8d5497cddf87990f1b39d8f3bb0a/hw/scsi/virtio-scsi.c#L893-L894
https://github.com/qemu/qemu/blob/ea9cdbcf3a0b8d5497cddf87990f1b39d8f3bb0a/hw/scsi/virtio-scsi.c#L1292-L1295

There's probably other ways to do it too - perhaps even solely on the driver side via VPD - but I believe this would require a HBA restart with new parameters rather than single init during FindAdapter().

Best regards,
Ben

Addendum to 100af3e.

1. Removed references to obsoleted RUN_MIN_CHECKED definition (PR virtio-win#1228).
2. Add comment to conditionally excluded variable.

Signed-off-by: benyamin-codez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant