From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 34464A2EEC for ; Thu, 12 Sep 2019 12:48:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0DE991E93F; Thu, 12 Sep 2019 12:48:38 +0200 (CEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by dpdk.org (Postfix) with ESMTP id 93CC92C19 for ; Thu, 12 Sep 2019 12:48:37 +0200 (CEST) Received: by mail-pl1-f180.google.com with SMTP id s17so6714505plp.2 for ; Thu, 12 Sep 2019 03:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=50to4CYcztkz+U5OSr26jH4WHUhIXR/sr9l5E2LB8b0=; b=BEv66gi0CivIbOQMRZuB5/ljceFRERIZoZpV2vEthVia+/UoRlnKXppAe6pSZ8ddW5 h4GB+kfS9tsjwupSDhKDkkJ/zM2VqC4OiGQkAxJ/nJazK1HihfFK/YLSqERFg+m57Qb/ Qy1GmhPxvm5iK9cvH7El6PBpZ4dacQD47LAcPLVxT5J7HN5kafxGjsW+3KaPw9I/2eet EduzNfPx+MzEoYJUTpaWYL1uh5fU+Ens0SiYO+iNQTcgFMX3Ow7leeOpRQG4MmZxDgFC nFjxQy5NCCspUZ7Y5EhFXlGyzRqpVzVdyWhOTlkugF5N265kPv5opXdI3hpP8zrZauN2 +KCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=50to4CYcztkz+U5OSr26jH4WHUhIXR/sr9l5E2LB8b0=; b=q0pw+mH+CtTMexjjtL4Mya8KgEMYNKJeDXGotRFymA72rJWCx7k0e+xiocXtfwQIN5 MXW/ghq1C5sNIXwy1T0WDw32M0HlSkE6espzEELcyg/nryj2O5gBh34L1pPEkNbkdMcA uk3aEUjmbScPRGor+GZk9rYsW9aeElOwi1RFPKoazhdcfxfeBceTBPDPcH450P0Glrh4 8fQGZ5bJj5QRRQvl5u+k9I8g4ZskfdJCqf67QAle1h/RCzYUUFLcZvKHcKtnntb13juX 3Vv/mG3F1SxcgBSLPPdYptn5vNEoiVrljzZ8+HNfEwAmFFIasEk2oZFk+eez4V+M6gVE gB0A== X-Gm-Message-State: APjAAAVSREhUIIdnhRMhHreZKqorzrIRw4BpGgEoD+THCdIOY597L4Ir w+QqO1lE3E2D47iIrxNs1V5vg8Tg X-Google-Smtp-Source: APXvYqz04t2uCVr6npe3eWWy9cOae6y+gqStxy6b9yJEFZmh+LmNOSqCO0iv8d+BEatRUuEqOpqMnw== X-Received: by 2002:a17:902:b495:: with SMTP id y21mr4500042plr.153.1568285316717; Thu, 12 Sep 2019 03:48:36 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id t3sm26034930pfe.7.2019.09.12.03.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Sep 2019 03:48:36 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Thu, 12 Sep 2019 19:48:20 +0900 Message-Id: <20190912104824.21519-6-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190912104824.21519-1-yasufum.o@gmail.com> References: <20190912104824.21519-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 5/9] shared: renaem util funcs of ring latency X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa 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 --- .../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