Soft Patch Panel
 help / color / Atom feed
* [spp] [PATCH 0/2] Remove global g_startup_param
@ 2019-06-26  5:35 yasufum.o
  2019-06-26  5:35 ` [spp] [PATCH 1/2] shared/sec: remove global var g_startup_param yasufum.o
  2019-06-26  5:35 ` [spp] [PATCH 2/2] spp_pcap: " yasufum.o
  0 siblings, 2 replies; 3+ messages in thread
From: yasufum.o @ 2019-06-26  5:35 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

This series of patches is to remove global variable of command args
`g_startup_param` because many of global variables are defined and
strongly depended on each other. It makes hard to change codes.

Instead of this global variable, each of args is retrieved with
following functions.

* get_client_id()
* get_vhost_cli_mode()
* get_spp_ctl_ip()
* get_spp_ctl_port()

Yasufumi Ogawa (2):
  shared/sec: remove global var g_startup_param
  spp_pcap: remove global var g_startup_param

 src/mirror/mir_cmd_runner.c                       | 12 ++++++------
 src/mirror/spp_mirror.c                           | 14 ++++----------
 src/pcap/cmd_runner.c                             |  8 +++-----
 src/pcap/cmd_utils.c                              | 13 +++----------
 src/pcap/cmd_utils.h                              | 15 ++-------------
 src/pcap/spp_pcap.c                               | 15 +++------------
 .../secondary/spp_worker_th/cmd_res_formatter.c   |  3 +--
 src/shared/secondary/spp_worker_th/cmd_runner.c   |  4 ++--
 src/shared/secondary/spp_worker_th/cmd_utils.c    |  9 +--------
 src/shared/secondary/spp_worker_th/cmd_utils.h    | 14 ++------------
 src/vf/spp_vf.c                                   |  8 +-------
 src/vf/vf_cmd_runner.c                            | 12 ++++++------
 12 files changed, 34 insertions(+), 93 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 1/2] shared/sec: remove global var g_startup_param
  2019-06-26  5:35 [spp] [PATCH 0/2] Remove global g_startup_param yasufum.o
@ 2019-06-26  5:35 ` yasufum.o
  2019-06-26  5:35 ` [spp] [PATCH 2/2] spp_pcap: " yasufum.o
  1 sibling, 0 replies; 3+ messages in thread
From: yasufum.o @ 2019-06-26  5:35 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

In SPP worker processes, command line options, such as client ID or
server's IP address, are contained as members of struct
`startup_param`. Its instance is a global variable and managed with
other global variables so that it accessible from anywhere of program.

This design enables developers to retrieve any gloval variable in same
manner with single function sppwk_get_mng_data(). However, all of this
global variables have dependency each other. In addition, this function
should take seven args for getting variables selectively. It makes
codes become hard to change.

This update is to remove one of such a global variable to ease this
issue. Each of variables can already be retrieved with functions
implemented in previous patches.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/mirror/mir_cmd_runner.c                        | 12 ++++++------
 src/mirror/spp_mirror.c                            | 14 ++++----------
 .../secondary/spp_worker_th/cmd_res_formatter.c    |  3 +--
 src/shared/secondary/spp_worker_th/cmd_runner.c    |  4 ++--
 src/shared/secondary/spp_worker_th/cmd_utils.c     |  9 +--------
 src/shared/secondary/spp_worker_th/cmd_utils.h     | 14 ++------------
 src/vf/spp_vf.c                                    |  8 +-------
 src/vf/vf_cmd_runner.c                             | 12 ++++++------
 8 files changed, 23 insertions(+), 53 deletions(-)

