All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio: xstats name issue
@ 2016-09-01  8:01 Zhiyong Yang
  2016-09-05  4:33 ` Yuanhan Liu
  2016-09-06  7:50 ` [PATCH v2] net/virtio: fix " Zhiyong Yang
  0 siblings, 2 replies; 9+ messages in thread
From: Zhiyong Yang @ 2016-09-01  8:01 UTC (permalink / raw)
  To: dev; +Cc: Zhiyong Yang

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(-)

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

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

* Re: [PATCH] virtio: xstats name issue
  2016-09-01  8:01 [PATCH] virtio: xstats name issue Zhiyong Yang
@ 2016-09-05  4:33 ` Yuanhan Liu
  2016-09-05  5:35   ` Yang, Zhiyong
  2016-09-05  6:19   ` Yuanhan Liu
  2016-09-06  7:50 ` [PATCH v2] net/virtio: fix " Zhiyong Yang
  1 sibling, 2 replies; 9+ messages in thread
From: Yuanhan Liu @ 2016-09-05  4:33 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: dev

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

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

* Re: [PATCH] virtio: xstats name issue
  2016-09-05  4:33 ` Yuanhan Liu
@ 2016-09-05  5:35   ` Yang, Zhiyong
  2016-09-05  6:19   ` Yuanhan Liu
  1 sibling, 0 replies; 9+ messages in thread
From: Yang, Zhiyong @ 2016-09-05  5:35 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev

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

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

* Re: [PATCH] virtio: xstats name issue
  2016-09-05  4:33 ` Yuanhan Liu
  2016-09-05  5:35   ` Yang, Zhiyong
@ 2016-09-05  6:19   ` Yuanhan Liu
  1 sibling, 0 replies; 9+ messages in thread
From: Yuanhan Liu @ 2016-09-05  6:19 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: dev

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

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

* [PATCH v2] net/virtio: fix xstats name issue
  2016-09-01  8:01 [PATCH] virtio: xstats name issue Zhiyong Yang
  2016-09-05  4:33 ` Yuanhan Liu
@ 2016-09-06  7:50 ` Zhiyong Yang
  2016-09-06 12:27   ` Yuanhan Liu
  2016-09-07  6:11   ` [PATCH v3] " Zhiyong Yang
  1 sibling, 2 replies; 9+ messages in thread
From: Zhiyong Yang @ 2016-09-06  7:50 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, huawei.xie, Zhiyong Yang

The patch fixes some xstats name issues and make the xstats name conform
to the definition of etherStatsPkts1024to1518Octets in rfc2819 page 23.

Fixes: 76d4c652e07d ("virtio: add extended stats")

---

Changes in v2:

modify commit summary.
add the fixline.

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

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

* Re: [PATCH v2] net/virtio: fix xstats name issue
  2016-09-06  7:50 ` [PATCH v2] net/virtio: fix " Zhiyong Yang
@ 2016-09-06 12:27   ` Yuanhan Liu
  2016-09-07  1:32     ` Yang, Zhiyong
  2016-09-07  6:11   ` [PATCH v3] " Zhiyong Yang
  1 sibling, 1 reply; 9+ messages in thread
From: Yuanhan Liu @ 2016-09-06 12:27 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: dev, huawei.xie

On Tue, Sep 06, 2016 at 03:50:12PM +0800, Zhiyong Yang wrote:
> The patch fixes some xstats name issues

Please, state **clearly** what the issue is: it's far away from being
enough just mentioning "fix a issue" without actually telling what it
is.

For this case, you could describe the issue like:

    We have a stats named "size_1024_1517_packets", while the code
    actually counts the range "[1024, 1518]", which is obviously wrong.

You could even add the related code piece here (you see the context
is missing in the patch, which is harder for reviewer to see what's
actually going wrong):

	else if (s < 1519)
		stats->size_bins[6]++;
    
> and make the xstats name conform
> to the definition of etherStatsPkts1024to1518Octets in rfc2819 page 23.

It's a bit abrupt to metion the RFC here, without some background. It
could be better if we mention something like: (just followed by above
issue description).

    We could either fix it by correcting the "if" check in the code,
    or fix it by just renaming the stats to conform to the code. The
    later solution is taken because that's what the RFC2819 suggests.


> Fixes: 76d4c652e07d ("virtio: add extended stats")
> 
> ---

Besides that, the three dash "---" means the end of your commit log,
therefore, it should go --->

> 
> Changes in v2:
> 
> modify commit summary.
> add the fixline.
> 
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>

... here

Otherwise, your SoB will be chopped off while apply.

Another thing to note is, it's a good candidate to me for stable branch,
thus, you may need add following in the commit log before you SoB:

    Cc: <stable@dpdk.org>

So, mind to send v3, with above fixes?

Thanks.

	--yliu

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

* Re: [PATCH v2] net/virtio: fix xstats name issue
  2016-09-06 12:27   ` Yuanhan Liu
@ 2016-09-07  1:32     ` Yang, Zhiyong
  0 siblings, 0 replies; 9+ messages in thread
From: Yang, Zhiyong @ 2016-09-07  1:32 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: dev, Xie, Huawei

hi, yuanhan:

