From 829db9e1818ef88cc276d69f2942c48fce394369 Mon Sep 17 00:00:00 2001 From: "Chen Jing D(Mark)" Date: Fri, 12 Jun 2015 15:06:29 +0800 Subject: [PATCH] fm10k: fix maximum queue number for VF Both PF and VF shared code in function fm10k_stats_get(). The function works well with PF, but has problem with VF since VF has less queues than PF. Fixes: a6061d9e7075 ("fm10k: register PF driver") Signed-off-by: Chen Jing D(Mark) Acked-by: Michael Qiu --- drivers/net/fm10k/fm10k_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index ae832bd28a..1da4ab784e 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -835,7 +835,7 @@ fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) ipackets = opackets = ibytes = obytes = 0; for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) && - (i < FM10K_MAX_QUEUES_PF); ++i) { + (i < hw->mac.max_queues); ++i) { stats->q_ipackets[i] = hw_stats->q[i].rx_packets.count; stats->q_opackets[i] = hw_stats->q[i].tx_packets.count; stats->q_ibytes[i] = hw_stats->q[i].rx_bytes.count; -- 2.20.1