diff --git a/src/mirror/mir_cmd_runner.c b/src/mirror/mir_cmd_runner.c
index abbd6f6..f63a84b 100644
--- a/src/mirror/mir_cmd_runner.c
+++ b/src/mirror/mir_cmd_runner.c
@@ -33,8 +33,8 @@ update_comp(enum sppwk_action wk_action, const char *name,
 	int *change_core = NULL;
 	int *change_component = NULL;
 
-	sppwk_get_mng_data(NULL, NULL, &comp_info_base, &core_info,
-				&change_core, &change_component, NULL);
+	sppwk_get_mng_data(NULL, &comp_info_base, &core_info, &change_core,
+			&change_component, NULL);
 
 	switch (wk_action) {
 	case SPPWK_ACT_START:
@@ -151,8 +151,8 @@ update_port(enum sppwk_action wk_action,
 				"(component = %s)\n", name);
 		return SPP_RET_NG;
 	}
-	sppwk_get_mng_data(NULL, NULL,
-			&comp_info_base, NULL, NULL, &change_component, NULL);
+	sppwk_get_mng_data(NULL, &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 == SPPWK_PORT_DIR_RX) {
@@ -323,8 +323,8 @@ spp_iterate_core_info(struct spp_iterate_core_params *params)
 		}
 
 		for (cnt = 0; cnt < core->num; cnt++) {
-			sppwk_get_mng_data(NULL, NULL, &comp_info_base,
-							NULL, NULL, NULL, NULL);
+			sppwk_get_mng_data(NULL, &comp_info_base, NULL, NULL,
+					NULL, NULL);
 			comp_info = (comp_info_base + core->id[cnt]);
 			ret = get_mirror_status(lcore_id, core->id[cnt],
 					params);
diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index 32489ed..f040010 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -59,9 +59,6 @@ static uint16_t nb_txd = MIR_TX_DESC_DEFAULT;
 /* Logical core ID for main process */
 static unsigned int g_main_lcore_id = 0xffffffff;
 
-/* Execution parameter of spp_mirror */
-static struct startup_param g_startup_param;
-
 /* Interface management information */
 static struct iface_info g_iface_info;
 
@@ -134,9 +131,6 @@ parse_app_args(int argc, char *argv[])
 	for (cnt = 0; cnt < argcopt; cnt++)
 		argvopt[cnt] = argv[cnt];
 
-	/* Clear startup parameters */
-	memset(&g_startup_param, 0x00, sizeof(g_startup_param));
-
 	/* vhost_cli is disabled as default. */
 	set_vhost_cli_mode(0);
 
@@ -507,10 +501,10 @@ main(int argc, char *argv[])
 		/* Get lcore id of main thread to set its status after */
 		g_main_lcore_id = rte_lcore_id();
 
-		if (sppwk_set_mng_data(&g_startup_param, &g_iface_info,
-					g_component_info, g_core_info,
-					g_change_core, g_change_component,
-					&g_backup_info, g_main_lcore_id) < 0) {
+		if (sppwk_set_mng_data(&g_iface_info, g_component_info,
+					g_core_info, g_change_core,
+					g_change_component, &g_backup_info,
+					g_main_lcore_id) < 0) {
 			RTE_LOG(ERR, MIRROR,
 				"Failed to set management data.\n");
 			break;
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 f095b08..a424fce 100644
--- a/src/shared/secondary/spp_worker_th/cmd_res_formatter.c
+++ b/src/shared/secondary/spp_worker_th/cmd_res_formatter.c
@@ -199,8 +199,7 @@ get_ethdev_port_id(enum port_type iface_type, int iface_no)
 {
 	struct iface_info *iface_info = NULL;
 
-	sppwk_get_mng_data(NULL, &iface_info,
-				NULL, NULL, NULL, NULL, NULL);
+	sppwk_get_mng_data(&iface_info, NULL, NULL, NULL, NULL, NULL);
 	switch (iface_type) {
 	case PHY:
 		return iface_info->nic[iface_no].ethdev_port_id;
diff --git a/src/shared/secondary/spp_worker_th/cmd_runner.c b/src/shared/secondary/spp_worker_th/cmd_runner.c
index 3684a2c..3ab69f9 100644
--- a/src/shared/secondary/spp_worker_th/cmd_runner.c
+++ b/src/shared/secondary/spp_worker_th/cmd_runner.c
@@ -44,8 +44,8 @@ flush_cmd(void)
 	struct sppwk_comp_info *p_comp_info;
 	struct cancel_backup_info *backup_info;
 
-	sppwk_get_mng_data(NULL, NULL, &p_comp_info,
-				NULL, NULL, &p_change_comp, &backup_info);
+	sppwk_get_mng_data(NULL, &p_comp_info, NULL, NULL, &p_change_comp,
+			&backup_info);
 
 	ret = update_port_info();
 	if (ret < SPP_RET_OK)
diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.c b/src/shared/secondary/spp_worker_th/cmd_utils.c
index 8a40d92..4f84365 100644
--- a/src/shared/secondary/spp_worker_th/cmd_utils.c
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.c
@@ -34,7 +34,6 @@
 /* A set of pointers of management data */
 /* TODO(yasufum) change names start with `p_change` because it wrong meanig. */
 struct mng_data_info {
-	struct startup_param *p_startup_param;
 	struct iface_info *p_iface_info;
 	struct sppwk_comp_info *p_component_info;
 	struct core_mng_info *p_core_info;
@@ -839,7 +838,6 @@ sppwk_convert_mac_str_to_int64(const char *macaddr)
 
 /* Set management data of global var for given non-NULL args. */
 int sppwk_set_mng_data(
-		struct startup_param *startup_param_p,
 		struct iface_info *iface_p,
 		struct sppwk_comp_info *component_p,
 		struct core_mng_info *core_mng_p,
@@ -852,13 +850,11 @@ int sppwk_set_mng_data(
 	 * TODO(yasufum) confirm why the last `0xffffffff` is same as NULL,
 	 * although it is reserved for meaning as invalid.
 	 */
-	if (startup_param_p == NULL || iface_p == NULL ||
-			component_p == NULL || core_mng_p == NULL ||
+	if (iface_p == NULL || component_p == NULL || core_mng_p == NULL ||
 			change_core_p == NULL || change_component_p == NULL ||
 			backup_info_p == NULL || main_lcore_id == 0xffffffff)
 		return SPP_RET_NG;
 
-	g_mng_data.p_startup_param = startup_param_p;
 	g_mng_data.p_iface_info = iface_p;
 	g_mng_data.p_component_info = component_p;
 	g_mng_data.p_core_info = core_mng_p;
@@ -872,7 +868,6 @@ int sppwk_set_mng_data(
 
 /* Get management data from global var for given non-NULL args. */
 void sppwk_get_mng_data(
-		struct startup_param **startup_param_p,
 		struct iface_info **iface_p,
 		struct sppwk_comp_info **component_p,
 		struct core_mng_info **core_mng_p,
@@ -881,8 +876,6 @@ void sppwk_get_mng_data(
 		struct cancel_backup_info **backup_info_p)
 {
 
-	if (startup_param_p != NULL)
-		*startup_param_p = g_mng_data.p_startup_param;
 	if (iface_p != NULL)
 		*iface_p = g_mng_data.p_iface_info;
 	if (component_p != NULL)
diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.h b/src/shared/secondary/spp_worker_th/cmd_utils.h
index 425d3eb..e2b987f 100644
--- a/src/shared/secondary/spp_worker_th/cmd_utils.h
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.h
@@ -191,12 +191,6 @@ struct sppwk_comp_info {
 	struct sppwk_port_info *tx_ports[RTE_MAX_ETHPORTS]; /**< tx ports */
 };
 
-/* Manage cmd arg as global variable, used for spp_vf and spp_mirror. */
-struct startup_param {
-	char server_ip[INET_ADDRSTRLEN];  /* IP address of spp-ctl */
-	int server_port;   /* Port Number of spp-ctl */
-};
-
 /* Manage number of interfaces  and port information as global variable. */
 struct iface_info {
 	int nof_phys;    /* Number of phy ports */
@@ -532,7 +526,6 @@ int64_t sppwk_convert_mac_str_to_int64(const char *macaddr);
 /**
  * Set mange data address.
  *
- * @param startup_param_p Pointer to g_startup_param address.
  * @param iface_p Pointer to g_iface_info address.
  * @param component_p Pointer to g_component_info address.
  * @param core_mng_p Pointer to g_core_info address.
@@ -543,8 +536,7 @@ int64_t sppwk_convert_mac_str_to_int64(const char *macaddr);
  * @retval SPP_RET_OK If succeeded.
  * @retval SPP_RET_NG If failed.
  */
-int sppwk_set_mng_data(struct startup_param *startup_param_p,
-		struct iface_info *iface_p,
+int sppwk_set_mng_data(struct iface_info *iface_p,
 		struct sppwk_comp_info *component_p,
 		struct core_mng_info *core_mng_p,
 		int *change_core_p,
@@ -555,7 +547,6 @@ int sppwk_set_mng_data(struct startup_param *startup_param_p,
 /**
  * Get mange data address.
  *
- * @param startup_param_p Pointer to startup params.
  * @param iface_p Pointer to g_iface_info.
  * @param component_p Pointer to g_component_info.
  * @param core_mng_p Pointer to g_core_mng_info.
@@ -563,8 +554,7 @@ int sppwk_set_mng_data(struct startup_param *startup_param_p,
  * @param change_component_p Pointer to g_change_component.
  * @param backup_info_p Pointer to g_backup_info.
  */
-void sppwk_get_mng_data(struct startup_param **startup_param_p,
-		struct iface_info **iface_p,
+void sppwk_get_mng_data(struct iface_info **iface_p,
 		struct sppwk_comp_info **component_p,
 		struct core_mng_info **core_mng_p,
 		int **change_core_p,
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index 25997db..44e39fc 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -21,9 +21,6 @@
 /* Logical core ID for main process */
 static unsigned int g_main_lcore_id = 0xffffffff;
 
-/* Execution parameter of spp_vf */
-static struct startup_param g_startup_param;
-
 /* Interface management information */
 static struct iface_info g_iface_info;
 
@@ -90,9 +87,6 @@ parse_app_args(int argc, char *argv[])
 	for (cnt = 0; cnt < argcopt; cnt++)
 		argvopt[cnt] = argv[cnt];
 
-	/* Clear startup parameters */
-	memset(&g_startup_param, 0x00, sizeof(g_startup_param));
-
 	/* vhost_cli is disabled as default. */
 	set_vhost_cli_mode(0);
 
@@ -240,7 +234,7 @@ main(int argc, char *argv[])
 		/* Get lcore id of main thread to set its status after */
 		g_main_lcore_id = rte_lcore_id();
 
-		if (sppwk_set_mng_data(&g_startup_param, &g_iface_info,
+		if (sppwk_set_mng_data(&g_iface_info,
 					g_component_info, g_core_info,
 					g_change_core, g_change_component,
 					&g_backup_info,
diff --git a/src/vf/vf_cmd_runner.c b/src/vf/vf_cmd_runner.c
index 4be3188..d9adc48 100644
--- a/src/vf/vf_cmd_runner.c
+++ b/src/vf/vf_cmd_runner.c
@@ -131,8 +131,8 @@ update_comp(enum sppwk_action wk_action, const char *name,
 	int *change_core = NULL;
 	int *change_component = NULL;
 
-	sppwk_get_mng_data(NULL, NULL, &comp_info_base, &core_info,
-				&change_core, &change_component, NULL);
+	sppwk_get_mng_data(NULL, &comp_info_base, &core_info, &change_core,
+			&change_component, NULL);
 
 	switch (wk_action) {
 	case SPPWK_ACT_START:
@@ -272,8 +272,8 @@ update_port(enum sppwk_action wk_action,
 				"(component = %s)\n", name);
 		return SPP_RET_NG;
 	}
-	sppwk_get_mng_data(NULL, NULL,
-			&comp_info_base, NULL, NULL, &change_component, NULL);
+	sppwk_get_mng_data(NULL, &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 == SPPWK_PORT_DIR_RX) {
@@ -457,8 +457,8 @@ spp_iterate_core_info(struct spp_iterate_core_params *params)
 		}
 
 		for (cnt = 0; cnt < core->num; cnt++) {
-			sppwk_get_mng_data(NULL, NULL, &comp_info_base,
-							NULL, NULL, NULL, NULL);
+			sppwk_get_mng_data(NULL, &comp_info_base, NULL, NULL,
+					NULL, NULL);
 			comp_info = (comp_info_base + core->id[cnt]);
 
 			if (comp_info->wk_type == SPPWK_TYPE_CLS) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 2/2] spp_pcap: remove global var g_startup_param
  2019-06-26  5:35 [spp] [PATCH 0/2] Remove global g_startup_param yasufum.o
  2019-06-26  5:35 ` [spp] [PATCH 1/2] shared/sec: remove global var g_startup_param yasufum.o
@ 2019-06-26  5:35 ` " yasufum.o
  1 sibling, 0 replies; 3+ messages in thread
From: yasufum.o @ 2019-06-26  5:35 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

This update for spp_pcap is the same as previous one for removing global
`g_startup_param`.

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

diff --git a/src/pcap/cmd_runner.c b/src/pcap/cmd_runner.c
index 4c1891e..48e8eba 100644
--- a/src/pcap/cmd_runner.c
+++ b/src/pcap/cmd_runner.c
@@ -373,7 +373,7 @@ append_capture_status_value(const char *name, char **output,
 {
 	int *capture_status = NULL;
 
-	spp_get_mng_data_addr(NULL, NULL, NULL, NULL, &capture_status);
+	spp_get_mng_data_addr(NULL, NULL, NULL, &capture_status);
 
 	return append_json_str_value(name, output,
 			CAPTURE_STATUS_STRINGS[*capture_status]);
@@ -797,15 +797,13 @@ send_command_result_response(int *sock,
 
 	/* pcap start command */
 	if (request->is_requested_start) {
-		spp_get_mng_data_addr(NULL, NULL, NULL,
-				      &capture_request, NULL);
+		spp_get_mng_data_addr(NULL, NULL, &capture_request, NULL);
 		*capture_request = SPP_CAPTURE_RUNNING;
 	}
 
 	/* pcap stop command */
 	if (request->is_requested_stop) {
-		spp_get_mng_data_addr(NULL, NULL, NULL,
-					&capture_request, NULL);
+		spp_get_mng_data_addr(NULL, NULL, &capture_request, NULL);
 		*capture_request = SPP_CAPTURE_IDLE;
 	}
 
diff --git a/src/pcap/cmd_utils.c b/src/pcap/cmd_utils.c
index d9e09e5..52ca905 100644
--- a/src/pcap/cmd_utils.c
+++ b/src/pcap/cmd_utils.c
@@ -14,7 +14,6 @@
 
 /* Manage data to addoress */
 struct mng_data_info {
-	struct startup_param	  *p_startup_param;
 	struct iface_info	  *p_iface_info;
 	struct core_mng_info	  *p_core_info;
 	int			  *p_capture_request;
@@ -258,21 +257,18 @@ int spp_format_port_string(char *port, enum port_type iface_type, int iface_no)
 }
 
 /* Set mange data address */
-int spp_set_mng_data_addr(struct startup_param *startup_param_p,
-			  struct iface_info *iface_p,
+int spp_set_mng_data_addr(struct iface_info *iface_p,
 			  struct core_mng_info *core_mng_p,
 			  int *capture_request_p,
 			  int *capture_status_p,
 			  unsigned int main_lcore_id)
 {
-	if (startup_param_p == NULL || iface_p == NULL ||
-			core_mng_p == NULL ||
+	if (iface_p == NULL || core_mng_p == NULL ||
 			capture_request_p == NULL ||
 			capture_status_p == NULL ||
 			main_lcore_id == 0xffffffff)
 		return SPPWK_RET_NG;
 
-	g_mng_data_addr.p_startup_param = startup_param_p;
 	g_mng_data_addr.p_iface_info = iface_p;
 	g_mng_data_addr.p_core_info = core_mng_p;
 	g_mng_data_addr.p_capture_request = capture_request_p;
@@ -283,15 +279,12 @@ int spp_set_mng_data_addr(struct startup_param *startup_param_p,
 }
 
 /* Get manage data address */
-void spp_get_mng_data_addr(struct startup_param **startup_param_p,
-			   struct iface_info **iface_p,
+void spp_get_mng_data_addr(struct iface_info **iface_p,
 			   struct core_mng_info **core_mng_p,
 			   int **capture_request_p,
 			   int **capture_status_p)
 {
 
-	if (startup_param_p != NULL)
-		*startup_param_p = g_mng_data_addr.p_startup_param;
 	if (iface_p != NULL)
 		*iface_p = g_mng_data_addr.p_iface_info;
 	if (core_mng_p != NULL)
diff --git a/src/pcap/cmd_utils.h b/src/pcap/cmd_utils.h
index 8281a3b..4fa2ea9 100644
--- a/src/pcap/cmd_utils.h
+++ b/src/pcap/cmd_utils.h
@@ -155,13 +155,6 @@ struct sppwk_comp_info {
 	struct sppwk_port_info *tx_ports[RTE_MAX_ETHPORTS]; /**< tx ports */
 };
 
-/* Manage given options as global variable */
-struct startup_param {
-	//int client_id;  /* Client ID */
-	char server_ip[INET_ADDRSTRLEN];  /* IP address of spp-ctl */
-	int server_port;  /* Port Number of spp-ctl */
-};
-
 /* Manage interfaces and port information as global variable */
 /* TODO(yasufum) confirm why nof_rings is required not used in anywhere. */
 struct iface_info {
@@ -327,7 +320,6 @@ spp_format_port_string(char *port, enum port_type iface_type, int iface_no);
 /**
  * Set mange data address
  *
- * @param startup_param_p Pointer to g_startup_param address.
  * @param iface_p Pointer to g_iface_info address.
  * @param core_mng_p Pointer to g_core_info address.
  * @param capture_status_p Pointer to status of pcap.
@@ -336,8 +328,7 @@ spp_format_port_string(char *port, enum port_type iface_type, int iface_no);
  * @retval SPP_RET_OK If succeeded.
  * @retval SPP_RET_NG If failed.
  */
-int spp_set_mng_data_addr(struct startup_param *startup_param_p,
-			  struct iface_info *iface_p,
+int spp_set_mng_data_addr(struct iface_info *iface_p,
 			  struct core_mng_info *core_mng_p,
 			  int *capture_request_p,
 			  int *capture_status_p,
@@ -346,14 +337,12 @@ int spp_set_mng_data_addr(struct startup_param *startup_param_p,
 /**
  * Get mange data address
  *
- * @param startup_param_p Pointer to startup params.
  * @param iface_p Pointer to g_iface_info.
  * @param core_mng_p Pointer to g_core_mng_info.
  * @param capture_request_p Pointer to status of pcap.
  * @param capture_status_p Pointer to req of pcap.
  */
-void spp_get_mng_data_addr(struct startup_param **startup_param_p,
-			   struct iface_info **iface_p,
+void spp_get_mng_data_addr(struct iface_info **iface_p,
 			   struct core_mng_info **core_mng_p,
 			   int **capture_request_p,
 			   int **capture_status_p);
diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c
index b69ffdd..0b846f3 100644
--- a/src/pcap/spp_pcap.c
+++ b/src/pcap/spp_pcap.c
@@ -132,9 +132,6 @@ struct pcap_status_info {
 /* Lcore ID of main thread. */
 static unsigned int g_main_lcore_id = 0xffffffff;
 
-/* Arguments for spp_pcap process. */
-static struct startup_param g_startup_param;
-
 /* Interface management information */
 static struct iface_info g_iface_info;
 
@@ -273,9 +270,6 @@ parse_app_args(int argc, char *argv[])
 	for (cnt = 0; cnt < argcopt; cnt++)
 		argvopt[cnt] = argv[cnt];
 
-	/* Clear startup parameters */
-	memset(&g_startup_param, 0x00, sizeof(g_startup_param));
-
 	/* option parameters init */
 	memset(&g_pcap_option, 0x00, sizeof(g_pcap_option));
 	strcpy(g_pcap_option.compress_file_path, DEFAULT_OUTPUT_DIR);
@@ -940,12 +934,9 @@ main(int argc, char *argv[])
 		g_main_lcore_id = rte_lcore_id();
 
 		/* set manage address */
-		if (spp_set_mng_data_addr(&g_startup_param,
-					  &g_iface_info,
-					  g_core_info,
-					  &g_capture_request,
-					  &g_capture_status,
-					  g_main_lcore_id) < 0) {
+		if (spp_set_mng_data_addr(&g_iface_info, g_core_info,
+					&g_capture_request, &g_capture_status,
+					g_main_lcore_id) < 0) {
 			RTE_LOG(ERR, SPP_PCAP,
 				"manage address set is failed.\n");
 			break;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26  5:35 [spp] [PATCH 0/2] Remove global g_startup_param yasufum.o
2019-06-26  5:35 ` [spp] [PATCH 1/2] shared/sec: remove global var g_startup_param yasufum.o
2019-06-26  5:35 ` [spp] [PATCH 2/2] spp_pcap: " yasufum.o

Soft Patch Panel

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/spp/0 spp/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 spp spp/ http://inbox.dpdk.org/spp \
		spp@dpdk.org
	public-inbox-index spp


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.spp


AGPL code for this site: git clone https://public-inbox.org/ public-inbox