Thanks a lot  for your clear comments in detail. 
Patch v3 will be sent later.

-zhiyong-

> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com]
> Sent: Tuesday, September 6, 2016 8:28 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; Xie, Huawei <huawei.xie@intel.com>
> Subject: Re: [PATCH v2] net/virtio: fix xstats name issue
> 
> On Tue, Sep 06, 2016 at 03:50:12PM +0800, Zhiyong Yang wrote:
> > The patch fixes some xstats name issues
> 
> Please, state **clearly** what the issue is: it's far away from being enough
> just mentioning "fix a issue" without actually telling what it is.
> 
> For this case, you could describe the issue like:
> 
>     We have a stats named "size_1024_1517_packets", while the code
>     actually counts the range "[1024, 1518]", which is obviously wrong.
> 
> You could even add the related code piece here (you see the context is
> missing in the patch, which is harder for reviewer to see what's actually going
> wrong):
> 
> 	else if (s < 1519)
> 		stats->size_bins[6]++;
> 
> > and make the xstats name conform
> > to the definition of etherStatsPkts1024to1518Octets in rfc2819 page 23.
> 
> It's a bit abrupt to metion the RFC here, without some background. It could
> be better if we mention something like: (just followed by above issue
> description).
> 
>     We could either fix it by correcting the "if" check in the code,
>     or fix it by just renaming the stats to conform to the code. The
>     later solution is taken because that's what the RFC2819 suggests.
> 
> 
> > Fixes: 76d4c652e07d ("virtio: add extended stats")
> >
> > ---
> 
> Besides that, the three dash "---" means the end of your commit log,
> therefore, it should go --->
> 
> >
> > Changes in v2:
> >
> > modify commit summary.
> > add the fixline.
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> 
> ... here
> 
> Otherwise, your SoB will be chopped off while apply.
> 
> Another thing to note is, it's a good candidate to me for stable branch, thus,
> you may need add following in the commit log before you SoB:
> 
>     Cc: <stable@dpdk.org>
> 
> So, mind to send v3, with above fixes?
> 
> Thanks.
> 
> 	--yliu

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

* [PATCH v3] net/virtio: fix xstats name issue
  2016-09-06  7:50 ` [PATCH v2] net/virtio: fix " Zhiyong Yang
  2016-09-06 12:27   ` Yuanhan Liu
@ 2016-09-07  6:11   ` Zhiyong Yang
  2016-09-07  7:22     ` [dpdk-stable] " Yuanhan Liu
  1 sibling, 1 reply; 9+ messages in thread
From: Zhiyong Yang @ 2016-09-07  6:11 UTC (permalink / raw)
  To: dev; +Cc: yuanhan.liu, stable, Zhiyong Yang

We have a stats named "size_1024_1517_packets", while the code
actually counts the range "[1024, 1518]", which is obviously wrong.
The code is as follows in the function virtio_update_packet_stats.

else if (s < 1519)
		stats->size_bins[6]++;

We could either fix it by correcting the "if" check in the code,
or fix it by just renaming the stats to conform to the code. The
latter solution is taken because that's what the RFC2819 suggests.

Fixes: 76d4c652e07d ("virtio: add extended stats")

Cc: <stable@dpdk.org>
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
Changes in v3:

add the issue description in detail.

Changes in v2:

modify commit summary and add the fixline.

 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

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

* Re: [dpdk-stable] [PATCH v3] net/virtio: fix xstats name issue
  2016-09-07  6:11   ` [PATCH v3] " Zhiyong Yang
@ 2016-09-07  7:22     ` Yuanhan Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Yuanhan Liu @ 2016-09-07  7:22 UTC (permalink / raw)
  To: Zhiyong Yang; +Cc: dev, yuanhan.liu, stable

On Wed, Sep 07, 2016 at 02:11:00PM +0800, Zhiyong Yang wrote:
> We have a stats named "size_1024_1517_packets", while the code
> actually counts the range "[1024, 1518]", which is obviously wrong.
> The code is as follows in the function virtio_update_packet_stats.
> 
> else if (s < 1519)
> 		stats->size_bins[6]++;
> 
> We could either fix it by correcting the "if" check in the code,
> or fix it by just renaming the stats to conform to the code. The
> latter solution is taken because that's what the RFC2819 suggests.
> 
> Fixes: 76d4c652e07d ("virtio: add extended stats")
> 
> Cc: <stable@dpdk.org>
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>

Applied to dpdk-next-virtio.

Thanks!

	--yliu

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

end of thread, other threads:[~2016-09-07  7:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-01  8:01 [PATCH] virtio: xstats name issue Zhiyong Yang
2016-09-05  4:33 ` Yuanhan Liu
2016-09-05  5:35   ` Yang, Zhiyong
2016-09-05  6:19   ` Yuanhan Liu
2016-09-06  7:50 ` [PATCH v2] net/virtio: fix " Zhiyong Yang
2016-09-06 12:27   ` Yuanhan Liu
2016-09-07  1:32     ` Yang, Zhiyong
2016-09-07  6:11   ` [PATCH v3] " Zhiyong Yang
2016-09-07  7:22     ` [dpdk-stable] " Yuanhan Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.