DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mvpp2: fix build by removing newlines in logs
@ 2024-10-09  9:18 Thomas Monjalon
  2024-10-09  9:24 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2024-10-09  9:18 UTC (permalink / raw)
  To: dev; +Cc: Liron Himi, Chengwen Feng, David Marchand, Andrew Rybchenko

After using RTE_LOG_LINE_PREFIX in MRVL_LOG macro,
an assert was detecting some newlines in logs.
After removing these superfluous newlines, the compilation passes.

Fixes: 2b843cac232e ("drivers: use per line logging in helpers")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 14 ++++-----
 drivers/net/mvpp2/mrvl_qos.c    | 56 ++++++++++++++++-----------------
 2 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 36be79b9a5..4200c11d46 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -215,7 +215,7 @@ mrvl_pp2_fixup_init(void)
 		dummy_pool_id[i] = mrvl_reserve_bit(&used_bpools[i],
 					     PP2_BPOOL_NUM_POOLS);
 		if (dummy_pool_id[i] < 0) {
-			MRVL_LOG(ERR, "Can't find free pool\n");
+			MRVL_LOG(ERR, "Can't find free pool");
 			return -1;
 		}
 
@@ -227,7 +227,7 @@ mrvl_pp2_fixup_init(void)
 		bpool_params.dummy_short_pool = 1;
 		err = pp2_bpool_init(&bpool_params, &dummy_pool[i]);
 		if (err != 0 || !dummy_pool[i]) {
-			MRVL_LOG(ERR, "BPool init failed!\n");
+			MRVL_LOG(ERR, "BPool init failed!");
 			used_bpools[i] &= ~(1 << dummy_pool_id[i]);
 			return -1;
 		}
@@ -491,7 +491,7 @@ mrvl_dev_configure(struct rte_eth_dev *dev)
 	}
 
 	if (dev->data->dev_conf.rxmode.mtu > priv->max_mtu) {
-		MRVL_LOG(ERR, "MTU %u is larger than max_mtu %u\n",
+		MRVL_LOG(ERR, "MTU %u is larger than max_mtu %u",
 			 dev->data->dev_conf.rxmode.mtu,
 			 priv->max_mtu);
 		return -EINVAL;
@@ -770,7 +770,7 @@ static int mrvl_populate_vlan_table(struct rte_eth_dev *dev, int on)
 				vbit >>= 1;
 			ret = mrvl_vlan_filter_set(dev, vlan, on);
 			if (ret) {
-				MRVL_LOG(ERR, "Failed to setup VLAN filter\n");
+				MRVL_LOG(ERR, "Failed to setup VLAN filter");
 				return ret;
 			}
 		}
@@ -1875,7 +1875,7 @@ static int mrvl_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	int ret;
 
 	if (mask & RTE_ETH_VLAN_STRIP_MASK) {
-		MRVL_LOG(ERR, "VLAN stripping is not supported\n");
+		MRVL_LOG(ERR, "VLAN stripping is not supported");
 		return -ENOTSUP;
 	}
 
@@ -1890,7 +1890,7 @@ static int mrvl_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	}
 
 	if (mask & RTE_ETH_VLAN_EXTEND_MASK) {
-		MRVL_LOG(ERR, "Extend VLAN not supported\n");
+		MRVL_LOG(ERR, "Extend VLAN not supported");
 		return -ENOTSUP;
 	}
 
@@ -1941,7 +1941,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
 			!= cookie_addr_high) {
 			MRVL_LOG(ERR,
 				"mbuf virtual addr high is out of range "
-				"0x%x instead of 0x%x\n",
+				"0x%x instead of 0x%x",
 				(uint32_t)((uint64_t)mbufs[i] >> 32),
 				(uint32_t)(cookie_addr_high >> 32));
 			goto out;
diff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c
index f43217bc58..e298da2724 100644
--- a/drivers/net/mvpp2/mrvl_qos.c
+++ b/drivers/net/mvpp2/mrvl_qos.c
@@ -500,7 +500,7 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 	entry = rte_cfgfile_get_entry(file, sec_name,
 				      MRVL_TOK_PARSER_UDF_PROTO);
 	if (!entry) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set\n", udf,
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set", udf,
 			 MRVL_TOK_PARSER_UDF_PROTO);
 		return -1;
 	}
@@ -509,7 +509,7 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 	entry_field = rte_cfgfile_get_entry(file, sec_name,
 				       MRVL_TOK_PARSER_UDF_FIELD);
 	if (!entry_field) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set\n", udf,
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set", udf,
 			 MRVL_TOK_PARSER_UDF_FIELD);
 		return -1;
 	}
