From: Andrew Lunn <andrew@lunn.ch>
To: Caleb James DeLisle <cjd@cjdns.fr>
Cc: netdev@vger.kernel.org, olteanv@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
chester.a.unal@arinc9.com, daniel@makrotopia.org,
linux@armlinux.org.uk, arinc.unal@arinc9.com,
Landen.Chao@mediatek.com, dqfext@gmail.com,
sean.wang@mediatek.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, naseefkm@gmail.com,
b.larsson@gmx.com
Subject: Re: [PATCH v3 3/7] net: dsa: mediatek: add support for passthrough mode
Date: Wed, 28 Oct 2026 13:35:02 +0100 [thread overview]
Message-ID: <2b406479-8c3d-40e6-93e2-e7ad01d5f432@lunn.ch> (raw)
In-Reply-To: <18472c61-efe2-4529-971b-82d877df6b15@cjdns.fr>
> > What is actually left?
>
>
> In v2 I was using special switch ops, and it looked like this:
Sorry, i did not look at v2.
> /* No manipulation of forwarding rules allowed in passthrough mode */
> static const struct dsa_switch_ops mt7530_passthrough_switch_ops = {
> .get_tag_protocol = mtk_get_tag_protocol,
> .setup = mt753x_setup,
> .teardown = mt753x_teardown,
> .preferred_default_local_cpu_port =
> mt753x_preferred_default_local_cpu_port,
> .get_strings = mt7530_get_strings,
> .get_ethtool_stats = mt7530_get_ethtool_stats,
> .get_sset_count = mt7530_get_sset_count,
> .get_eth_mac_stats = mt7530_get_eth_mac_stats,
> .get_rmon_stats = mt7530_get_rmon_stats,
> .get_eth_ctrl_stats = mt7530_get_eth_ctrl_stats,
> .get_stats64 = mt7530_get_stats64,
> .port_enable = mt7530_port_enable,
> .port_disable = mt7530_port_disable,
> .phylink_get_caps = mt753x_phylink_get_caps,
> .support_eee = dsa_supports_eee,
> .set_mac_eee = mt753x_set_mac_eee,
> .conduit_state_change = mt753x_conduit_state_change,
> };
I think you should be doing something like this. Either two
dsa_switch_ops, or you add generic implementations for all the ops,
which then call device specific implementations dependent on the
compatible. This is how many DSA drivers handle different families of
devices in one driver.
I would avoid putting "if (priv->passthrough)" everywhere.
Andrew
next prev parent reply other threads:[~2026-10-28 12:35 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 1:13 [PATCH v3 0/7] net: dsa: mt7530: support EcoNet EN751221 Caleb James DeLisle
2026-10-28 1:13 ` [PATCH v3 1/7] net: dsa: mt7530: get ctrl phy addr using a function Caleb James DeLisle
2026-10-29 2:02 ` netdev-bot+sashiko
2026-10-28 1:13 ` [PATCH v3 2/7] dt-bindings: net: dsa: mediatek,mt7530: add passthrough mode Caleb James DeLisle
2026-10-28 2:04 ` Andrew Lunn
2026-10-28 11:27 ` Caleb James DeLisle
2026-10-28 12:28 ` Andrew Lunn
2026-10-28 13:52 ` Caleb James DeLisle
2026-10-29 2:02 ` netdev-bot+sashiko
2026-10-28 1:13 ` [PATCH v3 3/7] net: dsa: mediatek: add support for " Caleb James DeLisle
2026-10-28 2:07 ` Andrew Lunn
2026-10-28 12:11 ` Caleb James DeLisle
2026-10-28 2:15 ` Andrew Lunn
2026-10-28 11:08 ` Caleb James DeLisle
2026-10-28 12:35 ` Andrew Lunn [this message]
2026-10-29 2:02 ` netdev-bot+sashiko
2026-10-28 1:13 ` [PATCH v3 4/7] net: dsa: mediatek: support PLL setup on MMIO MT7530 Caleb James DeLisle
2026-10-29 2:02 ` netdev-bot+sashiko
2026-10-28 1:13 ` [PATCH v3 5/7] net: dsa: mediatek: support MDIO switch downstream of MMIO switch Caleb James DeLisle
2026-10-28 2:20 ` Andrew Lunn
2026-10-28 11:59 ` Caleb James DeLisle
2026-10-28 12:50 ` Andrew Lunn
2026-10-28 15:04 ` Caleb James DeLisle
2026-10-29 2:02 ` netdev-bot+sashiko
2026-10-28 1:13 ` [PATCH v3 6/7] dt-bindings: net: dsa: mediatek,mt7530: add econet,en751221 Caleb James DeLisle
2026-10-28 2:26 ` Andrew Lunn
2026-10-28 11:19 ` Caleb James DeLisle
2026-10-29 2:02 ` netdev-bot+sashiko
2026-10-28 1:13 ` [PATCH v3 7/7] net: dsa: mediatek: support EN751221 switch Caleb James DeLisle
2026-10-29 2:02 ` netdev-bot+sashiko
2026-10-28 16:03 ` [PATCH v3 0/7] net: dsa: mt7530: support EcoNet EN751221 Cristian Papa
2026-10-28 16:33 ` Caleb James DeLisle
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=2b406479-8c3d-40e6-93e2-e7ad01d5f432@lunn.ch \
--to=andrew@lunn.ch \
--cc=Landen.Chao@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=arinc.unal@arinc9.com \
--cc=b.larsson@gmx.com \
--cc=chester.a.unal@arinc9.com \
--cc=cjd@cjdns.fr \
--cc=conor+dt@kernel.org \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=naseefkm@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=sean.wang@mediatek.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®