Soft Patch Panel
 help / color / mirror / 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 9/9] spp_pcap: rename struct spp_port_index
Date: Fri, 31 May 2019 17:51:39 +0900	[thread overview]
Message-ID: <1559292699-26940-10-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1559292699-26940-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

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

Rename struct `spp_port_index` to `sppwk_port_idx` to be more specific,
and its members.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/pcap/cmd_runner.c |  8 ++++----
 src/pcap/cmd_utils.c  |  4 ++--
 src/pcap/cmd_utils.h  | 31 +++++++++++++++----------------
 src/pcap/spp_pcap.c   |  2 +-
 4 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/src/pcap/cmd_runner.c b/src/pcap/cmd_runner.c
index 4d133e3..a931956 100644
--- a/src/pcap/cmd_runner.c
+++ b/src/pcap/cmd_runner.c
@@ -416,7 +416,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 spp_port_index *port,
+append_port_entry(char **output, const struct sppwk_port_idx *port,
 		const enum spp_port_rxtx rxtx __attribute__ ((unused)))
 {
 	int ret = SPPWK_RET_NG;
@@ -441,7 +441,7 @@ append_port_entry(char **output, const struct spp_port_index *port,
 /* append a list of port numbers for JSON format */
 static int
 append_port_array(const char *name, char **output, const int num,
-		const struct spp_port_index *ports,
+		const struct sppwk_port_idx *ports,
 		const enum spp_port_rxtx rxtx)
 {
 	int ret = SPPWK_RET_NG;
@@ -479,9 +479,9 @@ append_pcap_core_element_value(
 		const unsigned int lcore_id,
 		const char *name, const char *type,
 		const int num_rx,
-		const struct spp_port_index *rx_ports,
+		const struct sppwk_port_idx *rx_ports,
 		const int num_tx __attribute__ ((unused)),
-		const struct spp_port_index *tx_ports __attribute__ ((unused)))
+		const struct sppwk_port_idx *tx_ports __attribute__ ((unused)))
 {
 	int ret = SPPWK_RET_NG;
 	int unuse_flg = 0;
diff --git a/src/pcap/cmd_utils.c b/src/pcap/cmd_utils.c
index 08e4c98..084b3ca 100644
--- a/src/pcap/cmd_utils.c
+++ b/src/pcap/cmd_utils.c
@@ -176,12 +176,12 @@ init_iface_info(void)
 		p_iface_info->nic[port_cnt].iface_type = UNDEF;
 		p_iface_info->nic[port_cnt].iface_no   = port_cnt;
 		p_iface_info->nic[port_cnt].ethdev_port_id  = -1;
-		p_iface_info->nic[port_cnt].class_id.vlantag.vid =
+		p_iface_info->nic[port_cnt].cls_attrs.vlantag.vid =
 				ETH_VLAN_ID_MAX;
 		p_iface_info->ring[port_cnt].iface_type = UNDEF;
 		p_iface_info->ring[port_cnt].iface_no   = port_cnt;
 		p_iface_info->ring[port_cnt].ethdev_port_id  = -1;
-		p_iface_info->ring[port_cnt].class_id.vlantag.vid =
+		p_iface_info->ring[port_cnt].cls_attrs.vlantag.vid =
 				ETH_VLAN_ID_MAX;
 	}
 }
diff --git a/src/pcap/cmd_utils.h b/src/pcap/cmd_utils.h
index 862eb27..8487c23 100644
--- a/src/pcap/cmd_utils.h
+++ b/src/pcap/cmd_utils.h
@@ -103,12 +103,6 @@ enum SPP_LONGOPT_RETVAL {
 	SPP_LONGOPT_RETVAL_FILE_SIZE   /* --fsize */
 };
 
-/* Interface information structure */
-struct spp_port_index {
-	enum port_type  iface_type; /**< Interface type (phy/ring) */
-	int             iface_no;   /**< Interface number */
-};
-
 /** VLAN tag information */
 struct spp_vlantag_info {
 	int vid; /**< VLAN ID */
@@ -132,11 +126,18 @@ struct spp_port_ability {
 	union spp_ability_data data;   /**< Port ability data */
 };
 
-/** Port class identifier for classifying */
-struct spp_port_class_identifier {
-	uint64_t mac_addr;                      /**< Mac address (binary) */
-	char     mac_addr_str[SPP_MIN_STR_LEN]; /**< Mac address (text) */
-	struct spp_vlantag_info vlantag;        /**< VLAN tag information */
+/* TODO(yasufum) confirm why vlantag is required for spp_pcap. */
+/* Attributes for classifying . */
+struct sppwk_cls_attrs {
+	uint64_t mac_addr;  /**< Mac address (binary) */
+	char mac_addr_str[SPP_MIN_STR_LEN];  /**< Mac address (text) */
+	struct spp_vlantag_info vlantag;   /**< VLAN tag information */
+};
+
+/* Interface information structure */
+struct sppwk_port_idx {
+	enum port_type iface_type;  /**< phy, vhost or ring. */
+	int iface_no;
 };
 
 /* Define detailed port params in addition to `sppwk_port_idx`. */
@@ -144,10 +145,8 @@ struct sppwk_port_info {
 	enum port_type iface_type;  /**< phy, vhost or ring */
 	int iface_no;
 	int ethdev_port_id;  /**< Consistent ID of ethdev */
-	struct spp_port_class_identifier class_id;
-					/**< Port class identifier */
+	struct sppwk_cls_attrs cls_attrs;
 	struct spp_port_ability ability[SPP_PORT_ABILITY_MAX];
-					/**< Port ability */
 };
 
 /* TODO(yasufum) merge it to the same definition in shared/.../cmd_utils.h */
@@ -200,9 +199,9 @@ typedef int (*spp_iterate_core_element_proc)(
 		const char *name,
 		const char *type,
 		const int num_rx,
-		const struct spp_port_index *rx_ports,
+		const struct sppwk_port_idx *rx_ports,
 		const int num_tx,
-		const struct spp_port_index *tx_ports);
+		const struct sppwk_port_idx *tx_ports);
 
 /**
  * iterate core table parameters which is
diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c
index ee89b0a..bfb0233 100644
--- a/src/pcap/spp_pcap.c
+++ b/src/pcap/spp_pcap.c
@@ -420,7 +420,7 @@ spp_pcap_get_core_status(
 	char role_type[8];
 	struct pcap_mng_info *info = &g_pcap_info[lcore_id];
 	char name[PCAP_FPATH_STRLEN + PCAP_FDATE_STRLEN];
-	struct spp_port_index rx_ports[1];
+	struct sppwk_port_idx rx_ports[1];
 	int rx_num = 0;
 
 	RTE_LOG(DEBUG, SPP_PCAP, "status core[%d]\n", lcore_id);
-- 
2.17.1


      parent reply	other threads:[~2019-05-31  8:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31  8:51 [spp] [PATCH 0/9] Refactor func and struct for spp_pcap resources ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 1/9] spp_pcap: rename enum spp_core_status ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 2/9] spp_pcap: rename file of util libs ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 3/9] spp_pcap: refactor parse error code ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 4/9] spp_pcap: rename define starts from SPP_CMD_MAX ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 5/9] spp_pcap: rename define of buffer size for cmds ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 6/9] spp_pcap: revise name of error message object ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 7/9] spp_pcap: revise return codes ogawa.yasufumi
2019-05-31  8:51 ` [spp] [PATCH 8/9] spp_pcap: rename struct spp_port_info ogawa.yasufumi
2019-05-31  8:51 ` ogawa.yasufumi [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=1559292699-26940-10-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
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).