@@ -224,11 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw)
if (mq_cfg) {
if (hw->device_type == IFCVF_BLK) {
*(u32 *)mq_cfg = nr_queue;
- RTE_LOG(INFO, PMD, "%d queues are enabled\n", nr_queue);
+ IFCVF_LOG(INFO, "%d queues are enabled", nr_queue);
} else {
*(u32 *)mq_cfg = nr_queue / 2;
- RTE_LOG(INFO, PMD, "%d queue pairs are enabled\n",
- nr_queue / 2);
+ IFCVF_LOG(INFO, "%d queue pairs are enabled", nr_queue / 2);
}
}
}
@@ -246,7 +245,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
cfg = hw->common_cfg;
if (!cfg) {
- RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+ IFCVF_LOG(ERR, "common_cfg in HW is NULL.");
return -1;
}
@@ -258,8 +257,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i)
IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector);
msix_vector = IFCVF_READ_REG16(&cfg->queue_msix_vector);
if (msix_vector == IFCVF_MSI_NO_VECTOR) {
- RTE_LOG(ERR, PMD, "queue %d, msix vec alloc failed\n",
- i);
+ IFCVF_LOG(ERR, "queue %d, msix vec alloc failed", i);
return -1;
}
}
@@ -307,7 +305,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i)
cfg = hw->common_cfg;
if (!cfg) {
- RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n");
+ IFCVF_LOG(ERR, "common_cfg in HW is NULL.");
return;
}
@@ -531,3 +529,5 @@ ifcvf_get_queue_notify_off(struct ifcvf_hw *hw, int qid)
return (u8 *)hw->notify_addr[qid] -
(u8 *)hw->mem_resource[hw->notify_region].addr;
}
+
+RTE_LOG_REGISTER_DEFAULT(ifcvf_logtype, INFO);
@@ -13,8 +13,13 @@
#include <rte_log.h>
#include <rte_io.h>
-#define WARNINGOUT(S, args...) RTE_LOG(WARNING, PMD, S, ##args)
-#define DEBUGOUT(S, args...) RTE_LOG(DEBUG, PMD, S, ##args)
+extern int ifcvf_logtype;
+
+#define IFCVF_LOG(level, fmt, args...) \
+ rte_log(RTE_LOG_ ## level, ifcvf_logtype, fmt "\n", ## args)
+
+#define WARNINGOUT(S, args...) IFCVF_LOG(WARNING, S, ##args)
+#define DEBUGOUT(S, args...) IFCVF_LOG(DEBUG, S, ##args)
#define STATIC static
#define msec_delay(x) rte_delay_us_sleep(1000 * (x))