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 13/17] shared/sec: revise port info of SPP worker
Date: Wed,  8 May 2019 11:01:31 +0900	[thread overview]
Message-ID: <1557280895-7978-14-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1557280895-7978-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

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

SPP worker has two kind of struct `spp_port_index` and `spp_port_info`,
but it is confusing and not clear for considering usages.
`spp_port_index` is used for the case just refering port type and index,
and `spp_port_info` is for more detailed info actually.

This update is to refactor for rename prefix `spp_` to `sppwk_`, and
adding comment for usages.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/mirror/spp_mirror.c                       | 16 ++--
 .../secondary/spp_worker_th/cmd_parser.h      | 11 +--
 .../secondary/spp_worker_th/command_dec.c     | 26 +++----
 .../secondary/spp_worker_th/command_proc.c    | 22 +++---
 src/shared/secondary/spp_worker_th/spp_port.c |  4 +-
 src/shared/secondary/spp_worker_th/spp_proc.c | 46 ++++++------
 src/shared/secondary/spp_worker_th/spp_proc.h | 73 ++++++++++---------
 src/vf/classifier_mac.c                       |  8 +-
 src/vf/spp_forward.c                          | 16 ++--
 9 files changed, 111 insertions(+), 111 deletions(-)

diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index 6d01501..5c4f68a 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -29,8 +29,8 @@
 
 /* A set of port info of rx and tx */
 struct mirror_rxtx {
-	struct spp_port_info rx; /* rx port */
-	struct spp_port_info tx; /* tx port */
+	struct sppwk_port_info rx; /* rx port */
+	struct sppwk_port_info tx; /* tx port */
 };
 
 /* Information on the path used for mirror. */
@@ -319,12 +319,12 @@ spp_mirror_update(struct spp_component_info *component)
 	path->num_tx = component->num_tx_port;
 	for (cnt = 0; cnt < num_rx; cnt++)
 		memcpy(&path->ports[cnt].rx, component->rx_ports[cnt],
-				sizeof(struct spp_port_info));
+				sizeof(struct sppwk_port_info));
 
 	/* Transmit port is set according with larger num_rx / num_tx. */
 	for (cnt = 0; cnt < num_tx; cnt++)
 		memcpy(&path->ports[cnt].tx, component->tx_ports[cnt],
-				sizeof(struct spp_port_info));
+				sizeof(struct sppwk_port_info));
 
 	info->upd_index = info->ref_index;
 	while (likely(info->ref_index == info->upd_index))
@@ -368,8 +368,8 @@ mirror_proc(int id)
 	int nb_tx2 = 0;
 	struct mirror_info *info = &g_mirror_info[id];
 	struct mirror_path *path = NULL;
-	struct spp_port_info *rx = NULL;
-	struct spp_port_info *tx = NULL;
+	struct sppwk_port_info *rx = NULL;
+	struct sppwk_port_info *tx = NULL;
 	struct rte_mbuf *bufs[MAX_PKT_BURST];
 	struct rte_mbuf *copybufs[MAX_PKT_BURST];
 	struct rte_mbuf *org_mbuf = NULL;
