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 EBB10A0500 for ; Wed, 18 Dec 2019 07:58:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B85F134EF; Wed, 18 Dec 2019 07:58:21 +0100 (CET) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id C2FA434EF for ; Wed, 18 Dec 2019 07:58:19 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id z124so720819pgb.13 for ; Tue, 17 Dec 2019 22:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ucg+FxvuICPZjZy734D+tOFUdUpWL/aXFgRgXR98doE=; b=EZ5WDgBRKY3nMAbAqDt12Du3fdU7C4NMYT9gN19wm14Y2pWpfN9PiQcpqJ3toOzeGw x7X6LWuKAGI1g+KHbrcl5GKEYmn9s03mxQEYMuLMt6rLKcs2x7tTBPnuNzcLy80qZ5gR EJQuU11zyKRBmeIkFwc3I9B1SfXlBm//PhuSLw4JJKd72FNazrLrCue+aLcsp5ahcs1g a/fi7noDJAfxZ4M7t9Nu8i/0N2LOyleLwNh1BjhmW4ZlnlzMhDBh5rJQ4KbBRspAOeTb c66yCsS9gEEBnV01v6lWaRRhMvHySyPZZAwx0h9AZ/G72tDxtp0pWJJRYt0pnZnAI56Z 1oCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ucg+FxvuICPZjZy734D+tOFUdUpWL/aXFgRgXR98doE=; b=Irbj3yAgbjlyiethE1+n0bZYXrZ0NKG7WgXcEBKzddUVYLAbVuNtw3Cs7IinkiRfpK UeZCRYd9HidfbnI4tRwy7U13CdV8wtTi9P5M46nyQb/jzeOpWu+z6FxeeAdI6O+DQU3i jpmlYGLi1xV36yJZOaC/zUvn5c1i1gyfwKU4UuwI/XT1cT8xggEAgVxI7K01xpeAtiQo POk7/ojJ7Y8WWWxXJNl/rduIpmE6ON+FUeWOZo1jBcaIHjyMhF7MsfzGvhvbV3po+2dp Fcvkj4TfwmBzBAoJCiF771XACzYIqXcr8DYj4c7wBNWfCiITOI7C9Gr4VjcTsdjIdx9h EYPA== X-Gm-Message-State: APjAAAX3C9drReFXx64se7Jdvop8NGHP0g2odlthdJdxo6Ezr3haAngf ANGbuQ/3h8kzDLG3pKWuSz8= X-Google-Smtp-Source: APXvYqx76XmD14VF3FZVO9DcB/6fOUqyArg3oUBbLHkxUNNHj+3Ju5ACnbto5NVadT29UtLaM1XTgA== X-Received: by 2002:a63:ea4b:: with SMTP id l11mr1228701pgk.357.1576652298982; Tue, 17 Dec 2019 22:58:18 -0800 (PST) Received: from [172.30.202.27] ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id s18sm1448999pfh.47.2019.12.17.22.58.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Dec 2019 22:58:18 -0800 (PST) To: Itsuro Oda References: <20191218050203.2898-1-oda@valinux.co.jp> <20191218050203.2898-2-oda@valinux.co.jp> Cc: spp@dpdk.org, ferruh.yigit@intel.com From: Yasufumi Ogawa Message-ID: Date: Wed, 18 Dec 2019 15:58:58 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191218050203.2898-2-oda@valinux.co.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [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" 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 Applied, thanks! Acked-by: Yasufumi Ogawa > --- > 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; >