Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/9] Refactor ringlatencystats
@ 2019-09-12 10:48 yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 1/9] shared: rename file ringlatencystats to be short yasufum.o
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Spp_vf and spp_mirror support a feature for measuring latency of ring
PMD intended to be used by developers to roughly evaluate performance.
It is implemented as a set of utility functions. Howver, usage is not
intuitive for users because the name of functions are redundant,
lackness of comments, or log messages are not clear.

This series of update is to refactor the feature.

Yasufumi Ogawa (9):
  shared: rename file ringlatencystats to be short
  shared: rename func for calc latency of ring
  shared: rename struct for ring latency stats
  shared: rename func for init latency stats
  shared: renaem util funcs of ring latency
  spp_vf: revise util func for status command
  spp_mirror: revise util func for status command
  spp_pcap: revise util func for status command
  shared: add TODO to fix bug in latency stats

 src/mirror/Makefile                           |  6 +-
 src/mirror/mir_cmd_runner.c                   | 23 +++---
 src/mirror/spp_mirror.c                       |  6 +-
 src/pcap/Makefile                             |  2 +-
 src/pcap/cmd_runner.c                         | 12 +--
 src/pcap/spp_pcap.c                           |  2 +-
 .../{ringlatencystats.c => latency_stats.c}   | 68 ++++++++--------
 .../{ringlatencystats.h => latency_stats.h}   | 77 +++++++++----------
 .../secondary/spp_worker_th/port_capability.c |  7 +-
 src/vf/Makefile                               |  6 +-
 src/vf/classifier.c                           |  2 +-
 src/vf/forwarder.c                            |  2 +-
 src/vf/spp_vf.c                               |  6 +-
 src/vf/vf_cmd_runner.c                        | 23 +++---
 14 files changed, 113 insertions(+), 129 deletions(-)
 rename src/shared/secondary/spp_worker_th/{ringlatencystats.c => latency_stats.c} (73%)
 rename src/shared/secondary/spp_worker_th/{ringlatencystats.h => latency_stats.h} (67%)

-- 
2.17.1


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

* [spp] [PATCH 1/9] shared: rename file ringlatencystats to be short
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 2/9] shared: rename func for calc latency of ring yasufum.o
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Filename of `ringlatencystats.c` and its header is not understandable
because it is too long and has no separators. `latency_stats` is enough
for the usage and no need to add `ring` explicitly.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/mirror/Makefile                                             | 2 +-
 src/mirror/spp_mirror.c                                         | 2 +-
 src/pcap/Makefile                                               | 2 +-
 src/pcap/spp_pcap.c                                             | 2 +-
 .../spp_worker_th/{ringlatencystats.c => latency_stats.c}       | 2 +-
 .../spp_worker_th/{ringlatencystats.h => latency_stats.h}       | 0
 src/shared/secondary/spp_worker_th/port_capability.c            | 2 +-
 src/vf/Makefile                                                 | 2 +-
 src/vf/classifier.c                                             | 2 +-
 src/vf/forwarder.c                                              | 2 +-
 src/vf/spp_vf.c                                                 | 2 +-
 11 files changed, 10 insertions(+), 10 deletions(-)
 rename src/shared/secondary/spp_worker_th/{ringlatencystats.c => latency_stats.c} (99%)
 rename src/shared/secondary/spp_worker_th/{ringlatencystats.h => latency_stats.h} (100%)

diff --git a/src/mirror/Makefile b/src/mirror/Makefile
index ed2cb33..0adab15 100644
--- a/src/mirror/Makefile
+++ b/src/mirror/Makefile
@@ -26,7 +26,7 @@ SRCS-y += $(SPP_WKT_DIR)/port_capability.c
 SRCS-y += $(SPP_WKT_DIR)/conn_spp_ctl.c
 SRCS-y += $(SPP_WKT_DIR)/cmd_parser.c
 SRCS-y += $(SPP_WKT_DIR)/cmd_runner.c
-SRCS-y += $(SPP_WKT_DIR)/ringlatencystats.c
+SRCS-y += $(SPP_WKT_DIR)/latency_stats.c
 SRCS-y += $(SPP_WKT_DIR)/cmd_res_formatter.c
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index 0ace09c..40fbc6f 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -21,7 +21,7 @@
 #include "shared/secondary/spp_worker_th/port_capability.h"
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-#include "shared/secondary/spp_worker_th/ringlatencystats.h"
+#include "shared/secondary/spp_worker_th/latency_stats.h"
 #endif
 
 /* Declare global variables */
diff --git a/src/pcap/Makefile b/src/pcap/Makefile
index 5e6f0a6..b2ed5f0 100644
--- a/src/pcap/Makefile
+++ b/src/pcap/Makefile
@@ -24,7 +24,7 @@ SRCS-y += $(SPP_SEC_DIR)/utils.c
 SRCS-y += $(SPP_SEC_DIR)/string_buffer.c
 SRCS-y += $(SPP_WKT_DIR)/conn_spp_ctl.c
 SRCS-y += $(SPP_WKT_DIR)/port_capability.c
-SRCS-y += $(SPP_WKT_DIR)/ringlatencystats.c
+SRCS-y += $(SPP_WKT_DIR)/latency_stats.c
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
 CFLAGS += $(WERROR_FLAGS) -O3 -MMD
diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c
index ac87bd3..ab4d796 100644
--- a/src/pcap/spp_pcap.c
+++ b/src/pcap/spp_pcap.c
@@ -24,7 +24,7 @@
 #include "shared/secondary/spp_worker_th/port_capability.h"
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-#include "shared/secondary/spp_worker_th/ringlatencystats.h"
+#include "shared/secondary/spp_worker_th/latency_stats.h"
 #endif
 
 /* Declare global variables */
