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 25715A04FE for ; Wed, 18 Dec 2019 06:02:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1ECE51BF71; Wed, 18 Dec 2019 06:02:07 +0100 (CET) Received: from valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by dpdk.org (Postfix) with ESMTP id 782231BF71 for ; Wed, 18 Dec 2019 06:02:05 +0100 (CET) Received: by valinux.co.jp (Postfix, from userid 1000) id 18F4D24035F; Wed, 18 Dec 2019 14:02:04 +0900 (JST) From: Itsuro Oda To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Wed, 18 Dec 2019 14:02:03 +0900 Message-Id: <20191218050203.2898-2-oda@valinux.co.jp> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191218050203.2898-1-oda@valinux.co.jp> References: <20191218050203.2898-1-oda@valinux.co.jp> Subject: [spp] [PATCH 1/1] spp_primary: fix incorrect statistics 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" When showing primary's stat, tx_drops of physical ports indicates tx_drops of the ring which has same ID mistakenly. Also stats of ring ports includes other type of ports (ex. vhost) which has same ID mistakenly. This patch fiexes these mistakes. Signed-off-by: Itsuro Oda --- src/nfv/commands.h | 7 ++++++- src/primary/main.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/nfv/commands.h b/src/nfv/commands.h index 4a6a170..f6c2305 100644 --- a/src/nfv/commands.h +++ b/src/nfv/commands.h @@ -88,7 +88,12 @@ do_add(char *p_type, int p_id) port_id = (uint16_t) res; port_map[port_id].id = p_id; port_map[port_id].port_type = type; - port_map[port_id].stats = &ports->client_stats[p_id]; + if (type == RING) + port_map[port_id].stats = &ports->client_stats[p_id]; + /* NOTE: port_map[].stats points to &port_map[].default_stats + * other than RING. There is no support to show/clear this stats + * at the moment. + */ /* Update ports_fwd_array with port id */ ports_fwd_array[port_id].in_port_id = port_id; diff --git a/src/primary/main.c b/src/primary/main.c index fbc47c3..26e9c42 100644 --- a/src/primary/main.c +++ b/src/primary/main.c @@ -118,7 +118,7 @@ do_stats_display(void) " tx_drop: %9"PRIu64"\n", ports->id[i], ports->port_stats[i].rx, ports->port_stats[i].tx, - ports->client_stats[i].tx_drop); + ports->port_stats[i].tx_drop); } printf("\nCLIENTS\n"); @@ -644,7 +644,7 @@ phy_port_stats_json(char *str) get_printable_mac_addr(ports->id[i]), ports->port_stats[i].rx, ports->port_stats[i].tx, - ports->client_stats[i].tx_drop); + ports->port_stats[i].tx_drop); int cur_buf_size = (int)strlen(buf_phy_ports) + (int)strlen(phy_port); @@ -827,7 +827,12 @@ add_port(char *p_type, int p_id) port_id = (uint16_t) res; port_map[port_id].id = p_id; port_map[port_id].port_type = port_id_list[cnt].type; - port_map[port_id].stats = &ports->client_stats[p_id]; + if (port_map[port_id].port_type == RING) + port_map[port_id].stats = &ports->client_stats[p_id]; + /* NOTE: port_map[].stats points to &port_map[].default_stats + * other than RING. There is no support to show/clear this stats + * at the moment. + */ /* Update ports_fwd_array with port id */ ports_fwd_array[port_id].in_port_id = port_id; -- 2.17.1