netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: libwx: Fix statistics of multicast packets
@ 2025-05-20  6:38 Jiawen Wu
  2025-05-20 16:52 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Wu @ 2025-05-20  6:38 UTC (permalink / raw)
  To: netdev, pabeni, kuba, edumazet, davem, andrew+netdev, mengyuanlou
  Cc: Jiawen Wu

When SR-IOV is enabled, the number of multicast packets is mistakenly
counted starting from queue 0. It would be a wrong count that includes
the packets received on VF. Fix it to count from the correct offset.

Fixes: c52d4b898901 ("net: libwx: Redesign flow when sriov is enabled")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ethernet/wangxun/libwx/wx_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
index 143cc1088eea..17ff3c21539a 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
@@ -2792,7 +2792,8 @@ void wx_update_stats(struct wx *wx)
 		hwstats->fdirmiss += rd32(wx, WX_RDB_FDIR_MISS);
 	}
 
-	for (i = 0; i < wx->mac.max_rx_queues; i++)
+	for (i = wx->num_vfs * wx->num_rx_queues_per_pool;
+	     i < wx->mac.max_rx_queues; i++)
 		hwstats->qmprc += rd32(wx, WX_PX_MPRC(i));
 }
 EXPORT_SYMBOL(wx_update_stats);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next 1/2] net: libwx: Fix statistics of multicast packets
  2025-05-20  6:38 [PATCH net-next 1/2] net: libwx: Fix statistics of multicast packets Jiawen Wu
@ 2025-05-20 16:52 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2025-05-20 16:52 UTC (permalink / raw)
  To: Jiawen Wu
  Cc: netdev, pabeni, kuba, edumazet, davem, andrew+netdev, mengyuanlou

On Tue, May 20, 2025 at 02:38:59PM +0800, Jiawen Wu wrote:
> When SR-IOV is enabled, the number of multicast packets is mistakenly
> counted starting from queue 0. It would be a wrong count that includes
> the packets received on VF. Fix it to count from the correct offset.
> 
> Fixes: c52d4b898901 ("net: libwx: Redesign flow when sriov is enabled")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>

I note that this is a fix for a commit present in net-next
but not net. So the net-next target + Fixes tag looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-20 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20  6:38 [PATCH net-next 1/2] net: libwx: Fix statistics of multicast packets Jiawen Wu
2025-05-20 16:52 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).