From: Rustam Adilov <adilov@disroot.org>
To: "Alvin Šipraga" <alvin.sipraga@analog.com>
Cc: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Linus Walleij <linusw@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Taiga Ogawa <zectaiga@gmail.com>
Subject: Re: [PATCH net-next] net: dsa: tag_rtl8_4: add support for RTL9607C tag variant
Date: Fri, 20 Nov 2026 14:47:24 +0000 [thread overview]
Message-ID: <b1cd757ad411aa74cb2934ccea0924e0@disroot.org> (raw)
In-Reply-To: <awA2z07l0ZvzcWtc@analog.com>
Hello!
On 2026-11-20 12:09, Alvin Šipraga wrote:
> On Thu, Nov 19, 2026 at 09:50:51PM +0500, Rustam Adilov wrote:
>> The RTL9607C family of SoCs have an embdedded switch that utilizes
>> the same Realtek CPU Tag protocol 4 with 8 bytes in size but have
>> a bit different of a layout. And that layout is also different for
>> TX versus RX sides and introduces new fields not seen by RTL8_4.
>>
>> Add basic necessities for this cpu tag variant to function.
>>
>> Tested-by: Taiga Ogawa <zectaiga@gmail.com>
>> Signed-off-by: Rustam Adilov <adilov@disroot.org>
>> ---
>> Tested on OpenWrt with 6.18 kernel version [1].
>
> Mainline doesn't have the requisite DSA driver to make use of this
> protocol. Andrew, is it normal to accept tag protocol drivers without
> the corresponding DSA driver?
I suppose that is fair. I guess that also means i need to hold on to
the PHY support patches until then too?
> I can see that the OpenWRT kernel has a DSA driver using it. Why not
> submit that together with this? Otherwise it is kind of dead code IMO.
Yeah but right now it is not upstream ready yet. Ideally i would like it to
merge with rtl8365mb dsa driver cause by all accounts the embedded switch in
RTL9607C is very much like rtl8365mb but connected over MMIO. So that is my
overall plan.
I am already working on making the downstream dsa driver follow the rtl8365mb
in every case, mdio [1], irq [2], mdb plus vlan [3] but it is kinda messy as
VLAN side is very much like family D which is still being worked so nothing
concrete yet... and the table part is currently being provided by downstream
otto-table driver but we could just as well copy rtl8365mb_table in process.
After then introduce something like realtek-mmio (similar to realtek-mdio
and realtek-smi) and bam, we can straight up share the rtl83xx code :)
But maybe i should really jump straight to it and not slowly converting
the downstream dsa first (which wouldn't really be relevant anyway?).
If it turns that i do need DSA for this be also accepted then maybe.
> As a side note, it's unfortunate that Realtek recycles
> EtherType/protocol ID values for seemingly different formats. At first I
> thought this should be its own file/module, but I can see why you put it
> here. My one concern would be whether the semantics for the common
> fields are actually the same for both protocols? If not then maybe it's
> better to separate them after all to avoid confusion.
They do share the same semantics except reason part as its numbering seems
to be a bit different, 80 is reserved, 0 is normal forward. More documented
by the RTL9607C CPU NIC Application Note at [4] and the hwnat driver [5]
Anyways, thanks for review! I partially also wanted to announce our presence
to rtl8365mb folks by this patch as we may share the space soon :)
[1] https://github.com/openwrt/openwrt/pull/26779
[2] https://github.com/openwrt/openwrt/pull/26593
[3] https://github.com/openwrt/openwrt/pull/26415
[4] https://github.com/jameywine/realtek-doc/blob/main/datasheets/RTL9607C%20CPU%20NIC%20Application%20Note.pdf
[5] https://github.com/jameywine/GPL-for-GP3000/blob/main/linux-5.10.x/drivers/net/ethernet/realtek/rtl86900/FleetConntrackDriver/include/rtk_fc_mgrTRx.h#L540
>> The RTL8_4AP name was mostly chosen because Realtek gave the RTL9607C
>> family of SoCs a codename "ApolloPro" in their SDK, hence "AP" part.
>> Originally it was named RTL8_4_RTL9607C but that feels weird.
>>
>> [1] https://github.com/openwrt/openwrt/pull/26496
>> ---
>> include/net/dsa.h | 2 +
>> net/dsa/tag_rtl8_4.c | 193 ++++++++++++++++++++++++++++++++++++++++++-
>> 2 files changed, 194 insertions(+), 1 deletion(-)
>
> Kind regards,
> Alvin
Best,
Rustam
prev parent reply other threads:[~2026-11-20 14:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 16:50 [PATCH net-next] net: dsa: tag_rtl8_4: add support for RTL9607C tag variant Rustam Adilov
2026-11-20 12:09 ` Alvin Šipraga
2026-11-20 13:10 ` Andrew Lunn
2026-11-20 14:47 ` Rustam Adilov [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=b1cd757ad411aa74cb2934ccea0924e0@disroot.org \
--to=adilov@disroot.org \
--cc=alvin.sipraga@analog.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=zectaiga@gmail.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