From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2AD1CA10DA for ; Fri, 2 Aug 2019 11:36:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 171871C236; Fri, 2 Aug 2019 11:36:30 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by dpdk.org (Postfix) with ESMTP id 70B751C236 for ; Fri, 2 Aug 2019 11:36:28 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id i18so35791888pgl.11 for ; Fri, 02 Aug 2019 02:36:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=l9K5b5gk4/TzMrnIrrPiSc/yINCNmnwIaHdDw4DYTxk=; b=L7xWbP/8GmREWulstZ6crNXLIUrvTbhnb+H9y7c7pDNjZT03wvFLKTg/RohHcBiO02 WQZ1IGTPVMyOHf8AtE2BQilm8g27UUX1b8ZpOdZ3xxcniBCgRqNefmytT544oRjwWoGK J8Rzl51GfrSKNB9wRra73BnXX3pR+llwIR18NbVsCbrV6Z1Gf2hWr3sr5VWwa83i1MV0 1PDO6aW7+IflOzjsO6EiDJekgnpSGvTlQaAEfL2wjpsnGeMyLYFwUT6jc94TSbhCCBuC OWxUzsSoODkODICPLzXpeUNcvlHJ3+YBBGMeOYL2NDbPiebRJT1az3nOTqt3pEhNAcuy ixsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=l9K5b5gk4/TzMrnIrrPiSc/yINCNmnwIaHdDw4DYTxk=; b=eWdc+aiOLhGJaO2ONTM8AMBuhkyPX43tb7y0BarJ9POdO6gqeVw+ZZpOjpdvU8ayG4 JrcOyP03EF0cM96QQ9Rs33eucrRJQ29fOqtl9ci+Imim7JkqzgP3osuePir6dOGsPTy0 xAzJoYT+slMxX2s6FbYEoosyNQAjv0b8PJ5/LODudIus/J7ixq4rW56qLkZ/UqApaI5O fBeO93RI2nfulRRG6NwrpQiLhJvYaznr6LB/IztHRYAL6DSY2U5uRL0/a3kXo4CzcaRJ 3QcZIt+rpxD75PCBTN/vXadzApV8fL3ZQxzzM2NAknIWdCGDguCpNiykOQ/d0pv1PUKN WobQ== X-Gm-Message-State: APjAAAU0sxwropeRzP7QKthgFuYSORxQgqHuLSocHFiSf+f1wynL6xTH Ewz3DjNNDww/kZOb96DoHfJ+jLH9 X-Google-Smtp-Source: APXvYqyJQFhwbUiMdtpmJcO1RU38eg65eZXFkwXYktqp/TYRzkm2xjUBAzTAO3nM2VuVumM1r68gGg== X-Received: by 2002:a17:90a:8985:: with SMTP id v5mr3428706pjn.136.1564738587375; Fri, 02 Aug 2019 02:36:27 -0700 (PDT) Received: from localhost.localdomain ([2400:4050:c8c2:de00:9c1a:eba9:3129:63d2]) by smtp.gmail.com with ESMTPSA id k14sm4267086pgb.78.2019.08.02.02.36.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 02:36:27 -0700 (PDT) From: Yasufumi Ogawa To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Fri, 2 Aug 2019 18:36:22 +0900 Message-Id: <20190802093622.14163-1-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [spp] [PATCH] shared/sec: replace inappropriate log labels X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" There are still remained log label `APP` which has no meaning. This update is to replace it with other labels for identifying where the log message is generated. Signed-off-by: Yasufumi Ogawa --- .../secondary/spp_worker_th/cmd_utils.c | 41 +++++++++++-------- src/vf/spp_vf.c | 24 +++++------ 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.c b/src/shared/secondary/spp_worker_th/cmd_utils.c index de472cc..2c50dcd 100644 --- a/src/shared/secondary/spp_worker_th/cmd_utils.c +++ b/src/shared/secondary/spp_worker_th/cmd_utils.c @@ -28,7 +28,7 @@ /* TODO(yasufum) change log label after filename is revised. */ -#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1 +#define RTE_LOGTYPE_WK_CMD_UTILS RTE_LOGTYPE_USER1 /* A set of pointers of management data */ /* TODO(yasufum) change names start with `p_change` because it wrong meanig. */ @@ -54,10 +54,11 @@ log_hexdumped(const char *obj_name, const void *obj_addr, const size_t size) const uint32_t *buf = obj_addr; if ((obj_name != NULL) && (obj_name[0] != '\0')) - RTE_LOG(DEBUG, APP, "Name of dumped buf: %s.\n", obj_name); + RTE_LOG(DEBUG, WK_CMD_UTILS, "Name of dumped buf: %s.\n", + obj_name); for (cnt = 0; cnt < max_cnt; cnt += 16) { - RTE_LOG(DEBUG, APP, "[%p]" + RTE_LOG(DEBUG, WK_CMD_UTILS, "[%p]" " %08x %08x %08x %08x %08x %08x %08x %08x" " %08x %08x %08x %08x %08x %08x %08x %08x", &buf[cnt], @@ -106,7 +107,8 @@ check_core_status_wait(enum sppwk_lcore_status status) return SPPWK_RET_OK; } - RTE_LOG(ERR, APP, "Status check time out. (status = %d)\n", status); + RTE_LOG(ERR, WK_CMD_UTILS, "Status check time out. (status = %d)\n", + status); return SPPWK_RET_NG; } @@ -177,7 +179,8 @@ log_core_info(const struct core_mng_info *core_info) unsigned int lcore_id = 0; RTE_LCORE_FOREACH_SLAVE(lcore_id) { info = &core_info[lcore_id]; - RTE_LOG(DEBUG, APP, "core[%d] status=%d, ref=%d, upd=%d\n", + RTE_LOG(DEBUG, WK_CMD_UTILS, + "core[%d] status=%d, ref=%d, upd=%d\n", lcore_id, info->status, info->ref_index, info->upd_index); @@ -203,7 +206,7 @@ log_component_info(const struct sppwk_comp_info *comp_info) if (tmp_ci->wk_type == SPPWK_TYPE_NONE) continue; - RTE_LOG(DEBUG, APP, "component[%d] name=%s, type=%d, " + RTE_LOG(DEBUG, WK_CMD_UTILS, "component[%d] name=%s, type=%d, " "core=%u, index=%d\n", cnt, tmp_ci->name, tmp_ci->wk_type, tmp_ci->lcore_id, tmp_ci->comp_id); @@ -231,7 +234,8 @@ log_interface_info(const struct iface_info *iface_info) if (port->iface_type == UNDEF) continue; - RTE_LOG(DEBUG, APP, "phy [%d] type=%d, no=%d, port=%d, " + RTE_LOG(DEBUG, WK_CMD_UTILS, + "phy [%d] type=%d, no=%d, port=%d, " "vid = %u, mac=%08lx(%s)\n", cnt, port->iface_type, port->iface_no, port->ethdev_port_id, @@ -244,7 +248,8 @@ log_interface_info(const struct iface_info *iface_info) if (port->iface_type == UNDEF) continue; - RTE_LOG(DEBUG, APP, "vhost[%d] type=%d, no=%d, port=%d, " + RTE_LOG(DEBUG, WK_CMD_UTILS, + "vhost[%d] type=%d, no=%d, port=%d, " "vid = %u, mac=%08lx(%s)\n", cnt, port->iface_type, port->iface_no, port->ethdev_port_id, @@ -257,7 +262,8 @@ log_interface_info(const struct iface_info *iface_info) if (port->iface_type == UNDEF) continue; - RTE_LOG(DEBUG, APP, "ring [%d] type=%d, no=%d, port=%d, " + RTE_LOG(DEBUG, WK_CMD_UTILS, + "ring [%d] type=%d, no=%d, port=%d, " "vid = %u, mac=%08lx(%s)\n", cnt, port->iface_type, port->iface_no, port->ethdev_port_id, @@ -417,7 +423,8 @@ init_host_port_info(void) rte_eth_dev_get_name_by_port(i, dev_name); ret = parse_dev_name(dev_name, &port_type, &port_id); if (ret < 0) - RTE_LOG(ERR, APP, "Failed to parse dev_name.\n"); + RTE_LOG(ERR, WK_CMD_UTILS, + "Failed to parse dev_name.\n"); if (port_type == PHY) { port_id = nof_phys; @@ -438,9 +445,10 @@ init_host_port_info(void) p_iface_info->ring[port_id].ethdev_port_id = port_id; break; default: - RTE_LOG(ERR, APP, "Unsupported port on host, " - "type:%d, id:%d.\n", - port_type, port_id); + RTE_LOG(ERR, WK_CMD_UTILS, + "Unsupported port on host, " + "type:%d, id:%d.\n", + port_type, port_id); } } @@ -750,7 +758,8 @@ sppwk_convert_mac_str_to_int64(const char *macaddr) char *saveptr = NULL; char *endptr = NULL; - RTE_LOG(DEBUG, APP, "Try to convert MAC addr `%s`.\n", macaddr); + RTE_LOG(DEBUG, WK_CMD_UTILS, "Try to convert MAC addr `%s`.\n", + macaddr); strcpy(tmp_mac, macaddr); while (1) { @@ -761,7 +770,7 @@ sppwk_convert_mac_str_to_int64(const char *macaddr) /* Check for mal-formatted address */ if (unlikely(token_cnt >= ETHER_ADDR_LEN)) { - RTE_LOG(ERR, APP, + RTE_LOG(ERR, WK_CMD_UTILS, "Invalid MAC address `%s`.\n", macaddr); return SPPWK_RET_NG; @@ -779,7 +788,7 @@ sppwk_convert_mac_str_to_int64(const char *macaddr) str = NULL; } - RTE_LOG(DEBUG, APP, + RTE_LOG(DEBUG, WK_CMD_UTILS, "Succeeded to convert MAC addr `%s` to `0x%08lx`.\n", macaddr, ret_mac); return ret_mac; diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c index aabddd3..e7f08f4 100644 --- a/src/vf/spp_vf.c +++ b/src/vf/spp_vf.c @@ -16,7 +16,7 @@ #include "shared/secondary/spp_worker_th/cmd_parser.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1 +#define RTE_LOGTYPE_SPP_VF RTE_LOGTYPE_USER1 #ifdef SPP_RINGLATENCYSTATS_ENABLE #include "shared/secondary/spp_worker_th/ringlatencystats.h" @@ -54,7 +54,7 @@ static struct cancel_backup_info g_backup_info; static void usage(const char *progname) { - RTE_LOG(INFO, APP, "Usage: %s [EAL args] --" + RTE_LOG(INFO, SPP_VF, "Usage: %s [EAL args] --" " --client-id CLIENT_ID" " -s SERVER_IP:SERVER_PORT" " [--vhost-client]\n" @@ -140,7 +140,7 @@ parse_app_args(int argc, char *argv[]) usage(progname); return SPPWK_RET_NG; } - RTE_LOG(INFO, APP, + RTE_LOG(INFO, SPP_VF, "Parsed app args (client_id=%d,server=%s:%d," "vhost_client=%d)\n", cli_id, ctl_ip, ctl_port, get_vhost_cli_mode()); @@ -158,7 +158,7 @@ slave_main(void *arg __attribute__ ((unused))) struct core_mng_info *info = &g_core_info[lcore_id]; struct core_info *core = get_core_info(lcore_id); - RTE_LOG(INFO, APP, "Slave started on lcore %d.\n", lcore_id); + RTE_LOG(INFO, SPP_VF, "Slave started on lcore %d.\n", lcore_id); set_core_status(lcore_id, SPPWK_LCORE_IDLING); while ((status = sppwk_get_lcore_status(lcore_id)) != @@ -189,7 +189,7 @@ slave_main(void *arg __attribute__ ((unused))) } } if (unlikely(ret != 0)) { - RTE_LOG(ERR, APP, "Failed to forward on lcore %d. " + RTE_LOG(ERR, SPP_VF, "Failed to forward on lcore %d. " "(id = %d).\n", lcore_id, core->id[cnt]); break; @@ -197,7 +197,7 @@ slave_main(void *arg __attribute__ ((unused))) } set_core_status(lcore_id, SPPWK_LCORE_STOPPED); - RTE_LOG(INFO, APP, "Terminated slave on lcore %d.\n", lcore_id); + RTE_LOG(INFO, SPP_VF, "Terminated slave on lcore %d.\n", lcore_id); return ret; } @@ -219,7 +219,7 @@ main(int argc, char *argv[]) /* Daemonize process */ ret = daemon(0, 0); if (unlikely(ret != 0)) { - RTE_LOG(ERR, APP, "daemonize is failed. (ret = %d)\n", + RTE_LOG(ERR, SPP_VF, "daemonize is failed. (ret = %d)\n", ret); return ret; } @@ -256,7 +256,7 @@ main(int argc, char *argv[]) g_core_info, g_change_core, g_change_component, &g_backup_info) < SPPWK_RET_OK) { - RTE_LOG(ERR, APP, + RTE_LOG(ERR, SPP_VF, "Failed to set management data.\n"); break; } @@ -311,8 +311,8 @@ main(int argc, char *argv[]) /* Start forwarding */ set_all_core_status(SPPWK_LCORE_RUNNING); - RTE_LOG(INFO, APP, "My ID %d start handling message\n", 0); - RTE_LOG(INFO, APP, "[Press Ctrl-C to quit ...]\n"); + RTE_LOG(INFO, SPP_VF, "My ID %d start handling message\n", 0); + RTE_LOG(INFO, SPP_VF, "[Press Ctrl-C to quit ...]\n"); /* Backup the management information after initialization */ backup_mng_info(&g_backup_info); @@ -352,7 +352,7 @@ main(int argc, char *argv[]) g_core_info[master_lcore].status = SPPWK_LCORE_STOPPED; ret = check_core_status_wait(SPPWK_LCORE_STOPPED); if (unlikely(ret != SPPWK_RET_OK)) - RTE_LOG(ERR, APP, "Failed to terminate master thread.\n"); + RTE_LOG(ERR, SPP_VF, "Failed to terminate master thread.\n"); /* * Remove vhost sock file if it is not running @@ -364,6 +364,6 @@ main(int argc, char *argv[]) spp_ringlatencystats_uninit(); #endif /* SPP_RINGLATENCYSTATS_ENABLE */ - RTE_LOG(INFO, APP, "Exit spp_vf.\n"); + RTE_LOG(INFO, SPP_VF, "Exit spp_vf.\n"); return ret; } -- 2.17.1