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 D6539A2EEB for ; Thu, 12 Sep 2019 12:48:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CEEF81E93E; Thu, 12 Sep 2019 12:48:34 +0200 (CEST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by dpdk.org (Postfix) with ESMTP id 2B4191E933 for ; Thu, 12 Sep 2019 12:48:33 +0200 (CEST) Received: by mail-pf1-f177.google.com with SMTP id q5so15737124pfg.13 for ; Thu, 12 Sep 2019 03:48:33 -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=/FND5Si+8WuZfl0BUe1J4ZoaGKNLPuk9vOkb3OKIv3k=; b=JvJn//gKMVXarEZk6oXzVHVlpL219K9COx+TyYnc/QGqbuc8nfViAza8nEs+Kf+sli /CP+fgOBpcogU5LdGS6N5b3fhWXQ8MeeW1ExD4a5sQEtr7dDpIaxd4OKAS/TlE4fcuy5 GM+4j6QHJZH6Tn86/9yNyAl5aDdqCwMp/LtpV5wylaSCZbyedYjucwIyeg7kATVOC0mG l6U41T8tLWu+h7Cb7dfze1CDpprNEx4JXHlQUtuz7i4Pz7Gg4sI97noNhUzCvavWoBIi YhxHHMBaHVJMItTSWNmaACIZaDCMqC6QhCioUSWGr/VU/Q57Q3uplAyBocBUu+uMVrFq 8Qzw== 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=/FND5Si+8WuZfl0BUe1J4ZoaGKNLPuk9vOkb3OKIv3k=; b=NKt8UyNbpumMlTIxPsX5T32wtI5sIvF7jXlHtjn6UFs2iDIO3HEPBG7PdQUn0ExNcl FDR62bhm9GF9DUFESP2t3tTid7C/Ong5NR9e/HVNfTrp9rxgcyXbyCUatUNFi9/pK+Rp qumjHs7/kFYw8eihxIox7TkQzTpQrpE+ZeKAm/JTHxw0lzt9SFsKEf+Ky0ARGxVoqrZf QNCrQ4fdma2Z7BqUFBooIuMKv93R6dN7yfmKftvUYyUjUyCbfCPZsruwPqP9SnCeckS1 wA3g3lJU0y6kU4I0TruQbpUoSwQiQLRflCBP5/uwQyGqNffs858TzkVWTmkTW3dcVCRp Kn5Q== X-Gm-Message-State: APjAAAVooNZr8nUb4yctKch5G212lI18YZLs0RSjnYFgpj+Xmyhj8boP Qvnt1n1ERsA5/Ce4/T7HhTz10Hu0 X-Google-Smtp-Source: APXvYqx1J9r33lfINDIR75Nb+TQOcGir+wpXUnnqdJYklN9xgGawUVuI0UYtJFNelaEpZFTSrYVPcA== X-Received: by 2002:a65:4546:: with SMTP id x6mr36885363pgr.266.1568285312333; Thu, 12 Sep 2019 03:48:32 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id t3sm26034930pfe.7.2019.09.12.03.48.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Sep 2019 03:48:31 -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:17 +0900 Message-Id: <20190912104824.21519-3-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 2/9] shared: rename func for calc latency of ring 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 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 --- .../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