diff --git a/src/shared/secondary/spp_worker_th/ringlatencystats.c b/src/shared/secondary/spp_worker_th/latency_stats.c
similarity index 99%
rename from src/shared/secondary/spp_worker_th/ringlatencystats.c
rename to src/shared/secondary/spp_worker_th/latency_stats.c
index b0f2080..7ca7385 100644
--- a/src/shared/secondary/spp_worker_th/ringlatencystats.c
+++ b/src/shared/secondary/spp_worker_th/latency_stats.c
@@ -14,7 +14,7 @@
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 
-#include "ringlatencystats.h"
+#include "latency_stats.h"
 #include "cmd_utils.h"
 #include "port_capability.h"
 #include "../return_codes.h"
diff --git a/src/shared/secondary/spp_worker_th/ringlatencystats.h b/src/shared/secondary/spp_worker_th/latency_stats.h
similarity index 100%
rename from src/shared/secondary/spp_worker_th/ringlatencystats.h
rename to src/shared/secondary/spp_worker_th/latency_stats.h
diff --git a/src/shared/secondary/spp_worker_th/port_capability.c b/src/shared/secondary/spp_worker_th/port_capability.c
index d4276f1..e90fd0b 100644
--- a/src/shared/secondary/spp_worker_th/port_capability.c
+++ b/src/shared/secondary/spp_worker_th/port_capability.c
@@ -12,7 +12,7 @@
 #include "shared/secondary/return_codes.h"
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-#include "ringlatencystats.h"
+#include "latency_stats.h"
 #endif
 
 /**
diff --git a/src/vf/Makefile b/src/vf/Makefile
index 784d636..742986c 100644
--- a/src/vf/Makefile
+++ b/src/vf/Makefile
@@ -20,7 +20,7 @@ SRCS-y += $(SPP_SEC_DIR)/string_buffer.c
 SRCS-y += $(SPP_SEC_DIR)/json_helper.c
 SRCS-y += $(SPP_SEC_DIR)/common.c
 SRCS-y += $(SPP_SEC_DIR)/utils.c $(SPP_SEC_DIR)/add_port.c
-SRCS-y += $(SPP_WKT_DIR)/ringlatencystats.c
+SRCS-y += $(SPP_WKT_DIR)/latency_stats.c
 SRCS-y += $(SPP_WKT_DIR)/port_capability.c
 SRCS-y += $(SPP_WKT_DIR)/conn_spp_ctl.c
 SRCS-y += $(SPP_WKT_DIR)/cmd_parser.c
diff --git a/src/vf/classifier.c b/src/vf/classifier.c
index 375f710..fa47ed7 100644
--- a/src/vf/classifier.c
+++ b/src/vf/classifier.c
@@ -30,7 +30,7 @@
 #include "shared/secondary/spp_worker_th/port_capability.h"
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-#include "shared/secondary/spp_worker_th/ringlatencystats.h"
+#include "shared/secondary/spp_worker_th/latency_stats.h"
 #endif
 
 #define RTE_LOGTYPE_VF_CLS RTE_LOGTYPE_USER1
diff --git a/src/vf/forwarder.c b/src/vf/forwarder.c
index 3e98526..04bf5c3 100644
--- a/src/vf/forwarder.c
+++ b/src/vf/forwarder.c
@@ -10,7 +10,7 @@
 #include "shared/secondary/spp_worker_th/port_capability.h"
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-#include "shared/secondary/spp_worker_th/ringlatencystats.h"
+#include "shared/secondary/spp_worker_th/latency_stats.h"
 #endif
 
 #define RTE_LOGTYPE_FORWARD RTE_LOGTYPE_USER1
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index d6e6309..f843332 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -20,7 +20,7 @@
 #define RTE_LOGTYPE_SPP_VF RTE_LOGTYPE_USER1
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-#include "shared/secondary/spp_worker_th/ringlatencystats.h"
+#include "shared/secondary/spp_worker_th/latency_stats.h"
 #endif
 
 /* getopt_long return value for long option */
-- 
2.17.1


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

* [spp] [PATCH 2/9] shared: rename func for calc latency of ring
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 1/9] shared: rename file ringlatencystats to be short yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 3/9] shared: rename struct for ring latency stats yasufum.o
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Name of spp_ringlatencystats_calculate_latency() is too long and
redundant. sppwk_calc_ring_latency() is enough for the usage.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 .../secondary/spp_worker_th/latency_stats.c    | 12 +++++-------
 .../secondary/spp_worker_th/latency_stats.h    | 18 +++++++-----------
 .../secondary/spp_worker_th/port_capability.c  |  3 +--
 3 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/latency_stats.c b/src/shared/secondary/spp_worker_th/latency_stats.c
index 7ca7385..036a360 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.c
+++ b/src/shared/secondary/spp_worker_th/latency_stats.c
@@ -120,8 +120,8 @@ spp_ringlatencystats_add_time_stamp(int ring_id,
 }
 
 void
-spp_ringlatencystats_calculate_latency(int ring_id,
-			struct rte_mbuf **pkts, uint16_t nb_pkts)
+sppwk_calc_ring_latency(int ring_id,
+		struct rte_mbuf **pkts, uint16_t nb_pkts)
 {
 	unsigned int i;
 	uint64_t now;
@@ -199,7 +199,7 @@ print_ring_latency_stats(struct iface_info *if_info)
 	}
 }
 
