diff --git a/ci/unit/required_packages.sh b/ci/unit/required_packages.sh index 07588d89935..ff5e3f98d14 100755 --- a/ci/unit/required_packages.sh +++ b/ci/unit/required_packages.sh @@ -26,6 +26,7 @@ pkgs="argobots \ numactl-devel \ openmpi$OPENMPI_VER \ patchelf \ + pciutils-devel \ pmix \ protobuf-c \ spdk-devel \ diff --git a/debian/changelog b/debian/changelog index 24e6db8edc2..fb08d568cbd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +daos (2.6.0-5) unstable; urgency=medium + [ Tom Nabarro ] + * Add pciutils runtime dep for daos_server lspci call + * Add libpci-dev build dep for pciutils CGO bindings + + -- Tom Nabarro > Thu, 08 Aug 2024 12:00:00 -0000 + daos (2.6.0-4) unstable; urgency=medium [ Jerome Soumagne ] * Bump mercury version to 2.4.0rc4 diff --git a/debian/control b/debian/control index 769464e2ed1..bdc377e6d94 100644 --- a/debian/control +++ b/debian/control @@ -33,7 +33,8 @@ Build-Depends: debhelper (>= 10), python3-tabulate, liblz4-dev, libaio-dev, - libcapstone-dev + libcapstone-dev, + libpci-dev Standards-Version: 4.1.2 Homepage: https://docs.daos.io/ Vcs-Git: https://github.com/daos-stack/daos.git @@ -171,7 +172,7 @@ Package: daos-server Section: net Architecture: any Multi-Arch: same -Depends: ${shlibs:Depends}, ${misc:Depends}, openmpi-bin, +Depends: ${shlibs:Depends}, ${misc:Depends}, openmpi-bin, pciutils, ipmctl (>=03.00.00.0468), libfabric (>= 1.15.1-1), spdk-tools (>= 22.01.2) Description: The Distributed Asynchronous Object Storage (DAOS) is an open-source software-defined object store designed from the ground up for diff --git a/docs/admin/administration.md b/docs/admin/administration.md index 8ccf530c374..444e4ff7674 100644 --- a/docs/admin/administration.md +++ b/docs/admin/administration.md @@ -578,7 +578,7 @@ The engine's NVMe config (produced during format) then contains the following JSON to apply the criteria: ```json -[tanabarr@wolf-310 ~]$ cat /mnt/daos0/daos_nvme.conf +cat /mnt/daos0/daos_nvme.conf { "daos_data": { "config": [ diff --git a/src/bio/bio_device.c b/src/bio/bio_device.c index f9ec343eaf7..b5b49190065 100644 --- a/src/bio/bio_device.c +++ b/src/bio/bio_device.c @@ -382,6 +382,7 @@ struct pci_dev_opts { bool finished; int *socket_id; char **pci_type; + char **pci_cfg; int status; }; @@ -391,6 +392,7 @@ pci_device_cb(void *ctx, struct spdk_pci_device *pci_device) struct pci_dev_opts *opts = ctx; const char *device_type; int len; + int rc; if (opts->status != 0) return; @@ -422,6 +424,13 @@ pci_device_cb(void *ctx, struct spdk_pci_device *pci_device) opts->status = -DER_NOMEM; return; } + + rc = spdk_pci_device_cfg_read(pci_device, *opts->pci_cfg, NVME_PCI_CFG_SPC_MAX_LEN, 0); + if (rc != 0) { + D_ERROR("Failed to read config space of device (%s)\n", spdk_strerror(-rc)); + opts->status = -DER_INVAL; + return; + } } static int @@ -443,6 +452,7 @@ fetch_pci_dev_info(struct nvme_ctrlr_t *w_ctrlr, const char *tr_addr) opts.pci_addr = pci_addr; opts.socket_id = &w_ctrlr->socket_id; opts.pci_type = &w_ctrlr->pci_type; + opts.pci_cfg = &w_ctrlr->pci_cfg; spdk_pci_for_each_device(&opts, pci_device_cb); @@ -485,6 +495,10 @@ alloc_ctrlr_info(uuid_t dev_id, char *dev_name, struct bio_dev_info *b_info) if (b_info->bdi_ctrlr->nss == NULL) return -DER_NOMEM; + D_ALLOC(b_info->bdi_ctrlr->pci_cfg, NVME_PCI_CFG_SPC_MAX_LEN); + if (b_info->bdi_ctrlr->pci_cfg == NULL) + return -DER_NOMEM; + /* Namespace capacity by direct query of SPDK bdev object */ blk_sz = spdk_bdev_get_block_size(bdev); nr_blks = spdk_bdev_get_num_blocks(bdev); @@ -497,13 +511,8 @@ alloc_ctrlr_info(uuid_t dev_id, char *dev_name, struct bio_dev_info *b_info) return rc; } - /* Fetch socket ID and PCI device type by enumerating spdk_pci_device list */ - rc = fetch_pci_dev_info(b_info->bdi_ctrlr, b_info->bdi_traddr); - if (rc != 0) { - return rc; - } - - return 0; + /* Fetch PCI details by enumerating spdk_pci_device list */ + return fetch_pci_dev_info(b_info->bdi_ctrlr, b_info->bdi_traddr); } int diff --git a/src/bio/smd.pb-c.c b/src/bio/smd.pb-c.c index de49e886e19..720c0caa029 100644 --- a/src/bio/smd.pb-c.c +++ b/src/bio/smd.pb-c.c @@ -827,616 +827,369 @@ const ProtobufCMessageDescriptor ctl__bio_health_req__descriptor = (ProtobufCMessageInit) ctl__bio_health_req__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor ctl__bio_health_resp__field_descriptors[45] = -{ - { - "timestamp", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, timestamp), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "warn_temp_time", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, warn_temp_time), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "crit_temp_time", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, crit_temp_time), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ctrl_busy_time", - 7, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, ctrl_busy_time), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "power_cycles", - 8, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, power_cycles), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "power_on_hours", - 9, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, power_on_hours), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "unsafe_shutdowns", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, unsafe_shutdowns), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "media_errs", - 11, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, media_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "err_log_entries", - 12, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, err_log_entries), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bio_read_errs", - 13, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, bio_read_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bio_write_errs", - 14, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, bio_write_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bio_unmap_errs", - 15, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, bio_unmap_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "checksum_errs", - 16, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, checksum_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "temperature", - 17, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, temperature), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "temp_warn", - 18, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, temp_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "avail_spare_warn", - 19, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, avail_spare_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dev_reliability_warn", - 20, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, dev_reliability_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "read_only_warn", - 21, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, read_only_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "volatile_mem_warn", - 22, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, volatile_mem_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "status", - 23, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dev_uuid", - 24, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, dev_uuid), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "total_bytes", - 25, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, total_bytes), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "avail_bytes", - 26, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, avail_bytes), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "program_fail_cnt_norm", - 27, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, program_fail_cnt_norm), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "program_fail_cnt_raw", - 28, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, program_fail_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "erase_fail_cnt_norm", - 29, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, erase_fail_cnt_norm), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "erase_fail_cnt_raw", - 30, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, erase_fail_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_norm", - 31, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_norm), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_min", - 32, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_min), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_max", - 33, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_max), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_avg", - 34, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_avg), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "endtoend_err_cnt_raw", - 35, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, endtoend_err_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "crc_err_cnt_raw", - 36, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, crc_err_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "media_wear_raw", - 37, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, media_wear_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "host_reads_raw", - 38, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, host_reads_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "workload_timer_raw", - 39, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, workload_timer_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "thermal_throttle_status", - 40, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, thermal_throttle_status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "thermal_throttle_event_cnt", - 41, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, thermal_throttle_event_cnt), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "retry_buffer_overflow_cnt", - 42, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, retry_buffer_overflow_cnt), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pll_lock_loss_cnt", - 43, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, pll_lock_loss_cnt), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "nand_bytes_written", - 44, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, nand_bytes_written), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "host_bytes_written", - 45, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, host_bytes_written), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "cluster_size", - 46, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, cluster_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "meta_wal_size", - 47, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, meta_wal_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rdb_wal_size", - 48, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, rdb_wal_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor ctl__bio_health_resp__field_descriptors[50] = { + { + "timestamp", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, timestamp), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "warn_temp_time", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, warn_temp_time), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "crit_temp_time", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, crit_temp_time), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "ctrl_busy_time", 7, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, ctrl_busy_time), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "power_cycles", 8, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, power_cycles), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "power_on_hours", 9, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, power_on_hours), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "unsafe_shutdowns", 10, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, unsafe_shutdowns), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "media_errs", 11, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, media_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "err_log_entries", 12, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, err_log_entries), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "bio_read_errs", 13, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, bio_read_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "bio_write_errs", 14, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, bio_write_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "bio_unmap_errs", 15, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, bio_unmap_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "checksum_errs", 16, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, checksum_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "temperature", 17, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, temperature), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "temp_warn", 18, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, temp_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "avail_spare_warn", 19, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, avail_spare_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "dev_reliability_warn", 20, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, dev_reliability_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "read_only_warn", 21, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, read_only_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "volatile_mem_warn", 22, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, volatile_mem_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "status", 23, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "dev_uuid", 24, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, dev_uuid), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "total_bytes", 25, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, total_bytes), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "avail_bytes", 26, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, avail_bytes), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "program_fail_cnt_norm", 27, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, program_fail_cnt_norm), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "program_fail_cnt_raw", 28, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, program_fail_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "erase_fail_cnt_norm", 29, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, erase_fail_cnt_norm), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "erase_fail_cnt_raw", 30, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, erase_fail_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_norm", 31, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_norm), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_min", 32, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_min), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_max", 33, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_max), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_avg", 34, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_avg), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "endtoend_err_cnt_raw", 35, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, endtoend_err_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "crc_err_cnt_raw", 36, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, crc_err_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "media_wear_raw", 37, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, media_wear_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "host_reads_raw", 38, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, host_reads_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "workload_timer_raw", 39, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, workload_timer_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "thermal_throttle_status", 40, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, thermal_throttle_status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "thermal_throttle_event_cnt", 41, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, thermal_throttle_event_cnt), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "retry_buffer_overflow_cnt", 42, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, retry_buffer_overflow_cnt), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pll_lock_loss_cnt", 43, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, pll_lock_loss_cnt), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "nand_bytes_written", 44, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, nand_bytes_written), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "host_bytes_written", 45, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, host_bytes_written), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "cluster_size", 46, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, cluster_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "meta_wal_size", 47, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, meta_wal_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rdb_wal_size", 48, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, rdb_wal_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_port_id", 49, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_port_id), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_max_speed", 50, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_FLOAT, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_max_speed), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_max_width", 51, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_max_width), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_neg_speed", 52, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_FLOAT, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_neg_speed), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_neg_width", 53, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_neg_width), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned ctl__bio_health_resp__field_indices_by_name[] = { - 22, /* field[22] = avail_bytes */ - 15, /* field[15] = avail_spare_warn */ - 9, /* field[9] = bio_read_errs */ - 11, /* field[11] = bio_unmap_errs */ - 10, /* field[10] = bio_write_errs */ - 12, /* field[12] = checksum_errs */ - 42, /* field[42] = cluster_size */ - 32, /* field[32] = crc_err_cnt_raw */ - 2, /* field[2] = crit_temp_time */ - 3, /* field[3] = ctrl_busy_time */ - 16, /* field[16] = dev_reliability_warn */ - 20, /* field[20] = dev_uuid */ - 31, /* field[31] = endtoend_err_cnt_raw */ - 25, /* field[25] = erase_fail_cnt_norm */ - 26, /* field[26] = erase_fail_cnt_raw */ - 8, /* field[8] = err_log_entries */ - 41, /* field[41] = host_bytes_written */ - 34, /* field[34] = host_reads_raw */ - 7, /* field[7] = media_errs */ - 33, /* field[33] = media_wear_raw */ - 43, /* field[43] = meta_wal_size */ - 40, /* field[40] = nand_bytes_written */ - 39, /* field[39] = pll_lock_loss_cnt */ - 4, /* field[4] = power_cycles */ - 5, /* field[5] = power_on_hours */ - 23, /* field[23] = program_fail_cnt_norm */ - 24, /* field[24] = program_fail_cnt_raw */ - 44, /* field[44] = rdb_wal_size */ - 17, /* field[17] = read_only_warn */ - 38, /* field[38] = retry_buffer_overflow_cnt */ - 19, /* field[19] = status */ - 14, /* field[14] = temp_warn */ - 13, /* field[13] = temperature */ - 37, /* field[37] = thermal_throttle_event_cnt */ - 36, /* field[36] = thermal_throttle_status */ - 0, /* field[0] = timestamp */ - 21, /* field[21] = total_bytes */ - 6, /* field[6] = unsafe_shutdowns */ - 18, /* field[18] = volatile_mem_warn */ - 1, /* field[1] = warn_temp_time */ - 30, /* field[30] = wear_leveling_cnt_avg */ - 29, /* field[29] = wear_leveling_cnt_max */ - 28, /* field[28] = wear_leveling_cnt_min */ - 27, /* field[27] = wear_leveling_cnt_norm */ - 35, /* field[35] = workload_timer_raw */ -}; -static const ProtobufCIntRange ctl__bio_health_resp__number_ranges[2 + 1] = -{ - { 3, 0 }, - { 5, 1 }, - { 0, 45 } -}; -const ProtobufCMessageDescriptor ctl__bio_health_resp__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ctl.BioHealthResp", - "BioHealthResp", - "Ctl__BioHealthResp", - "ctl", - sizeof(Ctl__BioHealthResp), - 45, - ctl__bio_health_resp__field_descriptors, - ctl__bio_health_resp__field_indices_by_name, - 2, ctl__bio_health_resp__number_ranges, - (ProtobufCMessageInit) ctl__bio_health_resp__init, - NULL,NULL,NULL /* reserved[123] */ + 22, /* field[22] = avail_bytes */ + 15, /* field[15] = avail_spare_warn */ + 9, /* field[9] = bio_read_errs */ + 11, /* field[11] = bio_unmap_errs */ + 10, /* field[10] = bio_write_errs */ + 12, /* field[12] = checksum_errs */ + 42, /* field[42] = cluster_size */ + 32, /* field[32] = crc_err_cnt_raw */ + 2, /* field[2] = crit_temp_time */ + 3, /* field[3] = ctrl_busy_time */ + 16, /* field[16] = dev_reliability_warn */ + 20, /* field[20] = dev_uuid */ + 31, /* field[31] = endtoend_err_cnt_raw */ + 25, /* field[25] = erase_fail_cnt_norm */ + 26, /* field[26] = erase_fail_cnt_raw */ + 8, /* field[8] = err_log_entries */ + 41, /* field[41] = host_bytes_written */ + 34, /* field[34] = host_reads_raw */ + 46, /* field[46] = link_max_speed */ + 47, /* field[47] = link_max_width */ + 48, /* field[48] = link_neg_speed */ + 49, /* field[49] = link_neg_width */ + 45, /* field[45] = link_port_id */ + 7, /* field[7] = media_errs */ + 33, /* field[33] = media_wear_raw */ + 43, /* field[43] = meta_wal_size */ + 40, /* field[40] = nand_bytes_written */ + 39, /* field[39] = pll_lock_loss_cnt */ + 4, /* field[4] = power_cycles */ + 5, /* field[5] = power_on_hours */ + 23, /* field[23] = program_fail_cnt_norm */ + 24, /* field[24] = program_fail_cnt_raw */ + 44, /* field[44] = rdb_wal_size */ + 17, /* field[17] = read_only_warn */ + 38, /* field[38] = retry_buffer_overflow_cnt */ + 19, /* field[19] = status */ + 14, /* field[14] = temp_warn */ + 13, /* field[13] = temperature */ + 37, /* field[37] = thermal_throttle_event_cnt */ + 36, /* field[36] = thermal_throttle_status */ + 0, /* field[0] = timestamp */ + 21, /* field[21] = total_bytes */ + 6, /* field[6] = unsafe_shutdowns */ + 18, /* field[18] = volatile_mem_warn */ + 1, /* field[1] = warn_temp_time */ + 30, /* field[30] = wear_leveling_cnt_avg */ + 29, /* field[29] = wear_leveling_cnt_max */ + 28, /* field[28] = wear_leveling_cnt_min */ + 27, /* field[27] = wear_leveling_cnt_norm */ + 35, /* field[35] = workload_timer_raw */ +}; +static const ProtobufCIntRange ctl__bio_health_resp__number_ranges[2 + 1] = { + {3, 0}, {5, 1}, {0, 50}}; +const ProtobufCMessageDescriptor ctl__bio_health_resp__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ctl.BioHealthResp", + "BioHealthResp", + "Ctl__BioHealthResp", + "ctl", + sizeof(Ctl__BioHealthResp), + 50, + ctl__bio_health_resp__field_descriptors, + ctl__bio_health_resp__field_indices_by_name, + 2, + ctl__bio_health_resp__number_ranges, + (ProtobufCMessageInit)ctl__bio_health_resp__init, + NULL, + NULL, + NULL /* reserved[123] */ }; static const ProtobufCFieldDescriptor ctl__nvme_controller__namespace__field_descriptors[3] = { @@ -1502,186 +1255,111 @@ const ProtobufCMessageDescriptor ctl__nvme_controller__namespace__descriptor = (ProtobufCMessageInit) ctl__nvme_controller__namespace__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor ctl__nvme_controller__field_descriptors[12] = -{ - { - "model", +static const ProtobufCFieldDescriptor ctl__nvme_controller__field_descriptors[13] = { + { + "model", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, model), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "serial", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, serial), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pci_addr", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, pci_addr), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "fw_rev", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, fw_rev), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "socket_id", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, socket_id), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "health_stats", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, health_stats), &ctl__bio_health_resp__descriptor, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "namespaces", 7, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Ctl__NvmeController, n_namespaces), offsetof(Ctl__NvmeController, namespaces), + &ctl__nvme_controller__namespace__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "smd_devices", 8, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Ctl__NvmeController, n_smd_devices), offsetof(Ctl__NvmeController, smd_devices), + &ctl__smd_device__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "dev_state", 9, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, dev_state), &ctl__nvme_dev_state__descriptor, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "led_state", 10, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, led_state), &ctl__led_state__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pci_dev_type", 11, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, pci_dev_type), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "vendor_id", 12, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, vendor_id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pci_cfg", 13, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, pci_cfg), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned ctl__nvme_controller__field_indices_by_name[] = { + 8, /* field[8] = dev_state */ + 3, /* field[3] = fw_rev */ + 5, /* field[5] = health_stats */ + 9, /* field[9] = led_state */ + 0, /* field[0] = model */ + 6, /* field[6] = namespaces */ + 2, /* field[2] = pci_addr */ + 12, /* field[12] = pci_cfg */ + 10, /* field[10] = pci_dev_type */ + 1, /* field[1] = serial */ + 7, /* field[7] = smd_devices */ + 4, /* field[4] = socket_id */ + 11, /* field[11] = vendor_id */ +}; +static const ProtobufCIntRange ctl__nvme_controller__number_ranges[1 + 1] = {{1, 0}, {0, 13}}; +const ProtobufCMessageDescriptor ctl__nvme_controller__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ctl.NvmeController", + "NvmeController", + "Ctl__NvmeController", + "ctl", + sizeof(Ctl__NvmeController), + 13, + ctl__nvme_controller__field_descriptors, + ctl__nvme_controller__field_indices_by_name, 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, model), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "serial", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, serial), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pci_addr", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, pci_addr), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "fw_rev", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, fw_rev), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "socket_id", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, socket_id), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "health_stats", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, health_stats), - &ctl__bio_health_resp__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "namespaces", - 7, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Ctl__NvmeController, n_namespaces), - offsetof(Ctl__NvmeController, namespaces), - &ctl__nvme_controller__namespace__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "smd_devices", - 8, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Ctl__NvmeController, n_smd_devices), - offsetof(Ctl__NvmeController, smd_devices), - &ctl__smd_device__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dev_state", - 9, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, dev_state), - &ctl__nvme_dev_state__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "led_state", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, led_state), - &ctl__led_state__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pci_dev_type", - 11, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, pci_dev_type), + ctl__nvme_controller__number_ranges, + (ProtobufCMessageInit)ctl__nvme_controller__init, NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "vendor_id", - 12, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, vendor_id), NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned ctl__nvme_controller__field_indices_by_name[] = { - 8, /* field[8] = dev_state */ - 3, /* field[3] = fw_rev */ - 5, /* field[5] = health_stats */ - 9, /* field[9] = led_state */ - 0, /* field[0] = model */ - 6, /* field[6] = namespaces */ - 2, /* field[2] = pci_addr */ - 10, /* field[10] = pci_dev_type */ - 1, /* field[1] = serial */ - 7, /* field[7] = smd_devices */ - 4, /* field[4] = socket_id */ - 11, /* field[11] = vendor_id */ -}; -static const ProtobufCIntRange ctl__nvme_controller__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 12 } -}; -const ProtobufCMessageDescriptor ctl__nvme_controller__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ctl.NvmeController", - "NvmeController", - "Ctl__NvmeController", - "ctl", - sizeof(Ctl__NvmeController), - 12, - ctl__nvme_controller__field_descriptors, - ctl__nvme_controller__field_indices_by_name, - 1, ctl__nvme_controller__number_ranges, - (ProtobufCMessageInit) ctl__nvme_controller__init, - NULL,NULL,NULL /* reserved[123] */ + NULL /* reserved[123] */ }; static const ProtobufCFieldDescriptor ctl__smd_device__field_descriptors[14] = { @@ -1891,23 +1569,25 @@ const ProtobufCMessageDescriptor ctl__smd_device__descriptor = (ProtobufCMessageInit) ctl__smd_device__init, NULL,NULL,NULL /* reserved[123] */ }; -#define ctl__smd_dev_req__field_descriptors NULL +#define ctl__smd_dev_req__field_descriptors NULL #define ctl__smd_dev_req__field_indices_by_name NULL -#define ctl__smd_dev_req__number_ranges NULL -const ProtobufCMessageDescriptor ctl__smd_dev_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ctl.SmdDevReq", - "SmdDevReq", - "Ctl__SmdDevReq", - "ctl", - sizeof(Ctl__SmdDevReq), - 0, - ctl__smd_dev_req__field_descriptors, - ctl__smd_dev_req__field_indices_by_name, - 0, ctl__smd_dev_req__number_ranges, - (ProtobufCMessageInit) ctl__smd_dev_req__init, - NULL,NULL,NULL /* reserved[123] */ +#define ctl__smd_dev_req__number_ranges NULL +const ProtobufCMessageDescriptor ctl__smd_dev_req__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ctl.SmdDevReq", + "SmdDevReq", + "Ctl__SmdDevReq", + "ctl", + sizeof(Ctl__SmdDevReq), + 0, + ctl__smd_dev_req__field_descriptors, + ctl__smd_dev_req__field_indices_by_name, + 0, + ctl__smd_dev_req__number_ranges, + (ProtobufCMessageInit)ctl__smd_dev_req__init, + NULL, + NULL, + NULL /* reserved[123] */ }; static const ProtobufCFieldDescriptor ctl__smd_dev_resp__field_descriptors[2] = { diff --git a/src/bio/smd.pb-c.h b/src/bio/smd.pb-c.h index fd4ca542b60..7d197849f0e 100644 --- a/src/bio/smd.pb-c.h +++ b/src/bio/smd.pb-c.h @@ -216,11 +216,37 @@ struct _Ctl__BioHealthResp * RDB WAL blob size */ uint64_t rdb_wal_size; + /* + * PCIe config space link stats + */ + /* + * port identifier + */ + uint32_t link_port_id; + /* + * maximum speed in transactions per second + */ + float link_max_speed; + /* + * maximum width (number of lanes) + */ + uint32_t link_max_width; + /* + * negotiated speed in transactions per second + */ + float link_neg_speed; + /* + * negotiated width (number of lanes) + */ + uint32_t link_neg_width; }; -#define CTL__BIO_HEALTH_RESP__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&ctl__bio_health_resp__descriptor) \ - , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (char *)protobuf_c_empty_string, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - +#define CTL__BIO_HEALTH_RESP__INIT \ + { \ + PROTOBUF_C_MESSAGE_INIT(&ctl__bio_health_resp__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + (char *)protobuf_c_empty_string, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \ + } /* * Namespace represents a namespace created on an NvmeController. @@ -302,11 +328,20 @@ struct _Ctl__NvmeController * controller's vendor ID */ char *vendor_id; + /* + * PCIe configuration space + */ + char *pci_cfg; }; -#define CTL__NVME_CONTROLLER__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&ctl__nvme_controller__descriptor) \ - , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, NULL, 0,NULL, 0,NULL, CTL__NVME_DEV_STATE__UNKNOWN, CTL__LED_STATE__NA, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string } - +#define CTL__NVME_CONTROLLER__INIT \ + { \ + PROTOBUF_C_MESSAGE_INIT(&ctl__nvme_controller__descriptor) \ + , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, \ + (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, NULL, 0, \ + NULL, 0, NULL, CTL__NVME_DEV_STATE__UNKNOWN, CTL__LED_STATE__NA, \ + (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, \ + (char *)protobuf_c_empty_string \ + } /* * SmdDevice represents a DAOS BIO device, identified by a UUID written into a label stored on a @@ -382,10 +417,10 @@ struct _Ctl__SmdDevReq { ProtobufCMessage base; }; -#define CTL__SMD_DEV_REQ__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&ctl__smd_dev_req__descriptor) \ - } - +#define CTL__SMD_DEV_REQ__INIT \ + { \ + PROTOBUF_C_MESSAGE_INIT(&ctl__smd_dev_req__descriptor) \ + } struct _Ctl__SmdDevResp { diff --git a/src/control/cmd/dmg/pretty/storage_nvme.go b/src/control/cmd/dmg/pretty/storage_nvme.go index 4086499eabe..a65c3c050b9 100644 --- a/src/control/cmd/dmg/pretty/storage_nvme.go +++ b/src/control/cmd/dmg/pretty/storage_nvme.go @@ -157,6 +157,13 @@ func printNvmeHealth(stat *storage.NvmeHealth, out io.Writer, opts ...PrintConfi uint64(stat.HostBytesWritten)) } + fmt.Fprintf(out, "PCIe Link Info:\n") + fmt.Fprintf(iw, "Port: #%d\n", stat.LinkPortId) + fmt.Fprintf(iw, "Max Speed: %s\n", humanize.SI(float64(stat.LinkMaxSpeed), "T/s")) + fmt.Fprintf(iw, "Negotiated Speed: %s\n", humanize.SI(float64(stat.LinkNegSpeed), "T/s")) + fmt.Fprintf(iw, "Max Width: x%d\n", stat.LinkMaxWidth) + fmt.Fprintf(iw, "Negotiated Width: x%d\n", stat.LinkNegWidth) + return w.Err } diff --git a/src/control/cmd/dmg/pretty/storage_nvme_test.go b/src/control/cmd/dmg/pretty/storage_nvme_test.go index 08dc6b8426d..39dc8b6c17c 100644 --- a/src/control/cmd/dmg/pretty/storage_nvme_test.go +++ b/src/control/cmd/dmg/pretty/storage_nvme_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2023 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -195,6 +195,12 @@ PCI:%s Model:%s FW:%s Socket:%d Capacity:%s PLL Lock Loss Count:%d NAND Bytes Written:%d Host Bytes Written:%d + PCIe Link Info: + Port: #1 + Max Speed: 1 GT/s + Negotiated Speed: 1 GT/s + Max Width: x4 + Negotiated Width: x4 PCI:%s Model:%s FW:%s Socket:%d Capacity:%s Health Stats: @@ -236,6 +242,12 @@ PCI:%s Model:%s FW:%s Socket:%d Capacity:%s PLL Lock Loss Count:%d NAND Bytes Written:%d Host Bytes Written:%d + PCIe Link Info: + Port: #2 + Max Speed: 2 GT/s + Negotiated Speed: 2 GT/s + Max Width: x8 + Negotiated Width: x8 `, controllerA.PciAddr, controllerA.Model, controllerA.FwRev, @@ -339,6 +351,12 @@ PCI:%s Model:%s FW:%s Socket:%d Capacity:%s PLL Lock Loss Count:%d NAND Bytes Written:%d Host Bytes Written:%d + PCIe Link Info: + Port: #1 + Max Speed: 1 GT/s + Negotiated Speed: 1 GT/s + Max Width: x4 + Negotiated Width: x4 `, controllerAwTS.PciAddr, controllerAwTS.Model, controllerAwTS.FwRev, diff --git a/src/control/cmd/dmg/pretty/storage_test.go b/src/control/cmd/dmg/pretty/storage_test.go index ed6be6ad41f..7760d0aab1c 100644 --- a/src/control/cmd/dmg/pretty/storage_test.go +++ b/src/control/cmd/dmg/pretty/storage_test.go @@ -1652,6 +1652,12 @@ host1 PLL Lock Loss Count:%d NAND Bytes Written:%d Host Bytes Written:%d + PCIe Link Info: + Port: #1 + Max Speed: 1 GT/s + Negotiated Speed: 1 GT/s + Max Width: x4 + Negotiated Width: x4 `, mockController.HealthStats.TempK(), mockController.HealthStats.TempC(), diff --git a/src/control/common/env_utils.go b/src/control/common/env_utils.go index 83bf89d329e..1d370f173a1 100644 --- a/src/control/common/env_utils.go +++ b/src/control/common/env_utils.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2023 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -154,3 +154,21 @@ func MergeKeyValues(curVars []string, newVars []string) (merged []string) { return } + +// AppendToPathEnv appends entries to the supplied colon-separated string if non-existent. +func AppendToPathEnv(pathEnv string, toAdd ...string) string { + for _, add := range toAdd { + found := false + for _, elem := range strings.Split(pathEnv, ":") { + if elem == add { + found = true + break + } + } + if !found { + pathEnv += ":" + add + } + } + + return pathEnv +} diff --git a/src/control/common/env_utils_test.go b/src/control/common/env_utils_test.go index 2de752e0810..63a1af49da3 100644 --- a/src/control/common/env_utils_test.go +++ b/src/control/common/env_utils_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2021 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -213,3 +213,29 @@ func TestCommon_MergeKeyValues(t *testing.T) { }) } } + +func TestCommon_AppendToPathEnv(t *testing.T) { + for name, tc := range map[string]struct { + pathEnv string + toAdd []string + expVal string + }{ + "already exists": { + pathEnv: "/bin:/usr/bin:/sbin:/usr/sbin", + toAdd: []string{"/sbin", "/usr/sbin"}, + expVal: "/bin:/usr/bin:/sbin:/usr/sbin", + }, + "missing path added": { + pathEnv: "/bin:/usr/bin:/usr/sbin", + toAdd: []string{"/sbin", "/usr/sbin"}, + expVal: "/bin:/usr/bin:/usr/sbin:/sbin", + }, + } { + t.Run(name, func(t *testing.T) { + gotVal := AppendToPathEnv(tc.pathEnv, tc.toAdd...) + if diff := cmp.Diff(tc.expVal, gotVal, defCmpOpts...); diff != "" { + t.Fatalf("(-want, +got):\n%s", diff) + } + }) + } +} diff --git a/src/control/common/proto/ctl/smd.pb.go b/src/control/common/proto/ctl/smd.pb.go index 2fd9edf0aed..089c35cc7d4 100644 --- a/src/control/common/proto/ctl/smd.pb.go +++ b/src/control/common/proto/ctl/smd.pb.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2023 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -305,6 +305,12 @@ type BioHealthResp struct { ClusterSize uint64 `protobuf:"varint,46,opt,name=cluster_size,json=clusterSize,proto3" json:"cluster_size,omitempty"` // blobstore cluster size in bytes MetaWalSize uint64 `protobuf:"varint,47,opt,name=meta_wal_size,json=metaWalSize,proto3" json:"meta_wal_size,omitempty"` // metadata WAL blob size RdbWalSize uint64 `protobuf:"varint,48,opt,name=rdb_wal_size,json=rdbWalSize,proto3" json:"rdb_wal_size,omitempty"` // RDB WAL blob size + // PCIe config space link stats + LinkPortId uint32 `protobuf:"varint,49,opt,name=link_port_id,json=linkPortId,proto3" json:"link_port_id,omitempty"` // port identifier + LinkMaxSpeed float32 `protobuf:"fixed32,50,opt,name=link_max_speed,json=linkMaxSpeed,proto3" json:"link_max_speed,omitempty"` // maximum speed in transactions per second + LinkMaxWidth uint32 `protobuf:"varint,51,opt,name=link_max_width,json=linkMaxWidth,proto3" json:"link_max_width,omitempty"` // maximum width (number of lanes) + LinkNegSpeed float32 `protobuf:"fixed32,52,opt,name=link_neg_speed,json=linkNegSpeed,proto3" json:"link_neg_speed,omitempty"` // negotiated speed in transactions per second + LinkNegWidth uint32 `protobuf:"varint,53,opt,name=link_neg_width,json=linkNegWidth,proto3" json:"link_neg_width,omitempty"` // negotiated width (number of lanes) } func (x *BioHealthResp) Reset() { @@ -654,6 +660,41 @@ func (x *BioHealthResp) GetRdbWalSize() uint64 { return 0 } +func (x *BioHealthResp) GetLinkPortId() uint32 { + if x != nil { + return x.LinkPortId + } + return 0 +} + +func (x *BioHealthResp) GetLinkMaxSpeed() float32 { + if x != nil { + return x.LinkMaxSpeed + } + return 0 +} + +func (x *BioHealthResp) GetLinkMaxWidth() uint32 { + if x != nil { + return x.LinkMaxWidth + } + return 0 +} + +func (x *BioHealthResp) GetLinkNegSpeed() float32 { + if x != nil { + return x.LinkNegSpeed + } + return 0 +} + +func (x *BioHealthResp) GetLinkNegWidth() uint32 { + if x != nil { + return x.LinkNegWidth + } + return 0 +} + // NvmeController represents an NVMe Controller (SSD). type NvmeController struct { state protoimpl.MessageState @@ -672,6 +713,7 @@ type NvmeController struct { LedState LedState `protobuf:"varint,10,opt,name=led_state,json=ledState,proto3,enum=ctl.LedState" json:"led_state,omitempty"` // NVMe device LED state PciDevType string `protobuf:"bytes,11,opt,name=pci_dev_type,json=pciDevType,proto3" json:"pci_dev_type,omitempty"` // PCI device type, vmd or pci VendorId string `protobuf:"bytes,12,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id,omitempty"` // controller's vendor ID + PciCfg string `protobuf:"bytes,13,opt,name=pci_cfg,json=pciCfg,proto3" json:"pci_cfg,omitempty"` // PCIe configuration space } func (x *NvmeController) Reset() { @@ -790,6 +832,13 @@ func (x *NvmeController) GetVendorId() string { return "" } +func (x *NvmeController) GetPciCfg() string { + if x != nil { + return x.PciCfg + } + return "" +} + // SmdDevice represents a DAOS BIO device, identified by a UUID written into a label stored on a // SPDK blobstore created on a NVMe namespace. Multiple SmdDevices may exist per NVMe controller. type SmdDevice struct { @@ -2014,7 +2063,7 @@ var file_ctl_smd_proto_rawDesc = []byte{ 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x64, 0x62, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, - 0x72, 0x64, 0x62, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xdd, 0x0e, 0x0a, 0x0d, 0x42, 0x69, 0x6f, 0x48, + 0x72, 0x64, 0x62, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x97, 0x10, 0x0a, 0x0d, 0x42, 0x69, 0x6f, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x0e, 0x77, 0x61, 0x72, 0x6e, 0x5f, @@ -2131,182 +2180,195 @@ var file_ctl_smd_proto_rawDesc = []byte{ 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x57, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x72, 0x64, 0x62, 0x5f, 0x77, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x30, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0a, 0x72, 0x64, 0x62, 0x57, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x4a, 0x04, 0x08, 0x01, 0x10, - 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0xa6, 0x04, 0x0a, 0x0e, 0x4e, 0x76, 0x6d, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x69, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x69, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x15, 0x0a, 0x06, 0x66, 0x77, 0x5f, 0x72, 0x65, 0x76, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x77, 0x52, 0x65, 0x76, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, - 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x63, 0x74, 0x6c, 0x2e, 0x42, 0x69, 0x6f, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x3d, - 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4e, 0x76, 0x6d, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x2f, 0x0a, - 0x0b, 0x73, 0x6d, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x0a, 0x72, 0x64, 0x62, 0x57, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x6c, + 0x69, 0x6e, 0x6b, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x31, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x6e, 0x6b, 0x50, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, + 0x0e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, + 0x32, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x4d, 0x61, 0x78, 0x53, 0x70, + 0x65, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x33, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6c, 0x69, 0x6e, + 0x6b, 0x4d, 0x61, 0x78, 0x57, 0x69, 0x64, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x69, 0x6e, + 0x6b, 0x5f, 0x6e, 0x65, 0x67, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x34, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x4e, 0x65, 0x67, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, + 0x24, 0x0a, 0x0e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6e, 0x65, 0x67, 0x5f, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x18, 0x35, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x4e, 0x65, 0x67, + 0x57, 0x69, 0x64, 0x74, 0x68, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, + 0x03, 0x22, 0xbf, 0x04, 0x0a, 0x0e, 0x4e, 0x76, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x63, 0x69, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x63, 0x69, 0x41, 0x64, 0x64, 0x72, 0x12, 0x15, 0x0a, + 0x06, 0x66, 0x77, 0x5f, 0x72, 0x65, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, + 0x77, 0x52, 0x65, 0x76, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x49, + 0x64, 0x12, 0x35, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x42, 0x69, + 0x6f, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0b, 0x68, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, + 0x74, 0x6c, 0x2e, 0x4e, 0x76, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x0b, 0x73, 0x6d, 0x64, 0x5f, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, + 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x73, 0x6d, + 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x63, 0x74, + 0x6c, 0x2e, 0x4e, 0x76, 0x6d, 0x65, 0x44, 0x65, 0x76, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x08, + 0x64, 0x65, 0x76, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x09, 0x6c, 0x65, 0x64, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x74, + 0x6c, 0x2e, 0x4c, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x08, 0x6c, 0x65, 0x64, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x63, 0x69, 0x5f, 0x64, 0x65, 0x76, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x63, 0x69, 0x44, + 0x65, 0x76, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x63, 0x69, 0x5f, 0x63, 0x66, 0x67, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x63, 0x69, 0x43, 0x66, 0x67, 0x1a, 0x55, 0x0a, 0x09, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, + 0x0e, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x5f, 0x70, 0x63, 0x69, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x50, 0x63, 0x69, 0x41, + 0x64, 0x64, 0x72, 0x22, 0xda, 0x03, 0x0a, 0x09, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x67, 0x74, 0x5f, 0x69, 0x64, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x74, 0x67, 0x74, 0x49, 0x64, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x1f, 0x0a, 0x0b, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, + 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, + 0x62, 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, + 0x42, 0x69, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, 0x7a, + 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x77, 0x61, 0x6c, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x57, 0x61, + 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x64, 0x62, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x72, 0x64, 0x62, 0x53, 0x69, 0x7a, 0x65, + 0x12, 0x20, 0x0a, 0x0c, 0x72, 0x64, 0x62, 0x5f, 0x77, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x72, 0x64, 0x62, 0x57, 0x61, 0x6c, 0x53, 0x69, + 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x75, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x05, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4e, 0x76, 0x6d, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x05, 0x63, 0x74, 0x72, 0x6c, 0x72, + 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x63, 0x74, + 0x72, 0x6c, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x4a, 0x04, + 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, + 0x22, 0x0b, 0x0a, 0x09, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x52, 0x65, 0x71, 0x22, 0x4e, 0x0a, + 0x0a, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x28, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x0c, 0x0a, + 0x0a, 0x53, 0x6d, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x22, 0x9d, 0x01, 0x0a, 0x0b, + 0x53, 0x6d, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x50, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, + 0x1a, 0x49, 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x74, 0x67, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x74, + 0x67, 0x74, 0x49, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xa5, 0x01, 0x0a, 0x0b, + 0x53, 0x6d, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x21, 0x0a, 0x0c, 0x6f, + 0x6d, 0x69, 0x74, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0b, 0x6f, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x6f, 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x6f, 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x2c, 0x0a, + 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x62, 0x69, 0x6f, 0x5f, 0x68, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x42, 0x69, 0x6f, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, + 0x61, 0x6e, 0x6b, 0x22, 0x9b, 0x02, 0x0a, 0x0c, 0x53, 0x6d, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x0a, 0x05, + 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x74, + 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x52, + 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x1a, 0x49, + 0x0a, 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x67, + 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x74, 0x67, 0x74, + 0x49, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x1a, 0x76, 0x0a, 0x08, 0x52, 0x61, 0x6e, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x07, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, + 0x2e, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x05, 0x70, 0x6f, 0x6f, 0x6c, + 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x0c, 0x4c, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x69, 0x64, 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4c, + 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6c, 0x65, 0x64, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x09, 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4c, 0x65, 0x64, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x08, 0x6c, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x2a, 0x0a, 0x11, 0x6c, 0x65, 0x64, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x69, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6c, 0x65, 0x64, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x73, 0x22, 0x6e, 0x0a, 0x0d, 0x44, + 0x65, 0x76, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0c, + 0x6f, 0x6c, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x6c, 0x64, 0x44, 0x65, 0x76, 0x55, 0x75, 0x69, 0x64, 0x12, 0x20, + 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x64, 0x65, 0x76, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x44, 0x65, 0x76, 0x55, 0x75, 0x69, 0x64, + 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x72, 0x65, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x6e, 0x6f, 0x52, 0x65, 0x69, 0x6e, 0x74, 0x22, 0x22, 0x0a, 0x0c, 0x53, + 0x65, 0x74, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x22, + 0x4f, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, + 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x22, 0x98, 0x01, 0x0a, 0x0c, 0x53, 0x6d, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x25, 0x0a, 0x03, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4c, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x48, 0x00, 0x52, 0x03, 0x6c, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x74, 0x6c, 0x2e, + 0x44, 0x65, 0x76, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, + 0x07, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, + 0x65, 0x74, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x79, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x22, 0xe1, 0x01, 0x0a, 0x0d, + 0x53, 0x6d, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, + 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, + 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, + 0x1a, 0x48, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x52, 0x0a, 0x73, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x2e, - 0x0a, 0x09, 0x64, 0x65, 0x76, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x11, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4e, 0x76, 0x6d, 0x65, 0x44, 0x65, 0x76, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x08, 0x64, 0x65, 0x76, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, - 0x0a, 0x09, 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4c, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x08, 0x6c, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x63, - 0x69, 0x5f, 0x64, 0x65, 0x76, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x63, 0x69, 0x44, 0x65, 0x76, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x49, 0x64, 0x1a, 0x55, 0x0a, 0x09, 0x4e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x74, - 0x72, 0x6c, 0x72, 0x5f, 0x70, 0x63, 0x69, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x50, 0x63, 0x69, 0x41, 0x64, 0x64, 0x72, - 0x22, 0xda, 0x03, 0x0a, 0x09, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, - 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x67, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x05, 0x52, 0x06, 0x74, 0x67, 0x74, 0x49, 0x64, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, - 0x61, 0x76, 0x61, 0x69, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0a, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, - 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x74, - 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x69, 0x74, - 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, - 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x77, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x57, 0x61, 0x6c, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x64, 0x62, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x72, 0x64, 0x62, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x20, 0x0a, - 0x0c, 0x72, 0x64, 0x62, 0x5f, 0x77, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0a, 0x72, 0x64, 0x62, 0x57, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x75, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x29, 0x0a, 0x05, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4e, 0x76, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x52, 0x05, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x12, 0x2c, 0x0a, - 0x12, 0x63, 0x74, 0x72, 0x6c, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x63, 0x74, 0x72, 0x6c, 0x72, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x03, 0x10, - 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0x0b, 0x0a, - 0x09, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x52, 0x65, 0x71, 0x22, 0x4e, 0x0a, 0x0a, 0x53, 0x6d, - 0x64, 0x44, 0x65, 0x76, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x28, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x0c, 0x0a, 0x0a, 0x53, 0x6d, - 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x22, 0x9d, 0x01, 0x0a, 0x0b, 0x53, 0x6d, 0x64, - 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x1a, 0x49, 0x0a, - 0x04, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x67, 0x74, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x74, 0x67, 0x74, 0x49, - 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x04, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0xa5, 0x01, 0x0a, 0x0b, 0x53, 0x6d, 0x64, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x6d, 0x69, 0x74, - 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x6f, 0x6d, 0x69, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, - 0x6d, 0x69, 0x74, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x6f, 0x6d, 0x69, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x62, 0x69, 0x6f, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, - 0x69, 0x6f, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, - 0x22, 0x9b, 0x02, 0x0a, 0x0c, 0x53, 0x6d, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x61, 0x6e, - 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, - 0x6d, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x52, 0x61, 0x6e, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x1a, 0x49, 0x0a, 0x04, 0x50, - 0x6f, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x67, 0x74, 0x5f, 0x69, - 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x74, 0x67, 0x74, 0x49, 0x64, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, - 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x1a, 0x76, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x28, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, - 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x2e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x05, 0x70, 0x6f, 0x6f, 0x6c, 0x73, 0x22, 0xa7, - 0x01, 0x0a, 0x0c, 0x4c, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, - 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, - 0x73, 0x12, 0x2d, 0x0a, 0x0a, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4c, 0x65, 0x64, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6c, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x2a, 0x0a, 0x09, 0x6c, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x4c, 0x65, 0x64, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x08, 0x6c, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x11, - 0x6c, 0x65, 0x64, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x69, 0x6e, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6c, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x69, 0x6e, 0x73, 0x22, 0x6e, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x52, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x6c, 0x64, - 0x5f, 0x64, 0x65, 0x76, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x6f, 0x6c, 0x64, 0x44, 0x65, 0x76, 0x55, 0x75, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6e, - 0x65, 0x77, 0x5f, 0x64, 0x65, 0x76, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x44, 0x65, 0x76, 0x55, 0x75, 0x69, 0x64, 0x12, 0x19, 0x0a, - 0x08, 0x6e, 0x6f, 0x5f, 0x72, 0x65, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x6e, 0x6f, 0x52, 0x65, 0x69, 0x6e, 0x74, 0x22, 0x22, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x46, - 0x61, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x22, 0x4f, 0x0a, 0x0d, - 0x44, 0x65, 0x76, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x98, 0x01, - 0x0a, 0x0c, 0x53, 0x6d, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x25, - 0x0a, 0x03, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x74, - 0x6c, 0x2e, 0x4c, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, - 0x52, 0x03, 0x6c, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x44, 0x65, 0x76, - 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, - 0x70, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x65, 0x74, 0x46, - 0x61, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x79, 0x42, 0x04, 0x0a, 0x02, 0x6f, 0x70, 0x22, 0xe1, 0x01, 0x0a, 0x0d, 0x53, 0x6d, 0x64, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x05, 0x72, 0x61, - 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x74, 0x6c, 0x2e, - 0x53, 0x6d, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x52, 0x61, - 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x1a, 0x48, 0x0a, - 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x26, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x53, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x74, 0x6c, 0x2e, 0x53, - 0x6d, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x2a, 0x4c, 0x0a, 0x0c, - 0x4e, 0x76, 0x6d, 0x65, 0x44, 0x65, 0x76, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, - 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, 0x02, 0x12, 0x0b, - 0x0a, 0x07, 0x45, 0x56, 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x55, - 0x4e, 0x50, 0x4c, 0x55, 0x47, 0x47, 0x45, 0x44, 0x10, 0x04, 0x2a, 0x44, 0x0a, 0x08, 0x4c, 0x65, - 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x41, 0x10, 0x00, 0x12, 0x0f, - 0x0a, 0x0b, 0x51, 0x55, 0x49, 0x43, 0x4b, 0x5f, 0x42, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x01, 0x12, - 0x06, 0x0a, 0x02, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x4c, 0x4f, 0x57, 0x5f, - 0x42, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x46, 0x46, 0x10, 0x04, - 0x2a, 0x28, 0x0a, 0x09, 0x4c, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x07, 0x0a, - 0x03, 0x47, 0x45, 0x54, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, - 0x09, 0x0a, 0x05, 0x52, 0x45, 0x53, 0x45, 0x54, 0x10, 0x02, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2d, 0x73, 0x74, - 0x61, 0x63, 0x6b, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x63, 0x74, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x53, 0x0a, 0x08, 0x52, 0x61, + 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x33, 0x0a, 0x07, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x74, + 0x6c, 0x2e, 0x53, 0x6d, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x2a, + 0x4c, 0x0a, 0x0c, 0x4e, 0x76, 0x6d, 0x65, 0x44, 0x65, 0x76, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, + 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x57, 0x10, + 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x56, 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, + 0x0a, 0x09, 0x55, 0x4e, 0x50, 0x4c, 0x55, 0x47, 0x47, 0x45, 0x44, 0x10, 0x04, 0x2a, 0x44, 0x0a, + 0x08, 0x4c, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x41, 0x10, + 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x51, 0x55, 0x49, 0x43, 0x4b, 0x5f, 0x42, 0x4c, 0x49, 0x4e, 0x4b, + 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x4c, + 0x4f, 0x57, 0x5f, 0x42, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x46, + 0x46, 0x10, 0x04, 0x2a, 0x28, 0x0a, 0x09, 0x4c, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x45, 0x54, + 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x53, 0x45, 0x54, 0x10, 0x02, 0x42, 0x39, 0x5a, + 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6f, 0x73, + 0x2d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x64, 0x61, 0x6f, 0x73, 0x2f, 0x73, 0x72, 0x63, 0x2f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x74, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/src/control/lib/hardware/hwloc/bindings.go b/src/control/lib/hardware/hwloc/bindings.go index 3b6933e5b7f..675047f4443 100644 --- a/src/control/lib/hardware/hwloc/bindings.go +++ b/src/control/lib/hardware/hwloc/bindings.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -251,6 +251,8 @@ const ( bridgeTypeHost = C.HWLOC_OBJ_BRIDGE_HOST bridgeTypePCI = C.HWLOC_OBJ_BRIDGE_PCI + + giga = 1e+9 ) // object is a thin wrapper for hwloc_obj_t and related functions. @@ -543,7 +545,7 @@ func (o *object) blockDevice() (*hardware.BlockDevice, error) { return bd, nil } -func (o *object) linkSpeed() (float64, error) { +func (o *object) linkSpeed() (float32, error) { o.topo.RLock() defer o.topo.RUnlock() @@ -554,7 +556,8 @@ func (o *object) linkSpeed() (float64, error) { if pciDevAttr == nil { return 0, errors.Errorf("device %q attrs are nil", o.name()) } - return float64(pciDevAttr.linkspeed), nil + // Attribute in Giga units, return raw transactions per sec. + return float32(pciDevAttr.linkspeed) * giga, nil } func newObject(topo *topology, cObj C.hwloc_obj_t) *object { diff --git a/src/control/lib/hardware/hwloc/provider.go b/src/control/lib/hardware/hwloc/provider.go index 2321254b423..650859a400e 100644 --- a/src/control/lib/hardware/hwloc/provider.go +++ b/src/control/lib/hardware/hwloc/provider.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -298,7 +298,7 @@ func (p *Provider) getPCIDevsPerNUMANode(topo *topology, nodes hardware.NodeMap) numaID := p.getDeviceNUMANodeID(osDev, topo) var addr *hardware.PCIAddress - var linkSpeed float64 + var linkSpeed float32 switch osDevType { case osDevTypeBlock, osDevTypeNetwork, osDevTypeOpenFabrics: // If the device is an NVDIMM, it does not have an @@ -333,10 +333,10 @@ func (p *Provider) getPCIDevsPerNUMANode(topo *topology, nodes hardware.NodeMap) } pciDev := &hardware.PCIDevice{ - Name: osDev.name(), - Type: osDevTypeToHardwareDevType(osDevType), - PCIAddr: *addr, - LinkSpeed: linkSpeed, + Name: osDev.name(), + Type: osDevTypeToHardwareDevType(osDevType), + PCIAddr: *addr, + LinkNegSpeed: linkSpeed, } if err := nodes.AddPCIDevice(numaID, pciDev); err != nil { return err diff --git a/src/control/lib/hardware/hwloc/provider_test.go b/src/control/lib/hardware/hwloc/provider_test.go index 03f3ba9a346..d35eabef818 100644 --- a/src/control/lib/hardware/hwloc/provider_test.go +++ b/src/control/lib/hardware/hwloc/provider_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -122,22 +122,22 @@ func TestHwlocProvider_GetTopology_Samples(t *testing.T) { PCIAddr: *hardware.MustNewPCIAddress("0000:00:11.5"), }, { - Name: "ens259f0", - Type: hardware.DeviceTypeNetInterface, - PCIAddr: *hardware.MustNewPCIAddress("0000:04:00.0"), - LinkSpeed: 7.876923084259033, + Name: "ens259f0", + Type: hardware.DeviceTypeNetInterface, + PCIAddr: *hardware.MustNewPCIAddress("0000:04:00.0"), + LinkNegSpeed: 7.876923084259033e+9, }, { - Name: "ens259f1", - Type: hardware.DeviceTypeNetInterface, - PCIAddr: *hardware.MustNewPCIAddress("0000:04:00.1"), - LinkSpeed: 7.876923084259033, + Name: "ens259f1", + Type: hardware.DeviceTypeNetInterface, + PCIAddr: *hardware.MustNewPCIAddress("0000:04:00.1"), + LinkNegSpeed: 7.876923084259033e+9, }, { - Name: "hsn0", - Type: hardware.DeviceTypeNetInterface, - PCIAddr: *hardware.MustNewPCIAddress("0000:0a:00.0"), - LinkSpeed: 31.507692337036133, + Name: "hsn0", + Type: hardware.DeviceTypeNetInterface, + PCIAddr: *hardware.MustNewPCIAddress("0000:0a:00.0"), + LinkNegSpeed: 31.507692337036133e+9, }, { Name: "nvme0n1", @@ -311,10 +311,10 @@ func TestHwlocProvider_GetTopology_Samples(t *testing.T) { WithDevices( []*hardware.PCIDevice{ { - Name: "hsn1", - Type: hardware.DeviceTypeNetInterface, - PCIAddr: *hardware.MustNewPCIAddress("0000:83:00.0"), - LinkSpeed: 31.507692337036133, + Name: "hsn1", + Type: hardware.DeviceTypeNetInterface, + PCIAddr: *hardware.MustNewPCIAddress("0000:83:00.0"), + LinkNegSpeed: 31.507692337036133e+9, }, { Name: "nvme11n1", @@ -815,7 +815,6 @@ func TestHwlocProvider_GetTopology_Samples(t *testing.T) { t.Errorf("(-want, +got)\n%s\n", diff) } }) - } } diff --git a/src/control/lib/hardware/hwprov/defaults.go b/src/control/lib/hardware/hwprov/defaults.go index acb8e557463..1ebb47912cd 100644 --- a/src/control/lib/hardware/hwprov/defaults.go +++ b/src/control/lib/hardware/hwprov/defaults.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -10,6 +10,7 @@ import ( "github.com/daos-stack/daos/src/control/lib/hardware" "github.com/daos-stack/daos/src/control/lib/hardware/cart" "github.com/daos-stack/daos/src/control/lib/hardware/hwloc" + "github.com/daos-stack/daos/src/control/lib/hardware/pciutils" "github.com/daos-stack/daos/src/control/lib/hardware/sysfs" "github.com/daos-stack/daos/src/control/logging" ) @@ -74,3 +75,8 @@ func DefaultNetDevStateProvider(log logging.Logger) hardware.NetDevStateProvider func DefaultIOMMUDetector(log logging.Logger) hardware.IOMMUDetector { return sysfs.NewProvider(log) } + +// DefaultPCIeLinkStatsProvider gets the default provider for retrieving PCIe link stats. +func DefaultPCIeLinkStatsProvider() hardware.PCIeLinkStatsProvider { + return pciutils.NewPCIeLinkStatsProvider() +} diff --git a/src/control/lib/hardware/pci.go b/src/control/lib/hardware/pci.go index cab95fe4a13..e8109d9e799 100644 --- a/src/control/lib/hardware/pci.go +++ b/src/control/lib/hardware/pci.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2023 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -27,6 +27,14 @@ const ( var ErrNotVMDBackingAddress = errors.New("not a vmd backing device address") +// PCIeLinkStatsProvider is an interface for acquiring NVMe PCIe link info. +type PCIeLinkStatsProvider interface { + // PCIeCapsFromConfig takes a PCIe config space dump (of the format output by lspci + // -xxx) in the form of a byte slice. The second parameter is a reference to a + // PCIDevice struct to be populated. + PCIeCapsFromConfig([]byte, *PCIDevice) error +} + // parseVMDAddress returns the domain string interpreted as the VMD address. func parseVMDAddress(addr string) (*PCIAddress, error) { // Left-pad domain string as necessary make it a valid PCI address. @@ -436,13 +444,17 @@ func NewPCIAddressSetFromString(addrs string) (*PCIAddressSet, error) { type ( // PCIDevice represents an individual hardware device. PCIDevice struct { - Name string `json:"name"` - Type DeviceType `json:"type"` - NUMANode *NUMANode `json:"-"` - Bus *PCIBus `json:"-"` - PCIAddr PCIAddress `json:"pci_address"` - LinkSpeed float64 `json:"link_speed,omitempty"` - BlockDevice *BlockDevice `json:"-"` + Name string `json:"name"` + Type DeviceType `json:"type"` + NUMANode *NUMANode `json:"-"` + Bus *PCIBus `json:"-"` + PCIAddr PCIAddress `json:"pci_address"` + LinkPortID uint16 `json:"port_id"` + LinkMaxSpeed float32 `json:"link_max_speed,omitempty"` + LinkMaxWidth uint16 `json:"link_max_width,omitempty"` + LinkNegSpeed float32 `json:"link_neg_speed,omitempty"` + LinkNegWidth uint16 `json:"link_neg_width,omitempty"` + BlockDevice *BlockDevice `json:"-"` } // PCIBus represents the root of a PCI bus hierarchy. @@ -514,14 +526,19 @@ func (b *PCIBus) IsZero() bool { func (d *PCIDevice) String() string { var speedStr string - if d.LinkSpeed > 0 { - speedStr = fmt.Sprintf(" @ %.2f GB/s", d.LinkSpeed) + if d.LinkNegSpeed > 0 { + speedStr = fmt.Sprintf(" @ %s", humanize.SI(float64(d.LinkNegSpeed), "T/s")) + } + var widthStr string + if d.LinkNegWidth > 0 { + widthStr = fmt.Sprintf(" (x%d)", d.LinkNegWidth) } var sizeStr string if d.BlockDevice != nil { sizeStr = fmt.Sprintf("%s ", humanize.Bytes(d.BlockDevice.Size)) } - return fmt.Sprintf("%s %s (%s%s)%s", &d.PCIAddr, d.Name, sizeStr, d.Type, speedStr) + return fmt.Sprintf("%s %s (%s%s)%s%s", &d.PCIAddr, d.Name, sizeStr, d.Type, speedStr, + widthStr) } // DeviceName returns the system name of the PCI device. diff --git a/src/control/lib/hardware/pci_test.go b/src/control/lib/hardware/pci_test.go index 98a85be28f0..607f8571225 100644 --- a/src/control/lib/hardware/pci_test.go +++ b/src/control/lib/hardware/pci_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2020-2023 Intel Corporation. +// (C) Copyright 2020-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -48,8 +48,8 @@ func (d *PCIDevice) withType(t DeviceType) *PCIDevice { return d } -func (d *PCIDevice) withLinkSpeed(ls float64) *PCIDevice { - d.LinkSpeed = ls +func (d *PCIDevice) withLinkSpeed(ls float32) *PCIDevice { + d.LinkNegSpeed = ls return d } diff --git a/src/control/lib/hardware/pciutils/bindings.go b/src/control/lib/hardware/pciutils/bindings.go new file mode 100644 index 00000000000..86686896c80 --- /dev/null +++ b/src/control/lib/hardware/pciutils/bindings.go @@ -0,0 +1,172 @@ +// +// (C) Copyright 2024 Intel Corporation. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +package pciutils + +import ( + "os" + "strings" + "unsafe" + + "github.com/pkg/errors" + + "github.com/daos-stack/daos/src/control/lib/hardware" +) + +/* +#cgo LDFLAGS: -lpci + +#include +#include +*/ +import "C" + +const ( + giga = 1e+9 + + // dummyPreamble provides a prefix expected by library when reading a configuration dump. + // The actual address is irrelevant because only the config content is being used. Without + // an address and device values in the preamble, the library will refuse to parse the config + // dump file content. + dummyPreamble = "01:00.0 device #1\n" +) + +// Error values for common invalid situations. +var ( + ErrNoDevice = errors.New("no pci device scanned") + ErrMultiDevices = errors.New("want single device config got multiple") + ErrCfgNotTerminated = errors.New("device config content not new-line terminated") + ErrCfgMissing = errors.New("incomplete device config") +) + +// api provides the PCIeLinkStatsProvider interface by exposing a concrete implementation of +// PCIeCapsFromConfig(). +type api struct{} + +func speedToFloat(speed uint16) float32 { + var mant float32 + + switch speed { + case 1: + mant = 2.5 + case 2: + mant = 5 + case 3: + mant = 8 + case 4: + mant = 16 + case 5: + mant = 32 + case 6: + mant = 64 + default: + return 0 + } + + return mant * giga +} + +// PCIeCapsFromConfig takes a PCIe config space dump (of the format output by lspci -xxx) in the +// form of a byte slice. The second parameter is a reference to a PCIDevice struct to be populated. +// The library access method parameters are set to read the config dump from file and the input byte +// slice is written to a temporary file that is read on pci_scan_bus(). The device that has been +// populated on scan is used to populate the output PCIDevice field values. +func (ap *api) PCIeCapsFromConfig(cfgBytes []byte, dev *hardware.PCIDevice) error { + if dev == nil { + return errors.New("nil device reference") + } + + // Multiple device config dumps unsupported. + if strings.Contains(string(cfgBytes), "\n\n") { + return ErrMultiDevices + } + + lenCfg := len(cfgBytes) + if lenCfg == 0 { + return ErrCfgMissing + } + if cfgBytes[lenCfg-1] != '\n' { + return ErrCfgNotTerminated + } + + // Prefix config bytes with dummy preamble which is expected by the library when reading + // config from file (lspci "-F" option). The actual address is irrelevant because only the + // config content is being used. Without an address and device values in the preamble, the + // library will refuse to parse the file content. + cfgBytes = append([]byte(dummyPreamble), cfgBytes...) + + access := C.pci_alloc() + if access == nil { + return errors.New("pci_alloc() failed") + } + access.method = C.PCI_ACCESS_DUMP + + tmpFile, err := os.CreateTemp("", "pciutils") + if err != nil { + return err + } + fName := tmpFile.Name() + defer os.Remove(fName) + + // Write config dump contents to file to be read by library scan call. + if _, err := tmpFile.Write(cfgBytes); err != nil { + return err + } + + pName := "dump.name" + cParam := C.CString(pName) + defer C.free(unsafe.Pointer(cParam)) + + cFileName := C.CString(fName) + defer C.free(unsafe.Pointer(cFileName)) + + // Set access parameters to read config dump from file. + if rc := C.pci_set_param(access, cParam, cFileName); rc != 0 { + return errors.Errorf("pci_set_param: rc=%d", rc) + } + + // Init has to be called after access parameters have been set. + C.pci_init(access) + defer C.pci_cleanup(access) + + // Scan initiates read from config dump. + C.pci_scan_bus(access) + + var pciDev *C.struct_pci_dev = access.devices + + if pciDev == nil { + return ErrNoDevice + } + if pciDev.next != nil { + return ErrMultiDevices + } + + C.pci_fill_info(pciDev, + C.PCI_FILL_IDENT|C.PCI_FILL_BASES|C.PCI_FILL_CLASS|C.PCI_FILL_EXT_CAPS) + + var cp *C.struct_pci_cap = C.pci_find_cap(pciDev, C.PCI_CAP_ID_EXP, C.PCI_CAP_NORMAL) + + if cp == nil { + return errors.New("no pci-express capabilities found") + } + + cpAddr := uint32(cp.addr) + dev.LinkPortID = uint16(cpAddr >> 24) + + var tLnkCap C.u16 = C.pci_read_word(pciDev, C.int(cpAddr+C.PCI_EXP_LNKCAP)) + var tLnkSta C.u16 = C.pci_read_word(pciDev, C.int(cpAddr+C.PCI_EXP_LNKSTA)) + + dev.LinkMaxSpeed = speedToFloat(uint16(tLnkCap & C.PCI_EXP_LNKCAP_SPEED)) + dev.LinkMaxWidth = uint16(tLnkCap & C.PCI_EXP_LNKCAP_WIDTH >> 4) + dev.LinkNegSpeed = speedToFloat(uint16(tLnkSta & C.PCI_EXP_LNKSTA_SPEED)) + dev.LinkNegWidth = uint16(tLnkSta & C.PCI_EXP_LNKSTA_WIDTH >> 4) + + return nil +} + +func NewPCIeLinkStatsProvider() hardware.PCIeLinkStatsProvider { + return &api{} +} diff --git a/src/control/lib/hardware/pciutils/bindings_test.go b/src/control/lib/hardware/pciutils/bindings_test.go new file mode 100644 index 00000000000..af13e02dc70 --- /dev/null +++ b/src/control/lib/hardware/pciutils/bindings_test.go @@ -0,0 +1,103 @@ +// +// (C) Copyright 2024 Intel Corporation. +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +package pciutils_test + +import ( + "strings" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + + "github.com/daos-stack/daos/src/control/common/test" + "github.com/daos-stack/daos/src/control/lib/hardware" + "github.com/daos-stack/daos/src/control/lib/hardware/pciutils" +) + +func TestAPI_PCIeCapsFromConfig(t *testing.T) { + mockBytes := []byte(`00: 86 80 53 09 06 04 10 00 01 02 08 01 00 00 00 00 +10: 04 00 00 bc 00 00 00 00 00 00 00 00 00 00 00 00 +20: 00 00 00 00 00 00 00 00 00 00 00 00 90 15 a8 00 +30: 00 00 00 00 40 00 00 00 00 00 00 00 00 01 00 00 +40: 01 50 03 00 08 00 00 00 00 00 00 00 00 00 00 00 +50: 11 60 1f 00 00 20 00 00 00 30 00 00 00 00 00 00 +60: 10 00 02 00 a1 85 00 10 10 29 09 00 43 6c 41 00 +70: 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 +80: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00 +90: 03 00 1f 00 00 00 00 00 00 00 00 00 00 00 00 00 +a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +100: 01 00 01 15 00 00 00 00 00 00 00 00 30 20 06 00 +`) + + for name, tc := range map[string]struct { + cfgBytes []byte + expDev *hardware.PCIDevice + expErr error + }{ + "empty config": { + expErr: pciutils.ErrCfgMissing, + }, + "incomplete config; no pci-express caps": { + cfgBytes: append(mockBytes[:10], byte('\n')), + expErr: errors.New("no pci-express capabilities"), + }, + "multiple devices input": { + cfgBytes: append(append(mockBytes, []byte("\n\n")...), mockBytes...), + expErr: pciutils.ErrMultiDevices, + }, + "no final new-line char": { + cfgBytes: mockBytes[:len(mockBytes)-1], + expErr: pciutils.ErrCfgNotTerminated, + }, + "success": { + cfgBytes: mockBytes, + expDev: &hardware.PCIDevice{ + LinkMaxSpeed: 8e+9, + LinkMaxWidth: 4, + LinkNegSpeed: 8e+9, + LinkNegWidth: 4, + }, + }, + } { + t.Run(name, func(t *testing.T) { + ap := pciutils.NewPCIeLinkStatsProvider() + dev := &hardware.PCIDevice{} + + err := ap.PCIeCapsFromConfig(tc.cfgBytes, dev) + test.CmpErr(t, tc.expErr, err) + if err != nil { + return + } + + if diff := cmp.Diff(tc.expDev, dev); diff != "" { + t.Fatalf("(-want, +got)\n%s\n", diff) + } + + // Try again with updated values for negotiated speed and width to verify + // multiple consecutive library calls. + newCfgBytes := strings.Replace(string(tc.cfgBytes), `70: 00 00 43`, + `70: 00 00 82`, 1) + dev = &hardware.PCIDevice{} + + if err = ap.PCIeCapsFromConfig([]byte(newCfgBytes), dev); err != nil { + t.Fatal(err) + } + + tc.expDev.LinkNegWidth = 8 + tc.expDev.LinkNegSpeed = 5e+9 + + if diff := cmp.Diff(tc.expDev, dev); diff != "" { + t.Fatalf("2nd try: (-want +got)\n%s\n", diff) + } + }) + } +} diff --git a/src/control/lib/hardware/pretty_test.go b/src/control/lib/hardware/pretty_test.go index ae1a544771d..3ae90b7e053 100644 --- a/src/control/lib/hardware/pretty_test.go +++ b/src/control/lib/hardware/pretty_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -16,10 +16,10 @@ import ( func TestHardware_PrintTopology(t *testing.T) { test2Block := &PCIDevice{ - Name: "test2-block", - Type: DeviceTypeBlock, - PCIAddr: *MustNewPCIAddress("0000:00:1f.2"), - LinkSpeed: 1.75, + Name: "test2-block", + Type: DeviceTypeBlock, + PCIAddr: *MustNewPCIAddress("0000:00:1f.2"), + LinkNegSpeed: 1.75e+9, BlockDevice: &BlockDevice{ Name: "test2-block", Size: 512 * 1000 * 1000 * 1000, @@ -39,16 +39,16 @@ func TestHardware_PrintTopology(t *testing.T) { WithDevices( []*PCIDevice{ { - Name: "test0", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:01:01.1"), - LinkSpeed: 2.5, + Name: "test0", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:01:01.1"), + LinkNegSpeed: 2.5e+9, }, { - Name: "test0-peer", - Type: DeviceTypeOFIDomain, - PCIAddr: *MustNewPCIAddress("0000:01:01.1"), - LinkSpeed: 1.2, + Name: "test0-peer", + Type: DeviceTypeOFIDomain, + PCIAddr: *MustNewPCIAddress("0000:01:01.1"), + LinkNegSpeed: 1.2e+9, }, test2Block, }, @@ -76,10 +76,10 @@ NUMA Node 0 PCI buses: 0000:[00-0f] 0000:00:1f.2 - 0000:00:1f.2 test2-block (512 GB block device) @ 1.75 GB/s + 0000:00:1f.2 test2-block (512 GB block device) @ 1.75 GT/s 0000:01:01.1 - 0000:01:01.1 test0 (network interface) @ 2.50 GB/s - 0000:01:01.1 test0-peer (OFI domain) @ 1.20 GB/s + 0000:01:01.1 test0 (network interface) @ 2.5 GT/s + 0000:01:01.1 test0-peer (OFI domain) @ 1.2 GT/s `, }, "virtual": { @@ -105,14 +105,14 @@ NUMA Node 0 PCI buses: 0000:[00-0f] 0000:00:1f.2 - 0000:00:1f.2 test2-block (512 GB block device) @ 1.75 GB/s + 0000:00:1f.2 test2-block (512 GB block device) @ 1.75 GT/s 0000:01:01.1 - 0000:01:01.1 test0 (network interface) @ 2.50 GB/s - 0000:01:01.1 test0-peer (OFI domain) @ 1.20 GB/s + 0000:01:01.1 test0 (network interface) @ 2.5 GT/s + 0000:01:01.1 test0-peer (OFI domain) @ 1.2 GT/s Virtual Devices virt0 (network interface) virt1 (network interface) - backed by: 0000:01:01.1 test0 (network interface) @ 2.50 GB/s + backed by: 0000:01:01.1 test0 (network interface) @ 2.5 GT/s `, }, "multiple NUMA nodes and pmem": { @@ -130,10 +130,10 @@ Virtual Devices WithDevices( []*PCIDevice{ { - Name: "test2-net", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:01:01.1"), - LinkSpeed: 2.5, + Name: "test2-net", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:01:01.1"), + LinkNegSpeed: 2.5e+9, }, test2Block, }, @@ -160,10 +160,10 @@ Virtual Devices WithDevices( []*PCIDevice{ { - Name: "test0-net", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:80:01.1"), - LinkSpeed: 2.5, + Name: "test0-net", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:80:01.1"), + LinkNegSpeed: 2.5e+9, }, { Name: "test0-block", @@ -190,7 +190,7 @@ NUMA Node 0 PCI buses: 0000:[80-88] 0000:80:01.1 - 0000:80:01.1 test0-net (network interface) @ 2.50 GB/s + 0000:80:01.1 test0-net (network interface) @ 2.5 GT/s 0000:83:00.0 0000:83:00.0 test0-block (block device) Non-PCI block devices: @@ -200,9 +200,9 @@ NUMA Node 2 PCI buses: 0000:[00-0f] 0000:00:1f.2 - 0000:00:1f.2 test2-block (512 GB block device) @ 1.75 GB/s + 0000:00:1f.2 test2-block (512 GB block device) @ 1.75 GT/s 0000:01:01.1 - 0000:01:01.1 test2-net (network interface) @ 2.50 GB/s + 0000:01:01.1 test2-net (network interface) @ 2.5 GT/s Non-PCI block devices: pmem2 (4.4 TB NVDIMM) `, diff --git a/src/control/lib/hardware/topology.go b/src/control/lib/hardware/topology.go index 167dad70830..a3873100237 100644 --- a/src/control/lib/hardware/topology.go +++ b/src/control/lib/hardware/topology.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -353,8 +353,17 @@ func (t *Topology) Merge(newTopo *Topology) error { oldDev.Type = newDev.Type } - if oldDev.LinkSpeed == 0 { - oldDev.LinkSpeed = newDev.LinkSpeed + if oldDev.LinkMaxSpeed == 0 { + oldDev.LinkMaxSpeed = newDev.LinkMaxSpeed + } + if oldDev.LinkNegSpeed == 0 { + oldDev.LinkNegSpeed = newDev.LinkNegSpeed + } + if oldDev.LinkMaxWidth == 0 { + oldDev.LinkMaxWidth = newDev.LinkMaxWidth + } + if oldDev.LinkNegWidth == 0 { + oldDev.LinkNegWidth = newDev.LinkNegWidth } } } diff --git a/src/control/lib/hardware/topology_test.go b/src/control/lib/hardware/topology_test.go index b437e122e1b..b1b0f124117 100644 --- a/src/control/lib/hardware/topology_test.go +++ b/src/control/lib/hardware/topology_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -468,9 +468,9 @@ func TestHardware_Topology_Merge(t *testing.T) { MockNUMANode(1, 4). WithDevices([]*PCIDevice{ { - Name: "test0", - PCIAddr: *MustNewPCIAddress("0000:00:00.1"), - LinkSpeed: 60, + Name: "test0", + PCIAddr: *MustNewPCIAddress("0000:00:00.1"), + LinkNegSpeed: 8e+12, }, }). WithCPUCores([]CPUCore{}). @@ -548,9 +548,9 @@ func TestHardware_Topology_Merge(t *testing.T) { 1: MockNUMANode(1, 0). WithDevices([]*PCIDevice{ { - Name: "test0", - PCIAddr: *MustNewPCIAddress("0000:00:00.1"), - LinkSpeed: 60, + Name: "test0", + PCIAddr: *MustNewPCIAddress("0000:00:00.1"), + LinkNegSpeed: 8e+12, }, }), }, @@ -560,9 +560,9 @@ func TestHardware_Topology_Merge(t *testing.T) { 1: MockNUMANode(1, 4). WithDevices([]*PCIDevice{ { - Name: "test0", - PCIAddr: *MustNewPCIAddress("0000:00:00.1"), - LinkSpeed: 60, + Name: "test0", + PCIAddr: *MustNewPCIAddress("0000:00:00.1"), + LinkNegSpeed: 8e+12, }, }). WithCPUCores([]CPUCore{}). @@ -659,10 +659,10 @@ func TestHardware_Topology_Merge(t *testing.T) { PCIAddr: *MustNewPCIAddress("0000:00:00.1"), }, { - Name: "test1", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:00:00.2"), - LinkSpeed: 75, + Name: "test1", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:00:00.2"), + LinkNegSpeed: 16e+12, }, }). WithPCIBuses([]*PCIBus{ @@ -679,16 +679,16 @@ func TestHardware_Topology_Merge(t *testing.T) { testNuma(0).ID: MockNUMANode(testNuma(0).ID, 5). WithDevices([]*PCIDevice{ { - Name: "test0", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:00:00.1"), - LinkSpeed: 60, + Name: "test0", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:00:00.1"), + LinkNegSpeed: 8e+12, }, { - Name: "test1", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:00:00.2"), - LinkSpeed: 75, + Name: "test1", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:00:00.2"), + LinkNegSpeed: 16e+12, }, }). WithPCIBuses([]*PCIBus{ @@ -783,10 +783,10 @@ func TestHardware_Topology_Merge(t *testing.T) { testNuma(0).ID: MockNUMANode(testNuma(0).ID, 5). WithDevices([]*PCIDevice{ { - Name: "test0", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:00:00.1"), - LinkSpeed: 60, + Name: "test0", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:00:00.1"), + LinkNegSpeed: 8e+12, }, }). WithPCIBuses([]*PCIBus{ @@ -798,10 +798,10 @@ func TestHardware_Topology_Merge(t *testing.T) { Name: "virt0", Type: DeviceTypeNetInterface, BackingDevice: &PCIDevice{ - Name: "test0", - Type: DeviceTypeNetInterface, - PCIAddr: *MustNewPCIAddress("0000:00:00.1"), - LinkSpeed: 60, + Name: "test0", + Type: DeviceTypeNetInterface, + PCIAddr: *MustNewPCIAddress("0000:00:00.1"), + LinkNegSpeed: 8e+12, }, }, { diff --git a/src/control/pbin/exec.go b/src/control/pbin/exec.go index 7d2bf775c62..e9fc7fc7e3d 100644 --- a/src/control/pbin/exec.go +++ b/src/control/pbin/exec.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2023 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -16,6 +16,7 @@ import ( "github.com/pkg/errors" + "github.com/daos-stack/daos/src/control/common" "github.com/daos-stack/daos/src/control/fault" "github.com/daos-stack/daos/src/control/logging" ) @@ -149,7 +150,7 @@ func ExecReq(parent context.Context, log logging.Logger, binPath string, req *Re // ensure that /sbin and /usr/sbin are in child's $PATH for i, env := range child.Env { if strings.HasPrefix(env, "PATH=") { - child.Env[i] = env + ":/sbin:/usr/sbin" + child.Env[i] = common.AppendToPathEnv(env, "/sbin", "/usr/sbin") } } diff --git a/src/control/provider/system/distribution.go b/src/control/provider/system/distribution.go index 31a88ce255a..6cb22f3b41b 100644 --- a/src/control/provider/system/distribution.go +++ b/src/control/provider/system/distribution.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2023 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -10,10 +10,13 @@ import ( "bufio" "fmt" "os" + "os/exec" "strconv" "strings" "github.com/pkg/errors" + + "github.com/daos-stack/daos/src/control/common" ) type ( @@ -187,3 +190,21 @@ func getDistribution(open openFunc) Distribution { func GetDistribution() Distribution { return getDistribution(os.Open) } + +// GetLspciPath returns binary path based on distribution. +func GetLspciPath() (string, error) { + distro := GetDistribution() + + switch distro.ID { + case "opensuse-leap", "opensuse", "sles": + envPath, ok := os.LookupEnv("PATH") + if !ok { + return "", errors.New("couldn't find PATH env") + } + if err := os.Setenv("PATH", common.AppendToPathEnv(envPath, "/sbin")); err != nil { + return "", errors.Wrap(err, "adding /sbin to path env") + } + } + + return exec.LookPath("lspci") +} diff --git a/src/control/server/instance_storage_rpc.go b/src/control/server/instance_storage_rpc.go index d6f66be81dd..792850d4b7a 100644 --- a/src/control/server/instance_storage_rpc.go +++ b/src/control/server/instance_storage_rpc.go @@ -10,6 +10,7 @@ import ( "context" "fmt" "sort" + "strings" "time" "github.com/pkg/errors" @@ -20,6 +21,7 @@ import ( ctlpb "github.com/daos-stack/daos/src/control/common/proto/ctl" "github.com/daos-stack/daos/src/control/fault" "github.com/daos-stack/daos/src/control/lib/hardware" + "github.com/daos-stack/daos/src/control/lib/hardware/hwprov" "github.com/daos-stack/daos/src/control/server/storage" ) @@ -163,7 +165,27 @@ func (ei *EngineInstance) StorageFormatSCM(ctx context.Context, force bool) (mRe return } -func populateCtrlrHealth(ctx context.Context, engine Engine, req *ctlpb.BioHealthReq, ctrlr *ctlpb.NvmeController) (bool, error) { +func addLinkInfoToHealthStats(prov hardware.PCIeLinkStatsProvider, pciCfg string, health *ctlpb.BioHealthResp) error { + // Convert byte-string to lspci-format. + sb := new(strings.Builder) + formatBytestring(pciCfg, sb) + + pciDev := &hardware.PCIDevice{} + if err := prov.PCIeCapsFromConfig([]byte(sb.String()), pciDev); err != nil { + return err + } + + // Copy link details from PCIDevice to health stats. + health.LinkPortId = uint32(pciDev.LinkPortID) + health.LinkMaxSpeed = pciDev.LinkMaxSpeed + health.LinkMaxWidth = uint32(pciDev.LinkMaxWidth) + health.LinkNegSpeed = pciDev.LinkNegSpeed + health.LinkNegWidth = uint32(pciDev.LinkNegWidth) + + return nil +} + +func populateCtrlrHealth(ctx context.Context, engine Engine, req *ctlpb.BioHealthReq, ctrlr *ctlpb.NvmeController, prov hardware.PCIeLinkStatsProvider) (bool, error) { stateName := ctlpb.NvmeDevState_name[int32(ctrlr.DevState)] if !ctrlr.CanSupplyHealthStats() { engine.Debugf("skip fetching health stats on device %q in %q state", @@ -176,8 +198,17 @@ func populateCtrlrHealth(ctx context.Context, engine Engine, req *ctlpb.BioHealt return false, errors.Wrapf(err, "retrieve health stats for %q (state %q)", ctrlr, stateName) } - ctrlr.HealthStats = health + if ctrlr.PciCfg != "" { + if err := addLinkInfoToHealthStats(prov, ctrlr.PciCfg, health); err != nil { + return false, errors.Wrapf(err, "add link stats for %q", ctrlr) + } + } else { + engine.Debugf("no pcie config space received for %q, skip add link stats", ctrlr) + } + + ctrlr.HealthStats = health + ctrlr.PciCfg = "" return true, nil } @@ -241,7 +272,8 @@ func scanEngineBdevsOverDrpc(ctx context.Context, engine Engine, pbReq *ctlpb.Sc MetaSize: pbReq.MetaSize, RdbSize: pbReq.RdbSize, } - upd, err := populateCtrlrHealth(ctx, engine, bhReq, c) + upd, err := populateCtrlrHealth(ctx, engine, bhReq, c, + hwprov.DefaultPCIeLinkStatsProvider()) if err != nil { return nil, err } @@ -392,20 +424,22 @@ func smdQueryEngine(ctx context.Context, engine Engine, pbReq *ctlpb.SmdQueryReq return nil, errors.Wrapf(err, "instance %d GetRank", engine.Index()) } - rResp := new(ctlpb.SmdQueryResp_RankResp) - rResp.Rank = engineRank.Uint32() - - listDevsResp, err := listSmdDevices(ctx, engine, new(ctlpb.SmdDevReq)) + scanSmdResp, err := scanSmd(ctx, engine, &ctlpb.SmdDevReq{}) if err != nil { - return nil, errors.Wrapf(err, "rank %d", engineRank) + return nil, errors.Wrapf(err, "rank %d: scan smd", engineRank) + } + if scanSmdResp == nil { + return nil, errors.Errorf("rank %d: nil scan smd response", engineRank) } - if len(listDevsResp.Devices) == 0 { + rResp := new(ctlpb.SmdQueryResp_RankResp) + rResp.Rank = engineRank.Uint32() + if len(scanSmdResp.Devices) == 0 { rResp.Devices = nil return rResp, nil } - for _, sd := range listDevsResp.Devices { + for _, sd := range scanSmdResp.Devices { if sd != nil { rResp.Devices = append(rResp.Devices, sd) } @@ -418,7 +452,8 @@ func smdQueryEngine(ctx context.Context, engine Engine, pbReq *ctlpb.SmdQueryReq } if pbReq.IncludeBioHealth { bhReq := &ctlpb.BioHealthReq{DevUuid: dev.Uuid} - if _, err := populateCtrlrHealth(ctx, engine, bhReq, dev.Ctrlr); err != nil { + if _, err := populateCtrlrHealth(ctx, engine, bhReq, dev.Ctrlr, + hwprov.DefaultPCIeLinkStatsProvider()); err != nil { return nil, err } } diff --git a/src/control/server/instance_storage_rpc_test.go b/src/control/server/instance_storage_rpc_test.go index bd63a56d1d6..35a7e3f37f2 100644 --- a/src/control/server/instance_storage_rpc_test.go +++ b/src/control/server/instance_storage_rpc_test.go @@ -16,6 +16,7 @@ import ( "github.com/daos-stack/daos/src/control/common/proto" ctlpb "github.com/daos-stack/daos/src/control/common/proto/ctl" "github.com/daos-stack/daos/src/control/common/test" + "github.com/daos-stack/daos/src/control/lib/hardware" "github.com/daos-stack/daos/src/control/lib/ranklist" "github.com/daos-stack/daos/src/control/logging" "github.com/daos-stack/daos/src/control/server/config" @@ -25,6 +26,119 @@ import ( "github.com/daos-stack/daos/src/control/server/storage/scm" ) +type mockPCIeLinkStatsProvider struct { + pciDev *hardware.PCIDevice + pciDevErr error +} + +func (mp *mockPCIeLinkStatsProvider) PCIeCapsFromConfig(cfgBytes []byte, dev *hardware.PCIDevice) error { + if mp.pciDevErr != nil { + return mp.pciDevErr + } + *dev = *mp.pciDev + return nil +} + +func TestIOEngineInstance_populateCtrlrHealth(t *testing.T) { + healthWithoutLinkStats := func() *ctlpb.BioHealthResp { + bhr := proto.MockNvmeHealth() + bhr.LinkPortId = 0 + bhr.LinkMaxSpeed = 0 + bhr.LinkNegSpeed = 0 + bhr.LinkMaxWidth = 0 + bhr.LinkNegWidth = 0 + + return bhr + } + + for name, tc := range map[string]struct { + devState ctlpb.NvmeDevState + pciCfgSpc string + pciDev *hardware.PCIDevice + pciDevErr error + healthRes *ctlpb.BioHealthResp + healthErr error + expCtrlr *ctlpb.NvmeController + expUpdated bool + expErr error + }{ + "bad state; skip health": { + healthRes: healthWithoutLinkStats(), + expCtrlr: &ctlpb.NvmeController{}, + }, + "update health; add link stats skipped as empty pci config space": { + devState: ctlpb.NvmeDevState_NORMAL, + pciDev: &hardware.PCIDevice{ + LinkNegSpeed: 8e+9, + }, + healthRes: healthWithoutLinkStats(), + expCtrlr: &ctlpb.NvmeController{ + DevState: ctlpb.NvmeDevState_NORMAL, + HealthStats: healthWithoutLinkStats(), + }, + expUpdated: true, + }, + "update health; add link stats; pciutils lib error": { + devState: ctlpb.NvmeDevState_NORMAL, + pciCfgSpc: "ABCD", + pciDev: &hardware.PCIDevice{ + LinkNegSpeed: 8e+9, + }, + pciDevErr: errors.New("fail"), + expErr: errors.New("fail"), + }, + "update health; add link stats": { + devState: ctlpb.NvmeDevState_NORMAL, + pciCfgSpc: "ABCD", + pciDev: &hardware.PCIDevice{ + LinkPortID: 1, + LinkNegSpeed: 1e+9, + LinkMaxSpeed: 1e+9, + LinkNegWidth: 4, + LinkMaxWidth: 4, + }, + healthRes: healthWithoutLinkStats(), + expCtrlr: &ctlpb.NvmeController{ + DevState: ctlpb.NvmeDevState_NORMAL, + HealthStats: proto.MockNvmeHealth(), + }, + expUpdated: true, + }, + } { + t.Run(name, func(t *testing.T) { + getCtrlrHealth = func(_ context.Context, _ Engine, _ *ctlpb.BioHealthReq) (*ctlpb.BioHealthResp, error) { + return tc.healthRes, tc.healthErr + } + defer func() { + getCtrlrHealth = getBioHealth + }() + + mockProv := &mockPCIeLinkStatsProvider{ + pciDev: tc.pciDev, + pciDevErr: tc.pciDevErr, + } + + ctrlr := &ctlpb.NvmeController{ + PciCfg: tc.pciCfgSpc, + DevState: tc.devState, + } + + upd, err := populateCtrlrHealth(test.Context(t), NewMockInstance(nil), + &ctlpb.BioHealthReq{}, ctrlr, mockProv) + test.CmpErr(t, tc.expErr, err) + if err != nil { + return + } + + if diff := cmp.Diff(tc.expCtrlr, ctrlr, + defStorageScanCmpOpts...); diff != "" { + t.Fatalf("unexpected controller output (-want, +got):\n%s\n", diff) + } + test.AssertEqual(t, tc.expUpdated, upd, "") + }) + } +} + func TestIOEngineInstance_bdevScanEngine(t *testing.T) { c := storage.MockNvmeController(2) withState := func(ctrlr *ctlpb.NvmeController, state ctlpb.NvmeDevState) *ctlpb.NvmeController { diff --git a/src/control/server/server_utils.go b/src/control/server/server_utils.go index 10d5500bdf5..0fbf88740d4 100644 --- a/src/control/server/server_utils.go +++ b/src/control/server/server_utils.go @@ -49,6 +49,9 @@ const ( // scanMinHugepageCount is the minimum number of hugepages to allocate in order to satisfy // SPDK memory requirements when performing a NVMe device scan. scanMinHugepageCount = 128 + + // maxLineChars is the maximum number of chars per line in a formatted byte string. + maxLineChars = 32 ) // netListenerFn is a type alias for the net.Listener function signature. @@ -828,3 +831,24 @@ func checkFabricInterface(name string, lookup ifLookupFn) error { return nil } + +// Convert bytestring to format accepted by lspci, 16 bytes per line. +func formatBytestring(in string, sb *strings.Builder) { + if sb == nil { + return + } + for i, s := range in { + remainder := i % maxLineChars + if remainder == 0 { + sb.WriteString(fmt.Sprintf("%02x: ", i/2)) + } + sb.WriteString(string(s)) + if i == (len(in)-1) || remainder == maxLineChars-1 { + // Print newline after last char on line. + sb.WriteString("\n") + } else if (i % 2) != 0 { + // Print space after each double char group. + sb.WriteString(" ") + } + } +} diff --git a/src/control/server/server_utils_test.go b/src/control/server/server_utils_test.go index fc1e7a7cb0c..5a992e3a9fa 100644 --- a/src/control/server/server_utils_test.go +++ b/src/control/server/server_utils_test.go @@ -1165,3 +1165,42 @@ func TestServer_processFabricProvider(t *testing.T) { }) } } + +func TestServer_formatBytestring(t *testing.T) { + bytesIn := "86805309060410000102080100000000040000bc0000000000000000" + + "000000000000000000000000000000009015a8000000000040000000" + + "00000000000100000150030008000000000000000000000011601f00" + + "00200000003000000000000010000200a185001010290900436c4100" + + "00004300000000000000000000000000000000001f00000000000000" + + "0e00000003001f000000000000000000000000000000000000000000" + + "00000000000000000000000000000000000000000000000000000000" + + "00000000000000000000000000000000000000000000000000000000" + + "00000000000000000000000000000000000000000000000000000000" + + "0000000001000115000000000000000030200600" + expOut := `00: 86 80 53 09 06 04 10 00 01 02 08 01 00 00 00 00 +10: 04 00 00 bc 00 00 00 00 00 00 00 00 00 00 00 00 +20: 00 00 00 00 00 00 00 00 00 00 00 00 90 15 a8 00 +30: 00 00 00 00 40 00 00 00 00 00 00 00 00 01 00 00 +40: 01 50 03 00 08 00 00 00 00 00 00 00 00 00 00 00 +50: 11 60 1f 00 00 20 00 00 00 30 00 00 00 00 00 00 +60: 10 00 02 00 a1 85 00 10 10 29 09 00 43 6c 41 00 +70: 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 +80: 00 00 00 00 1f 00 00 00 00 00 00 00 0e 00 00 00 +90: 03 00 1f 00 00 00 00 00 00 00 00 00 00 00 00 00 +a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +100: 01 00 01 15 00 00 00 00 00 00 00 00 30 20 06 00 +` + + sb := new(strings.Builder) + + formatBytestring(bytesIn, sb) + + if diff := cmp.Diff(expOut, sb.String()); diff != "" { + t.Fatalf("unexpected output format (-want, +got):\n%s\n", diff) + } +} diff --git a/src/control/server/storage/bdev.go b/src/control/server/storage/bdev.go index df51110913d..981a64e936a 100644 --- a/src/control/server/storage/bdev.go +++ b/src/control/server/storage/bdev.go @@ -175,47 +175,52 @@ func (vls *LedState) UnmarshalJSON(data []byte) error { // NvmeHealth represents a set of health statistics for a NVMe device // and mirrors C.struct_nvme_stats. type NvmeHealth struct { - Timestamp uint64 `json:"timestamp"` - TempWarnTime uint32 `json:"warn_temp_time"` - TempCritTime uint32 `json:"crit_temp_time"` - CtrlBusyTime uint64 `json:"ctrl_busy_time"` - PowerCycles uint64 `json:"power_cycles"` - PowerOnHours uint64 `json:"power_on_hours"` - UnsafeShutdowns uint64 `json:"unsafe_shutdowns"` - MediaErrors uint64 `json:"media_errs"` - ErrorLogEntries uint64 `json:"err_log_entries"` - ReadErrors uint32 `json:"bio_read_errs"` - WriteErrors uint32 `json:"bio_write_errs"` - UnmapErrors uint32 `json:"bio_unmap_errs"` - ChecksumErrors uint32 `json:"checksum_errs"` - Temperature uint32 `json:"temperature"` - TempWarn bool `json:"temp_warn"` - AvailSpareWarn bool `json:"avail_spare_warn"` - ReliabilityWarn bool `json:"dev_reliability_warn"` - ReadOnlyWarn bool `json:"read_only_warn"` - VolatileWarn bool `json:"volatile_mem_warn"` - ProgFailCntNorm uint8 `json:"program_fail_cnt_norm"` - ProgFailCntRaw uint64 `json:"program_fail_cnt_raw"` - EraseFailCntNorm uint8 `json:"erase_fail_cnt_norm"` - EraseFailCntRaw uint64 `json:"erase_fail_cnt_raw"` - WearLevelingCntNorm uint8 `json:"wear_leveling_cnt_norm"` - WearLevelingCntMin uint16 `json:"wear_leveling_cnt_min"` - WearLevelingCntMax uint16 `json:"wear_leveling_cnt_max"` - WearLevelingCntAvg uint16 `json:"wear_leveling_cnt_avg"` - EndtoendErrCntRaw uint64 `json:"endtoend_err_cnt_raw"` - CrcErrCntRaw uint64 `json:"crc_err_cnt_raw"` - MediaWearRaw uint64 `json:"media_wear_raw"` - HostReadsRaw uint64 `json:"host_reads_raw"` - WorkloadTimerRaw uint64 `json:"workload_timer_raw"` - ThermalThrottleStatus uint8 `json:"thermal_throttle_status"` - ThermalThrottleEventCnt uint64 `json:"thermal_throttle_event_cnt"` - RetryBufferOverflowCnt uint64 `json:"retry_buffer_overflow_cnt"` - PllLockLossCnt uint64 `json:"pll_lock_loss_cnt"` - NandBytesWritten uint64 `json:"nand_bytes_written"` - HostBytesWritten uint64 `json:"host_bytes_written"` - ClusterSize uint64 `json:"cluster_size"` - MetaWalSize uint64 `json:"meta_wal_size"` - RdbWalSize uint64 `json:"rdb_wal_size"` + Timestamp uint64 `json:"timestamp"` + TempWarnTime uint32 `json:"warn_temp_time"` + TempCritTime uint32 `json:"crit_temp_time"` + CtrlBusyTime uint64 `json:"ctrl_busy_time"` + PowerCycles uint64 `json:"power_cycles"` + PowerOnHours uint64 `json:"power_on_hours"` + UnsafeShutdowns uint64 `json:"unsafe_shutdowns"` + MediaErrors uint64 `json:"media_errs"` + ErrorLogEntries uint64 `json:"err_log_entries"` + ReadErrors uint32 `json:"bio_read_errs"` + WriteErrors uint32 `json:"bio_write_errs"` + UnmapErrors uint32 `json:"bio_unmap_errs"` + ChecksumErrors uint32 `json:"checksum_errs"` + Temperature uint32 `json:"temperature"` + TempWarn bool `json:"temp_warn"` + AvailSpareWarn bool `json:"avail_spare_warn"` + ReliabilityWarn bool `json:"dev_reliability_warn"` + ReadOnlyWarn bool `json:"read_only_warn"` + VolatileWarn bool `json:"volatile_mem_warn"` + ProgFailCntNorm uint8 `json:"program_fail_cnt_norm"` + ProgFailCntRaw uint64 `json:"program_fail_cnt_raw"` + EraseFailCntNorm uint8 `json:"erase_fail_cnt_norm"` + EraseFailCntRaw uint64 `json:"erase_fail_cnt_raw"` + WearLevelingCntNorm uint8 `json:"wear_leveling_cnt_norm"` + WearLevelingCntMin uint16 `json:"wear_leveling_cnt_min"` + WearLevelingCntMax uint16 `json:"wear_leveling_cnt_max"` + WearLevelingCntAvg uint16 `json:"wear_leveling_cnt_avg"` + EndtoendErrCntRaw uint64 `json:"endtoend_err_cnt_raw"` + CrcErrCntRaw uint64 `json:"crc_err_cnt_raw"` + MediaWearRaw uint64 `json:"media_wear_raw"` + HostReadsRaw uint64 `json:"host_reads_raw"` + WorkloadTimerRaw uint64 `json:"workload_timer_raw"` + ThermalThrottleStatus uint8 `json:"thermal_throttle_status"` + ThermalThrottleEventCnt uint64 `json:"thermal_throttle_event_cnt"` + RetryBufferOverflowCnt uint64 `json:"retry_buffer_overflow_cnt"` + PllLockLossCnt uint64 `json:"pll_lock_loss_cnt"` + NandBytesWritten uint64 `json:"nand_bytes_written"` + HostBytesWritten uint64 `json:"host_bytes_written"` + ClusterSize uint64 `json:"cluster_size"` + MetaWalSize uint64 `json:"meta_wal_size"` + RdbWalSize uint64 `json:"rdb_wal_size"` + LinkPortId uint32 `json:"link_port_id"` + LinkMaxSpeed float32 `json:"link_max_speed"` + LinkMaxWidth uint32 `json:"link_max_width"` + LinkNegSpeed float32 `json:"link_neg_speed"` + LinkNegWidth uint32 `json:"link_neg_width"` } // TempK returns controller temperature in degrees Kelvin. diff --git a/src/control/server/storage/bdev/backend_vmd.go b/src/control/server/storage/bdev/backend_vmd.go index 027bf725bb2..ed7d7c39d4f 100644 --- a/src/control/server/storage/bdev/backend_vmd.go +++ b/src/control/server/storage/bdev/backend_vmd.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2023 Intel Corporation. +// (C) Copyright 2021-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -142,17 +142,14 @@ func substituteVMDAddresses(log logging.Logger, inPCIAddrs *hardware.PCIAddressS // DetectVMD returns whether VMD devices have been found and a slice of VMD // PCI addresses if found. Implements vmdDetectFn. func DetectVMD() (*hardware.PCIAddressSet, error) { - distro := system.GetDistribution() - var lspciCmd *exec.Cmd - // Check available VMD devices with command: // "$lspci | grep -i -E "Volume Management Device" - switch { - case distro.ID == "opensuse-leap" || distro.ID == "opensuse" || distro.ID == "sles": - lspciCmd = exec.Command("/sbin/lspci") - default: - lspciCmd = exec.Command("lspci") + + lspciPath, err := system.GetLspciPath() + if err != nil { + return nil, errors.Wrap(err, "lookup lspci binary path") } + lspciCmd := exec.Command(lspciPath) vmdCmd := exec.Command("grep", "-i", "-E", "Volume Management Device") var cmdOut bytes.Buffer @@ -160,9 +157,16 @@ func DetectVMD() (*hardware.PCIAddressSet, error) { vmdCmd.Stdin, _ = lspciCmd.StdoutPipe() vmdCmd.Stdout = &cmdOut - _ = lspciCmd.Start() - _ = vmdCmd.Run() - _ = lspciCmd.Wait() + if err := lspciCmd.Start(); err != nil { + return nil, errors.Wrap(err, "lspci start") + } + if err := vmdCmd.Run(); err != nil { + // Grep will return 1 if no results. + return hardware.NewPCIAddressSet() + } + if err := lspciCmd.Wait(); err != nil { + return nil, errors.Wrap(err, "lspci wait") + } if cmdOut.Len() == 0 { return hardware.NewPCIAddressSet() diff --git a/src/control/server/storage/bdev_test.go b/src/control/server/storage/bdev_test.go index 8f307632b1e..296cb1ce9ea 100644 --- a/src/control/server/storage/bdev_test.go +++ b/src/control/server/storage/bdev_test.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2022-2023 Intel Corporation. +// (C) Copyright 2022-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -193,9 +193,10 @@ func Test_Convert_SmdDevice(t *testing.T) { `_throttle_status":1,"thermal_throttle_event_cnt":1,"retry_buffer` + `_overflow_cnt":1,"pll_lock_loss_cnt":1,"nand_bytes_written":1,"` + `host_bytes_written":1,"cluster_size":0,"meta_wal_size":0,"rdb_wal` + - `_size":0},"namespaces":[{"id":1,"size":2000000000000}],"smd_devices` + - `":null,"dev_state":"EVICTED","led_state":"ON"},"ctrlr_namespace` + - `_id":0}` + `_size":0,"link_port_id":1,"link_max_speed":1000000000,"link_max_width":4,` + + `"link_neg_speed":1000000000,"link_neg_width":4},"namespaces":[{"id":1,` + + `"size":2000000000000}],"smd_devices":null,"dev_state":"EVICTED",` + + `"led_state":"ON"},"ctrlr_namespace_id":0}` if diff := cmp.Diff(expOut, string(out)); diff != "" { t.Fatalf("expected json output to match (-want, +got):\n%s\n", diff) } diff --git a/src/control/server/storage/mocks.go b/src/control/server/storage/mocks.go index 00e4fa32288..dc54f7e68cb 100644 --- a/src/control/server/storage/mocks.go +++ b/src/control/server/storage/mocks.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2023 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -83,6 +83,11 @@ func MockNvmeHealth(varIdx ...int32) *NvmeHealth { PllLockLossCnt: uint64(idx), NandBytesWritten: uint64(idx), HostBytesWritten: uint64(idx), + LinkPortId: uint32(idx), + LinkMaxSpeed: float32(idx) * 1e+9, + LinkMaxWidth: uint32(idx) * 4, + LinkNegSpeed: float32(idx) * 1e+9, + LinkNegWidth: uint32(idx) * 4, } } diff --git a/src/include/daos_srv/bio.h b/src/include/daos_srv/bio.h index 59f0d09bdca..a69f456e232 100644 --- a/src/include/daos_srv/bio.h +++ b/src/include/daos_srv/bio.h @@ -368,6 +368,7 @@ bio_free_dev_info(struct bio_dev_info *dev_info) D_FREE(dev_info->bdi_ctrlr->fw_rev); D_FREE(dev_info->bdi_ctrlr->vendor_id); D_FREE(dev_info->bdi_ctrlr->pci_type); + D_FREE(dev_info->bdi_ctrlr->pci_cfg); D_FREE(dev_info->bdi_ctrlr->nss); D_FREE(dev_info->bdi_ctrlr); } @@ -383,7 +384,8 @@ bio_free_dev_info(struct bio_dev_info *dev_info) * * \return Zero on success, negative value on error */ -int bio_dev_list(struct bio_xs_context *ctxt, d_list_t *dev_list, int *dev_cnt); +int +bio_dev_list(struct bio_xs_context *ctxt, d_list_t *dev_list, int *dev_cnt); /** * Callbacks called on NVMe device state transition diff --git a/src/include/daos_srv/control.h b/src/include/daos_srv/control.h index 4ac9187724a..fa0d64cb623 100644 --- a/src/include/daos_srv/control.h +++ b/src/include/daos_srv/control.h @@ -26,6 +26,11 @@ dpdk_cli_override_opts; #define NVME_PCI_DEV_TYPE_VMD "vmd" #define NVME_DETAIL_BUFLEN 1024 +/** + * intel.com/content/www/us/en/docs/programmable/683488/16-0/pci-express-capability-structure.html + * read up to byte 0xb4 to include extended capabilities. + */ +#define NVME_PCI_CFG_SPC_MAX_LEN 0xb4 /** Device state flags */ #define NVME_DEV_FL_PLUGGED (1 << 0) /* Device is present in slot */ @@ -137,6 +142,7 @@ struct nvme_ctrlr_t { char *fw_rev; char *pci_type; char *vendor_id; + char *pci_cfg; int socket_id; struct nvme_ns_t *nss; struct nvme_stats *stats; diff --git a/src/mgmt/smd.pb-c.c b/src/mgmt/smd.pb-c.c index de49e886e19..720c0caa029 100644 --- a/src/mgmt/smd.pb-c.c +++ b/src/mgmt/smd.pb-c.c @@ -827,616 +827,369 @@ const ProtobufCMessageDescriptor ctl__bio_health_req__descriptor = (ProtobufCMessageInit) ctl__bio_health_req__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor ctl__bio_health_resp__field_descriptors[45] = -{ - { - "timestamp", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, timestamp), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "warn_temp_time", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, warn_temp_time), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "crit_temp_time", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, crit_temp_time), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ctrl_busy_time", - 7, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, ctrl_busy_time), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "power_cycles", - 8, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, power_cycles), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "power_on_hours", - 9, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, power_on_hours), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "unsafe_shutdowns", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, unsafe_shutdowns), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "media_errs", - 11, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, media_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "err_log_entries", - 12, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, err_log_entries), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bio_read_errs", - 13, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, bio_read_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bio_write_errs", - 14, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, bio_write_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "bio_unmap_errs", - 15, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, bio_unmap_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "checksum_errs", - 16, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, checksum_errs), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "temperature", - 17, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, temperature), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "temp_warn", - 18, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, temp_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "avail_spare_warn", - 19, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, avail_spare_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dev_reliability_warn", - 20, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, dev_reliability_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "read_only_warn", - 21, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, read_only_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "volatile_mem_warn", - 22, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_BOOL, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, volatile_mem_warn), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "status", - 23, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dev_uuid", - 24, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, dev_uuid), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "total_bytes", - 25, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, total_bytes), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "avail_bytes", - 26, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, avail_bytes), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "program_fail_cnt_norm", - 27, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, program_fail_cnt_norm), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "program_fail_cnt_raw", - 28, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, program_fail_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "erase_fail_cnt_norm", - 29, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, erase_fail_cnt_norm), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "erase_fail_cnt_raw", - 30, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, erase_fail_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_norm", - 31, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_norm), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_min", - 32, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_min), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_max", - 33, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_max), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "wear_leveling_cnt_avg", - 34, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, wear_leveling_cnt_avg), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "endtoend_err_cnt_raw", - 35, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, endtoend_err_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "crc_err_cnt_raw", - 36, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, crc_err_cnt_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "media_wear_raw", - 37, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, media_wear_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "host_reads_raw", - 38, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, host_reads_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "workload_timer_raw", - 39, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, workload_timer_raw), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "thermal_throttle_status", - 40, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT32, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, thermal_throttle_status), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "thermal_throttle_event_cnt", - 41, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, thermal_throttle_event_cnt), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "retry_buffer_overflow_cnt", - 42, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, retry_buffer_overflow_cnt), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pll_lock_loss_cnt", - 43, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, pll_lock_loss_cnt), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "nand_bytes_written", - 44, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, nand_bytes_written), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "host_bytes_written", - 45, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, host_bytes_written), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "cluster_size", - 46, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, cluster_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "meta_wal_size", - 47, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, meta_wal_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "rdb_wal_size", - 48, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_UINT64, - 0, /* quantifier_offset */ - offsetof(Ctl__BioHealthResp, rdb_wal_size), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, +static const ProtobufCFieldDescriptor ctl__bio_health_resp__field_descriptors[50] = { + { + "timestamp", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, timestamp), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "warn_temp_time", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, warn_temp_time), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "crit_temp_time", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, crit_temp_time), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "ctrl_busy_time", 7, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, ctrl_busy_time), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "power_cycles", 8, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, power_cycles), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "power_on_hours", 9, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, power_on_hours), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "unsafe_shutdowns", 10, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, unsafe_shutdowns), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "media_errs", 11, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, media_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "err_log_entries", 12, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, err_log_entries), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "bio_read_errs", 13, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, bio_read_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "bio_write_errs", 14, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, bio_write_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "bio_unmap_errs", 15, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, bio_unmap_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "checksum_errs", 16, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, checksum_errs), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "temperature", 17, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, temperature), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "temp_warn", 18, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, temp_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "avail_spare_warn", 19, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, avail_spare_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "dev_reliability_warn", 20, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, dev_reliability_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "read_only_warn", 21, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, read_only_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "volatile_mem_warn", 22, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_BOOL, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, volatile_mem_warn), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "status", 23, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "dev_uuid", 24, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, dev_uuid), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "total_bytes", 25, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, total_bytes), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "avail_bytes", 26, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, avail_bytes), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "program_fail_cnt_norm", 27, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, program_fail_cnt_norm), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "program_fail_cnt_raw", 28, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, program_fail_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "erase_fail_cnt_norm", 29, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, erase_fail_cnt_norm), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "erase_fail_cnt_raw", 30, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, erase_fail_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_norm", 31, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_norm), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_min", 32, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_min), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_max", 33, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_max), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "wear_leveling_cnt_avg", 34, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, wear_leveling_cnt_avg), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "endtoend_err_cnt_raw", 35, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, endtoend_err_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "crc_err_cnt_raw", 36, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, crc_err_cnt_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "media_wear_raw", 37, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, media_wear_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "host_reads_raw", 38, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, host_reads_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "workload_timer_raw", 39, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, workload_timer_raw), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "thermal_throttle_status", 40, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, thermal_throttle_status), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "thermal_throttle_event_cnt", 41, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, thermal_throttle_event_cnt), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "retry_buffer_overflow_cnt", 42, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, retry_buffer_overflow_cnt), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pll_lock_loss_cnt", 43, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, pll_lock_loss_cnt), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "nand_bytes_written", 44, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, nand_bytes_written), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "host_bytes_written", 45, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, host_bytes_written), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "cluster_size", 46, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, cluster_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "meta_wal_size", 47, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, meta_wal_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "rdb_wal_size", 48, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT64, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, rdb_wal_size), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_port_id", 49, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_port_id), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_max_speed", 50, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_FLOAT, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_max_speed), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_max_width", 51, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_max_width), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_neg_speed", 52, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_FLOAT, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_neg_speed), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "link_neg_width", 53, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_UINT32, + 0, /* quantifier_offset */ + offsetof(Ctl__BioHealthResp, link_neg_width), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned ctl__bio_health_resp__field_indices_by_name[] = { - 22, /* field[22] = avail_bytes */ - 15, /* field[15] = avail_spare_warn */ - 9, /* field[9] = bio_read_errs */ - 11, /* field[11] = bio_unmap_errs */ - 10, /* field[10] = bio_write_errs */ - 12, /* field[12] = checksum_errs */ - 42, /* field[42] = cluster_size */ - 32, /* field[32] = crc_err_cnt_raw */ - 2, /* field[2] = crit_temp_time */ - 3, /* field[3] = ctrl_busy_time */ - 16, /* field[16] = dev_reliability_warn */ - 20, /* field[20] = dev_uuid */ - 31, /* field[31] = endtoend_err_cnt_raw */ - 25, /* field[25] = erase_fail_cnt_norm */ - 26, /* field[26] = erase_fail_cnt_raw */ - 8, /* field[8] = err_log_entries */ - 41, /* field[41] = host_bytes_written */ - 34, /* field[34] = host_reads_raw */ - 7, /* field[7] = media_errs */ - 33, /* field[33] = media_wear_raw */ - 43, /* field[43] = meta_wal_size */ - 40, /* field[40] = nand_bytes_written */ - 39, /* field[39] = pll_lock_loss_cnt */ - 4, /* field[4] = power_cycles */ - 5, /* field[5] = power_on_hours */ - 23, /* field[23] = program_fail_cnt_norm */ - 24, /* field[24] = program_fail_cnt_raw */ - 44, /* field[44] = rdb_wal_size */ - 17, /* field[17] = read_only_warn */ - 38, /* field[38] = retry_buffer_overflow_cnt */ - 19, /* field[19] = status */ - 14, /* field[14] = temp_warn */ - 13, /* field[13] = temperature */ - 37, /* field[37] = thermal_throttle_event_cnt */ - 36, /* field[36] = thermal_throttle_status */ - 0, /* field[0] = timestamp */ - 21, /* field[21] = total_bytes */ - 6, /* field[6] = unsafe_shutdowns */ - 18, /* field[18] = volatile_mem_warn */ - 1, /* field[1] = warn_temp_time */ - 30, /* field[30] = wear_leveling_cnt_avg */ - 29, /* field[29] = wear_leveling_cnt_max */ - 28, /* field[28] = wear_leveling_cnt_min */ - 27, /* field[27] = wear_leveling_cnt_norm */ - 35, /* field[35] = workload_timer_raw */ -}; -static const ProtobufCIntRange ctl__bio_health_resp__number_ranges[2 + 1] = -{ - { 3, 0 }, - { 5, 1 }, - { 0, 45 } -}; -const ProtobufCMessageDescriptor ctl__bio_health_resp__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ctl.BioHealthResp", - "BioHealthResp", - "Ctl__BioHealthResp", - "ctl", - sizeof(Ctl__BioHealthResp), - 45, - ctl__bio_health_resp__field_descriptors, - ctl__bio_health_resp__field_indices_by_name, - 2, ctl__bio_health_resp__number_ranges, - (ProtobufCMessageInit) ctl__bio_health_resp__init, - NULL,NULL,NULL /* reserved[123] */ + 22, /* field[22] = avail_bytes */ + 15, /* field[15] = avail_spare_warn */ + 9, /* field[9] = bio_read_errs */ + 11, /* field[11] = bio_unmap_errs */ + 10, /* field[10] = bio_write_errs */ + 12, /* field[12] = checksum_errs */ + 42, /* field[42] = cluster_size */ + 32, /* field[32] = crc_err_cnt_raw */ + 2, /* field[2] = crit_temp_time */ + 3, /* field[3] = ctrl_busy_time */ + 16, /* field[16] = dev_reliability_warn */ + 20, /* field[20] = dev_uuid */ + 31, /* field[31] = endtoend_err_cnt_raw */ + 25, /* field[25] = erase_fail_cnt_norm */ + 26, /* field[26] = erase_fail_cnt_raw */ + 8, /* field[8] = err_log_entries */ + 41, /* field[41] = host_bytes_written */ + 34, /* field[34] = host_reads_raw */ + 46, /* field[46] = link_max_speed */ + 47, /* field[47] = link_max_width */ + 48, /* field[48] = link_neg_speed */ + 49, /* field[49] = link_neg_width */ + 45, /* field[45] = link_port_id */ + 7, /* field[7] = media_errs */ + 33, /* field[33] = media_wear_raw */ + 43, /* field[43] = meta_wal_size */ + 40, /* field[40] = nand_bytes_written */ + 39, /* field[39] = pll_lock_loss_cnt */ + 4, /* field[4] = power_cycles */ + 5, /* field[5] = power_on_hours */ + 23, /* field[23] = program_fail_cnt_norm */ + 24, /* field[24] = program_fail_cnt_raw */ + 44, /* field[44] = rdb_wal_size */ + 17, /* field[17] = read_only_warn */ + 38, /* field[38] = retry_buffer_overflow_cnt */ + 19, /* field[19] = status */ + 14, /* field[14] = temp_warn */ + 13, /* field[13] = temperature */ + 37, /* field[37] = thermal_throttle_event_cnt */ + 36, /* field[36] = thermal_throttle_status */ + 0, /* field[0] = timestamp */ + 21, /* field[21] = total_bytes */ + 6, /* field[6] = unsafe_shutdowns */ + 18, /* field[18] = volatile_mem_warn */ + 1, /* field[1] = warn_temp_time */ + 30, /* field[30] = wear_leveling_cnt_avg */ + 29, /* field[29] = wear_leveling_cnt_max */ + 28, /* field[28] = wear_leveling_cnt_min */ + 27, /* field[27] = wear_leveling_cnt_norm */ + 35, /* field[35] = workload_timer_raw */ +}; +static const ProtobufCIntRange ctl__bio_health_resp__number_ranges[2 + 1] = { + {3, 0}, {5, 1}, {0, 50}}; +const ProtobufCMessageDescriptor ctl__bio_health_resp__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ctl.BioHealthResp", + "BioHealthResp", + "Ctl__BioHealthResp", + "ctl", + sizeof(Ctl__BioHealthResp), + 50, + ctl__bio_health_resp__field_descriptors, + ctl__bio_health_resp__field_indices_by_name, + 2, + ctl__bio_health_resp__number_ranges, + (ProtobufCMessageInit)ctl__bio_health_resp__init, + NULL, + NULL, + NULL /* reserved[123] */ }; static const ProtobufCFieldDescriptor ctl__nvme_controller__namespace__field_descriptors[3] = { @@ -1502,186 +1255,111 @@ const ProtobufCMessageDescriptor ctl__nvme_controller__namespace__descriptor = (ProtobufCMessageInit) ctl__nvme_controller__namespace__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCFieldDescriptor ctl__nvme_controller__field_descriptors[12] = -{ - { - "model", +static const ProtobufCFieldDescriptor ctl__nvme_controller__field_descriptors[13] = { + { + "model", 1, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, model), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "serial", 2, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, serial), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pci_addr", 3, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, pci_addr), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "fw_rev", 4, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, fw_rev), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "socket_id", 5, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, socket_id), NULL, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "health_stats", 6, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, health_stats), &ctl__bio_health_resp__descriptor, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "namespaces", 7, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Ctl__NvmeController, n_namespaces), offsetof(Ctl__NvmeController, namespaces), + &ctl__nvme_controller__namespace__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "smd_devices", 8, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, + offsetof(Ctl__NvmeController, n_smd_devices), offsetof(Ctl__NvmeController, smd_devices), + &ctl__smd_device__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "dev_state", 9, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, dev_state), &ctl__nvme_dev_state__descriptor, NULL, + 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "led_state", 10, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_ENUM, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, led_state), &ctl__led_state__descriptor, NULL, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pci_dev_type", 11, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, pci_dev_type), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "vendor_id", 12, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, vendor_id), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, + { + "pci_cfg", 13, PROTOBUF_C_LABEL_NONE, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ + offsetof(Ctl__NvmeController, pci_cfg), NULL, &protobuf_c_empty_string, 0, /* flags */ + 0, NULL, NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned ctl__nvme_controller__field_indices_by_name[] = { + 8, /* field[8] = dev_state */ + 3, /* field[3] = fw_rev */ + 5, /* field[5] = health_stats */ + 9, /* field[9] = led_state */ + 0, /* field[0] = model */ + 6, /* field[6] = namespaces */ + 2, /* field[2] = pci_addr */ + 12, /* field[12] = pci_cfg */ + 10, /* field[10] = pci_dev_type */ + 1, /* field[1] = serial */ + 7, /* field[7] = smd_devices */ + 4, /* field[4] = socket_id */ + 11, /* field[11] = vendor_id */ +}; +static const ProtobufCIntRange ctl__nvme_controller__number_ranges[1 + 1] = {{1, 0}, {0, 13}}; +const ProtobufCMessageDescriptor ctl__nvme_controller__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ctl.NvmeController", + "NvmeController", + "Ctl__NvmeController", + "ctl", + sizeof(Ctl__NvmeController), + 13, + ctl__nvme_controller__field_descriptors, + ctl__nvme_controller__field_indices_by_name, 1, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, model), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "serial", - 2, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, serial), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pci_addr", - 3, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, pci_addr), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "fw_rev", - 4, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, fw_rev), - NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "socket_id", - 5, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_INT32, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, socket_id), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "health_stats", - 6, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_MESSAGE, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, health_stats), - &ctl__bio_health_resp__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "namespaces", - 7, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Ctl__NvmeController, n_namespaces), - offsetof(Ctl__NvmeController, namespaces), - &ctl__nvme_controller__namespace__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "smd_devices", - 8, - PROTOBUF_C_LABEL_REPEATED, - PROTOBUF_C_TYPE_MESSAGE, - offsetof(Ctl__NvmeController, n_smd_devices), - offsetof(Ctl__NvmeController, smd_devices), - &ctl__smd_device__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "dev_state", - 9, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, dev_state), - &ctl__nvme_dev_state__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "led_state", - 10, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_ENUM, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, led_state), - &ctl__led_state__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "pci_dev_type", - 11, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, pci_dev_type), + ctl__nvme_controller__number_ranges, + (ProtobufCMessageInit)ctl__nvme_controller__init, NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "vendor_id", - 12, - PROTOBUF_C_LABEL_NONE, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(Ctl__NvmeController, vendor_id), NULL, - &protobuf_c_empty_string, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned ctl__nvme_controller__field_indices_by_name[] = { - 8, /* field[8] = dev_state */ - 3, /* field[3] = fw_rev */ - 5, /* field[5] = health_stats */ - 9, /* field[9] = led_state */ - 0, /* field[0] = model */ - 6, /* field[6] = namespaces */ - 2, /* field[2] = pci_addr */ - 10, /* field[10] = pci_dev_type */ - 1, /* field[1] = serial */ - 7, /* field[7] = smd_devices */ - 4, /* field[4] = socket_id */ - 11, /* field[11] = vendor_id */ -}; -static const ProtobufCIntRange ctl__nvme_controller__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 12 } -}; -const ProtobufCMessageDescriptor ctl__nvme_controller__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ctl.NvmeController", - "NvmeController", - "Ctl__NvmeController", - "ctl", - sizeof(Ctl__NvmeController), - 12, - ctl__nvme_controller__field_descriptors, - ctl__nvme_controller__field_indices_by_name, - 1, ctl__nvme_controller__number_ranges, - (ProtobufCMessageInit) ctl__nvme_controller__init, - NULL,NULL,NULL /* reserved[123] */ + NULL /* reserved[123] */ }; static const ProtobufCFieldDescriptor ctl__smd_device__field_descriptors[14] = { @@ -1891,23 +1569,25 @@ const ProtobufCMessageDescriptor ctl__smd_device__descriptor = (ProtobufCMessageInit) ctl__smd_device__init, NULL,NULL,NULL /* reserved[123] */ }; -#define ctl__smd_dev_req__field_descriptors NULL +#define ctl__smd_dev_req__field_descriptors NULL #define ctl__smd_dev_req__field_indices_by_name NULL -#define ctl__smd_dev_req__number_ranges NULL -const ProtobufCMessageDescriptor ctl__smd_dev_req__descriptor = -{ - PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, - "ctl.SmdDevReq", - "SmdDevReq", - "Ctl__SmdDevReq", - "ctl", - sizeof(Ctl__SmdDevReq), - 0, - ctl__smd_dev_req__field_descriptors, - ctl__smd_dev_req__field_indices_by_name, - 0, ctl__smd_dev_req__number_ranges, - (ProtobufCMessageInit) ctl__smd_dev_req__init, - NULL,NULL,NULL /* reserved[123] */ +#define ctl__smd_dev_req__number_ranges NULL +const ProtobufCMessageDescriptor ctl__smd_dev_req__descriptor = { + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ctl.SmdDevReq", + "SmdDevReq", + "Ctl__SmdDevReq", + "ctl", + sizeof(Ctl__SmdDevReq), + 0, + ctl__smd_dev_req__field_descriptors, + ctl__smd_dev_req__field_indices_by_name, + 0, + ctl__smd_dev_req__number_ranges, + (ProtobufCMessageInit)ctl__smd_dev_req__init, + NULL, + NULL, + NULL /* reserved[123] */ }; static const ProtobufCFieldDescriptor ctl__smd_dev_resp__field_descriptors[2] = { diff --git a/src/mgmt/smd.pb-c.h b/src/mgmt/smd.pb-c.h index fd4ca542b60..7d197849f0e 100644 --- a/src/mgmt/smd.pb-c.h +++ b/src/mgmt/smd.pb-c.h @@ -216,11 +216,37 @@ struct _Ctl__BioHealthResp * RDB WAL blob size */ uint64_t rdb_wal_size; + /* + * PCIe config space link stats + */ + /* + * port identifier + */ + uint32_t link_port_id; + /* + * maximum speed in transactions per second + */ + float link_max_speed; + /* + * maximum width (number of lanes) + */ + uint32_t link_max_width; + /* + * negotiated speed in transactions per second + */ + float link_neg_speed; + /* + * negotiated width (number of lanes) + */ + uint32_t link_neg_width; }; -#define CTL__BIO_HEALTH_RESP__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&ctl__bio_health_resp__descriptor) \ - , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (char *)protobuf_c_empty_string, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - +#define CTL__BIO_HEALTH_RESP__INIT \ + { \ + PROTOBUF_C_MESSAGE_INIT(&ctl__bio_health_resp__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + (char *)protobuf_c_empty_string, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \ + } /* * Namespace represents a namespace created on an NvmeController. @@ -302,11 +328,20 @@ struct _Ctl__NvmeController * controller's vendor ID */ char *vendor_id; + /* + * PCIe configuration space + */ + char *pci_cfg; }; -#define CTL__NVME_CONTROLLER__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&ctl__nvme_controller__descriptor) \ - , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, NULL, 0,NULL, 0,NULL, CTL__NVME_DEV_STATE__UNKNOWN, CTL__LED_STATE__NA, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string } - +#define CTL__NVME_CONTROLLER__INIT \ + { \ + PROTOBUF_C_MESSAGE_INIT(&ctl__nvme_controller__descriptor) \ + , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, \ + (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, NULL, 0, \ + NULL, 0, NULL, CTL__NVME_DEV_STATE__UNKNOWN, CTL__LED_STATE__NA, \ + (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, \ + (char *)protobuf_c_empty_string \ + } /* * SmdDevice represents a DAOS BIO device, identified by a UUID written into a label stored on a @@ -382,10 +417,10 @@ struct _Ctl__SmdDevReq { ProtobufCMessage base; }; -#define CTL__SMD_DEV_REQ__INIT \ - { PROTOBUF_C_MESSAGE_INIT (&ctl__smd_dev_req__descriptor) \ - } - +#define CTL__SMD_DEV_REQ__INIT \ + { \ + PROTOBUF_C_MESSAGE_INIT(&ctl__smd_dev_req__descriptor) \ + } struct _Ctl__SmdDevResp { diff --git a/src/mgmt/srv_drpc.c b/src/mgmt/srv_drpc.c index 5d41d42afcc..ab55671c74d 100644 --- a/src/mgmt/srv_drpc.c +++ b/src/mgmt/srv_drpc.c @@ -1982,6 +1982,7 @@ ds_mgmt_smd_free_dev(Ctl__SmdDevice *dev) D_FREE(dev->ctrlr->fw_rev); D_FREE(dev->ctrlr->vendor_id); D_FREE(dev->ctrlr->pci_dev_type); + D_FREE(dev->ctrlr->pci_cfg); if (dev->ctrlr->namespaces != NULL) { D_FREE(dev->ctrlr->namespaces[0]); D_FREE(dev->ctrlr->namespaces); diff --git a/src/mgmt/srv_internal.h b/src/mgmt/srv_internal.h index eafc9142060..6f8303ea8f2 100644 --- a/src/mgmt/srv_internal.h +++ b/src/mgmt/srv_internal.h @@ -1,5 +1,5 @@ /* - * (C) Copyright 2016-2023 Intel Corporation. + * (C) Copyright 2016-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -145,7 +145,8 @@ struct mgmt_bio_health { }; int ds_mgmt_bio_health_query(struct mgmt_bio_health *mbh, uuid_t uuid); -int ds_mgmt_smd_list_devs(Ctl__SmdDevResp *resp); +int +ds_mgmt_smd_list_devs(Ctl__SmdDevResp *resp); void ds_mgmt_smd_free_dev(Ctl__SmdDevice *dev); int ds_mgmt_smd_list_pools(Ctl__SmdPoolResp *resp); diff --git a/src/mgmt/srv_query.c b/src/mgmt/srv_query.c index eaf374b788b..51e457ba278 100644 --- a/src/mgmt/srv_query.c +++ b/src/mgmt/srv_query.c @@ -262,10 +262,10 @@ bio_storage_dev_manage_led(void *arg) } struct bio_list_devs_info { - d_list_t dev_list; - int dev_list_cnt; - uuid_t devid; - int *state; + d_list_t dev_list; + int dev_list_cnt; + uuid_t devid; + int *state; }; static int @@ -285,8 +285,7 @@ bio_query_dev_list(void *arg) return -DER_INVAL; } - rc = bio_dev_list(bxc, &list_devs_info->dev_list, - &list_devs_info->dev_list_cnt); + rc = bio_dev_list(bxc, &list_devs_info->dev_list, &list_devs_info->dev_list_cnt); if (rc != 0) { D_ERROR("Error getting BIO device list\n"); return rc; @@ -335,11 +334,16 @@ ctrlr_reset_str_fields(Ctl__NvmeController *ctrlr) ctrlr->fw_rev = NULL; ctrlr->vendor_id = NULL; ctrlr->pci_dev_type = NULL; + ctrlr->pci_cfg = NULL; } static int add_ctrlr_details(Ctl__NvmeController *ctrlr, struct bio_dev_info *dev_info) { + size_t buflen = (NVME_PCI_CFG_SPC_MAX_LEN << 1) + 1; + char buf[buflen]; + char *cur = buf; + const char *end = buf + sizeof(buf); int rc = 0; rc = copy_str2ctrlr(&ctrlr->pci_addr, dev_info->bdi_traddr); @@ -366,6 +370,17 @@ add_ctrlr_details(Ctl__NvmeController *ctrlr, struct bio_dev_info *dev_info) ctrlr->model, ctrlr->serial, ctrlr->fw_rev, ctrlr->vendor_id, ctrlr->pci_dev_type, ctrlr->socket_id); + /* Print config space byte-array to output string */ + for (int i = 0; i < NVME_PCI_CFG_SPC_MAX_LEN; i++) { + cur += snprintf(cur, end - cur, "%02x", dev_info->bdi_ctrlr->pci_cfg[i] & 0xff); + if (cur >= end) { + D_ERROR("buffer not big enough"); + return -DER_INVAL; + } + } + D_STRNDUP(ctrlr->pci_cfg, buf, strnlen(buf, buflen - 1)); + D_DEBUG(DB_MGMT, "ctrlr PCIe config space: %s\n", ctrlr->pci_cfg); + /* Populate NVMe namespace id and capacity */ if (dev_info->bdi_ctrlr->nss == NULL) { diff --git a/src/proto/ctl/smd.proto b/src/proto/ctl/smd.proto index e5494b73e4e..00c704e6a81 100644 --- a/src/proto/ctl/smd.proto +++ b/src/proto/ctl/smd.proto @@ -1,5 +1,5 @@ // -// (C) Copyright 2019-2023 Intel Corporation. +// (C) Copyright 2019-2024 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -73,6 +73,12 @@ message BioHealthResp { uint64 cluster_size = 46; // blobstore cluster size in bytes uint64 meta_wal_size = 47; // metadata WAL blob size uint64 rdb_wal_size = 48; // RDB WAL blob size + // PCIe config space link stats + uint32 link_port_id = 49; // port identifier + float link_max_speed = 50; // maximum speed in transactions per second + uint32 link_max_width = 51; // maximum width (number of lanes) + float link_neg_speed = 52; // negotiated speed in transactions per second + uint32 link_neg_width = 53; // negotiated width (number of lanes) } enum NvmeDevState { @@ -112,6 +118,7 @@ message NvmeController { LedState led_state = 10; // NVMe device LED state string pci_dev_type = 11; // PCI device type, vmd or pci string vendor_id = 12; // controller's vendor ID + string pci_cfg = 13; // PCIe configuration space } // SmdDevice represents a DAOS BIO device, identified by a UUID written into a label stored on a diff --git a/utils/ansible/ftest/vars/Rocky8.yml b/utils/ansible/ftest/vars/Rocky8.yml index 4f15333022c..bc4d5dccd57 100644 --- a/utils/ansible/ftest/vars/Rocky8.yml +++ b/utils/ansible/ftest/vars/Rocky8.yml @@ -39,6 +39,7 @@ daos_dev_deps: - libevent-devel - libyaml-devel - openssl-devel + - pciutils-devel - python3.11 - python3.11-devel - python3-clustershell @@ -72,6 +73,7 @@ daos_server_deps: - libuuid - lz4-libs - ndctl + - pciutils - spdk-tools mlnx_deps: diff --git a/utils/rpms/daos.spec b/utils/rpms/daos.spec index 897ea3a71cf..eb85dab4eef 100644 --- a/utils/rpms/daos.spec +++ b/utils/rpms/daos.spec @@ -15,7 +15,7 @@ Name: daos Version: 2.6.0 -Release: 4%{?relval}%{?dist} +Release: 5%{?relval}%{?dist} Summary: DAOS Storage Engine License: BSD-2-Clause-Patent @@ -82,6 +82,7 @@ BuildRequires: libcmocka-devel BuildRequires: valgrind-devel BuildRequires: systemd BuildRequires: go >= 1.17 +BuildRequires: pciutils-devel %if (0%{?rhel} >= 8) BuildRequires: numactl-devel BuildRequires: CUnit-devel @@ -157,6 +158,7 @@ Requires: mercury >= %{mercury_version} Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig Requires: numactl +Requires: pciutils %{?systemd_requires} %description server @@ -229,6 +231,7 @@ Requires: fuse3-devel >= 3 %else Requires: fuse3-devel >= 3.4.2 %endif +Requires: pciutils-devel %description client-tests This is the package needed to run the DAOS test suite (client tests) @@ -588,6 +591,10 @@ getent passwd daos_agent >/dev/null || useradd -s /sbin/nologin -r -g daos_agent # No files in a shim package %changelog +* Thu Aug 08 2024 Tom Nabarro 2.6.0-5 +- Add pciutils runtime dep for daos_server lspci call +- Add pciutils-devel build dep for pciutils CGO bindings + * Mon Aug 05 2024 Jerome Soumagne 2.6.0-4 - Bump mercury version to 2.4.0rc4 diff --git a/utils/scripts/install-el8.sh b/utils/scripts/install-el8.sh index 4f2e9d8ff75..81a044bfddb 100755 --- a/utils/scripts/install-el8.sh +++ b/utils/scripts/install-el8.sh @@ -54,6 +54,8 @@ dnf --nodocs install \ openssl-devel \ patch \ patchelf \ + pciutils \ + pciutils-devel \ protobuf-c-devel \ python3-devel \ python3-pip \ diff --git a/utils/scripts/install-el9.sh b/utils/scripts/install-el9.sh index a8dc1fc31a6..9ddd8c257d6 100755 --- a/utils/scripts/install-el9.sh +++ b/utils/scripts/install-el9.sh @@ -53,6 +53,8 @@ dnf --nodocs install \ openssl-devel \ patch \ patchelf \ + pciutils \ + pciutils-devel \ protobuf-c-devel \ python3-devel \ python3-pip \ diff --git a/utils/scripts/install-leap15.sh b/utils/scripts/install-leap15.sh index 2e6766e9dad..fc9826ce508 100755 --- a/utils/scripts/install-leap15.sh +++ b/utils/scripts/install-leap15.sh @@ -53,6 +53,7 @@ dnf --nodocs install \ patch \ patchelf \ pciutils \ + pciutils-devel \ python3-devel \ scons \ sg3_utils \ diff --git a/utils/scripts/install-ubuntu.sh b/utils/scripts/install-ubuntu.sh index 9f2a1fbb052..ec21c92f474 100755 --- a/utils/scripts/install-ubuntu.sh +++ b/utils/scripts/install-ubuntu.sh @@ -36,6 +36,7 @@ apt-get install \ liblz4-dev \ libnuma-dev \ libopenmpi-dev \ + libpci-dev \ libprotobuf-c-dev \ librdmacm-dev \ libssl-dev \