Thread (8 messages) 8 messages, 2 authors, 28d ago

Re: [PATCH] net: airoha: fix MIB stats collection to be lossless

From: Aniket Negi <hidden>
Date: 2026-07-01 10:30:05
Also in: linux-arm-kernel, linux-mediatek, lkml

Maybe better mib_prev?
Ok sure will update. mib_prev is cleaner and more concise. 
 
Since now we do not reset the MIB counters in airoha_update_hw_stats(), we can
get rid of the for loop there and just call airoha_dev_get_hw_stats() with the
provided dev pointer. Even better, just rename airoha_dev_get_hw_stats() in
airoha_update_hw_stats() and move the spinlock there. What do you think?
I am aligned with your suggestion, Since after removing MIB reset logic, there isn't need to iterate over all devs on airoha_gdm_port. This will simplify the code significantly.

I'll refactor as follows:

1. Remove the for loop in airoha_update_hw_stats()
2. Rename airoha_dev_get_hw_stats() to airoha_update_hw_stats()
3) move the spinlock into the renamed function.


Best Regards,
Aniket Negi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help