From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 2/9] shared: rename func for calc latency of ring
Date: Thu, 12 Sep 2019 19:48:17 +0900 [thread overview]
Message-ID: <20190912104824.21519-3-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190912104824.21519-1-yasufum.o@gmail.com>
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
next prev 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 ` yasufum.o [this message]
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
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-3-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).