From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Russell King <linux@armlinux.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/4] net: dsa: motorcomm: Split MIB buffers
Date: Thu, 3 Sep 2026 18:17:16 +0200 [thread overview]
Message-ID: <3716dd9c-1b85-4534-98e9-08999824c02f@lunn.ch> (raw)
In-Reply-To: <20260903143514.532023-3-mmyangfl@gmail.com>
On Thu, Sep 03, 2026 at 10:35:07PM +0800, David Yang wrote:
> With MIB improvement introduced later, struct yt921x_priv will be over
> 20k which is not very good for a single kmalloc(). Dynamically allocate
> the MIB structures to reduce the size of struct yt921x_priv, and do not
> waste memory on dummy ports.
When you read this....
>
> -struct yt921x_mib {
> - u64 rx_broadcast;
> - u64 rx_pause;
> - u64 rx_multicast;
> - u64 rx_crc_errors;
> -
>
> +struct yt921x_mib_stats {
> + u64 rx_broadcast;
> + u64 rx_pause;
> + u64 rx_multicast;
> + u64 rx_crc_errors;
It does not explain "Why?" this structure got renamed.
> +struct yt921x_mib {
> + struct yt921x_port *port;
> +
> + struct delayed_work work;
> + struct yt921x_mib_stats stats;
> + u64 rx_frames;
> + u64 tx_frames;
> +};
And the old structure gets new contents.
I find this confusing, and not easy to review.
Maybe avoid the rename, and call this new structure something else?
Maybe break this up into a number of patches, do things one step at a
time, making it easier to review, lots of small changes which are
obviously correct?
Andrew
next prev parent reply other threads:[~2026-09-03 16:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 14:35 [PATCH net-next 0/4] net: dsa: motorcomm: MIB fixup David Yang
2026-09-03 14:35 ` [PATCH net-next 1/4] net: dsa: motorcomm: Split MIB module David Yang
2026-09-03 15:01 ` Andrew Lunn
2026-09-03 14:35 ` [PATCH net-next 2/4] net: dsa: motorcomm: Split MIB buffers David Yang
2026-09-03 16:17 ` Andrew Lunn [this message]
2026-09-03 14:35 ` [PATCH net-next 3/4] net: dsa: motorcomm: Use u64_stats_t for MIB stats David Yang
2026-09-03 16:25 ` Andrew Lunn
2026-09-04 2:58 ` David Yang
2026-09-04 13:03 ` Andrew Lunn
2026-09-03 14:35 ` [PATCH net-next 4/4] net: dsa: motorcomm: Use safe 64-bit counter reader David Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3716dd9c-1b85-4534-98e9-08999824c02f@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox