Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 3/3] spp_pcap: revise enum spp_port_rxtx
Date: Mon, 24 Jun 2019 17:40:43 +0900	[thread overview]
Message-ID: <20190624084043.23718-4-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190624084043.23718-1-yasufum.o@gmail.com>

From: Yasufumi Ogawa <yasufum.o@gmail.com>

This update is to revise the name of enum `spp_port_rxtx` to
`sppwk_port_dir` because it is used to specify which of direction
packets are forwarded on a port. Term `rxtx` is used for a set of RX and
TX, so it should not be used for specifying the direction. This update
is also rename members of the enum, and a member of structs using this
enum from `rxtx` to `dir`.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/pcap/cmd_runner.c |  8 ++++----
 src/pcap/cmd_utils.h  | 17 +++++++----------
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/pcap/cmd_runner.c b/src/pcap/cmd_runner.c
index 4a74af2..7f17d40 100644
--- a/src/pcap/cmd_runner.c
+++ b/src/pcap/cmd_runner.c
@@ -399,7 +399,7 @@ append_client_id_value(const char *name, char **output,
 /* append a block of port entry for JSON format */
 static int
 append_port_entry(char **output, const struct sppwk_port_idx *port,
-		const enum spp_port_rxtx rxtx __attribute__ ((unused)))
+		const enum sppwk_port_dir dir __attribute__ ((unused)))
 {
 	int ret = SPPWK_RET_NG;
 	char port_str[CMD_TAG_APPEND_SIZE];
@@ -424,7 +424,7 @@ append_port_entry(char **output, const struct sppwk_port_idx *port,
 static int
 append_port_array(const char *name, char **output, const int num,
 		const struct sppwk_port_idx *ports,
-		const enum spp_port_rxtx rxtx)
+		const enum sppwk_port_dir dir)
 {
 	int ret = SPPWK_RET_NG;
 	int i = 0;
@@ -437,7 +437,7 @@ append_port_array(const char *name, char **output, const int num,
 	}
 
 	for (i = 0; i < num; i++) {
-		ret = append_port_entry(&tmp_buff, &ports[i], rxtx);
+		ret = append_port_entry(&tmp_buff, &ports[i], dir);
 		if (unlikely(ret < SPPWK_RET_OK))
 			return SPPWK_RET_NG;
 	}
@@ -493,7 +493,7 @@ append_pcap_core_element_value(
 
 	if (num_rx != 0)
 		ret = append_port_array("rx_port", &tmp_buff,
-				num_rx, rx_ports, SPP_PORT_RXTX_RX);
+				num_rx, rx_ports, SPPWK_PORT_DIR_RX);
 	else
 		ret = append_json_str_value("filename", &tmp_buff, name);
 	if (unlikely(ret < 0))
diff --git a/src/pcap/cmd_utils.h b/src/pcap/cmd_utils.h
index 5528e00..d38e0eb 100644
--- a/src/pcap/cmd_utils.h
+++ b/src/pcap/cmd_utils.h
@@ -59,15 +59,12 @@ enum sppwk_return_val {
 	SPPWK_RET_NG = -1, /**< failed */
 };
 
-/**
- * Port type (rx or tx) to indicate which direction packet goes
- * (e.g. receiving or transmitting)
- */
-enum spp_port_rxtx {
-	SPP_PORT_RXTX_NONE, /**< none */
-	SPP_PORT_RXTX_RX,   /**< rx port */
-	SPP_PORT_RXTX_TX,   /**< tx port */
-	SPP_PORT_RXTX_ALL,  /**< rx/tx port */
+/* Direction of RX or TX on a port. */
+enum sppwk_port_dir {
+	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 */
 };
 
 /* TODO(yasufum) merge it to the same definition in shared/.../cmd_utils.h */
@@ -122,7 +119,7 @@ union spp_ability_data {
 /** Port ability information */
 struct spp_port_ability {
 	enum spp_port_ability_ope ope; /**< Operation */
-	enum spp_port_rxtx rxtx;       /**< rx/tx identifier */
+	enum sppwk_port_dir dir;  /**< Direction of RX, TX or both */
 	union spp_ability_data data;   /**< Port ability data */
 };
 
-- 
2.17.1


      parent reply	other threads:[~2019-06-24  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24  8:40 [spp] [PATCH 0/3] Rename spp_port_rxtx yasufum.o
2019-06-24  8:40 ` [spp] [PATCH 1/3] shared/sec: revise enum spp_port_rxtx yasufum.o
2019-06-24  8:40 ` [spp] [PATCH 2/3] shared/sec: rename members of enum sppwk_port_dir yasufum.o
2019-06-24  8:40 ` yasufum.o [this message]

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=20190624084043.23718-4-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --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
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).