[EXTERNAL] [PATCH] net/netvsc: add stats counters from VF

Long Li longli at microsoft.com
Fri Mar 7 18:22:09 CET 2025



> -----Original Message-----
> From: Wei Hu <weh at microsoft.com>
> Sent: Tuesday, February 18, 2025 10:12 PM
> To: longli at linuxonhyperv.com; Stephen Hemminger
> <stephen at networkplumber.org>
> Cc: dev at dpdk.org; Long Li <longli at microsoft.com>; stable at dpdk.org
> Subject: RE: [EXTERNAL] [PATCH] net/netvsc: add stats counters from VF
> 
> 
> 
> > -----Original Message-----
> > From: longli at linuxonhyperv.com <longli at linuxonhyperv.com>
> > Sent: Wednesday, February 19, 2025 5:13 AM
> > To: Stephen Hemminger <stephen at networkplumber.org>; Wei Hu
> > <weh at microsoft.com>
> > Cc: dev at dpdk.org; Long Li <longli at microsoft.com>; stable at dpdk.org
> > Subject: [EXTERNAL] [PATCH] net/netvsc: add stats counters from VF
> >
> > From: Long Li <longli at microsoft.com>
> >
> > The netvsc driver should add per-queue and rx_nombuf counters from VF.
> >
> > Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
> > Cc: stable at dpdk.org
> > Signed-off-by: Long Li <longli at microsoft.com>
> > ---
> >  drivers/net/netvsc/hn_ethdev.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/netvsc/hn_ethdev.c
> > b/drivers/net/netvsc/hn_ethdev.c index 988c51928d..069d603d90 100644
> > --- a/drivers/net/netvsc/hn_ethdev.c
> > +++ b/drivers/net/netvsc/hn_ethdev.c
> > @@ -824,8 +824,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
> >  		stats->oerrors += txq->stats.errors;
> >
> >  		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
> > -			stats->q_opackets[i] = txq->stats.packets;
> > -			stats->q_obytes[i] = txq->stats.bytes;
> > +			stats->q_opackets[i] += txq->stats.packets;
> > +			stats->q_obytes[i] += txq->stats.bytes;
> >  		}
> >  	}
> >
> > @@ -841,12 +841,12 @@ static int hn_dev_stats_get(struct rte_eth_dev
> > *dev,
> >  		stats->imissed += rxq->stats.ring_full;
> >
> >  		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
> > -			stats->q_ipackets[i] = rxq->stats.packets;
> > -			stats->q_ibytes[i] = rxq->stats.bytes;
> > +			stats->q_ipackets[i] += rxq->stats.packets;
> > +			stats->q_ibytes[i] += rxq->stats.bytes;
> >  		}
> >  	}
> >
> > -	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
> > +	stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed;
> >  	return 0;
> >  }
> >
> > --
> > 2.34.1
> 
> Reviewed-by: Wei Hu <weh at linux.microsoft.com>

Hi Stephen,

Is it okay to merge this patch?

Thanks,
Long


More information about the dev mailing list