From: Mieczyslaw Nalewaj <namiltd@yahoo.com>
To: "Alvin Šipraga" <alvin.sipraga@analog.com>
Cc: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com,
kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, linux@armlinux.org.uk, luizluca@gmail.com,
maxime.chevallier@bootlin.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v7 10/10] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB
Date: Wed, 4 Nov 2026 00:41:40 +0100 [thread overview]
Message-ID: <6c6155f0-0431-4ef9-8067-dbc104af710e@yahoo.com> (raw)
In-Reply-To: <auph2uJLrJ6Nj0dh@analog.com>
On Tue, Nov 03, 2026 at 11:52:24PM +0100, Alvin Šipraga wrote:
> Hi Mieczyslaw,
>
> First of all, apologies for such a late review! I hope you appreciate
> the feedback anyways.
Hi Alvin,
Thanks for the review, no need to apologise. Your comments crossed
with the v8 I had just sent, so they are not included there. I will
address them in v9.
> This is OK, but in the same spirit as my comment to your other patch, I
> think we want to make the C and D families equal. So why not:
>
> -#define RTL8365MB_MAX_NUM_PORTS 11
> +#define RTL8365MB_C_MAX_NUM_PORTS 11
> +#define RTL8365MB_D_MAX_NUM_PORTS 8
>
> and add a num_ports member to struct rtl8365mb_chip_info. Then below:
[...]
> The above becomes something like
>
> priv->num_ports = mb->chip_info->num_ports;
Agreed. In v9 I'll rename the constants as you suggest, add num_ports
to struct rtl8365mb_chip_info and use it in rtl8365mb_detect().
> Another thing I noticed in the L2 patch was that you added a macro:
>
> #define RTL8365MB_D_L2_MAX_PORT 7
[...]
> Which I wonder, can you even get there if the num_ports is 8? We didn't
> need that protection for family C. I think you can drop the macro and
> this check.
Right, with num_ports capped at 8 the core never passes a port above 7,
same as on family C. I'll drop the macro and the related checks in v9.
> The reason I'm saying this is that I saw quite a few places where you
> have a construct of the form:
>
> if (family is d)
> // use family d constant
> else
> // use family c constant
>
> Which can become a bit hard to follow/maintain.
[...]
> I hope it's possible to remove most of the if (family is x) { do
> something } constructs and keep things flat.
Understood. I'll wait for the rest of your comments on v8 and then
move per-family constants into chip_info where it makes sense, rather
than branching in the code.
Thanks,
Mieczyslaw
prev parent reply other threads:[~2026-11-03 23:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3bf4dd70-9771-497b-8c27-e925e0ef81eb.ref@yahoo.com>
2026-11-02 14:34 ` [PATCH net-next v7 0/10] " Mieczyslaw Nalewaj
2026-11-02 14:36 ` [PATCH net-next v7 01/10] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-02 14:37 ` [PATCH net-next v7 02/10] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-02 14:38 ` [PATCH net-next v7 03/10] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-02 14:39 ` [PATCH net-next v7 04/10] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-02 14:40 ` [PATCH net-next v7 05/10] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-11-02 14:41 ` [PATCH net-next v7 06/10] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-11-02 14:42 ` [PATCH net-next v7 07/10] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-02 14:43 ` [PATCH net-next v7 08/10] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-11-02 14:44 ` [PATCH net-next v7 09/10] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-03 15:36 ` Alvin Šipraga
2026-11-03 16:44 ` Mieczyslaw Nalewaj
2026-11-02 14:45 ` [PATCH net-next v7 10/10] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-03 22:52 ` Alvin Šipraga
2026-11-03 23:41 ` Mieczyslaw Nalewaj [this message]
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=6c6155f0-0431-4ef9-8067-dbc104af710e@yahoo.com \
--to=namiltd@yahoo.com \
--cc=alvin.sipraga@analog.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=luizluca@gmail.com \
--cc=maxime.chevallier@bootlin.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
all inboxes | Powered by JetHome®