Skip to content

Commit ed02faa

Browse files
committed
net/netvsc: forward per-queue stats from VF device
hn_vf_stats_get was ignoring the qstats parameter (__rte_unused), calling rte_eth_stats_get which only collects aggregate stats. This meant per-queue stats (rx_q0_good_packets, tx_q0_good_packets, etc.) were always zero when VF datapath was active, even though the underlying MANA driver populates them in its stats_get callback. Call the VF device's stats_get op directly with the qstats pointer so per-queue counters are forwarded through netvsc to the xstats telemetry output. Signed-off-by: Long Li <longli@microsoft.com>
1 parent a946898 commit ed02faa

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/net/netvsc/hn_vf.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,16 +855,20 @@ void hn_vf_rx_queue_release(struct hn_data *hv, uint16_t queue_id)
855855

856856
int hn_vf_stats_get(struct rte_eth_dev *dev,
857857
struct rte_eth_stats *stats,
858-
struct eth_queue_stats *qstats __rte_unused)
858+
struct eth_queue_stats *qstats)
859859
{
860860
struct hn_data *hv = dev->data->dev_private;
861861
struct rte_eth_dev *vf_dev;
862862
int ret = 0;
863863

864864
rte_rwlock_read_lock(&hv->vf_lock);
865865
vf_dev = hn_get_vf_dev(hv);
866-
if (vf_dev)
867-
ret = rte_eth_stats_get(vf_dev->data->port_id, stats);
866+
if (vf_dev) {
867+
if (vf_dev->dev_ops->stats_get)
868+
ret = vf_dev->dev_ops->stats_get(vf_dev, stats, qstats);
869+
else
870+
ret = rte_eth_stats_get(vf_dev->data->port_id, stats);
871+
}
868872
rte_rwlock_read_unlock(&hv->vf_lock);
869873
return ret;
870874
}

0 commit comments

Comments
 (0)