Page MenuHomeFreeBSD

pvscsi: maximum target number is one less than number of targets
ClosedPublic

Authored by yuripv on Apr 28 2023, 11:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 10:23 AM
Unknown Object (File)
Mar 7 2024, 8:20 AM
Unknown Object (File)
Mar 7 2024, 7:28 AM
Unknown Object (File)
Mar 7 2024, 6:26 AM
Unknown Object (File)
Dec 26 2023, 7:53 AM
Unknown Object (File)
Dec 20 2023, 7:45 AM
Unknown Object (File)
Dec 20 2023, 7:45 AM
Unknown Object (File)
Nov 29 2023, 9:49 AM
Subscribers

Details

Summary

Fix the number of targets we inquiry to be one less than the maximum
number of targets adapter reports. This gets rid of the errors reported
on VMware Workstation (below) and still allows the target 64 to be
found correctly on VMware ESXi.

As a side note, getting 65 on VMware Workstation still does not look
correct as the GUI allows only 16 targets per adapter (those are created
automatically in WS when assigning the target).

While here, print the maximum number of targets.

kernel: (probe36:pvscsi0:0:65:0): INQUIRY. CDB: 12 00 00 00 24 00
kernel: (probe36:pvscsi0:0:65:0): CAM status: CCB request completed with an error
kernel: (probe36:pvscsi0:0:65:0): Retrying command, 3 more tries remain
kernel: (probe36:pvscsi0:0:65:0): INQUIRY. CDB: 12 00 00 00 24 00
kernel: (probe36:pvscsi0:0:65:0): CAM status: CCB request completed with an error
kernel: (probe36:pvscsi0:0:65:0): Retrying command, 2 more tries remain
kernel: (probe36:pvscsi0:0:65:0): INQUIRY. CDB: 12 00 00 00 24 00
kernel: (probe36:pvscsi0:0:65:0): CAM status: CCB request completed with an error
kernel: (probe36:pvscsi0:0:65:0): Retrying command, 1 more tries remain
kernel: (probe36:pvscsi0:0:65:0): INQUIRY. CDB: 12 00 00 00 24 00
kernel: (probe36:pvscsi0:0:65:0): CAM status: CCB request completed with an error
kernel: (probe36:pvscsi0:0:65:0): Retrying command, 0 more tries remain
kernel: (probe36:pvscsi0:0:65:0): INQUIRY. CDB: 12 00 00 00 24 00
kernel: (probe36:pvscsi0:0:65:0): CAM status: CCB request completed with an error
kernel: (probe36:pvscsi0:0:65:0): Error 5, Retries exhausted
Test Plan
  • boot on vmware workstation, check that there are no errors reported and targets are found
  • boot on vmware esxi with a target assigned to SCSI(0:64) (the highest possible via UI), check that target is found

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Is it better to fix it here, or where sc->max_targets is set? What's the source of this number, and how did it come to be off by one? And does vmware do it wrong consistently? Or is this nothing more than the 'number of targets' vs 'maximum target because we start at 0' issue other SIMs cope with?

In D39867#907602, @imp wrote:

Is it better to fix it here, or where sc->max_targets is set? What's the source of this number, and how did it come to be off by one? And does vmware do it wrong consistently? Or is this nothing more than the 'number of targets' vs 'maximum target because we start at 0' issue other SIMs cope with?

The number is correct, pvscsi on ESXi provides 65 targets (64 disks and one reserved) numbered 0-64. What we do at the moment with cpi->max_target set to 65 is inquiry targets 0-65, which triggers an error for target 65 on VMware Workstation.

Or is this nothing more than the 'number of targets' vs 'maximum target because we start at 0' issue other SIMs cope with?

If my understanding above is correct, this.

About my note:

As a side note, getting 65 on VMware Workstation still does not look
correct as the GUI allows only 16 targets per adapter (those are created
automatically in WS when assigning the target).

I just checked that editing the .vmx file and using target 64 on VMware WS works as expected, so it's only their GUI that limits it. In any case, with this change target 64 is found on both ESXi and Workstation (it was the case previously as well), and no more noise on Workstation.

Warner, are you OK with the explanation above?

With the explanation, this is the right fix. Thanks for answering my questions about it.

This revision is now accepted and ready to land.May 4 2023, 4:27 PM