Soft Patch Panel
 help / color / Atom feed
* [spp] [PATCH 0/1] spp_primary: fix incorrect statistics
@ 2019-12-18  5:02 Itsuro Oda
  2019-12-18  5:02 ` [spp] [PATCH 1/1] " Itsuro Oda
  0 siblings, 1 reply; 3+ messages in thread
From: Itsuro Oda @ 2019-12-18  5:02 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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.

Itsuro Oda (1):
  spp_primary: fix incorrect statistics

 src/nfv/commands.h |  7 ++++++-
 src/primary/main.c | 11 ++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 1/1] spp_primary: fix incorrect statistics
  2019-12-18  5:02 [spp] [PATCH 0/1] spp_primary: fix incorrect statistics Itsuro Oda
@ 2019-12-18  5:02 ` " Itsuro Oda
  2019-12-18  6:58   ` Yasufumi Ogawa
  0 siblings, 1 reply; 3+ messages in thread
From: Itsuro Oda @ 2019-12-18  5:02 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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 <oda@valinux.co.jp>
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [spp] [PATCH 1/1] spp_primary: fix incorrect statistics
  2019-12-18  5:02 ` [spp] [PATCH 1/1] " Itsuro Oda
@ 2019-12-18  6:58   ` Yasufumi Ogawa
  0 siblings, 0 replies; 3+ messages in thread
From: Yasufumi Ogawa @ 2019-12-18  6:58 UTC (permalink / raw)
  To: Itsuro Oda; +Cc: spp, ferruh.yigit

On 2019/12/18 14:02, Itsuro Oda wrote:
> 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 <oda@valinux.co.jp>

Applied, thanks!

Acked-by: Yasufumi Ogawa <yasufum.o@gmail.com>

> ---
>   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;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18  5:02 [spp] [PATCH 0/1] spp_primary: fix incorrect statistics Itsuro Oda
2019-12-18  5:02 ` [spp] [PATCH 1/1] " Itsuro Oda
2019-12-18  6:58   ` Yasufumi Ogawa

Soft Patch Panel

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/spp/0 spp/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 spp spp/ http://inbox.dpdk.org/spp \
		spp@dpdk.org
	public-inbox-index spp


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.spp


AGPL code for this site: git clone https://public-inbox.org/ public-inbox