DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com,
	"Chaoyong He" <chaoyong.he@corigine.com>,
	"Niklas Söderlund" <niklas.soderlund@corigine.com>
Subject: [PATCH v3 06/27] net/nfp: adjust the log statement
Date: Fri, 15 Sep 2023 17:15:30 +0800	[thread overview]
Message-ID: <20230915091551.1459606-7-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20230915091551.1459606-1-chaoyong.he@corigine.com>

Add log statement to the important control logic, which means
more strict check of the return value of function call.
Also remove some verbose info log statement.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 37 ++++++----------------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 20 +++++++++---
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       | 28 ++++++++--------
 drivers/net/nfp/nfpcore/nfp_mip.c          |  7 ++--
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  4 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  9 ++++--
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 25 +++++++++++----
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 10 +++---
 drivers/net/nfp/nfpcore/nfp_resource.c     | 17 +++++++---
 drivers/net/nfp/nfpcore/nfp_rtsym.c        | 14 +++-----
 10 files changed, 92 insertions(+), 79 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index 78beee07ef..bdf4a658f5 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -174,18 +174,10 @@ nfp_compute_bar(const struct nfp_bar *bar,
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
-		if ((offset & mask) != ((offset + size - 1) & mask)) {
-			PMD_DRV_LOG(ERR, "BAR%d: Won't use for Fixed mapping <%#llx,%#llx>, action=%d BAR too small (0x%llx)",
-					bar->index, (unsigned long long)offset,
-					(unsigned long long)(offset + size), act,
-					(unsigned long long)mask);
+		if ((offset & mask) != ((offset + size - 1) & mask))
 			return -EINVAL;
-		}
-		offset &= mask;
 
-		PMD_DRV_LOG(DEBUG, "BAR%d: Created Fixed mapping %d:%d:%d:0x%#llx-0x%#llx>",
-				bar->index, tgt, act, tok, (unsigned long long)offset,
-				(unsigned long long)(offset + mask));
+		offset &= mask;
 
 		bitsize = 40 - 16;
 	} else {
@@ -198,30 +190,16 @@ nfp_compute_bar(const struct nfp_bar *bar,
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
-		if ((offset & mask) != ((offset + size - 1) & mask)) {
-			PMD_DRV_LOG(ERR, "BAR%d: Won't use for bulk mapping <%#llx,%#llx> target=%d, token=%d BAR too small (%#llx) - (%#llx != %#llx).",
-					bar->index, (unsigned long long)offset,
-					(unsigned long long)(offset + size),
-					tgt, tok, (unsigned long long)mask,
-					(unsigned long long)(offset & mask),
-					(unsigned long long)(offset + size - 1) & mask);
+		if ((offset & mask) != ((offset + size - 1) & mask))
 			return -EINVAL;
-		}
 
 		offset &= mask;
 
-		PMD_DRV_LOG(DEBUG, "BAR%d: Created bulk mapping %d:x:%d:%#llx-%#llx",
-				bar->index, tgt, tok, (unsigned long long)offset,
-				(unsigned long long)(offset + ~mask));
-
 		bitsize = 40 - 21;
 	}
 
-	if (bar->bitsize < bitsize) {
-		PMD_DRV_LOG(ERR, "BAR%d: Too small for %d:%d:%d", bar->index,
-				tgt, tok, act);
+	if (bar->bitsize < bitsize)
 		return -EINVAL;
-	}
 
 	newcfg |= offset >> bitsize;
 
@@ -254,7 +232,6 @@ nfp_bar_write(struct nfp_pcie_user *nfp,
 	*(uint32_t *)(bar->csr) = newcfg;
 
 	bar->barcfg = newcfg;
-	PMD_DRV_LOG(DEBUG, "BAR%d: updated to 0x%08x", bar->index, newcfg);
 
 	return 0;
 }
@@ -795,7 +772,11 @@ nfp6000_init(struct nfp_cpp *cpp,
 	desc->cfg = dev->mem_resource[0].addr;
 	desc->dev_id = dev->addr.function & 0x7;
 
-	nfp_enable_bars(desc);
+	ret = nfp_enable_bars(desc);
+	if (ret != 0) {
+		PMD_DRV_LOG(ERR, "Enable bars failed");
+		return -1;
+	}
 
 	nfp_cpp_priv_set(cpp, desc);
 
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 2e5a4e7349..e2af888a28 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -200,6 +200,7 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 
 	err = cpp->op->area_init(area, dest, address, size);
 	if (err < 0) {
+		PMD_DRV_LOG(ERR, "Area init op failed");
 		free(area);
 		return NULL;
 	}
@@ -243,10 +244,13 @@ nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc(cpp, destination, address, size);
-	if (area == NULL)
+	if (area == NULL) {
+		PMD_DRV_LOG(ERR, "Failed to allocate CPP area");
 		return NULL;
+	}
 
 	if (nfp_cpp_area_acquire(area) != 0) {
+		PMD_DRV_LOG(ERR, "Failed to acquire CPP area");
 		nfp_cpp_area_free(area);
 		return NULL;
 	}
@@ -294,8 +298,10 @@ nfp_cpp_area_acquire(struct nfp_cpp_area *area)
 	if (area->cpp->op->area_acquire != NULL) {
 		int err = area->cpp->op->area_acquire(area);
 
-		if (err < 0)
+		if (err < 0) {
+			PMD_DRV_LOG(ERR, "Area acquire op failed");
 			return -1;
+		}
 	}
 
 	return 0;
@@ -662,7 +668,7 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL) {
-		PMD_DRV_LOG(ERR, "Area allocation/acquire failed");
+		PMD_DRV_LOG(ERR, "Area allocation/acquire failed for read");
 		return -1;
 	}
 
@@ -691,8 +697,10 @@ nfp_cpp_write(struct nfp_cpp *cpp,
 	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
-	if (area == NULL)
+	if (area == NULL) {
+		PMD_DRV_LOG(ERR, "Area allocation/acquire failed for write");
 		return -1;
+	}
 
 	err = nfp_cpp_area_write(area, 0, kernel_vaddr, length);
 
@@ -746,8 +754,10 @@ nfp_cpp_map_area(struct nfp_cpp *cpp,
 	uint8_t *res;
 
 	*area = nfp_cpp_area_alloc_acquire(cpp, cpp_id, addr, size);
-	if (*area == NULL)
+	if (*area == NULL) {
+		PMD_DRV_LOG(ERR, "Area allocation/acquire failed for map");
 		goto err_eio;
+	}
 
 	res = nfp_cpp_area_iomem(*area);
 	if (res == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index 819761eda0..b658b5e900 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -74,7 +74,7 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
 	new_crc = nfp_crc32_posix((char *)db, size);
 	crc = (uint32_t *)(db->start + size);
 	if (new_crc != *crc) {
-		PMD_DRV_LOG(ERR, "Corrupt hwinfo table (CRC mismatch) calculated 0x%x, expected 0x%x",
+		PMD_DRV_LOG(ERR, "CRC mismatch, calculated %#x, expected %#x",
 				new_crc, *crc);
 		return -EINVAL;
 	}
@@ -94,34 +94,36 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
 	struct nfp_hwinfo *header;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NFP_HWINFO);
-	if (res) {
-		cpp_id = nfp_resource_cpp_id(res);
-		cpp_addr = nfp_resource_address(res);
-		*cpp_size = nfp_resource_size(res);
+	if (res == NULL) {
+		PMD_DRV_LOG(ERR, "HWInfo - acquire resource failed");
+		return NULL;
+	}
 
-		nfp_resource_release(res);
+	cpp_id = nfp_resource_cpp_id(res);
+	cpp_addr = nfp_resource_address(res);
+	*cpp_size = nfp_resource_size(res);
 
-		if (*cpp_size < HWINFO_SIZE_MIN)
-			return NULL;
-	} else {
+	nfp_resource_release(res);
+
+	if (*cpp_size < HWINFO_SIZE_MIN)
 		return NULL;
-	}
 
 	db = malloc(*cpp_size + 1);
 	if (db == NULL)
 		return NULL;
 
 	err = nfp_cpp_read(cpp, cpp_id, cpp_addr, db, *cpp_size);
-	if (err != (int)*cpp_size)
+	if (err != (int)*cpp_size) {
+		PMD_DRV_LOG(ERR, "HWInfo - CPP read error %d", err);
 		goto exit_free;
+	}
 
 	header = (void *)db;
-	PMD_DRV_LOG(DEBUG, "NFP HWINFO header: %#08x", *(uint32_t *)header);
 	if (nfp_hwinfo_is_updating(header))
 		goto exit_free;
 
 	if (header->version != NFP_HWINFO_VERSION_2) {
-		PMD_DRV_LOG(DEBUG, "Unknown HWInfo version: 0x%08x",
+		PMD_DRV_LOG(ERR, "Unknown HWInfo version: %#08x",
 				header->version);
 		goto exit_free;
 	}
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 1e601313b4..086e82db70 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -46,16 +46,16 @@ nfp_mip_try_read(struct nfp_cpp *cpp,
 
 	ret = nfp_cpp_read(cpp, cpp_id, addr, mip, sizeof(*mip));
 	if (ret != sizeof(*mip)) {
-		PMD_DRV_LOG(ERR, "Failed to read MIP data (%d, %zu)", ret, sizeof(*mip));
+		PMD_DRV_LOG(ERR, "Failed to read MIP data");
 		return -EIO;
 	}
 	if (mip->signature != NFP_MIP_SIGNATURE) {
-		PMD_DRV_LOG(ERR, "Incorrect MIP signature (0x%08x)",
+		PMD_DRV_LOG(ERR, "Incorrect MIP signature %#08x",
 				rte_le_to_cpu_32(mip->signature));
 		return -EINVAL;
 	}
 	if (mip->mip_version != NFP_MIP_VERSION) {
-		PMD_DRV_LOG(ERR, "Unsupported MIP version (%d)",
+		PMD_DRV_LOG(ERR, "Unsupported MIP version %d",
 				rte_le_to_cpu_32(mip->mip_version));
 		return -EINVAL;
 	}
@@ -109,6 +109,7 @@ nfp_mip_open(struct nfp_cpp *cpp)
 
 	err = nfp_mip_read_resource(cpp, mip);
 	if (err != 0) {
+		PMD_DRV_LOG(ERR, "Failed to read MIP resource");
 		free(mip);
 		return NULL;
 	}
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 05e0ff46e5..82919d8270 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -221,9 +221,7 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 		if (err < 0 && err != -EBUSY)
 			return err;
 		if (time(NULL) >= warn_at) {
-			PMD_DRV_LOG(ERR, "Warning: waiting for NFP mutex usage:%u depth:%hd] target:%d addr:%lx key:%08x]",
-					mutex->usage, mutex->depth, mutex->target,
-					mutex->address, mutex->key);
+			PMD_DRV_LOG(WARNING, "Waiting for NFP mutex...");
 			warn_at = time(NULL) + 60;
 		}
 		sched_yield();
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 9123fc742a..b5a354137d 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -3,6 +3,7 @@
  * All rights reserved.
  */
 
+#include "../nfp_logs.h"
 #include "nfp_cpp.h"
 #include "nfp_nffw.h"
 #include "nfp_mip.h"
@@ -132,8 +133,10 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 	memset(state, 0, sizeof(*state));
 
 	state->res = nfp_resource_acquire(cpp, NFP_RESOURCE_NFP_NFFW);
-	if (state->res == NULL)
+	if (state->res == NULL) {
+		PMD_DRV_LOG(ERR, "NFFW - acquire resource failed");
 		goto err_free;
+	}
 
 	fwinf = &state->fwinf;
 
@@ -143,8 +146,10 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
 			nfp_resource_address(state->res),
 			fwinf, sizeof(*fwinf));
-	if (err < (int)sizeof(*fwinf))
+	if (err < (int)sizeof(*fwinf)) {
+		PMD_DRV_LOG(ERR, "NFFW - CPP read error %d", err);
 		goto err_release;
+	}
 
 	if (nffw_res_flg_init_get(fwinf) == 0)
 		goto err_release;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index a00bd5870d..76d418d478 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -82,8 +82,10 @@ nfp_nsp_check(struct nfp_nsp *state)
 	nsp_status = nfp_resource_address(state->res) + NSP_STATUS;
 
 	err = nfp_cpp_readq(cpp, nsp_cpp, nsp_status, &reg);
-	if (err < 0)
+	if (err < 0) {
+		PMD_DRV_LOG(ERR, "NSP - CPP readq failed %d", err);
 		return err;
+	}
 
 	if (FIELD_GET(NSP_STATUS_MAGIC, reg) != NSP_MAGIC) {
 		PMD_DRV_LOG(ERR, "Cannot detect NFP Service Processor");
@@ -119,8 +121,10 @@ nfp_nsp_open(struct nfp_cpp *cpp)
 	struct nfp_resource *res;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NSP);
-	if (res == NULL)
+	if (res == NULL) {
+		PMD_DRV_LOG(ERR, "NSP - resource acquire failed");
 		return NULL;
+	}
 
 	state = malloc(sizeof(*state));
 	if (state == NULL) {
@@ -133,6 +137,7 @@ nfp_nsp_open(struct nfp_cpp *cpp)
 
 	err = nfp_nsp_check(state);
 	if (err != 0) {
+		PMD_DRV_LOG(ERR, "NSP - check failed");
 		nfp_nsp_close(state);
 		return NULL;
 	}
@@ -180,8 +185,10 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
-		if (err < 0)
+		if (err < 0) {
+			PMD_DRV_LOG(ERR, "NSP - CPP readq failed");
 			return err;
+		}
 
 		if ((*reg & mask) == val)
 			return 0;
@@ -234,8 +241,10 @@ nfp_nsp_command(struct nfp_nsp *state,
 	nsp_buffer = nsp_base + NSP_BUFFER;
 
 	err = nfp_nsp_check(state);
-	if (err != 0)
+	if (err != 0) {
+		PMD_DRV_LOG(ERR, "Check NSP command failed");
 		return err;
+	}
 
 	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
 			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
@@ -261,7 +270,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_command,
 			NSP_COMMAND_START, 0);
 	if (err != 0) {
-		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
+		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to start",
 				err, code);
 		return err;
 	}
@@ -270,7 +279,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status,
 			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
-		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
+		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to complete",
 				err, code);
 		return err;
 	}
@@ -352,8 +361,10 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 	}
 
 	ret = nfp_nsp_command(nsp, code, option, cpp_id, cpp_buf);
-	if (ret < 0)
+	if (ret < 0) {
+		PMD_DRV_LOG(ERR, "NSP command failed");
 		return ret;
+	}
 
 	if (out_buf != NULL && out_size > 0) {
 		err = nfp_cpp_read(cpp, cpp_id, cpp_buf, out_buf, out_size);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 9b7c8aa7f8..74daa92aed 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -260,7 +260,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	memset(entries, 0, NSP_ETH_TABLE_SIZE);
 	ret = nfp_nsp_read_eth_table(nsp, entries, NSP_ETH_TABLE_SIZE);
 	if (ret < 0) {
-		PMD_DRV_LOG(ERR, "reading port table failed %d", ret);
+		PMD_DRV_LOG(ERR, "Reading port table failed %d", ret);
 		goto err;
 	}
 
@@ -279,7 +279,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	 * above.
 	 */
 	if (ret != 0 && ret != cnt) {
-		PMD_DRV_LOG(ERR, "table entry count (%d) unmatch entries present (%d)",
+		PMD_DRV_LOG(ERR, "Table entry count (%d) unmatch entries present (%d)",
 				ret, cnt);
 		goto err;
 	}
@@ -358,12 +358,12 @@ nfp_eth_config_start(struct nfp_cpp *cpp,
 
 	ret = nfp_nsp_read_eth_table(nsp, entries, NSP_ETH_TABLE_SIZE);
 	if (ret < 0) {
-		PMD_DRV_LOG(ERR, "reading port table failed %d", ret);
+		PMD_DRV_LOG(ERR, "Reading port table failed %d", ret);
 		goto err;
 	}
 
 	if ((entries[idx].port & NSP_ETH_PORT_LANES_MASK) == 0) {
-		PMD_DRV_LOG(ERR, "trying to set port state on disabled port %d", idx);
+		PMD_DRV_LOG(ERR, "Trying to set port state on disabled port %d", idx);
 		goto err;
 	}
 
@@ -643,7 +643,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp,
 
 	rate = nfp_eth_speed2rate(speed);
 	if (rate == RATE_INVALID) {
-		PMD_DRV_LOG(ERR, "could not find matching lane rate for speed %u", speed);
+		PMD_DRV_LOG(ERR, "Could not find matching lane rate for speed %u", speed);
 		return -EINVAL;
 	}
 
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index fa92f2762e..363f7d6198 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -118,16 +118,22 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp,
 {
 	int err;
 
-	if (nfp_cpp_mutex_lock(dev_mutex) != 0)
+	if (nfp_cpp_mutex_lock(dev_mutex) != 0) {
+		PMD_DRV_LOG(ERR, "RESOURCE - CPP mutex lock failed");
 		return -EINVAL;
+	}
 
 	err = nfp_cpp_resource_find(cpp, res);
-	if (err != 0)
+	if (err != 0) {
+		PMD_DRV_LOG(ERR, "RESOURCE - CPP resource find failed");
 		goto err_unlock_dev;
+	}
 
 	err = nfp_cpp_mutex_trylock(res->mutex);
-	if (err != 0)
+	if (err != 0) {
+		PMD_DRV_LOG(ERR, "RESOURCE - CPP mutex trylock failed");
 		goto err_res_mutex_free;
+	}
 
 	nfp_cpp_mutex_unlock(dev_mutex);
 
@@ -171,6 +177,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
 			NFP_RESOURCE_TBL_BASE, NFP_RESOURCE_TBL_KEY);
 	if (dev_mutex == NULL) {
+		PMD_DRV_LOG(ERR, "RESOURCE - CPP mutex alloc failed");
 		free(res);
 		return NULL;
 	}
@@ -182,8 +189,10 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
 		if (err == 0)
 			break;
-		if (err != -EBUSY)
+		if (err != -EBUSY) {
+			PMD_DRV_LOG(ERR, "RESOURCE - try acquire failed");
 			goto err_free;
+		}
 
 		if (count++ > 1000) {
 			PMD_DRV_LOG(ERR, "Error: resource %s timed out", name);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index a34278beca..d15a920752 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -60,8 +60,6 @@ nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
 	sw->size = ((uint64_t)fw->size_hi << 32) |
 			rte_le_to_cpu_32(fw->size_lo);
 
-	PMD_INIT_LOG(DEBUG, "rtsym_entry_init name=%s, addr=%" PRIx64 ", size=%" PRIu64 ", target=%d",
-		     sw->name, sw->addr, sw->size, sw->target);
 	switch (fw->target) {
 	case SYM_TGT_LMEM:
 		sw->target = NFP_RTSYM_TARGET_LMEM;
@@ -227,7 +225,7 @@ nfp_rtsym_size(const struct nfp_rtsym *sym)
 {
 	switch (sym->type) {
 	case NFP_RTSYM_TYPE_NONE:
-		PMD_DRV_LOG(ERR, "rtsym '%s': type NONE", sym->name);
+		PMD_DRV_LOG(ERR, "The type of rtsym '%s' is NONE", sym->name);
 		return 0;
 	case NFP_RTSYM_TYPE_OBJECT:    /* Fall through */
 	case NFP_RTSYM_TYPE_FUNCTION:
@@ -235,7 +233,7 @@ nfp_rtsym_size(const struct nfp_rtsym *sym)
 	case NFP_RTSYM_TYPE_ABS:
 		return sizeof(uint64_t);
 	default:
-		PMD_DRV_LOG(ERR, "rtsym '%s': unknown type: %d", sym->name, sym->type);
+		PMD_DRV_LOG(ERR, "Unknown RTSYM type %u", sym->type);
 		return 0;
 	}
 }
@@ -366,7 +364,7 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
 		err = nfp_rtsym_readq(rtbl->cpp, sym, NFP_CPP_ACTION_RW, 0, 0, &val);
 		break;
 	default:
-		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
+		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %#lx",
 				name, sym->size);
 		err = -EINVAL;
 		break;
@@ -396,10 +394,9 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
 	uint32_t cpp_id;
 	const struct nfp_rtsym *sym;
 
-	PMD_DRV_LOG(DEBUG, "mapping symbol %s", name);
 	sym = nfp_rtsym_lookup(rtbl, name);
 	if (sym == NULL) {
-		PMD_INIT_LOG(ERR, "symbol lookup fails for %s", name);
+		PMD_DRV_LOG(ERR, "Symbol lookup fails for %s", name);
 		return NULL;
 	}
 
@@ -418,10 +415,9 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
 
 	mem = nfp_cpp_map_area(rtbl->cpp, cpp_id, addr, sym->size, area);
 	if (mem == NULL) {
-		PMD_INIT_LOG(ERR, "Failed to map symbol %s", name);
+		PMD_DRV_LOG(ERR, "Failed to map symbol %s", name);
 		return NULL;
 	}
-	PMD_DRV_LOG(DEBUG, "symbol %s with address %p", name, mem);
 
 	return mem;
 }
-- 
2.39.1


  parent reply	other threads:[~2023-09-15  9:17 UTC|newest]

Thread overview: 159+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 11:09 [PATCH 00/27] refact the nfpcore module Chaoyong He
2023-08-24 11:09 ` [PATCH 01/27] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-08-24 11:09 ` [PATCH 02/27] net/nfp: unify the indent coding style Chaoyong He
2023-08-24 11:09 ` [PATCH 03/27] net/nfp: unify the type of integer variable Chaoyong He
2023-08-24 11:09 ` [PATCH 04/27] net/nfp: remove the unneeded logic Chaoyong He
2023-08-24 11:09 ` [PATCH 05/27] net/nfp: standard the local variable coding style Chaoyong He
2023-08-24 11:09 ` [PATCH 06/27] net/nfp: adjust the log statement Chaoyong He
2023-08-24 11:09 ` [PATCH 07/27] net/nfp: standard the comment style Chaoyong He
2023-08-24 11:09 ` [PATCH 08/27] net/nfp: using the DPDK memory management API Chaoyong He
2023-08-24 11:09 ` [PATCH 09/27] net/nfp: standard the blank character Chaoyong He
2023-08-24 11:09 ` [PATCH 10/27] net/nfp: unify the guide line of header file Chaoyong He
2023-08-24 11:09 ` [PATCH 11/27] net/nfp: rename some parameter and variable Chaoyong He
2023-08-24 11:09 ` [PATCH 12/27] net/nfp: refact the hwinfo module Chaoyong He
2023-08-24 11:09 ` [PATCH 13/27] net/nfp: refact the nffw module Chaoyong He
2023-08-24 11:09 ` [PATCH 14/27] net/nfp: refact the mip module Chaoyong He
2023-08-24 11:09 ` [PATCH 15/27] net/nfp: refact the rtsym module Chaoyong He
2023-08-24 11:09 ` [PATCH 16/27] net/nfp: refact the resource module Chaoyong He
2023-08-24 11:09 ` [PATCH 17/27] net/nfp: refact the target module Chaoyong He
2023-08-24 11:09 ` [PATCH 18/27] net/nfp: add a new header file Chaoyong He
2023-08-24 11:09 ` [PATCH 19/27] net/nfp: refact the nsp module Chaoyong He
2023-08-24 11:09 ` [PATCH 20/27] net/nfp: refact the mutex module Chaoyong He
2023-08-24 11:09 ` [PATCH 21/27] net/nfp: rename data field to sync with kernel driver Chaoyong He
2023-08-24 11:09 ` [PATCH 22/27] net/nfp: add the dev module Chaoyong He
2023-08-24 11:09 ` [PATCH 23/27] net/nfp: add header file for PCIe module Chaoyong He
2023-08-24 11:09 ` [PATCH 24/27] net/nfp: refact the cppcore module Chaoyong He
2023-08-24 11:09 ` [PATCH 25/27] net/nfp: refact the PCIe module Chaoyong He
2023-08-24 11:09 ` [PATCH 26/27] net/nfp: refact the cppcore and " Chaoyong He
2023-08-24 11:09 ` [PATCH 27/27] net/nfp: extend the usage of nfp BAR from 8 to 24 Chaoyong He
2023-08-30  2:14 ` [PATCH v2 00/27] refact the nfpcore module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 01/27] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-08-30  2:14   ` [PATCH v2 02/27] net/nfp: unify the indent coding style Chaoyong He
2023-08-30  2:14   ` [PATCH v2 03/27] net/nfp: unify the type of integer variable Chaoyong He
2023-08-30  2:14   ` [PATCH v2 04/27] net/nfp: remove the unneeded logic Chaoyong He
2023-08-30  2:14   ` [PATCH v2 05/27] net/nfp: standard the local variable coding style Chaoyong He
2023-08-30  2:14   ` [PATCH v2 06/27] net/nfp: adjust the log statement Chaoyong He
2023-08-30  2:14   ` [PATCH v2 07/27] net/nfp: standard the comment style Chaoyong He
2023-08-30  2:14   ` [PATCH v2 08/27] net/nfp: using the DPDK memory management API Chaoyong He
2023-08-30  2:14   ` [PATCH v2 09/27] net/nfp: standard the blank character Chaoyong He
2023-08-30  2:14   ` [PATCH v2 10/27] net/nfp: unify the guide line of header file Chaoyong He
2023-08-30  2:14   ` [PATCH v2 11/27] net/nfp: rename some parameter and variable Chaoyong He
2023-08-30  2:14   ` [PATCH v2 12/27] net/nfp: refact the hwinfo module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 13/27] net/nfp: refact the nffw module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 14/27] net/nfp: refact the mip module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 15/27] net/nfp: refact the rtsym module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 16/27] net/nfp: refact the resource module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 17/27] net/nfp: refact the target module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 18/27] net/nfp: add a new header file Chaoyong He
2023-08-30  2:14   ` [PATCH v2 19/27] net/nfp: refact the nsp module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 20/27] net/nfp: refact the mutex module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 21/27] net/nfp: rename data field to sync with kernel driver Chaoyong He
2023-08-30  2:14   ` [PATCH v2 22/27] net/nfp: add the dev module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 23/27] net/nfp: add header file for PCIe module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 24/27] net/nfp: refact the cppcore module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 25/27] net/nfp: refact the PCIe module Chaoyong He
2023-08-30  2:14   ` [PATCH v2 26/27] net/nfp: refact the cppcore and " Chaoyong He
2023-08-30  2:14   ` [PATCH v2 27/27] net/nfp: extend the usage of nfp BAR from 8 to 24 Chaoyong He
2023-09-15  9:15   ` [PATCH v3 00/27] refact the nfpcore module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 01/27] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-09-15  9:15     ` [PATCH v3 02/27] net/nfp: unify the indent coding style Chaoyong He
2023-09-15 13:40       ` Ferruh Yigit
2023-09-18  1:25         ` Chaoyong He
2023-09-18  2:22           ` Stephen Hemminger
2023-09-15  9:15     ` [PATCH v3 03/27] net/nfp: unify the type of integer variable Chaoyong He
2023-09-15 13:42       ` Ferruh Yigit
2023-09-18  1:26         ` Chaoyong He
2023-09-15  9:15     ` [PATCH v3 04/27] net/nfp: remove the unneeded logic Chaoyong He
2023-09-15  9:15     ` [PATCH v3 05/27] net/nfp: standard the local variable coding style Chaoyong He
2023-09-15  9:15     ` Chaoyong He [this message]
2023-09-15  9:15     ` [PATCH v3 07/27] net/nfp: standard the comment style Chaoyong He
2023-09-15 13:44       ` Ferruh Yigit
2023-09-18  1:28         ` Chaoyong He
2023-09-18  2:08         ` Chaoyong He
2023-09-15  9:15     ` [PATCH v3 08/27] net/nfp: using the DPDK memory management API Chaoyong He
2023-09-15 13:45       ` Ferruh Yigit
2023-09-18  1:29         ` Chaoyong He
2023-09-15  9:15     ` [PATCH v3 09/27] net/nfp: standard the blank character Chaoyong He
2023-09-15  9:15     ` [PATCH v3 10/27] net/nfp: unify the guide line of header file Chaoyong He
2023-09-15  9:15     ` [PATCH v3 11/27] net/nfp: rename some parameter and variable Chaoyong He
2023-09-15  9:15     ` [PATCH v3 12/27] net/nfp: refact the hwinfo module Chaoyong He
2023-09-15 13:46       ` Ferruh Yigit
2023-09-18  1:39         ` Chaoyong He
2023-09-18 11:01           ` Ferruh Yigit
2023-09-15  9:15     ` [PATCH v3 13/27] net/nfp: refact the nffw module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 14/27] net/nfp: refact the mip module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 15/27] net/nfp: refact the rtsym module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 16/27] net/nfp: refact the resource module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 17/27] net/nfp: refact the target module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 18/27] net/nfp: add a new header file Chaoyong He
2023-09-15  9:15     ` [PATCH v3 19/27] net/nfp: refact the nsp module Chaoyong He
2023-09-18 12:31       ` Ferruh Yigit
2023-09-18 12:36         ` Ferruh Yigit
2023-09-15  9:15     ` [PATCH v3 20/27] net/nfp: refact the mutex module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 21/27] net/nfp: rename data field to sync with kernel driver Chaoyong He
2023-09-15  9:15     ` [PATCH v3 22/27] net/nfp: add the dev module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 23/27] net/nfp: add header file for PCIe module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 24/27] net/nfp: refact the cppcore module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 25/27] net/nfp: refact the PCIe module Chaoyong He
2023-09-15  9:15     ` [PATCH v3 26/27] net/nfp: refact the cppcore and " Chaoyong He
2023-09-15  9:15     ` [PATCH v3 27/27] net/nfp: extend the usage of nfp BAR from 8 to 24 Chaoyong He
2023-09-15 13:49     ` [PATCH v3 00/27] refact the nfpcore module Ferruh Yigit
2023-09-18  2:45     ` [PATCH v4 00/26] " Chaoyong He
2023-09-18  2:45       ` [PATCH v4 01/26] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-09-18  2:45       ` [PATCH v4 02/26] net/nfp: unify the indent coding style Chaoyong He
2023-09-18 11:53         ` Niklas Söderlund
2023-09-18  2:45       ` [PATCH v4 03/26] net/nfp: unify the type of integer variable Chaoyong He
2023-09-18  2:45       ` [PATCH v4 04/26] net/nfp: remove the unneeded logic Chaoyong He
2023-09-18  2:45       ` [PATCH v4 05/26] net/nfp: standard the local variable coding style Chaoyong He
2023-09-18  2:45       ` [PATCH v4 06/26] net/nfp: adjust the log statement Chaoyong He
2023-09-18  2:45       ` [PATCH v4 07/26] net/nfp: standard the comment style Chaoyong He
2023-09-18  2:45       ` [PATCH v4 08/26] net/nfp: standard the blank character Chaoyong He
2023-09-18  2:45       ` [PATCH v4 09/26] net/nfp: unify the guide line of header file Chaoyong He
2023-09-18  2:45       ` [PATCH v4 10/26] net/nfp: rename some parameter and variable Chaoyong He
2023-09-18  2:45       ` [PATCH v4 11/26] net/nfp: refact the hwinfo module Chaoyong He
2023-09-18  2:45       ` [PATCH v4 12/26] net/nfp: refact the nffw module Chaoyong He
2023-09-18  2:45       ` [PATCH v4 13/26] net/nfp: refact the mip module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 14/26] net/nfp: refact the rtsym module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 15/26] net/nfp: refact the resource module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 16/26] net/nfp: refact the target module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 17/26] net/nfp: add a new header file Chaoyong He
2023-09-18  2:46       ` [PATCH v4 18/26] net/nfp: refact the nsp module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 19/26] net/nfp: refact the mutex module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 20/26] net/nfp: rename data field to sync with kernel driver Chaoyong He
2023-09-18  2:46       ` [PATCH v4 21/26] net/nfp: add the dev module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 22/26] net/nfp: add header file for PCIe module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 23/26] net/nfp: refact the cppcore module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 24/26] net/nfp: refact the PCIe module Chaoyong He
2023-09-18  2:46       ` [PATCH v4 25/26] net/nfp: refact the cppcore and " Chaoyong He
2023-09-18  2:46       ` [PATCH v4 26/26] net/nfp: extend the usage of nfp BAR from 8 to 24 Chaoyong He
2023-09-19  9:54       ` [PATCH v5 00/26] refact the nfpcore module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 01/26] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-09-19  9:54         ` [PATCH v5 02/26] net/nfp: unify the indent coding style Chaoyong He
2023-09-19  9:54         ` [PATCH v5 03/26] net/nfp: unify the type of integer variable Chaoyong He
2023-09-19  9:54         ` [PATCH v5 04/26] net/nfp: remove the unneeded logic Chaoyong He
2023-09-19  9:54         ` [PATCH v5 05/26] net/nfp: standard the local variable coding style Chaoyong He
2023-09-19  9:54         ` [PATCH v5 06/26] net/nfp: adjust the log statement Chaoyong He
2023-09-19  9:54         ` [PATCH v5 07/26] net/nfp: standard the comment style Chaoyong He
2023-09-19  9:54         ` [PATCH v5 08/26] net/nfp: standard the blank character Chaoyong He
2023-09-19  9:54         ` [PATCH v5 09/26] net/nfp: unify the guide line of header file Chaoyong He
2023-09-19  9:54         ` [PATCH v5 10/26] net/nfp: rename some parameter and variable Chaoyong He
2023-09-19  9:54         ` [PATCH v5 11/26] net/nfp: refact the hwinfo module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 12/26] net/nfp: refact the nffw module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 13/26] net/nfp: refact the mip module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 14/26] net/nfp: refact the rtsym module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 15/26] net/nfp: refact the resource module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 16/26] net/nfp: refact the target module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 17/26] net/nfp: add a new header file Chaoyong He
2023-09-19  9:54         ` [PATCH v5 18/26] net/nfp: refact the nsp module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 19/26] net/nfp: refact the mutex module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 20/26] net/nfp: rename data field to sync with kernel driver Chaoyong He
2023-09-19  9:54         ` [PATCH v5 21/26] net/nfp: add the dev module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 22/26] net/nfp: add header file for PCIe module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 23/26] net/nfp: refact the cppcore module Chaoyong He
2023-09-19  9:54         ` [PATCH v5 24/26] net/nfp: refact the PCIe module Chaoyong He
2023-09-19 21:18         ` [PATCH v5 00/26] refact the nfpcore module Ferruh Yigit
2023-09-20  1:55           ` Chaoyong He
2023-09-20  8:54             ` Ferruh Yigit
2023-09-20  9:59         ` Ferruh Yigit
2023-09-20  1:28       ` [PATCH v5 25/26] net/nfp: refact the cppcore and PCIe module Chaoyong He
2023-09-20  1:29       ` [PATCH v5 26/26] net/nfp: extend the usage of nfp BAR from 8 to 24 Chaoyong He

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=20230915091551.1459606-7-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=niklas.soderlund@corigine.com \
    --cc=oss-drivers@corigine.com \
    /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).