-/* Wrapper function for rte_eth_rx_burst() with ring latency feature. */
+/* Wrapper function for rte_eth_rx_burst() with calc ring latency. */
 uint16_t
 sppwk_eth_ring_stats_rx_burst(uint16_t port_id,
 		enum port_type iface_type,
@@ -216,13 +216,11 @@ sppwk_eth_ring_stats_rx_burst(uint16_t port_id,
 		return SPPWK_RET_OK;
 
 	if (iface_type == RING)
-		spp_ringlatencystats_calculate_latency(
-				iface_no,
-				rx_pkts, nb_pkts);
+		sppwk_calc_ring_latency(iface_no, rx_pkts, nb_pkts);
 	return nb_rx;
 }
 
-/* Wrapper function for rte_eth_tx_burst() with ring latency feature. */
+/* Wrapper function for rte_eth_tx_burst() with calc ring latency. */
 uint16_t
 sppwk_eth_ring_stats_tx_burst(uint16_t port_id,
 		enum port_type iface_type,
diff --git a/src/shared/secondary/spp_worker_th/latency_stats.h b/src/shared/secondary/spp_worker_th/latency_stats.h
index 332b4b8..4a7abb4 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.h
+++ b/src/shared/secondary/spp_worker_th/latency_stats.h
@@ -61,20 +61,16 @@ void spp_ringlatencystats_add_time_stamp(int ring_id,
 			struct rte_mbuf **pkts, uint16_t nb_pkts);
 
 /**
- * calculate latency.
+ * calculate latency of ring.
  *
  * @note call at dequeue.
  *
- * @param ring_id
- *  The ring id.
- * @param pkts
- *  The address of an array of nb_pkts pointers to rte_mbuf structures
- *  which contain the packets to be measured.
- * @param nb_pkts
- *  The maximum number of packets to be measured.
+ * @param ring_id ring id.
+ * @param pkts Pointer to nb_pkts to containing packets.
+ * @param nb_pkts Max number of packets to be measured.
  */
-void spp_ringlatencystats_calculate_latency(int ring_id,
-			struct rte_mbuf **pkts, uint16_t nb_pkts);
+void sppwk_calc_ring_latency(int ring_id,
+		struct rte_mbuf **pkts, uint16_t nb_pkts);
 
 /**
  * get number of ring latency statistics.
@@ -158,7 +154,7 @@ uint16_t sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id,
 #define spp_ringlatencystats_init(arg1, arg2) 0
 #define spp_ringlatencystats_uninit()
 #define spp_ringlatencystats_add_time_stamp(arg1, arg2, arg3)
-#define spp_ringlatencystats_calculate_latency(arg1, arg2, arg3)
+#define sppwk_calc_ring_latency(arg1, arg2, arg3)
 #define spp_ringlatencystats_get_count() 0
 #define spp_ringlatencystats_get_stats(arg1, arg2)
 #define print_ringlatencystats_stats(arg)
diff --git a/src/shared/secondary/spp_worker_th/port_capability.c b/src/shared/secondary/spp_worker_th/port_capability.c
index e90fd0b..4447749 100644
--- a/src/shared/secondary/spp_worker_th/port_capability.c
+++ b/src/shared/secondary/spp_worker_th/port_capability.c
@@ -422,8 +422,7 @@ sppwk_eth_vlan_ring_stats_rx_burst(uint16_t port_id,
 		return SPPWK_RET_OK;
 
 	if (iface_type == RING)
-		spp_ringlatencystats_calculate_latency(iface_no,
-				rx_pkts, nb_pkts);
+		sppwk_calc_ring_latency(iface_no, rx_pkts, nb_pkts);
 
 	/* Add or delete VLAN tag. */
 	return vlan_operation(port_id, rx_pkts, nb_rx, SPPWK_PORT_DIR_RX);
-- 
2.17.1


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

* [spp] [PATCH 3/9] shared: rename struct for ring latency stats
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 1/9] shared: rename file ringlatencystats to be short yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 2/9] shared: rename func for calc latency of ring yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 4/9] shared: rename func for init " yasufum.o
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Struct `spp_ringlatencystats_ring_latency_stats` is for containing stats
as a histgram like data. It is only used in `latency_stats.c` and its
header locally, so no need to such a long name. This update is to rename
it to `ring_latency_stats_t`.

This update also includes revising name of vars and comments.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 .../secondary/spp_worker_th/latency_stats.c   | 28 ++++++++-----------
 .../secondary/spp_worker_th/latency_stats.h   | 22 +++++++++------
 2 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/latency_stats.c b/src/shared/secondary/spp_worker_th/latency_stats.c
index 036a360..0a5e5a7 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.c
+++ b/src/shared/secondary/spp_worker_th/latency_stats.c
@@ -27,10 +27,9 @@
 
 /** ring latency statistics information */
 struct ring_latency_stats_info {
-	uint64_t timer_tsc;     /**< sampling interval counter */
-	uint64_t prev_tsc;      /**< previous time */
-	struct spp_ringlatencystats_ring_latency_stats stats;
-				/**< ring latency statistics list */
+	uint64_t timer_tsc;  /**< sampling interval */
+	uint64_t prev_tsc;   /**< previous time */
+	struct ring_latency_stats_t stats;  /**< list of stats */
 };
 
 /** sampling interval */
@@ -133,16 +132,13 @@ sppwk_calc_ring_latency(int ring_id,
 		if (likely(pkts[i]->timestamp == 0))
 			continue;
 
-		/* when mbuf::timestamp is not zero */
-		/* calculate latency */
+		/* calc latency if mbuf `timestamp` is non-zero. */
 		latency = (uint64_t)floor((now - pkts[i]->timestamp) /
 				cycles_per_ns());
-		if (likely(latency < SPP_RINGLATENCYSTATS_STATS_SLOT_COUNT-1))
-			stats_info->stats.slot[latency]++;
+		if (likely(latency < TOTAL_LATENCY_ENT-1))
+			stats_info->stats.distr[latency]++;
 		else
-			stats_info->stats.slot[
-					SPP_RINGLATENCYSTATS_STATS_SLOT_COUNT
-					-1]++;
+			stats_info->stats.distr[TOTAL_LATENCY_ENT-1]++;
 	}
 }
 
