From d810a7458d6d993a1794ccd6ea82ec6cfb6ae512 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 11 Nov 2021 12:51:37 -0700 Subject: [PATCH] idxd: change NOTICELOGs to DEBUGLOGs The NOTICELOGs really clutter the output during application start - it's better to make these DEBUGLOGs instead. Signed-off-by: Jim Harris Change-Id: I3ae37d5d057d7b972017befbc0834de414b9710b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10191 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- lib/idxd/idxd_user.c | 30 ++++++++++--------- test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c | 2 ++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lib/idxd/idxd_user.c b/lib/idxd/idxd_user.c index 9f0b212ac..dd6c19483 100644 --- a/lib/idxd/idxd_user.c +++ b/lib/idxd/idxd_user.c @@ -266,8 +266,8 @@ idxd_wq_config(struct spdk_user_idxd_device *user_idxd) struct spdk_idxd_device *idxd = &user_idxd->idxd; u_int32_t wq_size = user_idxd->registers.wqcap.total_wq_size / g_user_dev_cfg.total_wqs; - SPDK_NOTICELOG("Total ring slots available space 0x%x, so per work queue is 0x%x\n", - user_idxd->registers.wqcap.total_wq_size, wq_size); + SPDK_DEBUGLOG(idxd, "Total ring slots available space 0x%x, so per work queue is 0x%x\n", + user_idxd->registers.wqcap.total_wq_size, wq_size); assert(g_user_dev_cfg.total_wqs <= IDXD_MAX_QUEUES); assert(g_user_dev_cfg.total_wqs <= user_idxd->registers.wqcap.num_wqs); assert(LOG2_WQ_MAX_BATCH <= user_idxd->registers.gencap.max_batch_shift); @@ -401,9 +401,9 @@ idxd_device_configure(struct spdk_user_idxd_device *user_idxd) } if ((rc == 0) && (genstatus_reg.state == IDXD_DEVICE_STATE_ENABLED)) { - SPDK_NOTICELOG("Device enabled, version 0x%x gencap: 0x%lx\n", - user_idxd->registers.version, - user_idxd->registers.gencap.raw); + SPDK_DEBUGLOG(idxd, "Device enabled, version 0x%x gencap: 0x%lx\n", + user_idxd->registers.version, + user_idxd->registers.gencap.raw); } @@ -465,16 +465,18 @@ idxd_enum_cb(void *ctx, struct spdk_pci_device *pci_dev) static bool probe_cb(void *cb_ctx, struct spdk_pci_device *pci_dev) { - struct spdk_pci_addr pci_addr = spdk_pci_device_get_addr(pci_dev); + struct spdk_pci_addr pci_addr __attribute__((unused)); - SPDK_NOTICELOG( - " Found matching device at %04x:%02x:%02x.%x vendor:0x%04x device:0x%04x\n", - pci_addr.domain, - pci_addr.bus, - pci_addr.dev, - pci_addr.func, - spdk_pci_device_get_vendor_id(pci_dev), - spdk_pci_device_get_device_id(pci_dev)); + pci_addr = spdk_pci_device_get_addr(pci_dev); + + SPDK_DEBUGLOG(idxd, + " Found matching device at %04x:%02x:%02x.%x vendor:0x%04x device:0x%04x\n", + pci_addr.domain, + pci_addr.bus, + pci_addr.dev, + pci_addr.func, + spdk_pci_device_get_vendor_id(pci_dev), + spdk_pci_device_get_device_id(pci_dev)); /* Claim the device in case conflict with other process */ if (spdk_pci_device_claim(pci_dev) < 0) { diff --git a/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c b/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c index c8328c690..2f2eed4ff 100644 --- a/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c +++ b/test/unit/lib/idxd/idxd_user.c/idxd_user_ut.c @@ -44,6 +44,8 @@ #define MAX_TOKENS 0x40 #define MAX_ARRAY_SIZE 0x20 +SPDK_LOG_REGISTER_COMPONENT(idxd); + DEFINE_STUB(spdk_pci_idxd_get_driver, struct spdk_pci_driver *, (void), NULL); DEFINE_STUB_V(idxd_impl_register, (struct spdk_idxd_impl *impl)); DEFINE_STUB_V(spdk_pci_device_detach, (struct spdk_pci_device *device));