summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasufumi Ogawa <yasufum.o@gmail.com>2019-09-12 19:48:20 +0900
committerYasufumi Ogawa <yasufum.o@gmail.com>2019-10-04 22:06:14 +0900
commit499192ecfc9a355d57796e2b479f7d90b394fd09 (patch)
tree740bace65411f310383c0340152af1e9bb730da5
parent9c5079a21412253f8d581ebcfa2016f112424b36 (diff)
downloadspp-499192ecfc9a355d57796e2b479f7d90b394fd09.zip
spp-499192ecfc9a355d57796e2b479f7d90b394fd09.tar.gz
spp-499192ecfc9a355d57796e2b479f7d90b394fd09.tar.xz
shared: renaem util funcs of ring latency
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>
-rw-r--r--src/shared/secondary/spp_worker_th/latency_stats.c17
-rw-r--r--src/shared/secondary/spp_worker_th/latency_stats.h24
-rw-r--r--src/shared/secondary/spp_worker_th/port_capability.c2
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);