[spp] [PATCH 2/9] shared: rename func for calc latency of ring

yasufum.o at gmail.com yasufum.o at gmail.com
Thu Sep 12 12:48:17 CEST 2019


From: Yasufumi Ogawa <yasufum.o at 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 at 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



More information about the spp mailing list