From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch set removes 'ringlatency stats' functionality which is not used anymore. Hideyuki Yamashita (5): Makefile: remove ringlatency stats functionality shared: remove ringlatency stats functionality vf: remove ringlatency stats functionality pcap: remove ringlatency stats functionality mirror: remove ringlatency stats functionality src/mirror/Makefile | 6 - src/mirror/spp_mirror.c | 43 ---- src/pcap/Makefile | 2 - src/pcap/spp_pcap.c | 8 - .../secondary/spp_worker_th/cmd_utils.h | 3 - .../secondary/spp_worker_th/latency_stats.c | 240 ------------------ .../secondary/spp_worker_th/latency_stats.h | 167 ------------ .../secondary/spp_worker_th/port_capability.c | 47 ---- src/vf/Makefile | 6 - src/vf/classifier.c | 19 +- src/vf/forwarder.c | 19 +- src/vf/spp_vf.c | 27 -- 12 files changed, 8 insertions(+), 579 deletions(-) delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/mirror/Makefile | 6 ------ src/pcap/Makefile | 2 -- src/vf/Makefile | 6 ------ 3 files changed, 14 deletions(-) diff --git a/src/mirror/Makefile b/src/mirror/Makefile index e878c89..6cc960c 100644 --- a/src/mirror/Makefile +++ b/src/mirror/Makefile @@ -26,7 +26,6 @@ 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)/latency_stats.c SRCS-y += $(SPP_WKT_DIR)/cmd_res_formatter.c CFLAGS += -DALLOW_EXPERIMENTAL_API @@ -43,11 +42,6 @@ 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) LDLIBS += -lrte_pmd_ring LDLIBS += -lrte_pmd_vhost diff --git a/src/pcap/Makefile b/src/pcap/Makefile index 4e53952..6da03f6 100644 --- a/src/pcap/Makefile +++ b/src/pcap/Makefile @@ -24,7 +24,6 @@ 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)/latency_stats.c CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += $(WERROR_FLAGS) -O3 -MMD @@ -34,7 +33,6 @@ CFLAGS += -I$(SRCDIR)/../shared # Optional Settings #CFLAGS += -DSPP_DEMONIZE -#CFLAGS += -DSPP_RINGLATENCYSTATS_ENABLE LDLIBS += -llz4 diff --git a/src/vf/Makefile b/src/vf/Makefile index 1daddb6..ebaed37 100644 --- a/src/vf/Makefile +++ b/src/vf/Makefile @@ -20,7 +20,6 @@ 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)/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 @@ -38,11 +37,6 @@ 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) LDLIBS += -lrte_pmd_ring LDLIBS += -lrte_pmd_vhost -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- .../secondary/spp_worker_th/cmd_utils.h | 3 - .../secondary/spp_worker_th/latency_stats.c | 240 ------------------ .../secondary/spp_worker_th/latency_stats.h | 167 ------------ .../secondary/spp_worker_th/port_capability.c | 47 ---- 4 files changed, 457 deletions(-) delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.h b/src/shared/secondary/spp_worker_th/cmd_utils.h index eda55c6..3c4bec9 100644 --- a/src/shared/secondary/spp_worker_th/cmd_utils.h +++ b/src/shared/secondary/spp_worker_th/cmd_utils.h @@ -51,9 +51,6 @@ */ #define CLS_DUMMY_ADDR_STR "00:00:00:00:00:01" -/* Sampling interval timer for latency evaluation */ -#define SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL 1000000 - /** * TODO(Yamashita) change type names. * "merge" -> "merger", "forward" -> "forwarder". diff --git a/src/shared/secondary/spp_worker_th/latency_stats.c b/src/shared/secondary/spp_worker_th/latency_stats.c deleted file mode 100644 index d43f6a8..0000000 --- a/src/shared/secondary/spp_worker_th/latency_stats.c +++ /dev/null @@ -1,240 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation - */ - -#include <unistd.h> -#include <sys/types.h> -#include <stdio.h> -#include <stddef.h> -#include <math.h> - -#include <rte_mbuf.h> -#include <rte_log.h> -#include <rte_cycles.h> -#include <rte_malloc.h> -#include <rte_memcpy.h> - -#include "latency_stats.h" -#include "cmd_utils.h" -#include "port_capability.h" -#include "../return_codes.h" - -#define NS_PER_SEC 1E9 - -#define RTE_LOGTYPE_SPP_RING_LATENCY_STATS RTE_LOGTYPE_USER1 - -#ifdef SPP_RINGLATENCYSTATS_ENABLE - -/** ring latency statistics information */ -struct ring_latency_stats_info { - uint64_t timer_tsc; /**< sampling interval */ - uint64_t prev_tsc; /**< previous time */ - struct ring_latency_stats_t stats; /**< list of stats */ -}; - -/** sampling interval */ -static uint64_t g_samp_intvl; - -/** ring latency statistics information instance */ -static struct ring_latency_stats_info *g_stats_info; - -/** number of ring latency statistics */ -static uint16_t g_stats_count; - -/* clock cycles per nano second */ -static inline uint64_t -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) -{ - /* allocate memory for ring latency statistics information */ - g_stats_info = rte_zmalloc( - "global ring_latency_stats_info", - sizeof(struct ring_latency_stats_info) * stats_count, - 0); - if (unlikely(g_stats_info == NULL)) { - RTE_LOG(ERR, SPP_RING_LATENCY_STATS, "Cannot allocate memory " - "for ring latency stats info\n"); - return SPPWK_RET_NG; - } - - /* store global information for ring latency statistics */ - g_samp_intvl = samp_intvl * cycles_per_ns(); - g_stats_count = stats_count; - - RTE_LOG(DEBUG, SPP_RING_LATENCY_STATS, - "g_samp_intvl=%lu, g_stats_count=%hu, " - "cpns=%lu, NS_PER_SEC=%f\n", - g_samp_intvl, g_stats_count, - cycles_per_ns(), NS_PER_SEC); - - return SPPWK_RET_OK; -} - -void -sppwk_clean_ring_latency_stats(void) -{ - /* free memory for ring latency statistics information */ - if (likely(g_stats_info != NULL)) { - rte_free(g_stats_info); - g_stats_count = 0; - } -} - -void -sppwk_add_ring_latency_time(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts) -{ - unsigned int i; - uint64_t diff_tsc, now; - struct ring_latency_stats_info *stats_info = &g_stats_info[ring_id]; - - for (i = 0; i < nb_pkts; i++) { - - /* get tsc now */ - now = rte_rdtsc(); - - /* calculate difference from the previous processing time */ - diff_tsc = now - stats_info->prev_tsc; - stats_info->timer_tsc += diff_tsc; - - /* 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, " - "pkts_index=%u, timestamp=%lu\n", - ring_id, i, now); - pkts[i]->timestamp = now; - stats_info->timer_tsc = 0; - } - - /* update previous tsc */ - stats_info->prev_tsc = now; - } -} - -void -sppwk_calc_ring_latency(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts) -{ - unsigned int i; - uint64_t now; - int64_t latency; - struct ring_latency_stats_info *stats_info = &g_stats_info[ring_id]; - - now = rte_rdtsc(); - for (i = 0; i < nb_pkts; i++) { - if (likely(pkts[i]->timestamp == 0)) - continue; - - /* calc latency if mbuf `timestamp` is non-zero. */ - latency = (uint64_t)floor((now - pkts[i]->timestamp) / - cycles_per_ns()); - if (likely(latency < TOTAL_LATENCY_ENT-1)) - stats_info->stats.distr[latency]++; - else - stats_info->stats.distr[TOTAL_LATENCY_ENT-1]++; - } -} - -int -sppwk_get_ring_latency_stats_count(void) -{ - return g_stats_count; -} - -void -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]; - - rte_memcpy(stats, &stats_info->stats, - sizeof(struct ring_latency_stats_t)); -} - -/* Print statistics of time for packet processing in ring interface */ -void -print_ring_latency_stats(struct iface_info *if_info) -{ - /* Clear screen and move cursor to top left */ - const char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\0' }; - const char clr[] = { 27, '[', '2', 'J', '\0' }; - printf("%s%s", clr, topLeft); - - int ring_cnt, stats_cnt; - struct ring_latency_stats_t stats[RTE_MAX_ETHPORTS]; - memset(&stats, 0x00, sizeof(stats)); - - printf("RING Latency\n"); - printf(" RING"); - for (ring_cnt = 0; ring_cnt < RTE_MAX_ETHPORTS; ring_cnt++) { - if (if_info->ring[ring_cnt].iface_type == UNDEF) - continue; - - sppwk_get_ring_latency_stats(ring_cnt, &stats[ring_cnt]); - printf(", %-18d", ring_cnt); - } - printf("\n"); - - 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].distr[stats_cnt]); - } - printf("\n"); - } -} - -/* 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, - int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) -{ - uint16_t nb_rx; - - nb_rx = rte_eth_rx_burst(port_id, 0, rx_pkts, nb_pkts); - - /* TODO(yasufum) confirm why it returns SPPWK_RET_OK. */ - if (unlikely(nb_rx == 0)) - return SPPWK_RET_OK; - - if (iface_type == RING) - sppwk_calc_ring_latency(iface_no, rx_pkts, nb_pkts); - return nb_rx; -} - -/* 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, - int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **tx_pkts, uint16_t nb_pkts) -{ - uint16_t nb_tx; - - nb_tx = rte_eth_tx_burst(port_id, 0, tx_pkts, nb_pkts); - - if (iface_type == RING) - sppwk_add_ring_latency_time(iface_no, tx_pkts, nb_pkts); - return nb_tx; -} - -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ diff --git a/src/shared/secondary/spp_worker_th/latency_stats.h b/src/shared/secondary/spp_worker_th/latency_stats.h deleted file mode 100644 index 1857672..0000000 --- a/src/shared/secondary/spp_worker_th/latency_stats.h +++ /dev/null @@ -1,167 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation - */ - -#ifndef _RINGLATENCYSTATS_H_ -#define _RINGLATENCYSTATS_H_ - -/** - * @file - * SPP RING latency statistics - * - * Util functions for measuring latency of ring-PMD. - */ - -#include <rte_mbuf.h> -#include "cmd_utils.h" - -/** - * 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 - -/** statistics of latency of ring */ -struct ring_latency_stats_t { - uint64_t distr[TOTAL_LATENCY_ENT]; /* distribution of time */ -}; - - -#ifdef SPP_RINGLATENCYSTATS_ENABLE -/** - * initialize ring latency statistics. - * - * @param samp_intvl - * The interval timer(ns) to refer the counter. - * @param stats_count - * The number of ring to be measured. - * - * @retval SPPWK_RET_OK: succeeded. - * @retval SPPWK_RET_NG: failed. - */ -int sppwk_init_ring_latency_stats(uint64_t samp_intvl, uint16_t stats_count); - -void sppwk_clean_ring_latency_stats(void); - -/** - * add time-stamp to mbuf's member. - * - * @note call at enqueue. - * - * @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 sppwk_add_ring_latency_time(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts); - -/** - * calculate latency of ring. - * - * @note call at dequeue. - * - * @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 sppwk_calc_ring_latency(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts); - -/** - * get number of ring latency statistics. - * - * @return sppwk_init_ring_latency_stats's parameter "stats_count" - */ -int sppwk_get_ring_latency_stats_count(void); - -/** - *get specific ring latency statistics. - * - * @param ring_id - * The ring id. - * @param stats - * The statistics values. - */ -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 */ -void print_ring_latency_stats(struct iface_info *if_info); - -/** - * Wrapper function for rte_eth_rx_burst() with ring latency feature. - * - * @param[in] port_id Etherdev ID. - * @param[in] queue_id RX queue ID, but fixed value 0 in SPP. - * @param[in] rx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of RX packets. - * @return Number of RX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_ring_stats_rx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts); - -/** - * Wrapper function for rte_eth_tx_burst() with ring latency feature. - * - * @param port_id Etherdev ID. - * @param[in] queue_id TX queue ID, but fixed value 0 in SPP. - * @param[in] tx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of TX packets. - * @return Number of TX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_ring_stats_tx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **tx_pkts, uint16_t nb_pkts); - -/** - * Wrapper function for rte_eth_rx_burst() with VLAN and ring latency feature. - * - * @param[in] port_id Etherdev ID. - * @param[in] queue_id RX queue ID, but fixed value 0 in SPP. - * @param[in] rx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of RX packets. - * @return Number of RX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_vlan_ring_stats_rx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts); - -/** - * Wrapper function for rte_eth_tx_burst() with VLAN and ring latency feature. - * - * @param port_id Etherdev ID. - * @param[in] queue_id TX queue ID, but fixed value 0 in SPP. - * @param[in] tx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of TX packets. - * @return Number of TX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **tx_pkts, uint16_t nb_pkts); - -#else - -#define sppwk_init_ring_latency_stats(arg1, arg2) 0 -#define sppwk_clean_ring_latency_stats() -#define sppwk_add_ring_latency_time(arg1, arg2, arg3) -#define sppwk_calc_ring_latency(arg1, arg2, arg3) -#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) -#define sppwk_eth_vlan_ring_stats_rx_burst(arg1, arg2, arg3, arg4, arg5, arg6) -#define sppwk_eth_vlan_ring_stats_tx_burst(arg1, arg2, arg3, arg4, arg5, arg6) - -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ - -#endif /* _RINGLATENCYSTATS_H_ */ diff --git a/src/shared/secondary/spp_worker_th/port_capability.c b/src/shared/secondary/spp_worker_th/port_capability.c index 5bd759f..cced906 100644 --- a/src/shared/secondary/spp_worker_th/port_capability.c +++ b/src/shared/secondary/spp_worker_th/port_capability.c @@ -11,9 +11,6 @@ #include "port_capability.h" #include "shared/secondary/return_codes.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "latency_stats.h" -#endif /** * TODO(yasufum) This `port capability` is intended to be used mainly for VLAN @@ -407,47 +404,3 @@ sppwk_eth_vlan_tx_burst(uint16_t port_id, return rte_eth_tx_burst(port_id, queue_id, tx_pkts, nb_tx); } -#ifdef SPP_RINGLATENCYSTATS_ENABLE - -/* Wrapper function for rte_eth_rx_burst() with VLAN feature. */ -uint16_t -sppwk_eth_vlan_ring_stats_rx_burst(uint16_t port_id, - enum port_type iface_type, int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) -{ - uint16_t nb_rx; - nb_rx = rte_eth_rx_burst(port_id, 0, rx_pkts, nb_pkts); - if (unlikely(nb_rx == 0)) - return SPPWK_RET_OK; - - if (iface_type == RING) - 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); -} - -/* Wrapper function for rte_eth_tx_burst() with VLAN feature. */ -uint16_t -sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id, - enum port_type iface_type, int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **tx_pkts, uint16_t nb_pkts) -{ - uint16_t nb_tx; - - /* Add or delete VLAN tag. */ - nb_tx = vlan_operation(port_id, tx_pkts, nb_pkts, SPPWK_PORT_DIR_TX); - - if (unlikely(nb_tx == 0)) - return SPPWK_RET_OK; - - if (iface_type == RING) { - sppwk_add_ring_latency_time(iface_no, tx_pkts, nb_pkts); - } - - return rte_eth_tx_burst(port_id, 0, tx_pkts, nb_tx); -} - -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/vf/classifier.c | 19 ++++--------------- src/vf/forwarder.c | 19 ++++--------------- src/vf/spp_vf.c | 27 --------------------------- 3 files changed, 8 insertions(+), 57 deletions(-) diff --git a/src/vf/classifier.c b/src/vf/classifier.c index 2d95289..58d0f03 100644 --- a/src/vf/classifier.c +++ b/src/vf/classifier.c @@ -29,9 +29,6 @@ #include "shared/secondary/spp_worker_th/vf_deps.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif #define RTE_LOGTYPE_VF_CLS RTE_LOGTYPE_USER1 @@ -424,15 +421,11 @@ transmit_packets(struct cls_port_info *clsd_data) uint16_t n_tx; /* transmit packets */ -#ifdef SPP_RINGLATENCYSTATS_ENABLE - n_tx = sppwk_eth_vlan_ring_stats_tx_burst(clsd_data->ethdev_port_id, - clsd_data->iface_type, clsd_data->iface_no, - 0, clsd_data->pkts, clsd_data->nof_pkts); -#else + n_tx = sppwk_eth_vlan_tx_burst(clsd_data->ethdev_port_id, clsd_data->queue_no, clsd_data->pkts, clsd_data->nof_pkts); -#endif + /* free cannot transmit packets */ if (unlikely(n_tx != clsd_data->nof_pkts)) { @@ -758,14 +751,10 @@ classify_packets(int comp_id) return SPPWK_RET_OK; /* Retrieve packets */ -#ifdef SPP_RINGLATENCYSTATS_ENABLE - n_rx = sppwk_eth_vlan_ring_stats_rx_burst(clsd_data_rx->ethdev_port_id, - clsd_data_rx->iface_type, clsd_data_rx->iface_no, - 0, rx_pkts, MAX_PKT_BURST); -#else + n_rx = sppwk_eth_vlan_rx_burst(clsd_data_rx->ethdev_port_id, clsd_data_rx->queue_no, rx_pkts, MAX_PKT_BURST); -#endif + if (unlikely(n_rx == 0)) return SPPWK_RET_OK; diff --git a/src/vf/forwarder.c b/src/vf/forwarder.c index 66e1682..a95d472 100644 --- a/src/vf/forwarder.c +++ b/src/vf/forwarder.c @@ -9,9 +9,6 @@ #include "shared/secondary/spp_worker_th/vf_deps.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif #define RTE_LOGTYPE_FORWARD RTE_LOGTYPE_USER1 @@ -214,27 +211,19 @@ forward_packets(int id) rx = &path->ports[cnt].rx; tx = &path->ports[cnt].tx; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_rx = sppwk_eth_vlan_ring_stats_rx_burst(rx->ethdev_port_id, - rx->iface_type, rx->iface_no, 0, - bufs, MAX_PKT_BURST); -#else + nb_rx = sppwk_eth_vlan_rx_burst(rx->ethdev_port_id, rx->queue_no, bufs, MAX_PKT_BURST); -#endif + if (unlikely(nb_rx == 0)) continue; /* Send packets */ if (tx->ethdev_port_id >= 0) -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_tx = sppwk_eth_vlan_ring_stats_tx_burst( - tx->ethdev_port_id, tx->iface_type, - tx->iface_no, 0, bufs, nb_rx); -#else + nb_tx = sppwk_eth_vlan_tx_burst(tx->ethdev_port_id, tx->queue_no, bufs, nb_rx); -#endif + /* Discard remained packets to release mbuf */ if (unlikely(nb_tx < nb_rx)) { diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c index ab2e9f2..c2cc795 100644 --- a/src/vf/spp_vf.c +++ b/src/vf/spp_vf.c @@ -19,9 +19,6 @@ #define RTE_LOGTYPE_SPP_VF RTE_LOGTYPE_USER1 -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif /* getopt_long return value for long option */ enum SPP_LONGOPT_RETVAL { @@ -280,24 +277,6 @@ main(int argc, char *argv[]) if (unlikely(ret != SPPWK_RET_OK)) break; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - int port_type, port_id; - char dev_name[RTE_DEV_NAME_MAX_LEN] = { 0 }; - int nof_rings = 0; - for (int i = 0; i < RTE_MAX_ETHPORTS; i++) { - if (!rte_eth_dev_is_valid_port(i)) - continue; - rte_eth_dev_get_name_by_port(i, dev_name); - ret = parse_dev_name(dev_name, &port_type, &port_id); - if (port_type == RING) - nof_rings++; - } - ret = sppwk_init_ring_latency_stats( - SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL, - nof_rings); - if (unlikely(ret != SPPWK_RET_OK)) - break; -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ /* Start worker threads of classifier and forwarder */ RTE_LCORE_FOREACH_SLAVE(lcore_id) { @@ -332,9 +311,6 @@ main(int argc, char *argv[]) */ usleep(100); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - print_ring_latency_stats(&g_iface_info); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ } if (unlikely(ret != SPPWK_RET_OK)) { @@ -358,9 +334,6 @@ main(int argc, char *argv[]) */ del_vhost_sockfile(g_iface_info.vhost); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - sppwk_clean_ring_latency_stats(); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ RTE_LOG(INFO, SPP_VF, "Exit spp_vf.\n"); return ret; -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/pcap/spp_pcap.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c index 1f20e1e..5bb987f 100644 --- a/src/pcap/spp_pcap.c +++ b/src/pcap/spp_pcap.c @@ -23,9 +23,6 @@ #include "shared/secondary/utils.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif /* Declare global variables */ #define RTE_LOGTYPE_SPP_PCAP RTE_LOGTYPE_USER2 @@ -847,13 +844,8 @@ static int pcap_proc_receive(int lcore_id) /* Receive packets */ rx = &g_pcap_option.port_cap; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_rx = sppwk_eth_ring_stats_rx_burst(rx->ethdev_port_id, - rx->iface_type, rx->iface_no, 0, bufs, MAX_PCAP_BURST); -#else nb_rx = rte_eth_rx_burst(rx->ethdev_port_id, rx->queue_no, bufs, MAX_PCAP_BURST); -#endif if (unlikely(nb_rx == 0)) return SPPWK_RET_OK; -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/mirror/spp_mirror.c | 43 ----------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c index 2bfbf66..a2925f3 100644 --- a/src/mirror/spp_mirror.c +++ b/src/mirror/spp_mirror.c @@ -20,9 +20,6 @@ #include "shared/secondary/spp_worker_th/cmd_utils.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif /* Declare global variables */ #define RTE_LOGTYPE_MIRROR RTE_LOGTYPE_USER1 @@ -336,13 +333,8 @@ mirror_proc(int id) rx = &path->ports[0].rx; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_rx = sppwk_eth_ring_stats_rx_burst(rx->ethdev_port_id, - rx->iface_type, rx->iface_no, 0, bufs, MAX_PKT_BURST); -#else nb_rx = rte_eth_rx_burst(rx->ethdev_port_id, rx->queue_no, bufs, MAX_PKT_BURST); -#endif if (unlikely(nb_rx == 0)) return SPPWK_RET_OK; @@ -399,26 +391,15 @@ mirror_proc(int id) } if (cnt != 0) -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_tx2 = sppwk_eth_ring_stats_tx_burst( - tx->ethdev_port_id, tx->iface_type, - tx->iface_no, 0, copybufs, cnt); -#else nb_tx2 = rte_eth_tx_burst(tx->ethdev_port_id, tx->queue_no, copybufs, cnt); -#endif } /* orginal */ tx = &path->ports[0].tx; if (tx->ethdev_port_id >= 0) -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_tx1 = sppwk_eth_ring_stats_tx_burst(tx->ethdev_port_id, - tx->iface_type, tx->iface_no, 0, bufs, nb_rx); -#else nb_tx1 = rte_eth_tx_burst(tx->ethdev_port_id, tx->queue_no, bufs, nb_rx); -#endif nb_tx = nb_tx1; if (nb_tx1 != nb_tx2) @@ -570,24 +551,6 @@ main(int argc, char *argv[]) if (unlikely(ret_cmd_init != SPPWK_RET_OK)) break; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - int port_type, port_id; - char dev_name[RTE_DEV_NAME_MAX_LEN] = { 0 }; - int nof_rings = 0; - for (int i = 0; i < RTE_MAX_ETHPORTS; i++) { - if (!rte_eth_dev_is_valid_port(i)) - continue; - rte_eth_dev_get_name_by_port(i, dev_name); - ret = parse_dev_name(dev_name, &port_type, &port_id); - if (port_type == RING) - nof_rings++; - } - int ret_ringlatency = sppwk_init_ring_latency_stats( - SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL, - nof_rings); - if (unlikely(ret_ringlatency != SPPWK_RET_OK)) - break; -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ /* Start worker threads of classifier and forwarder */ lcore_id = 0; @@ -630,9 +593,6 @@ main(int argc, char *argv[]) */ usleep(100); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - print_ring_latency_stats(&g_iface_info); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ } if (unlikely(ret_do != SPPWK_RET_OK)) { @@ -653,9 +613,6 @@ main(int argc, char *argv[]) /* Remove vhost sock file if not running in vhost-client mode. */ del_vhost_sockfile(g_iface_info.vhost); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - sppwk_clean_ring_latency_stats(); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ RTE_LOG(INFO, MIRROR, "Exit spp_mirror.\n"); return ret; -- 2.17.1
Reviewed-by: Itsuro Oda <oda@valinux.co.jp>
On Mon, 22 Jun 2020 10:18:49 +0900
x-fn-spp-ml@ntt-tx.co.jp wrote:
> From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp>
>
> This patch set removes 'ringlatency stats'
> functionality which is not used anymore.
>
> Hideyuki Yamashita (5):
> Makefile: remove ringlatency stats functionality
> shared: remove ringlatency stats functionality
> vf: remove ringlatency stats functionality
> pcap: remove ringlatency stats functionality
> mirror: remove ringlatency stats functionality
>
> src/mirror/Makefile | 6 -
> src/mirror/spp_mirror.c | 43 ----
> src/pcap/Makefile | 2 -
> src/pcap/spp_pcap.c | 8 -
> .../secondary/spp_worker_th/cmd_utils.h | 3 -
> .../secondary/spp_worker_th/latency_stats.c | 240 ------------------
> .../secondary/spp_worker_th/latency_stats.h | 167 ------------
> .../secondary/spp_worker_th/port_capability.c | 47 ----
> src/vf/Makefile | 6 -
> src/vf/classifier.c | 19 +-
> src/vf/forwarder.c | 19 +-
> src/vf/spp_vf.c | 27 --
> 12 files changed, 8 insertions(+), 579 deletions(-)
> delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c
> delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h
>
> --
> 2.17.1
--
Itsuro ODA <oda@valinux.co.jp>
> From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> > > This patch set removes 'ringlatency stats' > functionality which is not used anymore. > > Hideyuki Yamashita (5): > Makefile: remove ringlatency stats functionality > shared: remove ringlatency stats functionality > vf: remove ringlatency stats functionality > pcap: remove ringlatency stats functionality > mirror: remove ringlatency stats functionality All of tag names are inappropriate. Please find names from `git log --oneline` and collect them. The reason why `shared:` not appropriate is because all changes in this patch is only for `shared/secondary`, so tag name should be `shared/sec:`. Thanks > > src/mirror/Makefile | 6 - > src/mirror/spp_mirror.c | 43 ---- > src/pcap/Makefile | 2 - > src/pcap/spp_pcap.c | 8 - > .../secondary/spp_worker_th/cmd_utils.h | 3 - > .../secondary/spp_worker_th/latency_stats.c | 240 ------------------ > .../secondary/spp_worker_th/latency_stats.h | 167 ------------ > .../secondary/spp_worker_th/port_capability.c | 47 ---- > src/vf/Makefile | 6 - > src/vf/classifier.c | 19 +- > src/vf/forwarder.c | 19 +- > src/vf/spp_vf.c | 27 -- > 12 files changed, 8 insertions(+), 579 deletions(-) > delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c > delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h >
Any updates?
On 2020/07/02 9:31, Yasufumi Ogawa wrote:
>> From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp>
>>
>> This patch set removes 'ringlatency stats'
>> functionality which is not used anymore.
>>
>> Hideyuki Yamashita (5):
>> Makefile: remove ringlatency stats functionality
>> shared: remove ringlatency stats functionality
>> vf: remove ringlatency stats functionality
>> pcap: remove ringlatency stats functionality
>> mirror: remove ringlatency stats functionality
> All of tag names are inappropriate. Please find names from `git log
> --oneline` and collect them. The reason why `shared:` not appropriate is
> because all changes in this patch is only for `shared/secondary`, so tag
> name should be `shared/sec:`.
>
> Thanks
>
>>
>> src/mirror/Makefile | 6 -
>> src/mirror/spp_mirror.c | 43 ----
>> src/pcap/Makefile | 2 -
>> src/pcap/spp_pcap.c | 8 -
>> .../secondary/spp_worker_th/cmd_utils.h | 3 -
>> .../secondary/spp_worker_th/latency_stats.c | 240 ------------------
>> .../secondary/spp_worker_th/latency_stats.h | 167 ------------
>> .../secondary/spp_worker_th/port_capability.c | 47 ----
>> src/vf/Makefile | 6 -
>> src/vf/classifier.c | 19 +-
>> src/vf/forwarder.c | 19 +-
>> src/vf/spp_vf.c | 27 --
>> 12 files changed, 8 insertions(+), 579 deletions(-)
>> delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c
>> delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h
>>
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> v2: * change tag name of each patch to appropriate ones. Hideyuki Yamashita (5): makefile: remove ringlatency stats functionality shared/sec: remove ringlatency stats functionality spp_pcap: remove ringlatency stats functionality spp_vf: remove ringlatency stats functionality spp_mirror: remove ringlatency stats functionality src/mirror/Makefile | 6 - src/mirror/spp_mirror.c | 43 ---- src/pcap/Makefile | 2 - src/pcap/spp_pcap.c | 8 - .../secondary/spp_worker_th/cmd_utils.h | 3 - .../secondary/spp_worker_th/latency_stats.c | 240 ------------------ .../secondary/spp_worker_th/latency_stats.h | 167 ------------ .../secondary/spp_worker_th/port_capability.c | 47 ---- src/vf/Makefile | 6 - src/vf/classifier.c | 19 +- src/vf/forwarder.c | 19 +- src/vf/spp_vf.c | 27 -- 12 files changed, 8 insertions(+), 579 deletions(-) delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/mirror/Makefile | 6 ------ src/pcap/Makefile | 2 -- src/vf/Makefile | 6 ------ 3 files changed, 14 deletions(-) diff --git a/src/mirror/Makefile b/src/mirror/Makefile index e878c89..6cc960c 100644 --- a/src/mirror/Makefile +++ b/src/mirror/Makefile @@ -26,7 +26,6 @@ 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)/latency_stats.c SRCS-y += $(SPP_WKT_DIR)/cmd_res_formatter.c CFLAGS += -DALLOW_EXPERIMENTAL_API @@ -43,11 +42,6 @@ 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) LDLIBS += -lrte_pmd_ring LDLIBS += -lrte_pmd_vhost diff --git a/src/pcap/Makefile b/src/pcap/Makefile index 4e53952..6da03f6 100644 --- a/src/pcap/Makefile +++ b/src/pcap/Makefile @@ -24,7 +24,6 @@ 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)/latency_stats.c CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += $(WERROR_FLAGS) -O3 -MMD @@ -34,7 +33,6 @@ CFLAGS += -I$(SRCDIR)/../shared # Optional Settings #CFLAGS += -DSPP_DEMONIZE -#CFLAGS += -DSPP_RINGLATENCYSTATS_ENABLE LDLIBS += -llz4 diff --git a/src/vf/Makefile b/src/vf/Makefile index 1daddb6..ebaed37 100644 --- a/src/vf/Makefile +++ b/src/vf/Makefile @@ -20,7 +20,6 @@ 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)/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 @@ -38,11 +37,6 @@ 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) LDLIBS += -lrte_pmd_ring LDLIBS += -lrte_pmd_vhost -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- .../secondary/spp_worker_th/cmd_utils.h | 3 - .../secondary/spp_worker_th/latency_stats.c | 240 ------------------ .../secondary/spp_worker_th/latency_stats.h | 167 ------------ .../secondary/spp_worker_th/port_capability.c | 47 ---- 4 files changed, 457 deletions(-) delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h diff --git a/src/shared/secondary/spp_worker_th/cmd_utils.h b/src/shared/secondary/spp_worker_th/cmd_utils.h index eda55c6..3c4bec9 100644 --- a/src/shared/secondary/spp_worker_th/cmd_utils.h +++ b/src/shared/secondary/spp_worker_th/cmd_utils.h @@ -51,9 +51,6 @@ */ #define CLS_DUMMY_ADDR_STR "00:00:00:00:00:01" -/* Sampling interval timer for latency evaluation */ -#define SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL 1000000 - /** * TODO(Yamashita) change type names. * "merge" -> "merger", "forward" -> "forwarder". diff --git a/src/shared/secondary/spp_worker_th/latency_stats.c b/src/shared/secondary/spp_worker_th/latency_stats.c deleted file mode 100644 index d43f6a8..0000000 --- a/src/shared/secondary/spp_worker_th/latency_stats.c +++ /dev/null @@ -1,240 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation - */ - -#include <unistd.h> -#include <sys/types.h> -#include <stdio.h> -#include <stddef.h> -#include <math.h> - -#include <rte_mbuf.h> -#include <rte_log.h> -#include <rte_cycles.h> -#include <rte_malloc.h> -#include <rte_memcpy.h> - -#include "latency_stats.h" -#include "cmd_utils.h" -#include "port_capability.h" -#include "../return_codes.h" - -#define NS_PER_SEC 1E9 - -#define RTE_LOGTYPE_SPP_RING_LATENCY_STATS RTE_LOGTYPE_USER1 - -#ifdef SPP_RINGLATENCYSTATS_ENABLE - -/** ring latency statistics information */ -struct ring_latency_stats_info { - uint64_t timer_tsc; /**< sampling interval */ - uint64_t prev_tsc; /**< previous time */ - struct ring_latency_stats_t stats; /**< list of stats */ -}; - -/** sampling interval */ -static uint64_t g_samp_intvl; - -/** ring latency statistics information instance */ -static struct ring_latency_stats_info *g_stats_info; - -/** number of ring latency statistics */ -static uint16_t g_stats_count; - -/* clock cycles per nano second */ -static inline uint64_t -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) -{ - /* allocate memory for ring latency statistics information */ - g_stats_info = rte_zmalloc( - "global ring_latency_stats_info", - sizeof(struct ring_latency_stats_info) * stats_count, - 0); - if (unlikely(g_stats_info == NULL)) { - RTE_LOG(ERR, SPP_RING_LATENCY_STATS, "Cannot allocate memory " - "for ring latency stats info\n"); - return SPPWK_RET_NG; - } - - /* store global information for ring latency statistics */ - g_samp_intvl = samp_intvl * cycles_per_ns(); - g_stats_count = stats_count; - - RTE_LOG(DEBUG, SPP_RING_LATENCY_STATS, - "g_samp_intvl=%lu, g_stats_count=%hu, " - "cpns=%lu, NS_PER_SEC=%f\n", - g_samp_intvl, g_stats_count, - cycles_per_ns(), NS_PER_SEC); - - return SPPWK_RET_OK; -} - -void -sppwk_clean_ring_latency_stats(void) -{ - /* free memory for ring latency statistics information */ - if (likely(g_stats_info != NULL)) { - rte_free(g_stats_info); - g_stats_count = 0; - } -} - -void -sppwk_add_ring_latency_time(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts) -{ - unsigned int i; - uint64_t diff_tsc, now; - struct ring_latency_stats_info *stats_info = &g_stats_info[ring_id]; - - for (i = 0; i < nb_pkts; i++) { - - /* get tsc now */ - now = rte_rdtsc(); - - /* calculate difference from the previous processing time */ - diff_tsc = now - stats_info->prev_tsc; - stats_info->timer_tsc += diff_tsc; - - /* 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, " - "pkts_index=%u, timestamp=%lu\n", - ring_id, i, now); - pkts[i]->timestamp = now; - stats_info->timer_tsc = 0; - } - - /* update previous tsc */ - stats_info->prev_tsc = now; - } -} - -void -sppwk_calc_ring_latency(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts) -{ - unsigned int i; - uint64_t now; - int64_t latency; - struct ring_latency_stats_info *stats_info = &g_stats_info[ring_id]; - - now = rte_rdtsc(); - for (i = 0; i < nb_pkts; i++) { - if (likely(pkts[i]->timestamp == 0)) - continue; - - /* calc latency if mbuf `timestamp` is non-zero. */ - latency = (uint64_t)floor((now - pkts[i]->timestamp) / - cycles_per_ns()); - if (likely(latency < TOTAL_LATENCY_ENT-1)) - stats_info->stats.distr[latency]++; - else - stats_info->stats.distr[TOTAL_LATENCY_ENT-1]++; - } -} - -int -sppwk_get_ring_latency_stats_count(void) -{ - return g_stats_count; -} - -void -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]; - - rte_memcpy(stats, &stats_info->stats, - sizeof(struct ring_latency_stats_t)); -} - -/* Print statistics of time for packet processing in ring interface */ -void -print_ring_latency_stats(struct iface_info *if_info) -{ - /* Clear screen and move cursor to top left */ - const char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\0' }; - const char clr[] = { 27, '[', '2', 'J', '\0' }; - printf("%s%s", clr, topLeft); - - int ring_cnt, stats_cnt; - struct ring_latency_stats_t stats[RTE_MAX_ETHPORTS]; - memset(&stats, 0x00, sizeof(stats)); - - printf("RING Latency\n"); - printf(" RING"); - for (ring_cnt = 0; ring_cnt < RTE_MAX_ETHPORTS; ring_cnt++) { - if (if_info->ring[ring_cnt].iface_type == UNDEF) - continue; - - sppwk_get_ring_latency_stats(ring_cnt, &stats[ring_cnt]); - printf(", %-18d", ring_cnt); - } - printf("\n"); - - 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].distr[stats_cnt]); - } - printf("\n"); - } -} - -/* 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, - int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) -{ - uint16_t nb_rx; - - nb_rx = rte_eth_rx_burst(port_id, 0, rx_pkts, nb_pkts); - - /* TODO(yasufum) confirm why it returns SPPWK_RET_OK. */ - if (unlikely(nb_rx == 0)) - return SPPWK_RET_OK; - - if (iface_type == RING) - sppwk_calc_ring_latency(iface_no, rx_pkts, nb_pkts); - return nb_rx; -} - -/* 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, - int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **tx_pkts, uint16_t nb_pkts) -{ - uint16_t nb_tx; - - nb_tx = rte_eth_tx_burst(port_id, 0, tx_pkts, nb_pkts); - - if (iface_type == RING) - sppwk_add_ring_latency_time(iface_no, tx_pkts, nb_pkts); - return nb_tx; -} - -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ diff --git a/src/shared/secondary/spp_worker_th/latency_stats.h b/src/shared/secondary/spp_worker_th/latency_stats.h deleted file mode 100644 index 1857672..0000000 --- a/src/shared/secondary/spp_worker_th/latency_stats.h +++ /dev/null @@ -1,167 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation - */ - -#ifndef _RINGLATENCYSTATS_H_ -#define _RINGLATENCYSTATS_H_ - -/** - * @file - * SPP RING latency statistics - * - * Util functions for measuring latency of ring-PMD. - */ - -#include <rte_mbuf.h> -#include "cmd_utils.h" - -/** - * 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 - -/** statistics of latency of ring */ -struct ring_latency_stats_t { - uint64_t distr[TOTAL_LATENCY_ENT]; /* distribution of time */ -}; - - -#ifdef SPP_RINGLATENCYSTATS_ENABLE -/** - * initialize ring latency statistics. - * - * @param samp_intvl - * The interval timer(ns) to refer the counter. - * @param stats_count - * The number of ring to be measured. - * - * @retval SPPWK_RET_OK: succeeded. - * @retval SPPWK_RET_NG: failed. - */ -int sppwk_init_ring_latency_stats(uint64_t samp_intvl, uint16_t stats_count); - -void sppwk_clean_ring_latency_stats(void); - -/** - * add time-stamp to mbuf's member. - * - * @note call at enqueue. - * - * @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 sppwk_add_ring_latency_time(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts); - -/** - * calculate latency of ring. - * - * @note call at dequeue. - * - * @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 sppwk_calc_ring_latency(int ring_id, - struct rte_mbuf **pkts, uint16_t nb_pkts); - -/** - * get number of ring latency statistics. - * - * @return sppwk_init_ring_latency_stats's parameter "stats_count" - */ -int sppwk_get_ring_latency_stats_count(void); - -/** - *get specific ring latency statistics. - * - * @param ring_id - * The ring id. - * @param stats - * The statistics values. - */ -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 */ -void print_ring_latency_stats(struct iface_info *if_info); - -/** - * Wrapper function for rte_eth_rx_burst() with ring latency feature. - * - * @param[in] port_id Etherdev ID. - * @param[in] queue_id RX queue ID, but fixed value 0 in SPP. - * @param[in] rx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of RX packets. - * @return Number of RX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_ring_stats_rx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts); - -/** - * Wrapper function for rte_eth_tx_burst() with ring latency feature. - * - * @param port_id Etherdev ID. - * @param[in] queue_id TX queue ID, but fixed value 0 in SPP. - * @param[in] tx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of TX packets. - * @return Number of TX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_ring_stats_tx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **tx_pkts, uint16_t nb_pkts); - -/** - * Wrapper function for rte_eth_rx_burst() with VLAN and ring latency feature. - * - * @param[in] port_id Etherdev ID. - * @param[in] queue_id RX queue ID, but fixed value 0 in SPP. - * @param[in] rx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of RX packets. - * @return Number of RX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_vlan_ring_stats_rx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts); - -/** - * Wrapper function for rte_eth_tx_burst() with VLAN and ring latency feature. - * - * @param port_id Etherdev ID. - * @param[in] queue_id TX queue ID, but fixed value 0 in SPP. - * @param[in] tx_pkts Pointers to mbuf should be enough to store nb_pkts. - * @param nb_pkts Maximum number of TX packets. - * @return Number of TX packets as number of pointers to mbuf. - */ -uint16_t sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id, - enum port_type iface_type, - int iface_no, uint16_t queue_id, - struct rte_mbuf **tx_pkts, uint16_t nb_pkts); - -#else - -#define sppwk_init_ring_latency_stats(arg1, arg2) 0 -#define sppwk_clean_ring_latency_stats() -#define sppwk_add_ring_latency_time(arg1, arg2, arg3) -#define sppwk_calc_ring_latency(arg1, arg2, arg3) -#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) -#define sppwk_eth_vlan_ring_stats_rx_burst(arg1, arg2, arg3, arg4, arg5, arg6) -#define sppwk_eth_vlan_ring_stats_tx_burst(arg1, arg2, arg3, arg4, arg5, arg6) - -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ - -#endif /* _RINGLATENCYSTATS_H_ */ diff --git a/src/shared/secondary/spp_worker_th/port_capability.c b/src/shared/secondary/spp_worker_th/port_capability.c index 5bd759f..cced906 100644 --- a/src/shared/secondary/spp_worker_th/port_capability.c +++ b/src/shared/secondary/spp_worker_th/port_capability.c @@ -11,9 +11,6 @@ #include "port_capability.h" #include "shared/secondary/return_codes.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "latency_stats.h" -#endif /** * TODO(yasufum) This `port capability` is intended to be used mainly for VLAN @@ -407,47 +404,3 @@ sppwk_eth_vlan_tx_burst(uint16_t port_id, return rte_eth_tx_burst(port_id, queue_id, tx_pkts, nb_tx); } -#ifdef SPP_RINGLATENCYSTATS_ENABLE - -/* Wrapper function for rte_eth_rx_burst() with VLAN feature. */ -uint16_t -sppwk_eth_vlan_ring_stats_rx_burst(uint16_t port_id, - enum port_type iface_type, int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) -{ - uint16_t nb_rx; - nb_rx = rte_eth_rx_burst(port_id, 0, rx_pkts, nb_pkts); - if (unlikely(nb_rx == 0)) - return SPPWK_RET_OK; - - if (iface_type == RING) - 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); -} - -/* Wrapper function for rte_eth_tx_burst() with VLAN feature. */ -uint16_t -sppwk_eth_vlan_ring_stats_tx_burst(uint16_t port_id, - enum port_type iface_type, int iface_no, - uint16_t queue_id __attribute__ ((unused)), - struct rte_mbuf **tx_pkts, uint16_t nb_pkts) -{ - uint16_t nb_tx; - - /* Add or delete VLAN tag. */ - nb_tx = vlan_operation(port_id, tx_pkts, nb_pkts, SPPWK_PORT_DIR_TX); - - if (unlikely(nb_tx == 0)) - return SPPWK_RET_OK; - - if (iface_type == RING) { - sppwk_add_ring_latency_time(iface_no, tx_pkts, nb_pkts); - } - - return rte_eth_tx_burst(port_id, 0, tx_pkts, nb_tx); -} - -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/pcap/spp_pcap.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c index 1f20e1e..5bb987f 100644 --- a/src/pcap/spp_pcap.c +++ b/src/pcap/spp_pcap.c @@ -23,9 +23,6 @@ #include "shared/secondary/utils.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif /* Declare global variables */ #define RTE_LOGTYPE_SPP_PCAP RTE_LOGTYPE_USER2 @@ -847,13 +844,8 @@ static int pcap_proc_receive(int lcore_id) /* Receive packets */ rx = &g_pcap_option.port_cap; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_rx = sppwk_eth_ring_stats_rx_burst(rx->ethdev_port_id, - rx->iface_type, rx->iface_no, 0, bufs, MAX_PCAP_BURST); -#else nb_rx = rte_eth_rx_burst(rx->ethdev_port_id, rx->queue_no, bufs, MAX_PCAP_BURST); -#endif if (unlikely(nb_rx == 0)) return SPPWK_RET_OK; -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/vf/classifier.c | 19 ++++--------------- src/vf/forwarder.c | 19 ++++--------------- src/vf/spp_vf.c | 27 --------------------------- 3 files changed, 8 insertions(+), 57 deletions(-) diff --git a/src/vf/classifier.c b/src/vf/classifier.c index 2d95289..58d0f03 100644 --- a/src/vf/classifier.c +++ b/src/vf/classifier.c @@ -29,9 +29,6 @@ #include "shared/secondary/spp_worker_th/vf_deps.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif #define RTE_LOGTYPE_VF_CLS RTE_LOGTYPE_USER1 @@ -424,15 +421,11 @@ transmit_packets(struct cls_port_info *clsd_data) uint16_t n_tx; /* transmit packets */ -#ifdef SPP_RINGLATENCYSTATS_ENABLE - n_tx = sppwk_eth_vlan_ring_stats_tx_burst(clsd_data->ethdev_port_id, - clsd_data->iface_type, clsd_data->iface_no, - 0, clsd_data->pkts, clsd_data->nof_pkts); -#else + n_tx = sppwk_eth_vlan_tx_burst(clsd_data->ethdev_port_id, clsd_data->queue_no, clsd_data->pkts, clsd_data->nof_pkts); -#endif + /* free cannot transmit packets */ if (unlikely(n_tx != clsd_data->nof_pkts)) { @@ -758,14 +751,10 @@ classify_packets(int comp_id) return SPPWK_RET_OK; /* Retrieve packets */ -#ifdef SPP_RINGLATENCYSTATS_ENABLE - n_rx = sppwk_eth_vlan_ring_stats_rx_burst(clsd_data_rx->ethdev_port_id, - clsd_data_rx->iface_type, clsd_data_rx->iface_no, - 0, rx_pkts, MAX_PKT_BURST); -#else + n_rx = sppwk_eth_vlan_rx_burst(clsd_data_rx->ethdev_port_id, clsd_data_rx->queue_no, rx_pkts, MAX_PKT_BURST); -#endif + if (unlikely(n_rx == 0)) return SPPWK_RET_OK; diff --git a/src/vf/forwarder.c b/src/vf/forwarder.c index 66e1682..a95d472 100644 --- a/src/vf/forwarder.c +++ b/src/vf/forwarder.c @@ -9,9 +9,6 @@ #include "shared/secondary/spp_worker_th/vf_deps.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif #define RTE_LOGTYPE_FORWARD RTE_LOGTYPE_USER1 @@ -214,27 +211,19 @@ forward_packets(int id) rx = &path->ports[cnt].rx; tx = &path->ports[cnt].tx; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_rx = sppwk_eth_vlan_ring_stats_rx_burst(rx->ethdev_port_id, - rx->iface_type, rx->iface_no, 0, - bufs, MAX_PKT_BURST); -#else + nb_rx = sppwk_eth_vlan_rx_burst(rx->ethdev_port_id, rx->queue_no, bufs, MAX_PKT_BURST); -#endif + if (unlikely(nb_rx == 0)) continue; /* Send packets */ if (tx->ethdev_port_id >= 0) -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_tx = sppwk_eth_vlan_ring_stats_tx_burst( - tx->ethdev_port_id, tx->iface_type, - tx->iface_no, 0, bufs, nb_rx); -#else + nb_tx = sppwk_eth_vlan_tx_burst(tx->ethdev_port_id, tx->queue_no, bufs, nb_rx); -#endif + /* Discard remained packets to release mbuf */ if (unlikely(nb_tx < nb_rx)) { diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c index ab2e9f2..c2cc795 100644 --- a/src/vf/spp_vf.c +++ b/src/vf/spp_vf.c @@ -19,9 +19,6 @@ #define RTE_LOGTYPE_SPP_VF RTE_LOGTYPE_USER1 -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif /* getopt_long return value for long option */ enum SPP_LONGOPT_RETVAL { @@ -280,24 +277,6 @@ main(int argc, char *argv[]) if (unlikely(ret != SPPWK_RET_OK)) break; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - int port_type, port_id; - char dev_name[RTE_DEV_NAME_MAX_LEN] = { 0 }; - int nof_rings = 0; - for (int i = 0; i < RTE_MAX_ETHPORTS; i++) { - if (!rte_eth_dev_is_valid_port(i)) - continue; - rte_eth_dev_get_name_by_port(i, dev_name); - ret = parse_dev_name(dev_name, &port_type, &port_id); - if (port_type == RING) - nof_rings++; - } - ret = sppwk_init_ring_latency_stats( - SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL, - nof_rings); - if (unlikely(ret != SPPWK_RET_OK)) - break; -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ /* Start worker threads of classifier and forwarder */ RTE_LCORE_FOREACH_SLAVE(lcore_id) { @@ -332,9 +311,6 @@ main(int argc, char *argv[]) */ usleep(100); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - print_ring_latency_stats(&g_iface_info); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ } if (unlikely(ret != SPPWK_RET_OK)) { @@ -358,9 +334,6 @@ main(int argc, char *argv[]) */ del_vhost_sockfile(g_iface_info.vhost); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - sppwk_clean_ring_latency_stats(); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ RTE_LOG(INFO, SPP_VF, "Exit spp_vf.\n"); return ret; -- 2.17.1
From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> This patch tries to remove ringlatency stats functionality. Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp> Signed-off-by: Naoki Takada <ntakada14@gmail.com> --- src/mirror/spp_mirror.c | 43 ----------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c index 2bfbf66..a2925f3 100644 --- a/src/mirror/spp_mirror.c +++ b/src/mirror/spp_mirror.c @@ -20,9 +20,6 @@ #include "shared/secondary/spp_worker_th/cmd_utils.h" #include "shared/secondary/spp_worker_th/port_capability.h" -#ifdef SPP_RINGLATENCYSTATS_ENABLE -#include "shared/secondary/spp_worker_th/latency_stats.h" -#endif /* Declare global variables */ #define RTE_LOGTYPE_MIRROR RTE_LOGTYPE_USER1 @@ -336,13 +333,8 @@ mirror_proc(int id) rx = &path->ports[0].rx; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_rx = sppwk_eth_ring_stats_rx_burst(rx->ethdev_port_id, - rx->iface_type, rx->iface_no, 0, bufs, MAX_PKT_BURST); -#else nb_rx = rte_eth_rx_burst(rx->ethdev_port_id, rx->queue_no, bufs, MAX_PKT_BURST); -#endif if (unlikely(nb_rx == 0)) return SPPWK_RET_OK; @@ -399,26 +391,15 @@ mirror_proc(int id) } if (cnt != 0) -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_tx2 = sppwk_eth_ring_stats_tx_burst( - tx->ethdev_port_id, tx->iface_type, - tx->iface_no, 0, copybufs, cnt); -#else nb_tx2 = rte_eth_tx_burst(tx->ethdev_port_id, tx->queue_no, copybufs, cnt); -#endif } /* orginal */ tx = &path->ports[0].tx; if (tx->ethdev_port_id >= 0) -#ifdef SPP_RINGLATENCYSTATS_ENABLE - nb_tx1 = sppwk_eth_ring_stats_tx_burst(tx->ethdev_port_id, - tx->iface_type, tx->iface_no, 0, bufs, nb_rx); -#else nb_tx1 = rte_eth_tx_burst(tx->ethdev_port_id, tx->queue_no, bufs, nb_rx); -#endif nb_tx = nb_tx1; if (nb_tx1 != nb_tx2) @@ -570,24 +551,6 @@ main(int argc, char *argv[]) if (unlikely(ret_cmd_init != SPPWK_RET_OK)) break; -#ifdef SPP_RINGLATENCYSTATS_ENABLE - int port_type, port_id; - char dev_name[RTE_DEV_NAME_MAX_LEN] = { 0 }; - int nof_rings = 0; - for (int i = 0; i < RTE_MAX_ETHPORTS; i++) { - if (!rte_eth_dev_is_valid_port(i)) - continue; - rte_eth_dev_get_name_by_port(i, dev_name); - ret = parse_dev_name(dev_name, &port_type, &port_id); - if (port_type == RING) - nof_rings++; - } - int ret_ringlatency = sppwk_init_ring_latency_stats( - SPP_RING_LATENCY_STATS_SAMPLING_INTERVAL, - nof_rings); - if (unlikely(ret_ringlatency != SPPWK_RET_OK)) - break; -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ /* Start worker threads of classifier and forwarder */ lcore_id = 0; @@ -630,9 +593,6 @@ main(int argc, char *argv[]) */ usleep(100); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - print_ring_latency_stats(&g_iface_info); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ } if (unlikely(ret_do != SPPWK_RET_OK)) { @@ -653,9 +613,6 @@ main(int argc, char *argv[]) /* Remove vhost sock file if not running in vhost-client mode. */ del_vhost_sockfile(g_iface_info.vhost); -#ifdef SPP_RINGLATENCYSTATS_ENABLE - sppwk_clean_ring_latency_stats(); -#endif /* SPP_RINGLATENCYSTATS_ENABLE */ RTE_LOG(INFO, MIRROR, "Exit spp_mirror.\n"); return ret; -- 2.17.1
> From: Hideyuki Yamashita <yamashita.hideyuki@ntt-tx.co.jp>
>
> v2:
> * change tag name of each patch to appropriate ones.
>
> Hideyuki Yamashita (5):
> makefile: remove ringlatency stats functionality
> shared/sec: remove ringlatency stats functionality
> spp_pcap: remove ringlatency stats functionality
> spp_vf: remove ringlatency stats functionality
> spp_mirror: remove ringlatency stats functionality
>
> src/mirror/Makefile | 6 -
> src/mirror/spp_mirror.c | 43 ----
> src/pcap/Makefile | 2 -
> src/pcap/spp_pcap.c | 8 -
> .../secondary/spp_worker_th/cmd_utils.h | 3 -
> .../secondary/spp_worker_th/latency_stats.c | 240 ------------------
> .../secondary/spp_worker_th/latency_stats.h | 167 ------------
> .../secondary/spp_worker_th/port_capability.c | 47 ----
> src/vf/Makefile | 6 -
> src/vf/classifier.c | 19 +-
> src/vf/forwarder.c | 19 +-
> src/vf/spp_vf.c | 27 --
> 12 files changed, 8 insertions(+), 579 deletions(-)
> delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.c
> delete mode 100644 src/shared/secondary/spp_worker_th/latency_stats.h
>
Applied, thanks!