@@ -478,8 +478,8 @@ spp_mirror_get_component_status(
 	const char *component_type = NULL;
 	struct mirror_info *info = &g_mirror_info[id];
 	struct mirror_path *path = &info->path[info->ref_index];
-	struct spp_port_index rx_ports[RTE_MAX_ETHPORTS];
-	struct spp_port_index tx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_idx rx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_idx tx_ports[RTE_MAX_ETHPORTS];
 
 	if (unlikely(path->type == SPP_COMPONENT_UNUSE)) {
 		RTE_LOG(ERR, MIRROR,
diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.h b/src/shared/secondary/spp_worker_th/cmd_parser.h
index 669f199..3d31833 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.h
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.h
@@ -78,12 +78,12 @@ struct sppwk_cls_cmd_attr {
 	enum spp_classifier_type type;  /**< currently only for mac */
 	int vid;  /**< VLAN ID  */
 	char mac[SPPWK_VAL_BUFSZ];  /**< MAC address  */
-	struct spp_port_index port;/**< Destination port type and number */
+	struct sppwk_port_idx port;/**< Destination port type and number */
 };
 
 /* `flush` command specific parameters. */
 struct sppwk_cmd_flush {
-	/* nothing specific */
+	/* Take no params. */
 };
 
 /* `component` command parameters. */
@@ -95,14 +95,15 @@ struct sppwk_cmd_comp {
 };
 
 /* `port` command parameters. */
-struct spp_command_port {
+struct sppwk_cmd_port {
 	enum sppwk_action wk_action;  /**< add or del */
-	struct spp_port_index port;  /**< port type and number */
+	struct sppwk_port_idx port;  /**< port type and number */
 	enum spp_port_rxtx rxtx;  /**< rx or tx identifier */
 	char name[SPPWK_NAME_BUFSZ];  /**<  component name */
 	struct spp_port_ability ability;  /**< port ability */
 };
 
+/* TODO(yasufum) Add usage and desc for members. What's command descriptors? */
 struct spp_command {
 	enum sppwk_cmd_type type; /**< command type */
 
@@ -110,7 +111,7 @@ struct spp_command {
 		struct sppwk_cls_cmd_attr cls_table;
 		struct sppwk_cmd_flush flush;
 		struct sppwk_cmd_comp comp;
-		struct spp_command_port port;
+		struct sppwk_cmd_port port;
 	} spec;
 };
 
diff --git a/src/shared/secondary/spp_worker_th/command_dec.c b/src/shared/secondary/spp_worker_th/command_dec.c
index 493d9cb..918c2a2 100644
--- a/src/shared/secondary/spp_worker_th/command_dec.c
+++ b/src/shared/secondary/spp_worker_th/command_dec.c
@@ -99,12 +99,10 @@ spp_check_classid_used_port(
 		int vid, uint64_t mac_addr,
 		enum port_type iface_type, int iface_no)
 {
-	struct spp_port_info *port_info = get_iface_info(iface_type, iface_no);
+	struct sppwk_port_info *port_info = get_iface_info(
+			iface_type, iface_no);
 
-	/**
-	 * return true if given mac_addr/vid matches
-	 *  with that of port_info/vid
-	 */
+	/* Return true if given mac_addr matches with port_info, and vid. */
 	return ((mac_addr == port_info->class_id.mac_addr) &&
 		(vid == port_info->class_id.vlantag.vid));
 }
@@ -113,7 +111,7 @@ spp_check_classid_used_port(
 static int
 spp_check_added_port(enum port_type iface_type, int iface_no)
 {
-	struct spp_port_info *port = get_iface_info(iface_type, iface_no);
+	struct sppwk_port_info *port = get_iface_info(iface_type, iface_no);
 	return port->iface_type != UNDEF;
 }
 
@@ -314,7 +312,7 @@ static int
 decode_port_value(void *output, const char *arg_val)
 {
 	int ret = SPP_RET_OK;
-	struct spp_port_index *port = output;
+	struct sppwk_port_idx *port = output;
 	ret = spp_convert_port_to_iface(arg_val, &port->iface_type,
 							&port->iface_no);
 	if (unlikely(ret != 0)) {
@@ -457,8 +455,8 @@ static int
 decode_port_port_value(void *output, const char *arg_val, int allow_override)
 {
 	int ret = SPP_RET_NG;
-	struct spp_port_index tmp_port;
-	struct spp_command_port *port = output;
+	struct sppwk_port_idx tmp_port;
+	struct sppwk_cmd_port *port = output;
 
 	ret = decode_port_value(&tmp_port, arg_val);
 	if (ret < SPP_RET_OK)
@@ -490,7 +488,7 @@ static int
 decode_port_rxtx_value(void *output, const char *arg_val, int allow_override)
 {
 	int ret = SPP_RET_OK;
-	struct spp_command_port *port = output;
+	struct sppwk_cmd_port *port = output;
 
 	ret = get_arrary_index(arg_val, PORT_RXTX_STRINGS);
 	if (unlikely(ret <= 0)) {
@@ -538,7 +536,7 @@ decode_port_vlan_operation(void *output, const char *arg_val,
 				int allow_override __attribute__ ((unused)))
 {
 	int ret = SPP_RET_OK;
-	struct spp_command_port *port = output;
+	struct sppwk_cmd_port *port = output;
 	struct spp_port_ability *ability = &port->ability;
 
 	switch (ability->ope) {
@@ -570,7 +568,7 @@ decode_port_vid(void *output, const char *arg_val,
 				int allow_override __attribute__ ((unused)))
 {
 	int ret = SPP_RET_OK;
-	struct spp_command_port *port = output;
+	struct sppwk_cmd_port *port = output;
 	struct spp_port_ability *ability = &port->ability;
 
 	switch (ability->ope) {
@@ -598,7 +596,7 @@ decode_port_pcp(void *output, const char *arg_val,
 				int allow_override __attribute__ ((unused)))
 {
 	int ret = SPP_RET_OK;
-	struct spp_command_port *port = output;
+	struct sppwk_cmd_port *port = output;
 	struct spp_port_ability *ability = &port->ability;
 
 	switch (ability->ope) {
@@ -706,7 +704,7 @@ parse_cls_port(void *cls_cmd_attr, const char *arg_val,
 {
 	int ret = SPP_RET_OK;
 	struct sppwk_cls_cmd_attr *cls_attr = cls_cmd_attr;
-	struct spp_port_index tmp_port;
+	struct sppwk_port_idx tmp_port;
 	int64_t mac_addr = 0;
 
 	ret = decode_port_value(&tmp_port, arg_val);
diff --git a/src/shared/secondary/spp_worker_th/command_proc.c b/src/shared/secondary/spp_worker_th/command_proc.c
index 3e8c52a..34bfe82 100644
--- a/src/shared/secondary/spp_worker_th/command_proc.c
+++ b/src/shared/secondary/spp_worker_th/command_proc.c
@@ -125,7 +125,7 @@ spp_get_process_type(void)
 static int
 spp_check_flush_port(enum port_type iface_type, int iface_no)
 {
-	struct spp_port_info *port = get_iface_info(iface_type, iface_no);
+	struct sppwk_port_info *port = get_iface_info(iface_type, iface_no);
 	return port->dpdk_port >= 0;
 }
 
@@ -136,9 +136,9 @@ spp_update_classifier_table(
 		enum spp_classifier_type type __attribute__ ((unused)),
 		int vid,
 		const char *mac_addr_str,
-		const struct spp_port_index *port)
+		const struct sppwk_port_idx *port)
 {
-	struct spp_port_info *port_info = NULL;
+	struct sppwk_port_info *port_info = NULL;
 	int64_t ret_mac = 0;
 	uint64_t mac_addr = 0;
 
@@ -365,7 +365,7 @@ check_port_count(int component_type, enum spp_port_rxtx rxtx, int num_rx,
  */
 static int
 spp_update_port(enum sppwk_action wk_action,
-		const struct spp_port_index *port,
+		const struct sppwk_port_idx *port,
 		enum spp_port_rxtx rxtx,
 		const char *name,
 		const struct spp_port_ability *ability)
@@ -376,9 +376,9 @@ spp_update_port(enum sppwk_action wk_action,
 	int component_id = 0;
 	int cnt = 0;
 	struct spp_component_info *comp_info = NULL;
-	struct spp_port_info *port_info = NULL;
+	struct sppwk_port_info *port_info = NULL;
 	int *num = NULL;
-	struct spp_port_info **ports = NULL;
+	struct sppwk_port_info **ports = NULL;
 	struct spp_component_info *comp_info_base = NULL;
 	int *change_component = NULL;
 
@@ -1078,7 +1078,7 @@ append_vlan_block(const char *name, char **output,
 
 /* append a block of port numbers for JSON format */
 static int
-append_port_block(char **output, const struct spp_port_index *port,
+append_port_block(char **output, const struct sppwk_port_idx *port,
 		const enum spp_port_rxtx rxtx)
 {
 	int ret = SPP_RET_NG;
@@ -1110,7 +1110,7 @@ append_port_block(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 = SPP_RET_NG;
@@ -1145,8 +1145,8 @@ append_core_element_value(
 		struct spp_iterate_core_params *params,
 		const unsigned int lcore_id,
 		const char *name, const char *type,
-		const int num_rx, const struct spp_port_index *rx_ports,
-		const int num_tx, const struct spp_port_index *tx_ports)
+		const int num_rx, const struct sppwk_port_idx *rx_ports,
+		const int num_tx, const struct sppwk_port_idx *tx_ports)
 {
 	int ret = SPP_RET_NG;
 	int unuse_flg = 0;
@@ -1247,7 +1247,7 @@ append_classifier_element_value(
 		struct spp_iterate_classifier_table_params *params,
 		enum spp_classifier_type type,
 		int vid, const char *mac,
-		const struct spp_port_index *port)
+		const struct sppwk_port_idx *port)
 {
 	int ret = SPP_RET_NG;
 	char *buff, *tmp_buff;
diff --git a/src/shared/secondary/spp_worker_th/spp_port.c b/src/shared/secondary/spp_worker_th/spp_port.c
index 06422c3..c4070ce 100644
--- a/src/shared/secondary/spp_worker_th/spp_port.c
+++ b/src/shared/secondary/spp_worker_th/spp_port.c
@@ -247,7 +247,7 @@ spp_port_ability_change_index(
 /* Set ability data of port ability. */
 static void
 port_ability_set_ability(
-		struct spp_port_info *port,
+		struct sppwk_port_info *port,
 		enum spp_port_rxtx rxtx)
 {
 	int in_cnt, out_cnt = 0;
@@ -308,7 +308,7 @@ void
 spp_port_ability_update(const struct spp_component_info *component)
 {
 	int cnt;
-	struct spp_port_info *port = NULL;
+	struct sppwk_port_info *port = NULL;
 	for (cnt = 0; cnt < component->num_rx_port; cnt++) {
 		port = component->rx_ports[cnt];
 		port_ability_set_ability(port, SPP_PORT_RXTX_RX);
diff --git a/src/shared/secondary/spp_worker_th/spp_proc.c b/src/shared/secondary/spp_worker_th/spp_proc.c
index 1d39e89..689fb00 100644
--- a/src/shared/secondary/spp_worker_th/spp_proc.c
+++ b/src/shared/secondary/spp_worker_th/spp_proc.c
@@ -269,7 +269,7 @@ stop_process(int signal)
  *
  * It returns NULL value if given type is invalid.
  */
-struct spp_port_info *
+struct sppwk_port_info *
 get_iface_info(enum port_type iface_type, int iface_no)
 {
 	struct iface_info *iface_info = g_mng_data_addr.p_iface_info;
@@ -309,30 +309,30 @@ dump_core_info(const struct core_mng_info *core_info)
 
 /* Dump of component information */
 void
-dump_component_info(const struct spp_component_info *component_info)
+dump_component_info(const struct spp_component_info *comp_info)
 {
 	char str[SPP_NAME_STR_LEN];
-	const struct spp_component_info *component = NULL;
+	const struct spp_component_info *tmp_ci = NULL;
 	int cnt = 0;
 	for (cnt = 0; cnt < RTE_MAX_LCORE; cnt++) {
-		component = &component_info[cnt];
-		if (component->type == SPP_COMPONENT_UNUSE)
+		tmp_ci = &comp_info[cnt];
+		if (tmp_ci->type == SPP_COMPONENT_UNUSE)
 			continue;
 
 		RTE_LOG(DEBUG, APP, "component[%d] name=%s, type=%d, "
 				"core=%u, index=%d\n",
-				cnt, component->name, component->type,
-				component->lcore_id, component->component_id);
+				cnt, tmp_ci->name, tmp_ci->type,
+				tmp_ci->lcore_id, tmp_ci->component_id);
 
 		sprintf(str, "component[%d] rx=%d", cnt,
-				component->num_rx_port);
-		dump_buff(str, component->rx_ports,
-			sizeof(struct spp_port_info *)*component->num_rx_port);
+				tmp_ci->num_rx_port);
+		dump_buff(str, tmp_ci->rx_ports,
+			sizeof(struct sppwk_port_info *)*tmp_ci->num_rx_port);
 
 		sprintf(str, "component[%d] tx=%d", cnt,
-				component->num_tx_port);
-		dump_buff(str, component->tx_ports,
-			sizeof(struct spp_port_info *)*component->num_tx_port);
+				tmp_ci->num_tx_port);
+		dump_buff(str, tmp_ci->tx_ports,
+			sizeof(struct sppwk_port_info *)*tmp_ci->num_tx_port);
 	}
 }
 
@@ -340,7 +340,7 @@ dump_component_info(const struct spp_component_info *component_info)
 void
 dump_interface_info(const struct iface_info *iface_info)
 {
-	const struct spp_port_info *port = NULL;
+	const struct sppwk_port_info *port = NULL;
 	int cnt = 0;
 	RTE_LOG(DEBUG, APP, "interface phy=%d, vhost=%d, ring=%d\n",
 			iface_info->num_nic,
@@ -598,7 +598,7 @@ print_ring_latency_stats(void)
 
 /* Remove sock file if spp is not running */
 void
-del_vhost_sockfile(struct spp_port_info *vhost)
+del_vhost_sockfile(struct sppwk_port_info *vhost)
 {
 	int cnt;
 
@@ -662,8 +662,8 @@ spp_check_used_port(
 {
 	int cnt, port_cnt, max = 0;
 	struct spp_component_info *component = NULL;
-	struct spp_port_info **port_array = NULL;
-	struct spp_port_info *port = get_iface_info(iface_type, iface_no);
+	struct sppwk_port_info **port_array = NULL;
+	struct sppwk_port_info *port = get_iface_info(iface_type, iface_no);
 	struct spp_component_info *component_info =
 					g_mng_data_addr.p_component_info;
 
@@ -693,7 +693,7 @@ spp_check_used_port(
 
 /* Set component update flag for given port */
 void
-set_component_change_port(struct spp_port_info *port, enum spp_port_rxtx rxtx)
+set_component_change_port(struct sppwk_port_info *port, enum spp_port_rxtx rxtx)
 {
 	int ret = 0;
 	if ((rxtx == SPP_PORT_RXTX_RX) || (rxtx == SPP_PORT_RXTX_ALL)) {
@@ -774,9 +774,9 @@ del_component_info(int component_id, int component_num, int *componet_array)
 /* get port element which matches the condition */
 int
 check_port_element(
-		struct spp_port_info *info,
+		struct sppwk_port_info *info,
 		int num,
-		struct spp_port_info *array[])
+		struct sppwk_port_info *array[])
 {
 	int cnt = 0;
 	int match = SPP_RET_NG;
@@ -790,9 +790,9 @@ check_port_element(
 /* search matched port_info from array and delete it */
 int
 get_del_port_element(
-		struct spp_port_info *info,
+		struct sppwk_port_info *info,
 		int num,
-		struct spp_port_info *array[])
+		struct sppwk_port_info *array[])
 {
 	int cnt = 0;
 	int match = SPP_RET_NG;
@@ -819,7 +819,7 @@ flush_port(void)
 {
 	int ret = 0;
 	int cnt = 0;
-	struct spp_port_info *port = NULL;
+	struct sppwk_port_info *port = NULL;
 	struct iface_info *p_iface_info = g_mng_data_addr.p_iface_info;
 
 	/* Initialize added vhost. */
diff --git a/src/shared/secondary/spp_worker_th/spp_proc.h b/src/shared/secondary/spp_worker_th/spp_proc.h
index 734c604..a11be2b 100644
--- a/src/shared/secondary/spp_worker_th/spp_proc.h
+++ b/src/shared/secondary/spp_worker_th/spp_proc.h
@@ -155,14 +155,6 @@ enum secondary_type {
 	SECONDARY_TYPE_MIRROR,
 };
 
-/**
- * Interface information structure
- */
-struct spp_port_index {
-	enum port_type  iface_type; /**< Interface type (phy/vhost/ring) */
-	int             iface_no;   /**< Interface number */
-};
-
 /** VLAN tag information */
 struct spp_vlantag_info {
 	int vid; /**< VLAN ID */
@@ -193,15 +185,23 @@ struct spp_port_class_identifier {
 	struct spp_vlantag_info vlantag;        /**< VLAN tag information */
 };
 
-/* Port info */
-struct spp_port_info {
-	enum port_type iface_type;      /**< Interface type (phy/vhost/ring) */
-	int            iface_no;        /**< Interface number */
-	int            dpdk_port;       /**< DPDK port number */
+/**
+ * Simply define type and index of resource UID such as phy:0. For detailed
+ * attributions, use `sppwk_port_info` which has additional port params.
+ */
+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`. */
+/* TODO(yasufum) revise name and usage of `dpdk_port`. */
+struct sppwk_port_info {
+	enum port_type iface_type;  /**< phy, vhost or ring */
+	int iface_no;
+	int dpdk_port;  /**< DPDK port number */
 	struct spp_port_class_identifier class_id;
-					/**< Port class identifier */
 	struct spp_port_ability ability[SPP_PORT_ABILITY_MAX];
-					/**< Port ability */
 };
 
 /* Component info */
@@ -212,9 +212,9 @@ struct spp_component_info {
 	int component_id;		/**< Component ID */
 	int num_rx_port;		/**< The number of rx ports */
 	int num_tx_port;		/**< The number of tx ports */
-	struct spp_port_info *rx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_info *rx_ports[RTE_MAX_ETHPORTS];
 					/**< Array of pointers to rx ports */
-	struct spp_port_info *tx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_info *tx_ports[RTE_MAX_ETHPORTS];
 					/**< Array of pointers to tx ports */
 };
 
@@ -234,11 +234,11 @@ struct iface_info {
 	int num_nic;		/* The number of phy */
 	int num_vhost;		/* The number of vhost */
 	int num_ring;		/* The number of ring */
-	struct spp_port_info nic[RTE_MAX_ETHPORTS];
+	struct sppwk_port_info nic[RTE_MAX_ETHPORTS];
 				/* Port information of phy */
-	struct spp_port_info vhost[RTE_MAX_ETHPORTS];
+	struct sppwk_port_info vhost[RTE_MAX_ETHPORTS];
 				/* Port information of vhost */
-	struct spp_port_info ring[RTE_MAX_ETHPORTS];
+	struct sppwk_port_info ring[RTE_MAX_ETHPORTS];
 				/* Port information of ring */
 };
 
@@ -288,9 +288,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
@@ -316,7 +316,7 @@ typedef int (*spp_iterate_classifier_element_proc)(
 		struct spp_iterate_classifier_table_params *params,
 		enum spp_classifier_type type,
 		int vid, const char *mac,
-		const struct spp_port_index *port);
+		const struct sppwk_port_idx *port);
 
 /**
  * iterate classifier table parameters which is
@@ -440,10 +440,10 @@ void stop_process(int signal);
  * @param iface_no
  *  Interface number to be validated.
  *
- * @retval !NULL  spp_port_info.
+ * @retval !NULL  sppwk_port_info.
  * @retval NULL   failed.
  */
-struct spp_port_info *
+struct sppwk_port_info *
 get_iface_info(enum port_type iface_type, int iface_no);
 
 /* Dump of core information */
@@ -487,7 +487,7 @@ void print_ring_latency_stats(void);
 #endif /* SPP_RINGLATENCYSTATS_ENABLE */
 
 /* Remove sock file if spp is not running */
-void  del_vhost_sockfile(struct spp_port_info *vhost);
+void  del_vhost_sockfile(struct sppwk_port_info *vhost);
 
 /**
  * Get core ID of target component
@@ -537,13 +537,14 @@ int spp_check_used_port(
  * Set component update flag for given port.
  *
  * @param port
- *  spp_port_info address
+ *  sppwk_port_info address
  * @param rxtx
  *  enum spp_port_rxtx
  *
  */
 void
-set_component_change_port(struct spp_port_info *port, enum spp_port_rxtx rxtx);
+set_component_change_port(
+		struct sppwk_port_info *port, enum spp_port_rxtx rxtx);
 
 /**
  * Get unused component id
@@ -584,37 +585,37 @@ del_component_info(int component_id, int component_num, int *componet_array);
  * get port element which matches the condition.
  *
  * @param info
- *  spp_port_info address
+ *  sppwk_port_info address
  * @param num
  *  port count
  * @param array[]
- *  spp_port_info array address
+ *  sppwk_port_info array address
  *
  * @retval 0~ match index.
  * @retval -1 failed.
  */
 int check_port_element(
-		struct spp_port_info *info,
+		struct sppwk_port_info *info,
 		int num,
-		struct spp_port_info *array[]);
+		struct sppwk_port_info *array[]);
 
 /**
  *  search matched port_info from array and delete it.
  *
  * @param info
- *  spp_port_info address
+ *  sppwk_port_info address
  * @param num
  *  port count
  * @param array[]
- *  spp_port_info array address
+ *  sppwk_port_info array address
  *
  * @retval 0  succeeded.
  * @retval -1 failed.
  */
 int get_del_port_element(
-		struct spp_port_info *info,
+		struct sppwk_port_info *info,
 		int num,
-		struct spp_port_info *array[]);
+		struct sppwk_port_info *array[]);
 
 /**
  * Flush initial setting of each interface.
diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c
index b49cf14..30b6353 100644
--- a/src/vf/classifier_mac.c
+++ b/src/vf/classifier_mac.c
@@ -330,7 +330,7 @@ init_component_info(struct component_info *cmp_info,
 	char mac_addr_str[ETHER_ADDR_STR_BUF_SZ];
 	struct classified_data *clsd_data_rx = &cmp_info->classified_data_rx;
 	struct classified_data *clsd_data_tx = cmp_info->classified_data_tx;
-	struct spp_port_info *tx_port = NULL;
+	struct sppwk_port_info *tx_port = NULL;
 	uint16_t vid;
 
 	/* set rx */
@@ -816,8 +816,8 @@ spp_classifier_get_component_status(
 	struct management_info *mng_info;
 	struct component_info *cmp_info;
 	struct classified_data *clsd_data;
-	struct spp_port_index rx_ports[RTE_MAX_ETHPORTS];
-	struct spp_port_index tx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_idx rx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_idx tx_ports[RTE_MAX_ETHPORTS];
 
 	mng_info = g_mng_infos + id;
 	if (!is_used_mng_info(mng_info)) {
@@ -870,7 +870,7 @@ mac_classification_iterate_table(
 	const void *key;
 	void *data;
 	uint32_t next;
-	struct spp_port_index port;
+	struct sppwk_port_idx port;
 	char mac_addr_str[ETHER_ADDR_STR_BUF_SZ];
 	enum spp_classifier_type type;
 
diff --git a/src/vf/spp_forward.c b/src/vf/spp_forward.c
index 053d7c9..b9c0ad6 100644
--- a/src/vf/spp_forward.c
+++ b/src/vf/spp_forward.c
@@ -13,8 +13,8 @@
 
 /* A set of port info of rx and tx */
 struct forward_rxtx {
-	struct spp_port_info rx; /* rx port */
-	struct spp_port_info tx; /* tx port */
+	struct sppwk_port_info rx; /* rx port */
+	struct sppwk_port_info tx; /* tx port */
 };
 
 /* Information on the path used for forward. */
@@ -93,12 +93,12 @@ spp_forward_update(struct spp_component_info *component)
 	path->num_tx = component->num_tx_port;
 	for (cnt = 0; cnt < num_rx; cnt++)
 		memcpy(&path->ports[cnt].rx, component->rx_ports[cnt],
-				sizeof(struct spp_port_info));
+				sizeof(struct sppwk_port_info));
 
 	/* Transmit port is set according with larger num_rx / num_tx. */
 	for (cnt = 0; cnt < max; cnt++)
 		memcpy(&path->ports[cnt].tx, component->tx_ports[0],
-				sizeof(struct spp_port_info));
+				sizeof(struct sppwk_port_info));
 
 	info->upd_index = info->ref_index;
 	while (likely(info->ref_index == info->upd_index))
@@ -141,8 +141,8 @@ spp_forward(int id)
 	int nb_tx = 0;
 	struct forward_info *info = &g_forward_info[id];
 	struct forward_path *path = NULL;
-	struct spp_port_info *rx;
-	struct spp_port_info *tx;
+	struct sppwk_port_info *rx;
+	struct sppwk_port_info *tx;
 	struct rte_mbuf *bufs[MAX_PKT_BURST];
 
 	change_forward_index(id);
@@ -194,8 +194,8 @@ spp_forward_get_component_status(
 	const char *component_type = NULL;
 	struct forward_info *info = &g_forward_info[id];
 	struct forward_path *path = &info->path[info->ref_index];
-	struct spp_port_index rx_ports[RTE_MAX_ETHPORTS];
-	struct spp_port_index tx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_idx rx_ports[RTE_MAX_ETHPORTS];
+	struct sppwk_port_idx tx_ports[RTE_MAX_ETHPORTS];
 
 	if (unlikely(path->type == SPP_COMPONENT_UNUSE)) {
 		RTE_LOG(ERR, FORWARD,
-- 
2.17.1


  parent reply	other threads:[~2019-05-08  2:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08  2:01 [spp] [PATCH 00/17] Refactor command parser " ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 01/17] shared/sec: change prefix of common functions ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 02/17] shared/sec: refactor parse error code ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 03/17] shared/sec: revice cmd parser of SPP worker ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 04/17] shared/sec: refactor branching for cmd action ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 05/17] shared/sec: rename define starts from SPP_CMD_MAX ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 06/17] shared/sec: rename define of buffer size for cmds ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 07/17] shared/sec: remove unused define of cmd parser ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 08/17] shared/sec: refactor commad type of SPP worker ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 09/17] shared/sec: change struct of classier table attrs ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 10/17] shared/sec: refactor function parsing cls port ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 11/17] shared/sec: rename func of flush command ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 12/17] shared/sec: change struct of comp command ogawa.yasufumi
2019-05-08  2:01 ` ogawa.yasufumi [this message]
2019-05-08  2:01 ` [spp] [PATCH 14/17] shared/sec: rename func for getting port ID ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 15/17] shared/sec: rename dpdk_port attr ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 16/17] shared/sec: rename struct for command request ogawa.yasufumi
2019-05-08  2:01 ` [spp] [PATCH 17/17] shared/sec: rename func for parsing request ogawa.yasufumi

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=1557280895-7978-14-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).