From: Tomasz Duszynski <tduszynski@marvell.com>
To: <dev@dpdk.org>
Cc: <jerinj@marvell.com>, <thomas@monjalon.net>,
Tomasz Duszynski <tduszynski@marvell.com>
Subject: [PATCH] raw/cnxk_bphy: use standard log calls
Date: Thu, 22 Feb 2024 10:13:13 +0100 [thread overview]
Message-ID: <20240222091313.4030144-1-tduszynski@marvell.com> (raw)
Use standard logging functions from DPDK instead of platform ones.
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
drivers/raw/cnxk_bphy/cnxk_bphy.c | 27 +++++++++++++--------------
drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +-
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
index 1dbab6fb3e..57f77297a8 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
@@ -81,21 +81,21 @@ bphy_rawdev_selftest(uint16_t dev_id)
goto err_desc;
if (descs != 1) {
ret = -ENODEV;
- plt_err("Wrong number of descs reported\n");
+ CNXK_BPHY_LOG(ERR, "Wrong number of descs reported");
goto err_desc;
}
ret = rte_pmd_bphy_npa_pf_func_get(dev_id, &pf_func);
if (ret || pf_func == 0)
- plt_warn("NPA pf_func is invalid");
+ CNXK_BPHY_LOG(WARNING, "NPA pf_func is invalid");
ret = rte_pmd_bphy_sso_pf_func_get(dev_id, &pf_func);
if (ret || pf_func == 0)
- plt_warn("SSO pf_func is invalid");
+ CNXK_BPHY_LOG(WARNING, "SSO pf_func is invalid");
ret = rte_pmd_bphy_intr_init(dev_id);
if (ret) {
- plt_err("intr init failed");
+ CNXK_BPHY_LOG(ERR, "intr init failed");
return ret;
}
@@ -103,7 +103,7 @@ bphy_rawdev_selftest(uint16_t dev_id)
test = rte_zmalloc("BPHY", max_irq * sizeof(*test), 0);
if (test == NULL) {
- plt_err("intr alloc failed");
+ CNXK_BPHY_LOG(ERR, "intr alloc failed");
goto err_alloc;
}
@@ -132,7 +132,7 @@ bphy_rawdev_selftest(uint16_t dev_id)
}
if (ret) {
- plt_err("intr register failed at irq %d", i);
+ CNXK_BPHY_LOG(ERR, "intr register failed at irq %d", i);
goto err_register;
}
}
@@ -142,12 +142,12 @@ bphy_rawdev_selftest(uint16_t dev_id)
for (i = 0; i < max_irq; i++) {
if (!test[i].handled_intr) {
- plt_err("intr %u not handled", i);
+ CNXK_BPHY_LOG(ERR, "intr %u not handled", i);
ret = -1;
break;
}
if (test[i].handled_data != test[i].test_data) {
- plt_err("intr %u has wrong handler", i);
+ CNXK_BPHY_LOG(ERR, "intr %u has wrong handler", i);
ret = -1;
break;
}
@@ -332,9 +332,8 @@ bphy_rawdev_probe(struct rte_pci_driver *pci_drv,
return 0;
if (!pci_dev->mem_resource[0].addr) {
- plt_err("BARs have invalid values: BAR0 %p\n BAR2 %p",
- pci_dev->mem_resource[0].addr,
- pci_dev->mem_resource[2].addr);
+ CNXK_BPHY_LOG(ERR, "BARs have invalid values: BAR0 %p\n BAR2 %p",
+ pci_dev->mem_resource[0].addr, pci_dev->mem_resource[2].addr);
return -ENODEV;
}
@@ -346,7 +345,7 @@ bphy_rawdev_probe(struct rte_pci_driver *pci_drv,
bphy_rawdev = rte_rawdev_pmd_allocate(name, sizeof(*bphy_dev),
rte_socket_id());
if (bphy_rawdev == NULL) {
- plt_err("Failed to allocate rawdev");
+ CNXK_BPHY_LOG(ERR, "Failed to allocate rawdev");
return -ENOMEM;
}
@@ -381,14 +380,14 @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev)
return 0;
if (pci_dev == NULL) {
- plt_err("invalid pci_dev");
+ CNXK_BPHY_LOG(ERR, "invalid pci_dev");
return -EINVAL;
}
bphy_rawdev_get_name(name, pci_dev);
rawdev = rte_rawdev_pmd_get_named_dev(name);
if (rawdev == NULL) {
- plt_err("invalid device name (%s)", name);
+ CNXK_BPHY_LOG(ERR, "invalid device name (%s)", name);
return -EINVAL;
}
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
index b424d6127d..8978f03825 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
@@ -87,7 +87,7 @@ cnxk_bphy_intr_unregister(uint16_t dev_id, int irq_num)
if (bphy_dev->irq_chip)
roc_bphy_intr_clear(bphy_dev->irq_chip, irq_num);
else
- plt_err("Missing irq chip");
+ CNXK_BPHY_LOG(ERR, "Missing irq chip");
}
struct cnxk_bphy_mem *
--
2.34.1
next reply other threads:[~2024-02-22 9:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 9:13 Tomasz Duszynski [this message]
2024-02-26 4:14 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240222091313.4030144-1-tduszynski@marvell.com \
--to=tduszynski@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).