vmd: change DEBUGLOGs to INFOLOG

None of the current DEBUGLOGs are in any kind of
performance critical code path.  Making them INFOLOG
means that we can enable them even in release builds
to get additional information if needed.

(Note: planning to do this with other libraries and
modules as well.)

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I61765fab843a06c36ac1979151589e8f57fea76e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12209
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Jim Harris 2022-04-08 23:07:56 +00:00 committed by Tomasz Zawadzki
parent 0ab324dd2c
commit 5d4b553cd9

View File

@ -183,7 +183,7 @@ vmd_hotplug_allocate_base_addr(struct vmd_hot_plug *hp, uint32_t size)
} }
if (region == NULL) { if (region == NULL) {
SPDK_DEBUGLOG(vmd, "Unable to find free hotplug memory region of size:" SPDK_INFOLOG(vmd, "Unable to find free hotplug memory region of size:"
"%"PRIx32"\n", size); "%"PRIx32"\n", size);
return 0; return 0;
} }
@ -192,7 +192,7 @@ vmd_hotplug_allocate_base_addr(struct vmd_hot_plug *hp, uint32_t size)
if (size < region->size) { if (size < region->size) {
free_region = TAILQ_FIRST(&hp->unused_mem_queue); free_region = TAILQ_FIRST(&hp->unused_mem_queue);
if (free_region == NULL) { if (free_region == NULL) {
SPDK_DEBUGLOG(vmd, "Unable to find unused descriptor to store the " SPDK_INFOLOG(vmd, "Unable to find unused descriptor to store the "
"free region of size: %"PRIu32"\n", region->size - size); "free region of size: %"PRIu32"\n", region->size - size);
} else { } else {
TAILQ_REMOVE(&hp->unused_mem_queue, free_region, tailq); TAILQ_REMOVE(&hp->unused_mem_queue, free_region, tailq);
@ -252,7 +252,7 @@ vmd_allocate_base_addr(struct vmd_adapter *vmd, struct vmd_pci_device *dev, uint
vmd->current_addr_size -= size + padding; vmd->current_addr_size -= size + padding;
} }
SPDK_DEBUGLOG(vmd, "allocated(size) %" PRIx64 " (%x)\n", base_address, size); SPDK_INFOLOG(vmd, "allocated(size) %" PRIx64 " (%x)\n", base_address, size);
return base_address; return base_address;
} }
@ -281,7 +281,7 @@ vmd_update_base_limit_register(struct vmd_pci_device *dev, uint16_t base, uint16
} }
bridge = bus->self; bridge = bus->self;
SPDK_DEBUGLOG(vmd, "base:limit = %x:%x\n", bridge->header->one.mem_base, SPDK_INFOLOG(vmd, "base:limit = %x:%x\n", bridge->header->one.mem_base,
bridge->header->one.mem_limit); bridge->header->one.mem_limit);
if (dev->bus->vmd->scan_completed) { if (dev->bus->vmd->scan_completed) {
@ -504,14 +504,14 @@ vmd_update_scan_info(struct vmd_pci_device *dev)
if (vmd_device_is_root_port(dev->header)) { if (vmd_device_is_root_port(dev->header)) {
vmd_adapter->root_port_updated = 1; vmd_adapter->root_port_updated = 1;
SPDK_DEBUGLOG(vmd, "root_port_updated = %d\n", SPDK_INFOLOG(vmd, "root_port_updated = %d\n",
vmd_adapter->root_port_updated); vmd_adapter->root_port_updated);
SPDK_DEBUGLOG(vmd, "upper:limit = %x : %x\n", SPDK_INFOLOG(vmd, "upper:limit = %x : %x\n",
dev->header->one.prefetch_base_upper, dev->header->one.prefetch_base_upper,
dev->header->one.prefetch_limit_upper); dev->header->one.prefetch_limit_upper);
if (vmd_device_is_enumerated(dev->header)) { if (vmd_device_is_enumerated(dev->header)) {
vmd_adapter->scan_completed = 1; vmd_adapter->scan_completed = 1;
SPDK_DEBUGLOG(vmd, "scan_completed = %d\n", SPDK_INFOLOG(vmd, "scan_completed = %d\n",
vmd_adapter->scan_completed); vmd_adapter->scan_completed);
} }
} }
@ -586,7 +586,7 @@ vmd_init_hotplug(struct vmd_pci_device *dev, struct vmd_pci_bus *bus)
TAILQ_INSERT_TAIL(&hp->unused_mem_queue, &hp->mem[mem_id], tailq); TAILQ_INSERT_TAIL(&hp->unused_mem_queue, &hp->mem[mem_id], tailq);
} }
SPDK_DEBUGLOG(vmd, "%s: mem_base:mem_limit = %x : %x\n", __func__, SPDK_INFOLOG(vmd, "%s: mem_base:mem_limit = %x : %x\n", __func__,
bus->self->header->one.mem_base, bus->self->header->one.mem_limit); bus->self->header->one.mem_base, bus->self->header->one.mem_limit);
} }
@ -630,7 +630,7 @@ vmd_alloc_dev(struct vmd_pci_bus *bus, uint32_t devfn)
header = (struct pci_header * volatile)(bus->vmd->cfg_vaddr + header = (struct pci_header * volatile)(bus->vmd->cfg_vaddr +
CONFIG_OFFSET_ADDR(bus->config_bus_number, devfn, 0, 0)); CONFIG_OFFSET_ADDR(bus->config_bus_number, devfn, 0, 0));
SPDK_DEBUGLOG(vmd, "PCI device found: %04x:%04x ***\n", SPDK_INFOLOG(vmd, "PCI device found: %04x:%04x ***\n",
header->common.vendor_id, header->common.device_id); header->common.vendor_id, header->common.device_id);
dev = calloc(1, sizeof(*dev)); dev = calloc(1, sizeof(*dev));
@ -914,7 +914,7 @@ vmd_dev_init(struct vmd_pci_device *dev)
if (vmd_is_supported_device(dev)) { if (vmd_is_supported_device(dev)) {
spdk_pci_addr_fmt(bdf, sizeof(bdf), &dev->pci.addr); spdk_pci_addr_fmt(bdf, sizeof(bdf), &dev->pci.addr);
SPDK_DEBUGLOG(vmd, "Initializing NVMe device at %s\n", bdf); SPDK_INFOLOG(vmd, "Initializing NVMe device at %s\n", bdf);
dev->pci.parent = dev->bus->vmd->pci; dev->pci.parent = dev->bus->vmd->pci;
spdk_pci_hook_device(spdk_pci_nvme_get_driver(), &dev->pci); spdk_pci_hook_device(spdk_pci_nvme_get_driver(), &dev->pci);
} }
@ -985,7 +985,7 @@ vmd_scan_single_bus(struct vmd_pci_bus *bus, struct vmd_pci_device *parent_bridg
/* Attach hot plug instance if HP is supported */ /* Attach hot plug instance if HP is supported */
/* Hot inserted SSDs can be assigned port bus of sub-ordinate + 1 */ /* Hot inserted SSDs can be assigned port bus of sub-ordinate + 1 */
SPDK_DEBUGLOG(vmd, "hotplug_capable/slot_implemented = " SPDK_INFOLOG(vmd, "hotplug_capable/slot_implemented = "
"%x:%x\n", slot_cap.bit_field.hotplug_capable, "%x:%x\n", slot_cap.bit_field.hotplug_capable,
new_dev->pcie_cap->express_cap_register.bit_field.slot_implemented); new_dev->pcie_cap->express_cap_register.bit_field.slot_implemented);
} }
@ -1024,7 +1024,7 @@ vmd_scan_single_bus(struct vmd_pci_bus *bus, struct vmd_pci_device *parent_bridg
vmd->nvme_count++; vmd->nvme_count++;
} }
} else { } else {
SPDK_DEBUGLOG(vmd, "Removing failed device:%p\n", new_dev); SPDK_INFOLOG(vmd, "Removing failed device:%p\n", new_dev);
TAILQ_REMOVE(&bus->dev_list, new_dev, tailq); TAILQ_REMOVE(&bus->dev_list, new_dev, tailq);
free(new_dev); free(new_dev);
if (dev_cnt) { if (dev_cnt) {
@ -1091,7 +1091,7 @@ vmd_cache_scan_info(struct vmd_pci_device *dev)
return; return;
} }
SPDK_DEBUGLOG(vmd, "vendor/device id:%x:%x\n", dev->header->common.vendor_id, SPDK_INFOLOG(vmd, "vendor/device id:%x:%x\n", dev->header->common.vendor_id,
dev->header->common.device_id); dev->header->common.device_id);
if (vmd_device_is_root_port(dev->header)) { if (vmd_device_is_root_port(dev->header)) {
@ -1100,7 +1100,7 @@ vmd_cache_scan_info(struct vmd_pci_device *dev)
dev->header->one.prefetch_limit_upper = VMD_UPPER_LIMIT_SIGNATURE; dev->header->one.prefetch_limit_upper = VMD_UPPER_LIMIT_SIGNATURE;
reg = dev->header->one.prefetch_limit_upper; reg = dev->header->one.prefetch_limit_upper;
SPDK_DEBUGLOG(vmd, "prefetch: %x:%x\n", SPDK_INFOLOG(vmd, "prefetch: %x:%x\n",
dev->header->one.prefetch_base_upper, dev->header->one.prefetch_base_upper,
dev->header->one.prefetch_limit_upper); dev->header->one.prefetch_limit_upper);
} }
@ -1147,8 +1147,8 @@ vmd_scan_pcibus(struct vmd_pci_bus *bus)
bus->vmd->next_bus_number = bus->bus_number + 1; bus->vmd->next_bus_number = bus->bus_number + 1;
dev_cnt = vmd_scan_single_bus(bus, NULL); dev_cnt = vmd_scan_single_bus(bus, NULL);
SPDK_DEBUGLOG(vmd, "VMD scan found %u devices\n", dev_cnt); SPDK_INFOLOG(vmd, "VMD scan found %u devices\n", dev_cnt);
SPDK_DEBUGLOG(vmd, "VMD scan found %u END DEVICES\n", g_end_device_count); SPDK_INFOLOG(vmd, "VMD scan found %u END DEVICES\n", g_end_device_count);
SPDK_INFOLOG(vmd, "PCIe devices attached to VMD %04x:%02x:%02x:%x...\n", SPDK_INFOLOG(vmd, "PCIe devices attached to VMD %04x:%02x:%02x:%x...\n",
bus->vmd->pci->addr.domain, bus->vmd->pci->addr.bus, bus->vmd->pci->addr.domain, bus->vmd->pci->addr.bus,
@ -1276,7 +1276,7 @@ vmd_enum_cb(void *ctx, struct spdk_pci_device *pci_dev)
spdk_pci_device_cfg_write32(pci_dev, cmd_reg, 4); spdk_pci_device_cfg_write32(pci_dev, cmd_reg, 4);
spdk_pci_addr_fmt(bdf, sizeof(bdf), &pci_dev->addr); spdk_pci_addr_fmt(bdf, sizeof(bdf), &pci_dev->addr);
SPDK_DEBUGLOG(vmd, "Found a VMD[ %d ] at %s\n", vmd_c->count, bdf); SPDK_INFOLOG(vmd, "Found a VMD[ %d ] at %s\n", vmd_c->count, bdf);
/* map vmd bars */ /* map vmd bars */
i = vmd_c->count; i = vmd_c->count;
@ -1290,13 +1290,13 @@ vmd_enum_cb(void *ctx, struct spdk_pci_device *pci_dev)
return -1; return -1;
} }
SPDK_DEBUGLOG(vmd, "vmd config bar(%p) vaddr(%p) size(%x)\n", SPDK_INFOLOG(vmd, "vmd config bar(%p) vaddr(%p) size(%x)\n",
(void *)vmd_c->vmd[i].cfgbar, (void *)vmd_c->vmd[i].cfg_vaddr, (void *)vmd_c->vmd[i].cfgbar, (void *)vmd_c->vmd[i].cfg_vaddr,
(uint32_t)vmd_c->vmd[i].cfgbar_size); (uint32_t)vmd_c->vmd[i].cfgbar_size);
SPDK_DEBUGLOG(vmd, "vmd mem bar(%p) vaddr(%p) size(%x)\n", SPDK_INFOLOG(vmd, "vmd mem bar(%p) vaddr(%p) size(%x)\n",
(void *)vmd_c->vmd[i].membar, (void *)vmd_c->vmd[i].mem_vaddr, (void *)vmd_c->vmd[i].membar, (void *)vmd_c->vmd[i].mem_vaddr,
(uint32_t)vmd_c->vmd[i].membar_size); (uint32_t)vmd_c->vmd[i].membar_size);
SPDK_DEBUGLOG(vmd, "vmd msix bar(%p) vaddr(%p) size(%x)\n\n", SPDK_INFOLOG(vmd, "vmd msix bar(%p) vaddr(%p) size(%x)\n\n",
(void *)vmd_c->vmd[i].msixbar, (void *)vmd_c->vmd[i].msix_vaddr, (void *)vmd_c->vmd[i].msixbar, (void *)vmd_c->vmd[i].msix_vaddr,
(uint32_t)vmd_c->vmd[i].msixbar_size); (uint32_t)vmd_c->vmd[i].msixbar_size);
@ -1407,11 +1407,11 @@ spdk_vmd_hotplug_monitor(void)
} }
if (device->pcie_cap->link_status.bit_field.datalink_layer_active == 1) { if (device->pcie_cap->link_status.bit_field.datalink_layer_active == 1) {
SPDK_DEBUGLOG(vmd, "Device hotplug detected on bus " SPDK_INFOLOG(vmd, "Device hotplug detected on bus "
"%"PRIu32"\n", bus->bus_number); "%"PRIu32"\n", bus->bus_number);
vmd_bus_handle_hotplug(bus); vmd_bus_handle_hotplug(bus);
} else { } else {
SPDK_DEBUGLOG(vmd, "Device hotremove detected on bus " SPDK_INFOLOG(vmd, "Device hotremove detected on bus "
"%"PRIu32"\n", bus->bus_number); "%"PRIu32"\n", bus->bus_number);
vmd_bus_handle_hotremove(bus); vmd_bus_handle_hotremove(bus);
} }