From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BC36AA046B for ; Mon, 24 Jun 2019 10:40:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B68601BF39; Mon, 24 Jun 2019 10:40:53 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 82AB71BF31 for ; Mon, 24 Jun 2019 10:40:52 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id bi6so6472538plb.12 for ; Mon, 24 Jun 2019 01:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=H+uvE74snuNmaintbLvXFvMP5b1nJuhdoZOmL4jsmTE=; b=E5Dzz+pAW+bVnCqoZXrw4lfkTRDYyPk5Cx9+kvqV88jnUCaRAtkKw8omkXeN3j/nCL SWNpRC9SVrshcAar20pPGZ6Pvpi98Vcrkw6EvtYg39y0fWZx5b/OijW3szNCQ2Mce6Pn X6UC3wjschaq0ixcLozpkX9TSQHnPqSdjKx9nryzLNUzSz1AC/Ym35UPNoAJJgz89V+1 syl5dp92MFg8UQ6nJ3o73v0YkCMTovd9UV2RPA9NLiEDaggC7VcBGQ8CFSgSKcdnq8aA +yuarHIc+pG2Bl/rI2pY4sKFHjV/EcsFBHxbUYGeKxVf/Ez6o6ow6xozjpCyKP5BAXbl Nrwg== 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:in-reply-to :references; bh=H+uvE74snuNmaintbLvXFvMP5b1nJuhdoZOmL4jsmTE=; b=SvBk0jz41wgfNi6FpNsMv7UlGG9DJEH0MzyWz6YHRSYZ00FQPHp/l34QAgPHajXGYA UqGIa2sGNh65rbfTSwOoa0LuE/8CCRAReld3GyZsBRN0PyAh0yFtIFIKX51DImDAABGB mYFaWByla5L7pW9brw8ocklIlAo3wcLW8l04kAwn7j87ozdUgEGcG3RNdCbDFq0DJKN7 Ir8ZKGGfsEhkNWtUB2INzPN9AjKseGrg7IwsOtjZIFWOHmGs7XEUlxlDGt55oqwPoyvI lzVxryQA8XjCi5tiDPC41e4xuy+eLX3ZP4Bl+SzzMynR3v2W3Kxqq8FJxszSbzEpZITw qSXA== X-Gm-Message-State: APjAAAVCUOflSE8nIzdq5FZoxuycSdexdFF9DkdE9T1F5JnXLyn3AB0x I8uQG1Z98i5C3YUdLwvWfWGeix7p X-Google-Smtp-Source: APXvYqwFKLktVaGZpX17D1BIILxgM+cWakR7TiYc/QaSlhG49FtBbZjzYPFWO823mJbkEhy2xX1CEg== X-Received: by 2002:a17:902:549:: with SMTP id 67mr87076577plf.86.1561365651573; Mon, 24 Jun 2019 01:40:51 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id 30sm28759534pjk.17.2019.06.24.01.40.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 01:40:51 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Mon, 24 Jun 2019 17:40:42 +0900 Message-Id: <20190624084043.23718-3-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190624084043.23718-1-yasufum.o@gmail.com> References: <20190624084043.23718-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 2/3] shared/sec: rename members of enum sppwk_port_dir 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" From: Yasufumi Ogawa This update is to rename members of enum `sppwk_port_dir` such as `SPP_PORT_RXTX_RX` to `SPPWK_PORT_DIR_RX` or so. Signed-off-by: Yasufumi Ogawa --- src/mirror/mir_cmd_runner.c | 4 ++-- .../secondary/spp_worker_th/cmd_parser.c | 4 ++-- .../spp_worker_th/cmd_res_formatter.c | 4 ++-- .../secondary/spp_worker_th/cmd_utils.c | 12 +++++------ .../secondary/spp_worker_th/cmd_utils.h | 8 ++++---- src/shared/secondary/spp_worker_th/spp_port.c | 20 +++++++++---------- src/vf/vf_cmd_runner.c | 6 +++--- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/mirror/mir_cmd_runner.c b/src/mirror/mir_cmd_runner.c index eda4d1a..312ded5 100644 --- a/src/mirror/mir_cmd_runner.c +++ b/src/mirror/mir_cmd_runner.c @@ -111,7 +111,7 @@ check_mir_port_count(enum sppwk_port_dir dir, int nof_rx, int nof_tx) { RTE_LOG(INFO, MIR_CMD_RUNNER, "port count, port_type=%d," " rx=%d, tx=%d\n", dir, nof_rx, nof_tx); - if (dir == SPP_PORT_RXTX_RX) + if (dir == SPPWK_PORT_DIR_RX) nof_rx++; else nof_tx++; @@ -155,7 +155,7 @@ update_port(enum sppwk_action wk_action, &comp_info_base, NULL, NULL, &change_component, NULL); comp_info = (comp_info_base + comp_lcore_id); port_info = get_sppwk_port(port->iface_type, port->iface_no); - if (dir == SPP_PORT_RXTX_RX) { + if (dir == SPPWK_PORT_DIR_RX) { nof_ports = &comp_info->nof_rx; ports = comp_info->rx_ports; } else { diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c index c1b311c..10d46d8 100644 --- a/src/shared/secondary/spp_worker_th/cmd_parser.c +++ b/src/shared/secondary/spp_worker_th/cmd_parser.c @@ -462,10 +462,10 @@ parse_port(void *output, const char *arg_val, int allow_override) if ((port->wk_action == SPPWK_ACT_ADD) && (spp_check_used_port(tmp_port.iface_type, tmp_port.iface_no, - SPP_PORT_RXTX_RX) >= 0) && + SPPWK_PORT_DIR_RX) >= 0) && (spp_check_used_port(tmp_port.iface_type, tmp_port.iface_no, - SPP_PORT_RXTX_TX) >= 0)) { + SPPWK_PORT_DIR_TX) >= 0)) { RTE_LOG(ERR, WK_CMD_PARSER, "Port `%s` is already used.\n", arg_val); diff --git a/src/shared/secondary/spp_worker_th/cmd_res_formatter.c b/src/shared/secondary/spp_worker_th/cmd_res_formatter.c index a174890..3c2c3a6 100644 --- a/src/shared/secondary/spp_worker_th/cmd_res_formatter.c +++ b/src/shared/secondary/spp_worker_th/cmd_res_formatter.c @@ -345,12 +345,12 @@ append_core_element_value( if (unuse_flg) { ret = append_port_array("rx_port", &tmp_buff, - num_rx, rx_ports, SPP_PORT_RXTX_RX); + num_rx, rx_ports, SPPWK_PORT_DIR_RX); if (unlikely(ret < 0)) return ret; ret = append_port_array("tx_port", &tmp_buff, - num_tx, tx_ports, SPP_PORT_RXTX_TX); + num_tx, tx_ports, SPPWK_PORT_DIR_TX); if (unlikely(ret < SPP_RET_OK)) return ret; } diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.c b/src/shared/secondary/spp_worker_th/cmd_utils.c index 4f80b2e..d21c23a 100644 --- a/src/shared/secondary/spp_worker_th/cmd_utils.c +++ b/src/shared/secondary/spp_worker_th/cmd_utils.c @@ -678,10 +678,10 @@ spp_check_used_port( if (component->wk_type == SPPWK_TYPE_NONE) continue; - if (dir == SPP_PORT_RXTX_RX) { + if (dir == SPPWK_PORT_DIR_RX) { max = component->nof_rx; port_array = component->rx_ports; - } else if (dir == SPP_PORT_RXTX_TX) { + } else if (dir == SPPWK_PORT_DIR_TX) { max = component->nof_tx; port_array = component->tx_ports; } @@ -700,16 +700,16 @@ set_component_change_port(struct sppwk_port_info *port, enum sppwk_port_dir dir) { int ret = 0; - if ((dir == SPP_PORT_RXTX_RX) || (dir == SPP_PORT_RXTX_ALL)) { + if ((dir == SPPWK_PORT_DIR_RX) || (dir == SPPWK_PORT_DIR_BOTH)) { ret = spp_check_used_port(port->iface_type, port->iface_no, - SPP_PORT_RXTX_RX); + SPPWK_PORT_DIR_RX); if (ret >= 0) *(g_mng_data.p_change_component + ret) = 1; } - if ((dir == SPP_PORT_RXTX_TX) || (dir == SPP_PORT_RXTX_ALL)) { + if ((dir == SPPWK_PORT_DIR_TX) || (dir == SPPWK_PORT_DIR_BOTH)) { ret = spp_check_used_port(port->iface_type, port->iface_no, - SPP_PORT_RXTX_TX); + SPPWK_PORT_DIR_TX); if (ret >= 0) *(g_mng_data.p_change_component + ret) = 1; } diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.h b/src/shared/secondary/spp_worker_th/cmd_utils.h index e08e4fb..b15b40a 100644 --- a/src/shared/secondary/spp_worker_th/cmd_utils.h +++ b/src/shared/secondary/spp_worker_th/cmd_utils.h @@ -97,10 +97,10 @@ enum spp_classifier_type { /* Direction of RX or TX on a port. */ enum sppwk_port_dir { - SPP_PORT_RXTX_NONE, /**< none */ - SPP_PORT_RXTX_RX, /**< rx port */ - SPP_PORT_RXTX_TX, /**< tx port */ - SPP_PORT_RXTX_ALL, /**< rx/tx port */ + SPPWK_PORT_DIR_NONE, /**< None */ + SPPWK_PORT_DIR_RX, /**< RX port */ + SPPWK_PORT_DIR_TX, /**< TX port */ + SPPWK_PORT_DIR_BOTH, /**< Both of RX and TX */ }; /** diff --git a/src/shared/secondary/spp_worker_th/spp_port.c b/src/shared/secondary/spp_worker_th/spp_port.c index 7ac6858..b0a29f7 100644 --- a/src/shared/secondary/spp_worker_th/spp_port.c +++ b/src/shared/secondary/spp_worker_th/spp_port.c @@ -66,10 +66,10 @@ spp_port_ability_get_info( struct port_ability_mng_info *mng = NULL; switch (dir) { - case SPP_PORT_RXTX_RX: + case SPPWK_PORT_DIR_RX: mng = &g_port_mng_info[port_id].rx; break; - case SPP_PORT_RXTX_TX: + case SPPWK_PORT_DIR_TX: mng = &g_port_mng_info[port_id].tx; break; default: @@ -213,12 +213,12 @@ spp_port_ability_change_index( if (type == PORT_ABILITY_CHG_INDEX_UPD) { switch (dir) { - case SPP_PORT_RXTX_RX: + case SPPWK_PORT_DIR_RX: mng = &g_port_mng_info[port_id].rx; mng->upd_index = mng->ref_index; rx_list[num_rx++] = port_id; break; - case SPP_PORT_RXTX_TX: + case SPPWK_PORT_DIR_TX: mng = &g_port_mng_info[port_id].tx; mng->upd_index = mng->ref_index; tx_list[num_tx++] = port_id; @@ -264,10 +264,10 @@ port_ability_set_ability( port_mng->iface_no = port->iface_no; switch (dir) { - case SPP_PORT_RXTX_RX: + case SPPWK_PORT_DIR_RX: mng = &port_mng->rx; break; - case SPP_PORT_RXTX_TX: + case SPPWK_PORT_DIR_TX: mng = &port_mng->tx; break; default: @@ -312,12 +312,12 @@ spp_port_ability_update(const struct sppwk_comp_info *component) struct sppwk_port_info *port = NULL; for (cnt = 0; cnt < component->nof_rx; cnt++) { port = component->rx_ports[cnt]; - port_ability_set_ability(port, SPP_PORT_RXTX_RX); + port_ability_set_ability(port, SPPWK_PORT_DIR_RX); } for (cnt = 0; cnt < component->nof_tx; cnt++) { port = component->tx_ports[cnt]; - port_ability_set_ability(port, SPP_PORT_RXTX_TX); + port_ability_set_ability(port, SPPWK_PORT_DIR_TX); } } @@ -384,7 +384,7 @@ spp_eth_rx_burst( #endif /* SPP_RINGLATENCYSTATS_ENABLE */ return port_ability_each_operation(port_id, rx_pkts, nb_rx, - SPP_PORT_RXTX_RX); + SPPWK_PORT_DIR_RX); } /* Wrapper function for rte_eth_tx_burst(). */ @@ -395,7 +395,7 @@ spp_eth_tx_burst( { uint16_t nb_tx = 0; nb_tx = port_ability_each_operation(port_id, tx_pkts, nb_pkts, - SPP_PORT_RXTX_TX); + SPPWK_PORT_DIR_TX); if (unlikely(nb_tx == 0)) return SPP_RET_OK; diff --git a/src/vf/vf_cmd_runner.c b/src/vf/vf_cmd_runner.c index 89cf12f..4a78ab2 100644 --- a/src/vf/vf_cmd_runner.c +++ b/src/vf/vf_cmd_runner.c @@ -107,7 +107,7 @@ update_cls_table(enum sppwk_action wk_action, strcpy(port_info->cls_attrs.mac_addr_str, mac_str); } - set_component_change_port(port_info, SPP_PORT_RXTX_TX); + set_component_change_port(port_info, SPPWK_PORT_DIR_TX); return SPP_RET_OK; } @@ -214,7 +214,7 @@ check_vf_port_count(int component_type, enum sppwk_port_dir dir, { RTE_LOG(INFO, VF_CMD_RUNNER, "port count, port_type=%d," " rx=%d, tx=%d\n", dir, nof_rx, nof_tx); - if (dir == SPP_PORT_RXTX_RX) + if (dir == SPPWK_PORT_DIR_RX) nof_rx++; else nof_tx++; @@ -276,7 +276,7 @@ update_port(enum sppwk_action wk_action, &comp_info_base, NULL, NULL, &change_component, NULL); comp_info = (comp_info_base + comp_lcore_id); port_info = get_sppwk_port(port->iface_type, port->iface_no); - if (dir == SPP_PORT_RXTX_RX) { + if (dir == SPPWK_PORT_DIR_RX) { nof_ports = &comp_info->nof_rx; ports = comp_info->rx_ports; } else { -- 2.17.1