@@ -154,12 +150,12 @@ spp_ringlatencystats_get_count(void)
 
 void
 spp_ringlatencystats_get_stats(int ring_id,
-		struct spp_ringlatencystats_ring_latency_stats *stats)
+		struct ring_latency_stats_t *stats)
 {
 	struct ring_latency_stats_info *stats_info = &g_stats_info[ring_id];
 
 	rte_memcpy(stats, &stats_info->stats,
-			sizeof(struct spp_ringlatencystats_ring_latency_stats));
+			sizeof(struct ring_latency_stats_t));
 }
 
 /* Print statistics of time for packet processing in ring interface */
@@ -172,7 +168,7 @@ print_ring_latency_stats(struct iface_info *if_info)
 	printf("%s%s", clr, topLeft);
 
 	int ring_cnt, stats_cnt;
-	struct spp_ringlatencystats_ring_latency_stats stats[RTE_MAX_ETHPORTS];
+	struct ring_latency_stats_t stats[RTE_MAX_ETHPORTS];
 	memset(&stats, 0x00, sizeof(stats));
 
 	printf("RING Latency\n");
@@ -186,14 +182,14 @@ print_ring_latency_stats(struct iface_info *if_info)
 	}
 	printf("\n");
 
-	for (stats_cnt = 0; stats_cnt < SPP_RINGLATENCYSTATS_STATS_SLOT_COUNT;
+	for (stats_cnt = 0; stats_cnt < TOTAL_LATENCY_ENT;
 			stats_cnt++) {
 		printf("%3dns", stats_cnt);
 		for (ring_cnt = 0; ring_cnt < RTE_MAX_ETHPORTS; ring_cnt++) {
 			if (if_info->ring[ring_cnt].iface_type == UNDEF)
 				continue;
 
-			printf(", 0x%-16lx", stats[ring_cnt].slot[stats_cnt]);
+			printf(", 0x%-16lx", stats[ring_cnt].distr[stats_cnt]);
 		}
 		printf("\n");
 	}
diff --git a/src/shared/secondary/spp_worker_th/latency_stats.h b/src/shared/secondary/spp_worker_th/latency_stats.h
index 4a7abb4..de9ee5d 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.h
+++ b/src/shared/secondary/spp_worker_th/latency_stats.h
@@ -9,19 +9,25 @@
  * @file
  * SPP RING latency statistics
  *
- * Measure the latency through ring-PMD.
+ * Util functions for measuring latency of ring-PMD.
  */
 
 #include <rte_mbuf.h>
 #include "cmd_utils.h"
 
-/** number of slots to save latency. 0ns~99ns and 100ns over */
-#define SPP_RINGLATENCYSTATS_STATS_SLOT_COUNT 101
+/**
+ * Statistics of latency of ring is counted with histgram like data structure.
+ * To count frequency of each of time in nano sec, this data is implemented as
+ * an array in which frequency counts of 1-100[ns] are contained. If the
+ * latency is larger than 100[ns], it is added to the last entry. It means
+ * this array has 101 entries, 100 entries for 1-100[ns] and 1 entry for over
+ * 100[ns].
+ */
+#define TOTAL_LATENCY_ENT 101
 
-/** ring latency statistics */
-struct spp_ringlatencystats_ring_latency_stats {
-	/** slots to save latency */
-	uint64_t slot[SPP_RINGLATENCYSTATS_STATS_SLOT_COUNT];
+/** statistics of latency of ring */
+struct ring_latency_stats_t {
+	uint64_t distr[TOTAL_LATENCY_ENT]; /* distribution of time */
 };
 
 
@@ -88,7 +94,7 @@ int spp_ringlatencystats_get_count(void);
  *  The statistics values.
  */
 void spp_ringlatencystats_get_stats(int ring_id,
-		struct spp_ringlatencystats_ring_latency_stats *stats);
+		struct ring_latency_stats_t *stats);
 
 /* Print statistics of time for packet processing in ring interface */
 void print_ring_latency_stats(struct iface_info *if_info);
-- 
2.17.1


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

* [spp] [PATCH 4/9] shared: rename func for init latency stats
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
                   ` (2 preceding siblings ...)
  2019-09-12 10:48 ` [spp] [PATCH 3/9] shared: rename struct for ring latency stats yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 5/9] shared: renaem util funcs of ring latency yasufum.o
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

This update is to revise name of func spp_ringlatencystats_init() to
sppwk_ring_latency_stats(), and also spp_ringlatencystats_uninit()
to sppwk_clean_ring_latency_stats() to be more specific.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/mirror/spp_mirror.c                            |  4 ++--
 src/shared/secondary/spp_worker_th/latency_stats.c |  4 ++--
 src/shared/secondary/spp_worker_th/latency_stats.h | 13 +++++--------
 src/vf/spp_vf.c                                    |  4 ++--
 4 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index 40fbc6f..a6bad3a 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -580,7 +580,7 @@ main(int argc, char *argv[])
 			if (port_type == RING)
 				nof_rings++;
 		}
-		int ret_ringlatency = spp_ringlatencystats_init(
+		int ret_ringlatency = sppwk_init_ring_latency_stats(
 				SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL,
 				nof_rings);
 		if (unlikely(ret_ringlatency != SPPWK_RET_OK))
@@ -650,7 +650,7 @@ main(int argc, char *argv[])
 	del_vhost_sockfile(g_iface_info.vhost);
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-	spp_ringlatencystats_uninit();
+	sppwk_clean_ring_latency_stats();
 #endif /* SPP_RINGLATENCYSTATS_ENABLE */
 
 	RTE_LOG(INFO, MIRROR, "Exit spp_mirror.\n");
diff --git a/src/shared/secondary/spp_worker_th/latency_stats.c b/src/shared/secondary/spp_worker_th/latency_stats.c
index 0a5e5a7..e1dde2c 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.c
+++ b/src/shared/secondary/spp_worker_th/latency_stats.c
@@ -49,7 +49,7 @@ cycles_per_ns(void)
 }
 
 int
