[dpdk-dev] virtio: xstats name issue

Message ID 1472716874-34036-1-git-send-email-zhiyong.yang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Yuanhan Liu
Headers

Commit Message

Yang, Zhiyong Sept. 1, 2016, 8:01 a.m. UTC
  The patch fixes some xstats name issues and make the xstats name conform to
code implementation(the function virtio_update_packet_stats).

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Yuanhan Liu Sept. 5, 2016, 4:33 a.m. UTC | #1
Few generic (trivial) comments first:

- cc to related maintainers 

- follow the right prefix, "net/virtio" but not "virtio"

- start commit summary with a verb, and start with "fix" for bug fixing patch.

On Thu, Sep 01, 2016 at 04:01:14PM +0800, Zhiyong Yang wrote:
> The patch fixes some xstats name issues and make the xstats name conform to
> code implementation(the function virtio_update_packet_stats).

I would fix it inside virtio_update_packet_stats(), to keep the consistency
of name style: starts with an even number, and ends with an odd number.

	--yliu

> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 07d6449..4cee067 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -125,8 +125,8 @@ static const struct rte_virtio_xstats_name_off rte_virtio_rxq_stat_strings[] = {
>  	{"size_128_255_packets",   offsetof(struct virtnet_rx, stats.size_bins[3])},
>  	{"size_256_511_packets",   offsetof(struct virtnet_rx, stats.size_bins[4])},
>  	{"size_512_1023_packets",  offsetof(struct virtnet_rx, stats.size_bins[5])},
> -	{"size_1024_1517_packets", offsetof(struct virtnet_rx, stats.size_bins[6])},
> -	{"size_1518_max_packets",  offsetof(struct virtnet_rx, stats.size_bins[7])},
> +	{"size_1024_1518_packets", offsetof(struct virtnet_rx, stats.size_bins[6])},
> +	{"size_1519_max_packets",  offsetof(struct virtnet_rx, stats.size_bins[7])},
>  };
>  
>  /* [rt]x_qX_ is prepended to the name string here */
> @@ -142,8 +142,8 @@ static const struct rte_virtio_xstats_name_off rte_virtio_txq_stat_strings[] = {
>  	{"size_128_255_packets",   offsetof(struct virtnet_tx, stats.size_bins[3])},
>  	{"size_256_511_packets",   offsetof(struct virtnet_tx, stats.size_bins[4])},
>  	{"size_512_1023_packets",  offsetof(struct virtnet_tx, stats.size_bins[5])},
> -	{"size_1024_1517_packets", offsetof(struct virtnet_tx, stats.size_bins[6])},
> -	{"size_1518_max_packets",  offsetof(struct virtnet_tx, stats.size_bins[7])},
> +	{"size_1024_1518_packets", offsetof(struct virtnet_tx, stats.size_bins[6])},
> +	{"size_1519_max_packets",  offsetof(struct virtnet_tx, stats.size_bins[7])},
>  };
>  
>  #define VIRTIO_NB_RXQ_XSTATS (sizeof(rte_virtio_rxq_stat_strings) / \
> -- 
> 2.5.5
  
Yang, Zhiyong Sept. 5, 2016, 5:35 a.m. UTC | #2
Hi, Yuanhan:

	Thanks for your comments and suggestions.

Zhiyong

> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Monday, September 5, 2016 12:33 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] virtio: xstats name issue
> 
> Few generic (trivial) comments first:
> 
> - cc to related maintainers
> 
> - follow the right prefix, "net/virtio" but not "virtio"
> 
> - start commit summary with a verb, and start with "fix" for bug fixing patch.
> 
> On Thu, Sep 01, 2016 at 04:01:14PM +0800, Zhiyong Yang wrote:
> > The patch fixes some xstats name issues and make the xstats name
> > conform to code implementation(the function virtio_update_packet_stats).
> 
> I would fix it inside virtio_update_packet_stats(), to keep the consistency of
> name style: starts with an even number, and ends with an odd number.
> 
> 	--yliu
  
Yuanhan Liu Sept. 5, 2016, 6:19 a.m. UTC | #3
On Mon, Sep 05, 2016 at 12:33:29PM +0800, Yuanhan Liu wrote:
> Few generic (trivial) comments first:
> 
> - cc to related maintainers 
> 
> - follow the right prefix, "net/virtio" but not "virtio"
> 
> - start commit summary with a verb, and start with "fix" for bug fixing patch.

I forgot to mention that you need to add a fixline for bug fix patch.

	--yliu
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 07d6449..4cee067 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -125,8 +125,8 @@  static const struct rte_virtio_xstats_name_off rte_virtio_rxq_stat_strings[] = {
 	{"size_128_255_packets",   offsetof(struct virtnet_rx, stats.size_bins[3])},
 	{"size_256_511_packets",   offsetof(struct virtnet_rx, stats.size_bins[4])},
 	{"size_512_1023_packets",  offsetof(struct virtnet_rx, stats.size_bins[5])},
-	{"size_1024_1517_packets", offsetof(struct virtnet_rx, stats.size_bins[6])},
-	{"size_1518_max_packets",  offsetof(struct virtnet_rx, stats.size_bins[7])},
+	{"size_1024_1518_packets", offsetof(struct virtnet_rx, stats.size_bins[6])},
+	{"size_1519_max_packets",  offsetof(struct virtnet_rx, stats.size_bins[7])},
 };
 
 /* [rt]x_qX_ is prepended to the name string here */
@@ -142,8 +142,8 @@  static const struct rte_virtio_xstats_name_off rte_virtio_txq_stat_strings[] = {
 	{"size_128_255_packets",   offsetof(struct virtnet_tx, stats.size_bins[3])},
 	{"size_256_511_packets",   offsetof(struct virtnet_tx, stats.size_bins[4])},
 	{"size_512_1023_packets",  offsetof(struct virtnet_tx, stats.size_bins[5])},
-	{"size_1024_1517_packets", offsetof(struct virtnet_tx, stats.size_bins[6])},
-	{"size_1518_max_packets",  offsetof(struct virtnet_tx, stats.size_bins[7])},
+	{"size_1024_1518_packets", offsetof(struct virtnet_tx, stats.size_bins[6])},
+	{"size_1519_max_packets",  offsetof(struct virtnet_tx, stats.size_bins[7])},
 };
 
 #define VIRTIO_NB_RXQ_XSTATS (sizeof(rte_virtio_rxq_stat_strings) / \