net/virtio: fix duplicated rxq xstats

Message ID 20231124135235.1831304-1-edwin.brossette@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series net/virtio: fix duplicated rxq xstats |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-unit-amd64-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

edwin.brossette@6wind.com Nov. 24, 2023, 1:52 p.m. UTC
  From: Edwin Brossette <edwin.brossette@6wind.com>

The flag RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS was temporarily set while
moving queue stats from 'struct rte_eth_stats' to the individual pmds,
as explained in commit f30e69b41f94 ("ethdev: add device flag to bypass
auto-filled queue xstats").

This flag was added so every pmd would keep its original behavior until
the change was implemented. However, this flag was not removed
afterwards in the virtio pmd and as a result, some queue stats are
displayed twice when trying to get them: once in lib_rte_ethdev, and a
second time in the virtio pmd.

Remove this flag so stats are printed only once.

Fixes: f30e69b41f94 ("ethdev: add device flag to bypass auto-filled queue xstats")
Cc: stable@dpdk.org

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Ferruh Yigit Nov. 27, 2023, 10:20 a.m. UTC | #1
On 11/24/2023 1:52 PM, edwin.brossette@6wind.com wrote:
> From: Edwin Brossette <edwin.brossette@6wind.com>
> 
> The flag RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS was temporarily set while
> moving queue stats from 'struct rte_eth_stats' to the individual pmds,
> as explained in commit f30e69b41f94 ("ethdev: add device flag to bypass
> auto-filled queue xstats").
> 
> This flag was added so every pmd would keep its original behavior until
> the change was implemented. However, this flag was not removed
> afterwards in the virtio pmd and as a result, some queue stats are
> displayed twice when trying to get them: once in lib_rte_ethdev, and a
> second time in the virtio pmd.
> 
> Remove this flag so stats are printed only once.
> 
> Fixes: f30e69b41f94 ("ethdev: add device flag to bypass auto-filled queue xstats")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
> 

Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
  
Maxime Coquelin Feb. 6, 2024, 2:56 p.m. UTC | #2
On 11/24/23 14:52, edwin.brossette@6wind.com wrote:
> From: Edwin Brossette <edwin.brossette@6wind.com>
> 
> The flag RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS was temporarily set while
> moving queue stats from 'struct rte_eth_stats' to the individual pmds,
> as explained in commit f30e69b41f94 ("ethdev: add device flag to bypass
> auto-filled queue xstats").
> 
> This flag was added so every pmd would keep its original behavior until
> the change was implemented. However, this flag was not removed
> afterwards in the virtio pmd and as a result, some queue stats are
> displayed twice when trying to get them: once in lib_rte_ethdev, and a
> second time in the virtio pmd.
> 
> Remove this flag so stats are printed only once.
> 
> Fixes: f30e69b41f94 ("ethdev: add device flag to bypass auto-filled queue xstats")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c | 2 --
>   1 file changed, 2 deletions(-)
> 

Applied to next-virtio tree.

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index c2c0a1a11137..517585740eeb 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1793,8 +1793,6 @@  virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 	else
 		eth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC;
 
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
-
 	/* Setting up rx_header size for the device */
 	if (virtio_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF) ||
 	    virtio_with_feature(hw, VIRTIO_F_VERSION_1) ||