[v2] net/ixgbe: support per-queue stats for fewer queues

Message ID 20241024185352.987356-1-mb@smartsharesystems.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers
Series [v2] net/ixgbe: support per-queue stats for fewer queues |

Checks

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

Commit Message

Morten Brørup Oct. 24, 2024, 6:53 p.m. UTC
Remove the requirement that the configured number of queues to provide
statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the
driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS).

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
---
v2:
* Fix subject. (Bruce Richardson)
* Simplify type cast. (Bruce Richardson, Stephen Hemminger)
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Morten Brørup Oct. 24, 2024, 6:58 p.m. UTC | #1
> From: Morten Brørup [mailto:mb@smartsharesystems.com]
> Sent: Thursday, 24 October 2024 20.54
> 
> Remove the requirement that the configured number of queues to provide
> statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the
> driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS).
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>

Forgot the
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

And the
--in-reply-to 20241024111757.791634-1-mb@smartsharesystems.com

> ---
> v2:
> * Fix subject. (Bruce Richardson)
> * Simplify type cast. (Bruce Richardson, Stephen Hemminger)
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ab37c37469..09d648af6d 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -3385,7 +3385,8 @@ ixgbe_dev_stats_get(struct rte_eth_dev *dev,
> struct rte_eth_stats *stats)
>  	stats->opackets = hw_stats->gptc;
>  	stats->obytes = hw_stats->gotc;
> 
> -	for (i = 0; i < IXGBE_QUEUE_STAT_COUNTERS; i++) {
> +	for (i = 0; i < RTE_MIN_T(IXGBE_QUEUE_STAT_COUNTERS,
> +			RTE_ETHDEV_QUEUE_STAT_CNTRS, typeof(i)); i++) {
>  		stats->q_ipackets[i] = hw_stats->qprc[i];
>  		stats->q_opackets[i] = hw_stats->qptc[i];
>  		stats->q_ibytes[i] = hw_stats->qbrc[i];
> --
> 2.43.0
  
Stephen Hemminger Oct. 24, 2024, 7:05 p.m. UTC | #2
On Thu, 24 Oct 2024 18:53:52 +0000
Morten Brørup <mb@smartsharesystems.com> wrote:

> Remove the requirement that the configured number of queues to provide
> statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the
> driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS).
> 
> Signed-off-by: Morten Brørup <mb@smartsharesystems.com>


Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Bruce Richardson Oct. 25, 2024, 10:11 a.m. UTC | #3
On Thu, Oct 24, 2024 at 12:05:39PM -0700, Stephen Hemminger wrote:
> On Thu, 24 Oct 2024 18:53:52 +0000
> Morten Brørup <mb@smartsharesystems.com> wrote:
> 
> > Remove the requirement that the configured number of queues to provide
> > statistics for (RTE_ETHDEV_QUEUE_STAT_CNTRS) cannot be less than the
> > driver's max supported number of the same (IXGBE_QUEUE_STAT_COUNTERS).
> > 
> > Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
> 
> 
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Applied to dpdk-next-net-intel.

Thanks,
/Bruce
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ab37c37469..09d648af6d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3385,7 +3385,8 @@  ixgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	stats->opackets = hw_stats->gptc;
 	stats->obytes = hw_stats->gotc;
 
-	for (i = 0; i < IXGBE_QUEUE_STAT_COUNTERS; i++) {
+	for (i = 0; i < RTE_MIN_T(IXGBE_QUEUE_STAT_COUNTERS,
+			RTE_ETHDEV_QUEUE_STAT_CNTRS, typeof(i)); i++) {
 		stats->q_ipackets[i] = hw_stats->qprc[i];
 		stats->q_opackets[i] = hw_stats->qptc[i];
 		stats->q_ibytes[i] = hw_stats->qbrc[i];