@@ -523,7 +523,7 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 			field_size = 2;
 		} else {
 			MRVL_LOG(ERR, "UDF[%d]: mismatch between '%s' proto "
-				 "and '%s' field\n", udf,
+				 "and '%s' field", udf,
 				 MRVL_TOK_PARSER_UDF_PROTO_ETH,
 				 entry_field);
 			return -1;
@@ -537,45 +537,45 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 			field_size = 2;
 		} else {
 			MRVL_LOG(ERR, "UDF[%d]: mismatch between '%s' proto "
-				 "and '%s' field\n", udf,
+				 "and '%s' field", udf,
 				 MRVL_TOK_PARSER_UDF_PROTO_UDP,
 				 entry_field);
 			return -1;
 		}
 	} else {
-		MRVL_LOG(ERR, "UDF[%d]: Unsupported '%s' proto\n", udf, entry);
+		MRVL_LOG(ERR, "UDF[%d]: Unsupported '%s' proto", udf, entry);
 		return -1;
 	}
 
 	snprintf(malloc_name, sizeof(malloc_name), "mrvl_udf_%d_key", udf);
 	udf_params->match_key = rte_zmalloc(malloc_name, field_size, 0);
 	if (udf_params->match_key == NULL) {
-		MRVL_LOG(ERR, "Cannot allocate udf %d key\n", udf);
+		MRVL_LOG(ERR, "Cannot allocate udf %d key", udf);
 		return -1;
 	}
 	snprintf(malloc_name, sizeof(malloc_name), "mrvl_udf_%d_mask", udf);
 	udf_params->match_mask = rte_zmalloc(malloc_name, field_size, 0);
 	if (udf_params->match_mask == NULL) {
-		MRVL_LOG(ERR, "Cannot allocate udf %d mask\n", udf);
+		MRVL_LOG(ERR, "Cannot allocate udf %d mask", udf);
 		return -1;
 	}
 
 	/* Read 'key' field */
 	entry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PARSER_UDF_KEY);
 	if (!entry) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set\n", udf,
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set", udf,
 			 MRVL_TOK_PARSER_UDF_KEY);
 		return -1;
 	}
 
 	if (strncmp(entry, "0x", 2) != 0)  {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field must start with '0x'\n",
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field must start with '0x'",
 			 udf, MRVL_TOK_PARSER_UDF_KEY);
 		return -EINVAL;
 	}
 
 	if (strlen(entry) != FIELD_LEN_IN_CHARS(field_size)) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field's len must be %d\n", udf,
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field's len must be %d", udf,
 			 MRVL_TOK_PARSER_UDF_KEY,
 			 FIELD_LEN_IN_CHARS(field_size));
 		return -EINVAL;
@@ -588,7 +588,7 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 		if (get_val_securely8(tmp_arr, 16,
 				      &udf_params->match_key[i]) < 0) {
 			MRVL_LOG(ERR, "UDF[%d]: '%s' field's value is not in "
-				"hex format\n", udf, MRVL_TOK_PARSER_UDF_KEY);
+				"hex format", udf, MRVL_TOK_PARSER_UDF_KEY);
 			return -EINVAL;
 		}
 		entry += 2;
@@ -597,18 +597,18 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 	/* Read 'mask' field */
 	entry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PARSER_UDF_MASK);
 	if (!entry) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set\n", udf,
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set", udf,
 			 MRVL_TOK_PARSER_UDF_MASK);
 		return -1;
 	}
 	if (strncmp(entry, "0x", 2) != 0) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field must start with '0x'\n",
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field must start with '0x'",
 			 udf, MRVL_TOK_PARSER_UDF_MASK);
 		return -EINVAL;
 	}
 
 	if (strlen(entry) != FIELD_LEN_IN_CHARS(field_size)) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field's len must be %d\n", udf,
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field's len must be %d", udf,
 			 MRVL_TOK_PARSER_UDF_MASK,
 			 FIELD_LEN_IN_CHARS(field_size));
 		return -EINVAL;
@@ -621,7 +621,7 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 		if (get_val_securely8(tmp_arr, 16,
 				      &udf_params->match_mask[i]) < 0) {
 			MRVL_LOG(ERR, "UDF[%d]: '%s' field's value is not in "
-				"hex format\n", udf, MRVL_TOK_PARSER_UDF_MASK);
+				"hex format", udf, MRVL_TOK_PARSER_UDF_MASK);
 			return -EINVAL;
 		}
 		entry += 2;
