Soft Patch Panel
 help / color / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 2/2] shared/sec: change log label in cmd runner
Date: Fri, 31 May 2019 12:36:17 +0900
Message-ID: <1559273777-26186-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1559273777-26186-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

As previous update, this patch is to change log labels to
`WK_CMD_RUNNER`.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 .../secondary/spp_worker_th/cmd_runner.c      | 142 +++++++++---------
 1 file changed, 72 insertions(+), 70 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/cmd_runner.c b/src/shared/secondary/spp_worker_th/cmd_runner.c
index e917007..613e924 100644
--- a/src/shared/secondary/spp_worker_th/cmd_runner.c
+++ b/src/shared/secondary/spp_worker_th/cmd_runner.c
@@ -17,8 +17,7 @@
 #include "cmd_parser.h"
 #include "cmd_runner.h"
 
-#define RTE_LOGTYPE_SPP_COMMAND_PROC RTE_LOGTYPE_USER1
-#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER2
+#define RTE_LOGTYPE_WK_CMD_RUNNER RTE_LOGTYPE_USER1
 
 /* request message initial size */
 #define CMD_ERR_MSG_LEN 128
@@ -136,25 +135,26 @@ update_cls_table(enum sppwk_action wk_action,
 	uint64_t mac_uint64;
 	struct sppwk_port_info *port_info;
 
-	RTE_LOG(DEBUG, APP, "Called update_cls_table with "
+	RTE_LOG(DEBUG, WK_CMD_RUNNER, "Called __func__ with "
 			"type `mac`, mac_addr `%s`, and port `%d:%d`.\n",
 			mac_str, port->iface_type, port->iface_no);
 
 	mac_int64 = sppwk_convert_mac_str_to_int64(mac_str);
 	if (unlikely(mac_int64 == -1)) {
-		RTE_LOG(ERR, APP, "Invalid MAC address `%s`.\n", mac_str);
+		RTE_LOG(ERR, WK_CMD_RUNNER, "Invalid MAC address `%s`.\n",
+				mac_str);
 		return SPP_RET_NG;
 	}
 	mac_uint64 = (uint64_t)mac_int64;
 
 	port_info = get_sppwk_port(port->iface_type, port->iface_no);
 	if (unlikely(port_info == NULL)) {
-		RTE_LOG(ERR, APP, "Failed to get port %d:%d.\n",
+		RTE_LOG(ERR, WK_CMD_RUNNER, "Failed to get port %d:%d.\n",
 				port->iface_type, port->iface_no);
 		return SPP_RET_NG;
 	}
 	if (unlikely(port_info->iface_type == UNDEF)) {
-		RTE_LOG(ERR, APP, "Port %d:%d doesn't exist.\n",
+		RTE_LOG(ERR, WK_CMD_RUNNER, "Port %d:%d doesn't exist.\n",
 				port->iface_type, port->iface_no);
 		return SPP_RET_NG;
 	}
@@ -162,12 +162,14 @@ update_cls_table(enum sppwk_action wk_action,
 	if (wk_action == SPPWK_ACT_DEL) {
 		if ((port_info->cls_attrs.vlantag.vid != 0) &&
 				port_info->cls_attrs.vlantag.vid != vid) {
-			RTE_LOG(ERR, APP, "Unexpected VLAN ID `%d`.\n", vid);
+			RTE_LOG(ERR, WK_CMD_RUNNER,
+					"Unexpected VLAN ID `%d`.\n", vid);
 			return SPP_RET_NG;
 		}
 		if ((port_info->cls_attrs.mac_addr != 0) &&
 				port_info->cls_attrs.mac_addr != mac_uint64) {
-			RTE_LOG(ERR, APP, "Unexpected MAC %s.\n", mac_str);
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Unexpected MAC %s.\n",
+					mac_str);
 			return SPP_RET_NG;
 		}
 
@@ -180,14 +182,14 @@ update_cls_table(enum sppwk_action wk_action,
 		if (unlikely(port_info->cls_attrs.vlantag.vid !=
 				ETH_VLAN_ID_MAX)) {
 			/* TODO(yasufum) why two vids are required in msg ? */
-			RTE_LOG(ERR, APP, "Used port %d:%d, vid %d != %d.\n",
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Used port %d:%d, vid %d != %d.\n",
 					port->iface_type, port->iface_no,
 					port_info->cls_attrs.vlantag.vid, vid);
 			return SPP_RET_NG;
 		}
 		if (unlikely(port_info->cls_attrs.mac_addr != 0)) {
 			/* TODO(yasufum) why two macs are required in msg ? */
-			RTE_LOG(ERR, APP, "Used port %d:%d, mac %s != %s.\n",
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Used port %d:%d, mac %s != %s.\n",
 					port->iface_type, port->iface_no,
 					port_info->cls_attrs.mac_addr_str,
 					mac_str);
@@ -228,21 +230,21 @@ update_comp(enum sppwk_action wk_action, const char *name,
 	case SPPWK_ACT_START:
 		info = (core_info + lcore_id);
 		if (info->status == SPP_CORE_UNUSE) {
-			RTE_LOG(ERR, APP, "Core %d is not available because "
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Core %d is not available because "
 				"it is in SPP_CORE_UNUSE state.\n", lcore_id);
 			return SPP_RET_NG;
 		}
 
 		comp_lcore_id = sppwk_get_lcore_id(name);
 		if (comp_lcore_id >= 0) {
-			RTE_LOG(ERR, APP, "Component name '%s' is already "
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Component name '%s' is already "
 				"used.\n", name);
 			return SPP_RET_NG;
 		}
 
 		comp_lcore_id = get_free_lcore_id();
 		if (comp_lcore_id < 0) {
-			RTE_LOG(ERR, APP, "Cannot assign component over the "
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Cannot assign component over the "
 				"maximum number.\n");
 			return SPP_RET_NG;
 		}
@@ -304,14 +306,14 @@ static int
 check_port_count(int component_type, enum spp_port_rxtx rxtx, int num_rx,
 								int num_tx)
 {
-	RTE_LOG(INFO, SPP_COMMAND_PROC, "port count, port_type=%d,"
+	RTE_LOG(INFO, WK_CMD_RUNNER, "port count, port_type=%d,"
 				" rx=%d, tx=%d\n", rxtx, num_rx, num_tx);
 	if (rxtx == SPP_PORT_RXTX_RX)
 		num_rx++;
 	else
 		num_tx++;
 	/* Add rx or tx port appointed in port_type. */
-	RTE_LOG(INFO, SPP_COMMAND_PROC, "Num of ports after count up,"
+	RTE_LOG(INFO, WK_CMD_RUNNER, "Num of ports after count up,"
 				" port_type=%d, rx=%d, tx=%d\n",
 				rxtx, num_rx, num_tx);
 	switch (component_type) {
@@ -365,7 +367,7 @@ update_port(enum sppwk_action wk_action,
 
 	comp_lcore_id = sppwk_get_lcore_id(name);
 	if (comp_lcore_id < 0) {
-		RTE_LOG(ERR, APP, "Unknown component by port command. "
+		RTE_LOG(ERR, WK_CMD_RUNNER, "Unknown component by port command. "
 				"(component = %s)\n", name);
 		return SPP_RET_NG;
 	}
@@ -399,7 +401,7 @@ update_port(enum sppwk_action wk_action,
 					    SPPWK_PORT_ABL_OPS_ADD_VLANTAG))
 					cnt++;
 				if (cnt >= SPP_PORT_ABILITY_MAX) {
-					RTE_LOG(ERR, APP, "update VLAN tag "
+					RTE_LOG(ERR, WK_CMD_RUNNER, "update VLAN tag "
 						"Non-registratio\n");
 					return SPP_RET_NG;
 				}
@@ -413,7 +415,7 @@ update_port(enum sppwk_action wk_action,
 		}
 
 		if (*nof_ports >= RTE_MAX_ETHPORTS) {
-			RTE_LOG(ERR, APP, "Cannot assign port over the "
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Cannot assign port over the "
 				"maximum number.\n");
 			return SPP_RET_NG;
 		}
@@ -425,7 +427,7 @@ update_port(enum sppwk_action wk_action,
 				cnt++;
 			}
 			if (cnt >= SPP_PORT_ABILITY_MAX) {
-				RTE_LOG(ERR, APP,
+				RTE_LOG(ERR, WK_CMD_RUNNER,
 						"No space of port ability.\n");
 				return SPP_RET_NG;
 			}
@@ -512,7 +514,7 @@ spp_iterate_core_info(struct spp_iterate_core_params *params)
 				"", SPP_TYPE_UNUSE_STR,
 				0, NULL, 0, NULL);
 			if (unlikely(ret != 0)) {
-				RTE_LOG(ERR, APP, "Cannot iterate core "
+				RTE_LOG(ERR, WK_CMD_RUNNER, "Cannot iterate core "
 						"information. "
 						"(core = %d, type = %d)\n",
 						lcore_id, SPP_COMPONENT_UNUSE);
@@ -545,7 +547,7 @@ spp_iterate_core_info(struct spp_iterate_core_params *params)
 						params);
 #endif /* SPP_MIRROR_MODULE */
 			if (unlikely(ret != 0)) {
-				RTE_LOG(ERR, APP, "Cannot iterate core "
+				RTE_LOG(ERR, WK_CMD_RUNNER, "Cannot iterate core "
 						"information. "
 						"(core = %d, type = %d)\n",
 						lcore_id, comp_info->type);
@@ -567,7 +569,7 @@ spp_iterate_classifier_table(
 
 	ret = spp_classifier_mac_iterate_table(params);
 	if (unlikely(ret != 0)) {
-		RTE_LOG(ERR, APP, "Cannot iterate classifier_mac_table.\n");
+		RTE_LOG(ERR, WK_CMD_RUNNER, "Cannot iterate classifier_mac_table.\n");
 		return SPP_RET_NG;
 	}
 
@@ -604,7 +606,7 @@ append_json_comma(char **output)
 {
 	*output = spp_strbuf_append(*output, JSON_COMMA, strlen(JSON_COMMA));
 	if (unlikely(*output == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"JSON's comma failed to add.\n");
 		return SPP_RET_NG;
 	}
@@ -621,7 +623,7 @@ append_json_uint_value(const char *name, char **output, unsigned int value)
 	*output = spp_strbuf_append(*output, "",
 			strlen(name) + CMD_TAG_APPEND_SIZE*2);
 	if (unlikely(*output == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"JSON's numeric format failed to add. "
 				"(name = %s, uint = %u)\n", name, value);
 		return SPP_RET_NG;
@@ -641,7 +643,7 @@ append_json_int_value(const char *name, char **output, int value)
 	*output = spp_strbuf_append(*output, "",
 			strlen(name) + CMD_TAG_APPEND_SIZE*2);
 	if (unlikely(*output == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"JSON's numeric format failed to add. "
 				"(name = %s, int = %d)\n", name, value);
 		return SPP_RET_NG;
@@ -661,7 +663,7 @@ append_json_str_value(const char *name, char **output, const char *str)
 	*output = spp_strbuf_append(*output, "",
 			strlen(name) + strlen(str) + CMD_TAG_APPEND_SIZE);
 	if (unlikely(*output == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"JSON's string format failed to add. "
 				"(name = %s, str = %s)\n", name, str);
 		return SPP_RET_NG;
@@ -681,7 +683,7 @@ append_json_array_brackets(const char *name, char **output, const char *str)
 	*output = spp_strbuf_append(*output, "",
 			strlen(name) + strlen(str) + CMD_TAG_APPEND_SIZE);
 	if (unlikely(*output == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"JSON's square bracket failed to add. "
 				"(name = %s, str = %s)\n", name, str);
 		return SPP_RET_NG;
@@ -701,7 +703,7 @@ append_json_block_brackets(const char *name, char **output, const char *str)
 	*output = spp_strbuf_append(*output, "",
 			strlen(name) + strlen(str) + CMD_TAG_APPEND_SIZE);
 	if (unlikely(*output == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"JSON's curly bracket failed to add. "
 				"(name = %s, str = %s)\n", name, str);
 		return SPP_RET_NG;
@@ -722,7 +724,7 @@ exec_cmd(const struct spp_command *cmd)
 {
 	int ret;
 
-	RTE_LOG(INFO, SPP_COMMAND_PROC, "Exec `%s` cmd.\n",
+	RTE_LOG(INFO, WK_CMD_RUNNER, "Exec `%s` cmd.\n",
 			sppwk_cmd_type_str(cmd->type));
 
 	switch (cmd->type) {
@@ -734,7 +736,7 @@ exec_cmd(const struct spp_command *cmd)
 				cmd->spec.cls_table.mac,
 				&cmd->spec.cls_table.port);
 		if (ret == 0) {
-			RTE_LOG(INFO, SPP_COMMAND_PROC, "Exec flush.\n");
+			RTE_LOG(INFO, WK_CMD_RUNNER, "Exec flush.\n");
 			ret = spp_flush();
 		}
 		break;
@@ -746,19 +748,19 @@ exec_cmd(const struct spp_command *cmd)
 				cmd->spec.comp.core,
 				cmd->spec.comp.type);
 		if (ret == 0) {
-			RTE_LOG(INFO, SPP_COMMAND_PROC, "Exec flush.\n");
+			RTE_LOG(INFO, WK_CMD_RUNNER, "Exec flush.\n");
 			ret = spp_flush();
 		}
 		break;
 
 	case SPPWK_CMDTYPE_PORT:
-		RTE_LOG(INFO, SPP_COMMAND_PROC, "with action `%s`.\n",
+		RTE_LOG(INFO, WK_CMD_RUNNER, "with action `%s`.\n",
 				sppwk_action_str(cmd->spec.port.wk_action));
 		ret = update_port(cmd->spec.port.wk_action,
 				&cmd->spec.port.port, cmd->spec.port.rxtx,
 				cmd->spec.port.name, &cmd->spec.port.ability);
 		if (ret == 0) {
-			RTE_LOG(INFO, SPP_COMMAND_PROC, "Exec flush.\n");
+			RTE_LOG(INFO, WK_CMD_RUNNER, "Exec flush.\n");
 			ret = spp_flush();
 		}
 		break;
@@ -883,7 +885,7 @@ append_error_details_value(const char *name, char **output, void *tmp)
 
 	tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s)\n",
 				name);
@@ -925,7 +927,7 @@ append_interface_array(char **output, const enum port_type type)
 
 		*output = spp_strbuf_append(*output, tmp_str, strlen(tmp_str));
 		if (unlikely(*output == NULL)) {
-			RTE_LOG(ERR, SPP_COMMAND_PROC,
+			RTE_LOG(ERR, WK_CMD_RUNNER,
 					"Interface number failed to add. "
 					"(type = %d)\n", type);
 			return SPP_RET_NG;
@@ -954,7 +956,7 @@ append_interface_value(const char *name, char **output,
 	int ret = SPP_RET_NG;
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s)\n",
 				name);
@@ -1011,7 +1013,7 @@ append_vlan_block(const char *name, char **output,
 	struct spp_port_ability *info = NULL;
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s)\n",
 				name);
@@ -1062,7 +1064,7 @@ append_port_block(char **output, const struct sppwk_port_idx *port,
 	char port_str[CMD_TAG_APPEND_SIZE];
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = port_block)\n");
 		return SPP_RET_NG;
@@ -1095,7 +1097,7 @@ append_port_array(const char *name, char **output, const int num,
 	int i = 0;
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s)\n",
 				name);
@@ -1133,7 +1135,7 @@ append_core_element_value(
 	tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
 		/* TODO(yasufum) refactor no meaning err msg */
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"allocate error. (name = %s)\n",
 				name);
 		return ret;
@@ -1197,7 +1199,7 @@ append_core_value(const char *name, char **output,
 	struct spp_iterate_core_params itr_params;
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s)\n",
 				name);
@@ -1234,7 +1236,7 @@ append_classifier_element_value(
 	buff = params->output;
 	tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = classifier_table)\n");
 		return ret;
@@ -1285,7 +1287,7 @@ append_classifier_table_value(const char *name, char **output,
 	struct spp_iterate_classifier_table_params itr_params;
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s)\n",
 				name);
@@ -1318,7 +1320,7 @@ append_response_list_value(char **output,
 	char *tmp_buff;
 	tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = response_list)\n");
 		return SPP_RET_NG;
@@ -1329,7 +1331,7 @@ append_response_list_value(char **output,
 		ret = responses[i].func(responses[i].tag_name, &tmp_buff, tmp);
 		if (unlikely(ret < SPP_RET_OK)) {
 			spp_strbuf_free(tmp_buff);
-			RTE_LOG(ERR, SPP_COMMAND_PROC,
+			RTE_LOG(ERR, WK_CMD_RUNNER,
 					"Failed to get reply string. "
 					"(tag = %s)\n", responses[i].tag_name);
 			return SPP_RET_NG;
@@ -1342,7 +1344,7 @@ append_response_list_value(char **output,
 			ret = append_json_comma(output);
 			if (unlikely(ret < SPP_RET_OK)) {
 				spp_strbuf_free(tmp_buff);
-				RTE_LOG(ERR, SPP_COMMAND_PROC,
+				RTE_LOG(ERR, WK_CMD_RUNNER,
 						"Failed to add commas. "
 						"(tag = %s)\n",
 						responses[i].tag_name);
@@ -1354,7 +1356,7 @@ append_response_list_value(char **output,
 				strlen(tmp_buff));
 		if (unlikely(*output == NULL)) {
 			spp_strbuf_free(tmp_buff);
-			RTE_LOG(ERR, SPP_COMMAND_PROC,
+			RTE_LOG(ERR, WK_CMD_RUNNER,
 					"Failed to add reply string. "
 					"(tag = %s)\n",
 					responses[i].tag_name);
@@ -1402,7 +1404,7 @@ append_command_results_value(const char *name, char **output,
 	char *tmp_buff1, *tmp_buff2;
 	tmp_buff1 = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff1 == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s, buff=1)\n",
 				name);
@@ -1412,7 +1414,7 @@ append_command_results_value(const char *name, char **output,
 	tmp_buff2 = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff2 == NULL)) {
 		spp_strbuf_free(tmp_buff1);
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s, buff=2)\n",
 				name);
@@ -1451,7 +1453,7 @@ append_info_value(const char *name, char **output)
 	int ret = SPP_RET_NG;
 	char *tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = %s)\n",
 				name);
@@ -1481,7 +1483,7 @@ send_decode_error_response(int *sock,
 	tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
 		/* TODO(yasufum) refactor no meaning err msg */
-		RTE_LOG(ERR, SPP_COMMAND_PROC, "allocate error. "
+		RTE_LOG(ERR, WK_CMD_RUNNER, "allocate error. "
 				"(name = decode_error_response)\n");
 		return;
 	}
@@ -1491,7 +1493,7 @@ send_decode_error_response(int *sock,
 			request->num_command, command_results);
 	if (unlikely(ret < SPP_RET_OK)) {
 		spp_strbuf_free(tmp_buff);
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"Failed to make command result response.\n");
 		return;
 	}
@@ -1500,7 +1502,7 @@ send_decode_error_response(int *sock,
 	if (unlikely(msg == NULL)) {
 		spp_strbuf_free(tmp_buff);
 		/* TODO(yasufum) refactor no meaning err msg */
-		RTE_LOG(ERR, SPP_COMMAND_PROC, "allocate error. "
+		RTE_LOG(ERR, WK_CMD_RUNNER, "allocate error. "
 				"(name = decode_error_response)\n");
 		return;
 	}
@@ -1508,20 +1510,20 @@ send_decode_error_response(int *sock,
 	spp_strbuf_free(tmp_buff);
 	if (unlikely(ret < SPP_RET_OK)) {
 		spp_strbuf_free(msg);
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = result_response)\n");
 		return;
 	}
 
-	RTE_LOG(DEBUG, SPP_COMMAND_PROC,
+	RTE_LOG(DEBUG, WK_CMD_RUNNER,
 			"Make command response (decode error). "
 			"response_str=\n%s\n", msg);
 
 	/* send response to requester */
 	ret = spp_send_message(sock, msg, strlen(msg));
 	if (unlikely(ret != SPP_RET_OK)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"Failed to send decode error response.\n");
 		/* not return */
 	}
@@ -1539,7 +1541,7 @@ send_command_result_response(int *sock,
 	char *msg, *tmp_buff;
 	tmp_buff = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(tmp_buff == NULL)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = result_response)\n");
 		return;
@@ -1550,7 +1552,7 @@ send_command_result_response(int *sock,
 			request->num_command, command_results);
 	if (unlikely(ret < SPP_RET_OK)) {
 		spp_strbuf_free(tmp_buff);
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				"Failed to make command result response.\n");
 		return;
 	}
@@ -1560,7 +1562,7 @@ send_command_result_response(int *sock,
 		ret = append_client_id_value("client_id", &tmp_buff, NULL);
 		if (unlikely(ret < SPP_RET_OK)) {
 			spp_strbuf_free(tmp_buff);
-			RTE_LOG(ERR, SPP_COMMAND_PROC, "Failed to make "
+			RTE_LOG(ERR, WK_CMD_RUNNER, "Failed to make "
 					"client id response.\n");
 			return;
 		}
@@ -1573,7 +1575,7 @@ send_command_result_response(int *sock,
 		ret = append_info_value("info", &tmp_buff);
 		if (unlikely(ret < SPP_RET_OK)) {
 			spp_strbuf_free(tmp_buff);
-			RTE_LOG(ERR, SPP_COMMAND_PROC,
+			RTE_LOG(ERR, WK_CMD_RUNNER,
 					"Failed to make status response.\n");
 			return;
 		}
@@ -1582,7 +1584,7 @@ send_command_result_response(int *sock,
 	msg = spp_strbuf_allocate(CMD_RES_BUF_INIT_SIZE);
 	if (unlikely(msg == NULL)) {
 		spp_strbuf_free(tmp_buff);
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = result_response)\n");
 		return;
@@ -1591,20 +1593,20 @@ send_command_result_response(int *sock,
 	spp_strbuf_free(tmp_buff);
 	if (unlikely(ret < SPP_RET_OK)) {
 		spp_strbuf_free(msg);
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 				/* TODO(yasufum) refactor no meaning err msg */
 				"allocate error. (name = result_response)\n");
 		return;
 	}
 
-	RTE_LOG(DEBUG, SPP_COMMAND_PROC,
+	RTE_LOG(DEBUG, WK_CMD_RUNNER,
 			"Make command response (command result). "
 			"response_str=\n%s\n", msg);
 
 	/* send response to requester */
 	ret = spp_send_message(sock, msg, strlen(msg));
 	if (unlikely(ret != SPP_RET_OK)) {
-		RTE_LOG(ERR, SPP_COMMAND_PROC,
+		RTE_LOG(ERR, WK_CMD_RUNNER,
 			"Failed to send command result response.\n");
 		/* not return */
 	}
@@ -1627,7 +1629,7 @@ process_request(int *sock, const char *request_str, size_t request_str_len)
 	memset(&wk_err_msg, 0, sizeof(struct sppwk_parse_err_msg));
 	memset(command_results, 0, sizeof(command_results));
 
-	RTE_LOG(DEBUG, SPP_COMMAND_PROC, "Start command request processing. "
+	RTE_LOG(DEBUG, WK_CMD_RUNNER, "Start command request processing. "
 			"request_str=\n%.*s\n",
 			(int)request_str_len, request_str);
 
@@ -1639,12 +1641,12 @@ process_request(int *sock, const char *request_str, size_t request_str_len)
 		prepare_parse_err_msg(command_results, &request,
 				&wk_err_msg);
 		send_decode_error_response(sock, &request, command_results);
-		RTE_LOG(DEBUG, SPP_COMMAND_PROC,
+		RTE_LOG(DEBUG, WK_CMD_RUNNER,
 				"End command request processing.\n");
 		return SPP_RET_OK;
 	}
 
-	RTE_LOG(DEBUG, SPP_COMMAND_PROC, "Command request is valid. "
+	RTE_LOG(DEBUG, WK_CMD_RUNNER, "Command request is valid. "
 			"num_command=%d, num_valid_command=%d\n",
 			request.num_command, request.num_valid_command);
 
@@ -1671,7 +1673,7 @@ process_request(int *sock, const char *request_str, size_t request_str_len)
 		/* Other route is normal end because it responds to command. */
 		set_cmd_result(&command_results[0], CMD_SUCCESS, "");
 		send_command_result_response(sock, &request, command_results);
-		RTE_LOG(INFO, SPP_COMMAND_PROC,
+		RTE_LOG(INFO, WK_CMD_RUNNER,
 				"Terminate process for exit.\n");
 		return SPP_RET_NG;
 	}
@@ -1679,7 +1681,7 @@ process_request(int *sock, const char *request_str, size_t request_str_len)
 	/* send response */
 	send_command_result_response(sock, &request, command_results);
 
-	RTE_LOG(DEBUG, SPP_COMMAND_PROC, "End command request processing.\n");
+	RTE_LOG(DEBUG, WK_CMD_RUNNER, "End command request processing.\n");
 
 	return SPP_RET_OK;
 }
@@ -1704,7 +1706,7 @@ sppwk_cmd_run(void)
 	if (unlikely(msgbuf == NULL)) {
 		msgbuf = spp_strbuf_allocate(CMD_REQ_BUF_INIT_SIZE);
 		if (unlikely(msgbuf == NULL)) {
-			RTE_LOG(ERR, SPP_COMMAND_PROC,
+			RTE_LOG(ERR, WK_CMD_RUNNER,
 					"Cannot allocate memory "
 					"for receive data(init).\n");
 			return SPP_RET_NG;
-- 
2.17.1


      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  3:36 [spp] [PATCH 0/2] Update old log labels APP ogawa.yasufumi
2019-05-31  3:36 ` [spp] [PATCH 1/2] shared/sec: change log label in cmd parser ogawa.yasufumi
2019-05-31  3:36 ` ogawa.yasufumi [this message]

Reply instructions:

You may reply publically 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=1559273777-26186-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /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

Soft Patch Panel

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/spp/0 spp/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 spp spp/ http://inbox.dpdk.org/spp \
		spp@dpdk.org
	public-inbox-index spp


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.spp


AGPL code for this site: git clone https://public-inbox.org/ public-inbox