timberland-sig/edk2

Missing records in the Discovery Descriptor List

Opened this issue · 2 comments

Tested with #33 applied on top of the timberland_upstream-dev-full branch.

Two HFIs:

  • 192.168.122.158
  • 192.168.123.158

Defined two boot attempts through HII:

  • HFI 1, 192.168.122.1:4420, nqn.2014-08.org.nvmexpress.discovery
  • HFI 2, 192.168.123.1:4420, nqn.2014-08.org.nvmexpress.discovery

Each port on the target exports four namespaces. EDK2 performs two discovery attempts as expected and generates NBFT with 8 SSNS records (four namespaces * 2 HFIs). So far so good.

However, examining the NBFT table, only one Discovery record is present:

    "discovery":[
      {
        "index":1,
        "hfi":1,
        "uri":"nvme+tcp://192.168.122.1:4420/",
        "nqn":"nqn.2014-08.org.nvmexpress.discovery"
      }
    ]

Futhermore, the first four SSNS records properly reference this Disovery Descriptor, the other four records do not. The SSNS Discovered Namespace Flag just follows the buggy behaviour, e.g.:

subsystem_ns_list[0]->index=1
subsystem_ns_list[0]->discovery->index=1
subsystem_ns_list[0]->num_hfis=1
subsystem_ns_list[0]->hfis[0]->index=1
subsystem_ns_list[0]->transport=tcp
subsystem_ns_list[0]->traddr=192.168.122.1
subsystem_ns_list[0]->trsvcid=4420
subsystem_ns_list[0]->subsys_port_id=0
subsystem_ns_list[0]->nsid=123
subsystem_ns_list[0]->nid_type=3
subsystem_ns_list[0]->nid=d592cdf3ffffffff84123fcf7d99df27
subsystem_ns_list[0]->subsys_nqn=nqn.2014-08.org.nvmexpress.boot.poc:test-target
subsystem_ns_list[0]->pdu_header_digest_required=0
subsystem_ns_list[0]->data_digest_required=0
subsystem_ns_list[0]->controller_id=2
subsystem_ns_list[0]->asqsz=0
subsystem_ns_list[0]->dhcp_root_path_string=(null)
subsystem_ns_list[0]->discovered=1
subsystem_ns_list[0]->unavailable=0

subsystem_ns_list[4]->index=5
subsystem_ns_list[4]->num_hfis=1
subsystem_ns_list[4]->hfis[0]->index=2
subsystem_ns_list[4]->transport=tcp
subsystem_ns_list[4]->traddr=192.168.123.1
subsystem_ns_list[4]->trsvcid=4420
subsystem_ns_list[4]->subsys_port_id=0
subsystem_ns_list[4]->nsid=123
subsystem_ns_list[4]->nid_type=3
subsystem_ns_list[4]->nid=d592cdf3ffffffff84123fcf7d99df27
subsystem_ns_list[4]->subsys_nqn=nqn.2014-08.org.nvmexpress.boot.poc:test-target
subsystem_ns_list[4]->pdu_header_digest_required=0
subsystem_ns_list[4]->data_digest_required=0
subsystem_ns_list[4]->controller_id=3
subsystem_ns_list[4]->asqsz=0
subsystem_ns_list[4]->dhcp_root_path_string=(null)
subsystem_ns_list[4]->discovered=0
subsystem_ns_list[4]->unavailable=0

# nvme nbft show -o json
# libnvme/.build/test/nbft/nbft-dump

Some more tests (failure cases):

  1. wrong IP address set for the first boot attempt:
  • SSNS records from the discovery of the second boot attempt are present as expected
  • the Discovery Descriptor List is empty
  1. wrong IP address set for the second boot attempt:
  • SSNS records from the discovery of the first boot attempt are present as expected
  • fifth SSNS record present, for the second HFI, having a wrong subsys_nqn and controller_id (looks like these data were reused from the first HFI):
      {
        "index":5,
        "num_hfis":1,
        "hfis":[
          2
        ],
        "transport":"tcp",
        "traddr":"192.168.123.12",
        "trsvcid":"4420",
        "subsys_port_id":0,
        "nsid":0,
        "nid":"",
        "subsys_nqn":"nqn.2014-08.org.nvmexpress.boot.poc:test-target",
        "controller_id":17,
        "asqsz":0,
        "pdu_header_digest_required":0,
        "data_digest_required":0
      }

nvme_nbft_show_test2.json
libnvme_nbft-dump_test2.txt

  • corresponding Discovery record is present for the first boot attempt, the second is missng

Having correct addresses but tearing the NIC link down produces exactly the same results as wrong IP addresses with link up.