Soft Patch Panel
 help / color / mirror / Atom feed
From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: Itsuro Oda <oda@valinux.co.jp>
Cc: spp@dpdk.org, ferruh.yigit@intel.com
Subject: Re: [spp] [PATCH 1/1] spp_primary: fix incorrect statistics
Date: Wed, 18 Dec 2019 15:58:58 +0900	[thread overview]
Message-ID: <b56e3773-9ca3-4138-2e89-2ed68c13c24e@gmail.com> (raw)
In-Reply-To: <20191218050203.2898-2-oda@valinux.co.jp>

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

      reply	other threads:[~2019-12-18  6:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  5:02 [spp] [PATCH 0/1] " Itsuro Oda
2019-12-18  5:02 ` [spp] [PATCH 1/1] " Itsuro Oda
2019-12-18  6:58   ` Yasufumi Ogawa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b56e3773-9ca3-4138-2e89-2ed68c13c24e@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=ferruh.yigit@intel.com \
    --cc=oda@valinux.co.jp \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).