-spp_ringlatencystats_init(uint64_t samp_intvl, uint16_t stats_count)
+sppwk_init_ring_latency_stats(uint64_t samp_intvl, uint16_t stats_count)
 {
 	/* allocate memory for ring latency statistics information */
 	g_stats_info = rte_zmalloc(
@@ -76,7 +76,7 @@ spp_ringlatencystats_init(uint64_t samp_intvl, uint16_t stats_count)
 }
 
 void
-spp_ringlatencystats_uninit(void)
+sppwk_clean_ring_latency_stats(void)
 {
 	/* free memory for ring latency statistics information */
 	if (likely(g_stats_info != NULL)) {
diff --git a/src/shared/secondary/spp_worker_th/latency_stats.h b/src/shared/secondary/spp_worker_th/latency_stats.h
index de9ee5d..8016233 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.h
+++ b/src/shared/secondary/spp_worker_th/latency_stats.h
@@ -43,12 +43,9 @@ struct ring_latency_stats_t {
  * @retval SPPWK_RET_OK: succeeded.
  * @retval SPPWK_RET_NG: failed.
  */
-int spp_ringlatencystats_init(uint64_t samp_intvl, uint16_t stats_count);
+int sppwk_init_ring_latency_stats(uint64_t samp_intvl, uint16_t stats_count);
 
-/**
- *uninitialize ring latency statistics.
- */
-void spp_ringlatencystats_uninit(void);
+void sppwk_clean_ring_latency_stats(void);
 
 /**
  * add time-stamp to mbuf's member.
@@ -81,7 +78,7 @@ void sppwk_calc_ring_latency(int ring_id,
 /**
  * get number of ring latency statistics.
  *
- * @return spp_ringlatencystats_init's parameter "stats_count"
+ * @return sppwk_init_ring_latency_stats's parameter "stats_count"
  */
 int spp_ringlatencystats_get_count(void);
 
@@ -157,8 +154,8 @@ uint16_t sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id,
 
 #else
 
-#define spp_ringlatencystats_init(arg1, arg2) 0
-#define spp_ringlatencystats_uninit()
+#define sppwk_init_ring_latency_stats(arg1, arg2) 0
+#define sppwk_clean_ring_latency_stats()
 #define spp_ringlatencystats_add_time_stamp(arg1, arg2, arg3)
 #define sppwk_calc_ring_latency(arg1, arg2, arg3)
 #define spp_ringlatencystats_get_count() 0
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index f843332..bf4cdbe 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -292,7 +292,7 @@ main(int argc, char *argv[])
 			if (port_type == RING)
 				nof_rings++;
 		}
-		ret = spp_ringlatencystats_init(
+		ret = sppwk_init_ring_latency_stats(
 				SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL,
 				nof_rings);
 		if (unlikely(ret != SPPWK_RET_OK))
@@ -357,7 +357,7 @@ main(int argc, char *argv[])
 	del_vhost_sockfile(g_iface_info.vhost);
 
 #ifdef SPP_RINGLATENCYSTATS_ENABLE
-	spp_ringlatencystats_uninit();
+	sppwk_clean_ring_latency_stats();
 #endif /* SPP_RINGLATENCYSTATS_ENABLE */
 
 	RTE_LOG(INFO, SPP_VF, "Exit spp_vf.\n");
-- 
2.17.1


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

* [spp] [PATCH 5/9] shared: renaem util funcs of ring latency
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
                   ` (3 preceding siblings ...)
  2019-09-12 10:48 ` [spp] [PATCH 4/9] shared: rename func for init " yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 6/9] spp_vf: revise util func for status command yasufum.o
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Rename following functions for conventions.

* spp_ringlatencystats_add_time_stamp() to sppwk_add_ring_latency_time()

* spp_ringlatencystats_get_count() to
  sppwk_get_ring_latency_stats_count()

* spp_ringlatencystats_get_stats() to sppwk_get_ring_latency_stats()

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 .../secondary/spp_worker_th/latency_stats.c   | 17 ++++++-------
 .../secondary/spp_worker_th/latency_stats.h   | 24 ++++++++-----------
 .../secondary/spp_worker_th/port_capability.c |  2 +-
 3 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/src/shared/secondary/spp_worker_th/latency_stats.c b/src/shared/secondary/spp_worker_th/latency_stats.c
index e1dde2c..33b3b44 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.c
+++ b/src/shared/secondary/spp_worker_th/latency_stats.c
@@ -86,8 +86,8 @@ sppwk_clean_ring_latency_stats(void)
 }
 
 void
-spp_ringlatencystats_add_time_stamp(int ring_id,
-			struct rte_mbuf **pkts, uint16_t nb_pkts)
+sppwk_add_ring_latency_time(int ring_id,
+		struct rte_mbuf **pkts, uint16_t nb_pkts)
 {
 	unsigned int i;
 	uint64_t diff_tsc, now;
@@ -102,8 +102,7 @@ spp_ringlatencystats_add_time_stamp(int ring_id,
 		diff_tsc = now - stats_info->prev_tsc;
 		stats_info->timer_tsc += diff_tsc;
 
-		/* when it is over sampling interval */
-		/* set tsc to mbuf::timestamp */
+		/* set tsc to mbuf timestamp if it is over sampling interval. */
 		if (unlikely(stats_info->timer_tsc >= g_samp_intvl)) {
 			RTE_LOG(DEBUG, SPP_RING_LATENCY_STATS,
 					"Set timestamp. ring_id=%d, "
@@ -143,13 +142,13 @@ sppwk_calc_ring_latency(int ring_id,
 }
 
 int
-spp_ringlatencystats_get_count(void)
+sppwk_get_ring_latency_stats_count(void)
 {
 	return g_stats_count;
 }
 
 void
-spp_ringlatencystats_get_stats(int ring_id,
+sppwk_get_ring_latency_stats(int ring_id,
 		struct ring_latency_stats_t *stats)
 {
 	struct ring_latency_stats_info *stats_info = &g_stats_info[ring_id];
@@ -177,7 +176,7 @@ print_ring_latency_stats(struct iface_info *if_info)
 		if (if_info->ring[ring_cnt].iface_type == UNDEF)
 			continue;
 
-		spp_ringlatencystats_get_stats(ring_cnt, &stats[ring_cnt]);
+		sppwk_get_ring_latency_stats(ring_cnt, &stats[ring_cnt]);
 		printf(", %-18d", ring_cnt);
 	}
 	printf("\n");
@@ -229,9 +228,7 @@ sppwk_eth_ring_stats_tx_burst(uint16_t port_id,
 	nb_tx = rte_eth_tx_burst(port_id, 0, tx_pkts, nb_pkts);
 
 	if (iface_type == RING)
-		spp_ringlatencystats_add_time_stamp(
-				iface_no,
-				tx_pkts, nb_pkts);
+		sppwk_add_ring_latency_time(iface_no, tx_pkts, nb_pkts);
 	return nb_tx;
 }
 
diff --git a/src/shared/secondary/spp_worker_th/latency_stats.h b/src/shared/secondary/spp_worker_th/latency_stats.h
index 8016233..1857672 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.h
+++ b/src/shared/secondary/spp_worker_th/latency_stats.h
@@ -52,16 +52,12 @@ void sppwk_clean_ring_latency_stats(void);
  *
  * @note call at enqueue.
  *
- * @param ring_id
- *  The ring id.
- * @param pkts
- *  The address of an array of nb_pkts pointers to rte_mbuf structures
- *  which contain the packets to be measured.
- * @param nb_pkts
- *  The maximum number of packets to be measured.
+ * @param ring_id Ring id.
+ * @param pkts Pointer to nb_pkts rte_mbuf containing packets.
+ * @param nb_pkts Maximum number of packets to be measured.
  */
-void spp_ringlatencystats_add_time_stamp(int ring_id,
-			struct rte_mbuf **pkts, uint16_t nb_pkts);
+void sppwk_add_ring_latency_time(int ring_id,
+		struct rte_mbuf **pkts, uint16_t nb_pkts);
 
 /**
  * calculate latency of ring.
@@ -80,7 +76,7 @@ void sppwk_calc_ring_latency(int ring_id,
  *
  * @return sppwk_init_ring_latency_stats's parameter "stats_count"
  */
-int spp_ringlatencystats_get_count(void);
+int sppwk_get_ring_latency_stats_count(void);
 
 /**
  *get specific ring latency statistics.
@@ -90,7 +86,7 @@ int spp_ringlatencystats_get_count(void);
  * @param stats
  *  The statistics values.
  */
-void spp_ringlatencystats_get_stats(int ring_id,
+void sppwk_get_ring_latency_stats(int ring_id,
 		struct ring_latency_stats_t *stats);
 
 /* Print statistics of time for packet processing in ring interface */
@@ -156,10 +152,10 @@ uint16_t sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id,
 
 #define sppwk_init_ring_latency_stats(arg1, arg2) 0
 #define sppwk_clean_ring_latency_stats()
-#define spp_ringlatencystats_add_time_stamp(arg1, arg2, arg3)
+#define sppwk_add_ring_latency_time(arg1, arg2, arg3)
 #define sppwk_calc_ring_latency(arg1, arg2, arg3)
-#define spp_ringlatencystats_get_count() 0
-#define spp_ringlatencystats_get_stats(arg1, arg2)
+#define sppwk_get_ring_latency_stats_count() 0
+#define sppwk_get_ring_latency_stats(arg1, arg2)
 #define print_ringlatencystats_stats(arg)
 #define sppwk_eth_ring_stats_rx_burst(arg1, arg2, arg3, arg4, arg5, arg6)
 #define sppwk_eth_ring_stats_tx_burst(arg1, arg2, arg3, arg4, arg5, arg6)
diff --git a/src/shared/secondary/spp_worker_th/port_capability.c b/src/shared/secondary/spp_worker_th/port_capability.c
index 4447749..ccef496 100644
--- a/src/shared/secondary/spp_worker_th/port_capability.c
+++ b/src/shared/secondary/spp_worker_th/port_capability.c
@@ -444,7 +444,7 @@ sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id,
 		return SPPWK_RET_OK;
 
 	if (iface_type == RING) {
-		spp_ringlatencystats_add_time_stamp(iface_no, tx_pkts, nb_pkts);
+		sppwk_add_ring_latency_time(iface_no, tx_pkts, nb_pkts);
 	}
 
 	return rte_eth_tx_burst(port_id, 0, tx_pkts, nb_tx);
-- 
2.17.1


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

* [spp] [PATCH 6/9] spp_vf: revise util func for status command
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
                   ` (4 preceding siblings ...)
  2019-09-12 10:48 ` [spp] [PATCH 5/9] shared: renaem util funcs of ring latency yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 7/9] spp_mirror: " yasufum.o
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Util function spp_iterate_core_info() is for gettng each of lcore info
for composing response of status command. This update is to rename it
to iterate_lcore_info() and add comments as refactoring.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/vf/vf_cmd_runner.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/vf/vf_cmd_runner.c b/src/vf/vf_cmd_runner.c
index c94288a..305c4a2 100644
--- a/src/vf/vf_cmd_runner.c
+++ b/src/vf/vf_cmd_runner.c
@@ -428,9 +428,9 @@ exec_one_cmd(const struct sppwk_cmd_attrs *cmd)
 	return ret;
 }
 
-/* Iterate core information to create response to status command */
+/* Iterate core info to create response of spp_vf status */
 static int
-spp_iterate_core_info(struct sppwk_lcore_params *params)
+iterate_lcore_info(struct sppwk_lcore_params *params)
 {
 	int ret;
 	int lcore_id, cnt;
@@ -444,16 +444,12 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
 
 		core = get_core_info(lcore_id);
 		if (core->num == 0) {
-			ret = (*params->lcore_proc)(
-				params, lcore_id,
-				"", SPPWK_TYPE_NONE_STR,
-				0, NULL, 0, NULL);
+			ret = (*params->lcore_proc)(params, lcore_id, "",
+				SPPWK_TYPE_NONE_STR, 0, NULL, 0, NULL);
 			if (unlikely(ret != 0)) {
 				RTE_LOG(ERR, VF_CMD_RUNNER,
-						"Cannot iterate core "
-						"information. "
-						"(core = %d, type = %d)\n",
-						lcore_id, SPPWK_TYPE_NONE);
+						"Failed to proc on lcore %d\n",
+						lcore_id);
 				return SPPWK_RET_NG;
 			}
 			continue;
@@ -474,9 +470,8 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
 
 			if (unlikely(ret != 0)) {
 				RTE_LOG(ERR, VF_CMD_RUNNER,
-						"Cannot iterate core "
-						"information. "
-						"(core = %d, type = %d)\n",
+						"Failed to get on lcore %d ,"
+						"type %d\n",
 						lcore_id, comp_info->wk_type);
 				return SPPWK_RET_NG;
 			}
@@ -502,7 +497,7 @@ add_core(const char *name, char **output,
 	lcore_params.output = tmp_buff;
 	lcore_params.lcore_proc = append_core_element_value;
 
-	ret = spp_iterate_core_info(&lcore_params);
+	ret = iterate_lcore_info(&lcore_params);
 	if (unlikely(ret != SPPWK_RET_OK)) {
 		spp_strbuf_free(lcore_params.output);
 		return SPPWK_RET_NG;
-- 
2.17.1


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

* [spp] [PATCH 7/9] spp_mirror: revise util func for status command
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
                   ` (5 preceding siblings ...)
  2019-09-12 10:48 ` [spp] [PATCH 6/9] spp_vf: revise util func for status command yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 8/9] spp_pcap: " yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 9/9] shared: add TODO to fix bug in latency stats yasufum.o
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

As previous patch for spp_vf, this update is to rename it to
iterate_lcore_info() and add comments as refactoring.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/mirror/mir_cmd_runner.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/mirror/mir_cmd_runner.c b/src/mirror/mir_cmd_runner.c
index 730d75f..fb1695f 100644
--- a/src/mirror/mir_cmd_runner.c
+++ b/src/mirror/mir_cmd_runner.c
@@ -294,9 +294,9 @@ exec_one_cmd(const struct sppwk_cmd_attrs *cmd)
 	return ret;
 }
 
-/* Iterate core information to create response to status command */
+/* Iterate core info to create response of spp_mirror status */
 static int
-spp_iterate_core_info(struct sppwk_lcore_params *params)
+iterate_lcore_info(struct sppwk_lcore_params *params)
 {
 	int ret;
 	int lcore_id, cnt;
@@ -310,16 +310,12 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
 
 		core = get_core_info(lcore_id);
 		if (core->num == 0) {
-			ret = (*params->lcore_proc)(
-				params, lcore_id,
-				"", SPPWK_TYPE_NONE_STR,
-				0, NULL, 0, NULL);
+			ret = (*params->lcore_proc)(params, lcore_id, "",
+					SPPWK_TYPE_NONE_STR, 0, NULL, 0, NULL);
 			if (unlikely(ret != 0)) {
 				RTE_LOG(ERR, MIR_CMD_RUNNER,
-						"Cannot iterate core "
-						"information. "
-						"(core = %d, type = %d)\n",
-						lcore_id, SPPWK_TYPE_NONE);
+						"Failed to proc on lcore %d\n",
+						lcore_id);
 				return SPPWK_RET_NG;
 			}
 			continue;
@@ -334,9 +330,8 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
 
 			if (unlikely(ret != 0)) {
 				RTE_LOG(ERR, MIR_CMD_RUNNER,
-						"Cannot iterate core "
-						"information. "
-						"(core = %d, type = %d)\n",
+						"Failed to get on lcore %d ,"
+						"type %d\n",
 						lcore_id, comp_info->wk_type);
 				return SPPWK_RET_NG;
 			}
@@ -365,7 +360,7 @@ add_core(const char *name, char **output,
 	lcore_params.output = tmp_buff;
 	lcore_params.lcore_proc = append_core_element_value;
 
-	ret = spp_iterate_core_info(&lcore_params);
+	ret = iterate_lcore_info(&lcore_params);
 	if (unlikely(ret != SPPWK_RET_OK)) {
 		spp_strbuf_free(lcore_params.output);
 		return SPPWK_RET_NG;
-- 
2.17.1


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

* [spp] [PATCH 8/9] spp_pcap: revise util func for status command
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
                   ` (6 preceding siblings ...)
  2019-09-12 10:48 ` [spp] [PATCH 7/9] spp_mirror: " yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  2019-09-12 10:48 ` [spp] [PATCH 9/9] shared: add TODO to fix bug in latency stats yasufum.o
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

As previous patch for spp_vf, this update is to rename it to
iterate_lcore_info() and add comments as refactoring.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/pcap/cmd_runner.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/pcap/cmd_runner.c b/src/pcap/cmd_runner.c
index 63658a5..ac5181d 100644
--- a/src/pcap/cmd_runner.c
+++ b/src/pcap/cmd_runner.c
@@ -61,12 +61,9 @@ const char *CAPTURE_STATUS_STRINGS[] = {
 	"", /* termination */
 };
 
-/**
- * Iterate core information for number of available cores to
- * append response for status command.
- */
+/* Iterate core info to create response of spp_pcap status */
 static int
-spp_iterate_core_info(struct sppwk_lcore_params *params)
+iterate_lcore_info(struct sppwk_lcore_params *params)
 {
 	int ret;
 	int lcore_id;
@@ -78,8 +75,7 @@ spp_iterate_core_info(struct sppwk_lcore_params *params)
 		ret = spp_pcap_get_core_status(lcore_id, params);
 		if (unlikely(ret != 0)) {
 			RTE_LOG(ERR, PCAP_RUNNER,
-					"Cannot iterate core information. "
-						"(core = %d)\n", lcore_id);
+					"Failed to get lcore %d\n", lcore_id);
 			return SPPWK_RET_NG;
 		}
 	}
@@ -524,7 +520,7 @@ append_core_value(const char *name, char **output,
 	lcore_params.output = tmp_buff;
 	lcore_params.lcore_proc = append_pcap_core_element_value;
 
-	ret = spp_iterate_core_info(&lcore_params);
+	ret = iterate_lcore_info(&lcore_params);
 	if (unlikely(ret != SPPWK_RET_OK)) {
 		spp_strbuf_free(lcore_params.output);
 		return SPPWK_RET_NG;
-- 
2.17.1


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

* [spp] [PATCH 9/9] shared: add TODO to fix bug in latency stats
  2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
                   ` (7 preceding siblings ...)
  2019-09-12 10:48 ` [spp] [PATCH 8/9] spp_pcap: " yasufum.o
@ 2019-09-12 10:48 ` yasufum.o
  8 siblings, 0 replies; 10+ messages in thread
From: yasufum.o @ 2019-09-12 10:48 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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

Spp_vf and spp_mirror has a feature for measuring latency of ring PMD.
This optional feature is intended to be used by developers and is not
activate by default. It is activated by editing Makefile in src/vf and
src/mirror.

Although this feature is not interested by most of users and does not
prevent users from using SPP, it should be fixed. This update is to add
TODO comments for notifying users to not use this feature until the bug
is fixed.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
 src/mirror/Makefile                                | 4 ++++
 src/shared/secondary/spp_worker_th/latency_stats.c | 5 +++++
 src/vf/Makefile                                    | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/src/mirror/Makefile b/src/mirror/Makefile
index 0adab15..0bd079a 100644
--- a/src/mirror/Makefile
+++ b/src/mirror/Makefile
@@ -42,6 +42,10 @@ CFLAGS += -DSPP_MIRROR_SHALLOWCOPY
 
 # Optional Settings
 #CFLAGS += -DSPP_DEMONIZE
+
+# TODO(Hideyuki Yamashita) ringlatencystats cannot run because a fatal
+# bug in initialization of this feature. So you should not use it until
+# this fatal bug is fixed.
 #CFLAGS += -DSPP_RINGLATENCYSTATS_ENABLE
 
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
diff --git a/src/shared/secondary/spp_worker_th/latency_stats.c b/src/shared/secondary/spp_worker_th/latency_stats.c
index 33b3b44..d43f6a8 100644
--- a/src/shared/secondary/spp_worker_th/latency_stats.c
+++ b/src/shared/secondary/spp_worker_th/latency_stats.c
@@ -48,6 +48,11 @@ cycles_per_ns(void)
 	return rte_get_timer_hz() / NS_PER_SEC;
 }
 
+/**
+ * TODO(Hideyuki Yamashita) This function has a fatal bug in rte_zmalloc()
+ * for `g_stats_info` and should be fixed. rte_zmalloc() returns NULL for
+ * unknow reason.
+ */
 int
 sppwk_init_ring_latency_stats(uint64_t samp_intvl, uint16_t stats_count)
 {
diff --git a/src/vf/Makefile b/src/vf/Makefile
index 742986c..43e5e4d 100644
--- a/src/vf/Makefile
+++ b/src/vf/Makefile
@@ -37,6 +37,10 @@ CFLAGS += -DSPP_VF_MODULE
 
 # Optional Settings
 #CFLAGS += -DSPP_DEMONIZE
+
+# TODO(Hideyuki Yamashita) ringlatencystats cannot run because a fatal
+# bug in initialization of this feature. So you should not use it until
+# this fatal bug is fixed.
 #CFLAGS += -DSPP_RINGLATENCYSTATS_ENABLE
 
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
-- 
2.17.1


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

end of thread, other threads:[~2019-09-12 10:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 10:48 [spp] [PATCH 0/9] Refactor ringlatencystats yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 1/9] shared: rename file ringlatencystats to be short yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 2/9] shared: rename func for calc latency of ring yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 3/9] shared: rename struct for ring latency stats yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 4/9] shared: rename func for init " yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 5/9] shared: renaem util funcs of ring latency yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 6/9] spp_vf: revise util func for status command yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 7/9] spp_mirror: " yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 8/9] spp_pcap: " yasufum.o
2019-09-12 10:48 ` [spp] [PATCH 9/9] shared: add TODO to fix bug in latency stats yasufum.o

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).