Re: [PATCH net-next v6] net: dlink: add support for reporting stats via `ethtool -S` and `ip -s -s link show`
From: Moon Yeounsu
Date: Mon Apr 07 2025 - 18:12:21 EST
On Mon, Apr 07, 2025 at 10:43:41PM +0200, Andrew Lunn wrote:
> That is an odd way of doing it. It would be better to repeat the
> static const struct dlink_stats.
Oh, I see — sorry about that. I wasn’t aware it might be considered an odd approach.
If you don’t mind, could you please explain a bit more about why it seems problematic to you?
Let me briefly share my reasoning behind the current design:
Each ethtool stats function (e.g., get_ethtool_XXX) gathers a specific group of related statistics.
You can see this grouping in action in my patch.
So, I thought managing each stat group in that way would make the code more intuitive,
and help simplify the logic for developers who use or extend it.
I'm still new to kernel development, so there are many things I don't fully understand yet.
I'd appreciate it if you could feel free to point out anything.
Thank you for reviewing my patch!