From: Christian Marangi <ansuelsmth@gmail.com>
To: "Michał Kępień" <kernel@kempniu.pl>
Cc: Andrew Lunn <andrew@lunn.ch>, 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>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: dsa: qca8k: Disable mgmt Ethernet for qca8327
Date: Mon, 10 Aug 2026 15:53:58 +0200 [thread overview]
Message-ID: <6a79d7fa.ebbd881c.2cd61f.2e0d@mx.google.com> (raw)
In-Reply-To: <20260810061612.23745-1-kernel@kempniu.pl>
On Mon, Aug 10, 2026 at 08:15:53AM +0200, Michał Kępień wrote:
> While the qca8327 switch appears to support in-band mgmt Ethernet,
> prolonged use of that protocol (e.g. for polling link state) makes the
> device unstable: within minutes, ports randomly go down and no traffic
> is forwarded anymore. The same issues do not occur when MDIO is used
> exclusively, so ensure mgmt Ethernet is not used on the qca8327.
>
> Signed-off-by: Michał Kępień <kernel@kempniu.pl>
> ---
> I came across this while migrating an AR9344-based router with a QCA8327
> rev. 4 switch to a DSA-aware driver. This glitch is a pain in the neck
> to troubleshoot any further as it occurs randomly, anywhere between a
> minute to an hour after the switch is set up; traffic load exerted on
> the switch does not seem to matter as the problem can be triggered on a
> virtually idle device. Previously working links are reported as going
> down (one by one, not all at once), even though port LEDs still blink;
> no traffic is forwarded; reloading qca8k does not alleviate the problem,
> only power cycling seems to help. Nothing like this happens when only
> MDIO is used. However, qca8k currently only uses MDIO as a fallback. I
> figured that simpler is better and that mgmt Ethernet should simply be
> disabled for the qca8327, but I would be happy to work on some
> configurable solution if that would be preferable.
>
This is a long standing issue and it seems to me disabling mgmt is just a
big workaround to a real problem.
Long time ago it was reported that there seems to be a problem with the
mdio master register for external and internall access and how mgmt was
actually sending mdio command... just done by the switch. Could the 2 issue
related?
One idea might be to verify that stuff gets actually written... as Andrew
said to verify if some packets doesn't get lost or just ignored.
Also as Andrew said I would still save this for the MIB part as the 2 thing
should be unrelated.
> drivers/net/dsa/qca/qca8k-8xxx.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
> index 4c928983b8623..1d90a23aba6bb 100644
> --- a/drivers/net/dsa/qca/qca8k-8xxx.c
> +++ b/drivers/net/dsa/qca/qca8k-8xxx.c
> @@ -160,6 +160,11 @@ qca8k_set_page(struct qca8k_priv *priv, u16 page)
> return 0;
> }
>
> +static bool qca8k_mgmt_eth_disabled(const struct qca8k_priv *priv)
> +{
> + return priv->switch_id == QCA8K_ID_QCA8327;
> +}
> +
Instead of this and return ENXIO I would just not install the relevant OPs
for the tagger and use the mdio path directly...
Makes the code cleaner and less CPU cycle (the target is ath79 and powerpc
stuff)
But as said above disabling the feature is the last solution after all the
verification are done.
> static void qca8k_rw_reg_ack_handler(struct dsa_switch *ds, struct sk_buff *skb)
> {
> struct qca8k_mgmt_eth_data *mgmt_eth_data;
> @@ -316,6 +321,9 @@ static int qca8k_read_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
> bool ack;
> int ret;
>
> + if (qca8k_mgmt_eth_disabled(priv))
> + return -ENXIO;
> +
> skb = qca8k_alloc_mdio_header(MDIO_READ, reg, NULL,
> QCA8K_ETHERNET_MDIO_PRIORITY, len);
> if (!skb)
> @@ -368,6 +376,9 @@ static int qca8k_write_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
> bool ack;
> int ret;
>
> + if (qca8k_mgmt_eth_disabled(priv))
> + return -ENXIO;
> +
> skb = qca8k_alloc_mdio_header(MDIO_WRITE, reg, val,
> QCA8K_ETHERNET_MDIO_PRIORITY, len);
> if (!skb)
> @@ -630,6 +641,9 @@ qca8k_phy_eth_command(struct qca8k_priv *priv, bool read, int phy,
> int ret, ret1;
> bool ack;
>
> + if (qca8k_mgmt_eth_disabled(priv))
> + return -ENXIO;
> +
> if (regnum >= QCA8K_MDIO_MASTER_MAX_REG)
> return -EINVAL;
>
> --
> 2.55.0
>
--
Ansuel
prev parent reply other threads:[~2026-08-10 13:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 6:15 [PATCH] net: dsa: qca8k: Disable mgmt Ethernet for qca8327 Michał Kępień
2026-08-10 13:38 ` Andrew Lunn
2026-08-10 13:53 ` Christian Marangi [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=6a79d7fa.ebbd881c.2cd61f.2e0d@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel@kempniu.pl \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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