patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v3] net/virtio: fix xstats name issue
@ 2016-09-07  5:54 Zhiyong Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Zhiyong Yang @ 2016-09-07  5:54 UTC (permalink / raw)
  To: zhiyong.yang; +Cc: stable

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	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH v3] net/virtio: fix xstats name issue
  2016-09-07  6:11 ` Zhiyong Yang
@ 2016-09-07  7:22   ` Yuanhan Liu
  0 siblings, 0 replies; 3+ 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] 3+ messages in thread

* [dpdk-stable] [PATCH v3] net/virtio: fix xstats name issue
       [not found] <1473148212-142486-1-git-send-email-zhiyong.yang@intel.com>
@ 2016-09-07  6:11 ` Zhiyong Yang
  2016-09-07  7:22   ` Yuanhan Liu
  0 siblings, 1 reply; 3+ 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	[flat|nested] 3+ messages in thread

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-07  5:54 [dpdk-stable] [PATCH v3] net/virtio: fix xstats name issue Zhiyong Yang
     [not found] <1473148212-142486-1-git-send-email-zhiyong.yang@intel.com>
2016-09-07  6:11 ` Zhiyong Yang
2016-09-07  7:22   ` Yuanhan Liu

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