spdk / spdk

Storage Performance Development Kit
https://spdk.io/
Other
3.02k stars 1.19k forks source link

Set command Dword 11 to 1 for getting NVMe-oF reservation report #3478

Open shbhmbhrgv opened 1 month ago

shbhmbhrgv commented 1 month ago

Sighting report

As per the NVME specs, NVMe over Fabrics implementations use 128-bit Host identifier. For getting the reservation report, we need to set Command Dword 11 to 1 in case of 128 bit Host identifiers(see here). Currently this is not set to 1, see code here.

Expected Behavior

Command Dword 11 should be set to 1 in case the Host identifier is 128 bit.

Current Behavior

Since command dword 11 is set to 0 right now and Host identifier used is 128 bit, fetching the reservation report returns Host Identifier inconsistent format. As per the specs: "If a 128-bit Host Identifier has been specified and the Extended Data Structure bit is cleared to ‘0’ in Command Dword 11, then the controller shall abort the command with the status code of Host Identifier Inconsistent Format."

Possible Solution

Set the bit to 1 here if the Host identifier is 128 bit.

Steps to Reproduce

(There isn't any existing example for this, I wrote code on top of initiator to test this)

  1. Start NVME-oF target
  2. From the initiator side, establish connection to that target
  3. Get reservation report - returns an error

Context (Environment including OS version, SPDK version, etc.)

Using SPDK commit: d005e023bd514d7d48470775331498120af1a8d8

jimharris commented 1 month ago

Hi @shbhmbhrgv, would you like to push a patch to fix this issue?

shbhmbhrgv commented 1 month ago

@jimharris For the solution: do we need to just set the bit here? How do we know if we are using 64 bit or 128 bit host identifier?

shbhmbhrgv commented 1 month ago

@jimharris any updates?