Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 5/9] shared: renaem util funcs of ring latency
Date: Thu, 12 Sep 2019 19:48:20 +0900	[thread overview]
Message-ID: <20190912104824.21519-6-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190912104824.21519-1-yasufum.o@gmail.com>

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


  parent reply	other threads:[~2019-09-12 10:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` yasufum.o [this message]
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

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=20190912104824.21519-6-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).