@@ -631,7 +631,7 @@ parse_udf(struct rte_cfgfile *file, const char *sec_name, int udf,
 	entry = rte_cfgfile_get_entry(file, sec_name,
 				      MRVL_TOK_PARSER_UDF_OFFSET);
 	if (!entry) {
-		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set\n", udf,
+		MRVL_LOG(ERR, "UDF[%d]: '%s' field must be set", udf,
 			 MRVL_TOK_PARSER_UDF_OFFSET);
 		return -1;
 	}
@@ -663,7 +663,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 	char sec_name[32];
 
 	if (file == NULL) {
-		MRVL_LOG(ERR, "Cannot load configuration %s\n", path);
+		MRVL_LOG(ERR, "Cannot load configuration %s", path);
 		return -1;
 	}
 
@@ -672,7 +672,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 	 */
 	*cfg = rte_zmalloc("mrvl_cfg", sizeof(struct mrvl_cfg), 0);
 	if (*cfg == NULL) {
-		MRVL_LOG(ERR, "Cannot allocate configuration %s\n", path);
+		MRVL_LOG(ERR, "Cannot allocate configuration %s", path);
 		return -1;
 	}
 
@@ -681,7 +681,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 		sizeof(MRVL_TOK_PARSER_UDF) - 1);
 
 	if (n && n > PP2_MAX_UDFS_SUPPORTED) {
-		MRVL_LOG(ERR, "found %d udf sections, but only %d are supported\n",
+		MRVL_LOG(ERR, "found %d udf sections, but only %d are supported",
 			 n, PP2_MAX_UDFS_SUPPORTED);
 		return -1;
 	}
@@ -693,14 +693,14 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 		/* udf sections must be sequential. */
 		if (rte_cfgfile_num_sections(file, sec_name,
 				strlen(sec_name)) <= 0) {
-			MRVL_LOG(ERR, "udf sections must be sequential (0 - %d)\n",
+			MRVL_LOG(ERR, "udf sections must be sequential (0 - %d)",
 				 PP2_MAX_UDFS_SUPPORTED - 1);
 			return -1;
 		}
 
 		ret = parse_udf(file, sec_name, i, *cfg);
 		if (ret) {
-			MRVL_LOG(ERR, "Error in parsing %s!\n", sec_name);
+			MRVL_LOG(ERR, "Error in parsing %s!", sec_name);
 			return -1;
 		}
 	}
@@ -763,7 +763,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 				PP2_PPIO_HDR_ETH_EXT_DSA;
 			} else {
 				MRVL_LOG(ERR,
-					"Error in parsing %s value (%s)!\n",
+					"Error in parsing %s value (%s)!",
 					MRVL_TOK_START_HDR, entry);
 				return -1;
 			}
@@ -823,7 +823,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 					PP2_CLS_QOS_TBL_VLAN_PRI;
 			} else {
 				MRVL_LOG(ERR,
-					"Error in parsing %s value (%s)!\n",
+					"Error in parsing %s value (%s)!",
 					MRVL_TOK_MAPPING_PRIORITY, entry);
 				return -1;
 			}
@@ -851,7 +851,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 			ret = get_outq_cfg(file, n, i, *cfg);
 			if (ret < 0) {
 				MRVL_LOG(ERR,
-					"Error %d parsing port %d outq %d!\n",
+					"Error %d parsing port %d outq %d!",
 					ret, n, i);
 				return -1;
 			}
@@ -861,7 +861,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 			ret = parse_tc_cfg(file, n, i, *cfg);
 			if (ret < 0) {
 				MRVL_LOG(ERR,
-					"Error %d parsing port %d tc %d!\n",
+					"Error %d parsing port %d tc %d!",
 					ret, n, i);
 				return -1;
 			}
@@ -889,7 +889,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 		if (entry) {
 			if (get_val_securely(entry, &val) < 0) {
 				MRVL_LOG(ERR,
-					"Error in parsing %s value (%s)!\n",
+					"Error in parsing %s value (%s)!",
 					MRVL_TOK_FWD_BAD_FRAMES, entry);
 				return -1;
 			}
@@ -904,7 +904,7 @@ mrvl_get_cfg(const char *key __rte_unused, const char *path, void *extra_args)
 		if (entry) {
 			if (get_val_securely(entry, &val) < 0) {
 				MRVL_LOG(ERR,
-					"Error in parsing %s value (%s)!\n",
+					"Error in parsing %s value (%s)!",
 					MRVL_TOK_FILL_BPOOL_BUFFS, entry);
 				return -1;
 			}
@@ -972,7 +972,7 @@ setup_policer(struct mrvl_priv *priv, struct pp2_cls_plcr_params *params)
 	 *
 	 * Lets use 0th then.
 	 */
-	sprintf(match, "policer-%d:%d\n", priv->pp_id, 0);
+	sprintf(match, "policer-%d:%d", priv->pp_id, 0);
 	params->match = match;
 
 	ret = pp2_cls_plcr_init(params, &priv->default_policer);
-- 
2.46.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/mvpp2: fix build by removing newlines in logs
  2024-10-09  9:18 [PATCH] net/mvpp2: fix build by removing newlines in logs Thomas Monjalon
@ 2024-10-09  9:24 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2024-10-09  9:24 UTC (permalink / raw)
  To: dev; +Cc: Liron Himi, Chengwen Feng, David Marchand, Andrew Rybchenko

09/10/2024 11:18, Thomas Monjalon:
> After using RTE_LOG_LINE_PREFIX in MRVL_LOG macro,
> an assert was detecting some newlines in logs.
> After removing these superfluous newlines, the compilation passes.
> 
> Fixes: 2b843cac232e ("drivers: use per line logging in helpers")
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

It can be dropped as it has been already fixed by Jerin.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-09  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-09  9:18 [PATCH] net/mvpp2: fix build by removing newlines in logs Thomas Monjalon
2024-10-09  9:24 ` Thomas Monjalon

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).