From: Jakub Kicinski <kuba@kernel.org>
To: lukeh@padl.com
Cc: Jakub Kicinski <kuba@kernel.org>,
olteanv@gmail.com, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, vivien.didelot@gmail.com,
gregory.clement@bootlin.com, andrew@lunn.ch, horms@kernel.org,
f.fainelli@gmail.com, tobias@waldekranz.com,
cedric.jehasse@gmail.com, kieran@sienda.com, mh@rme-audio.de,
max@huntershome.org, christoph.mellauner@joyned.at,
simon.gapp@gapp-audio.com, Ryan.Wilkins@telosalliance.com,
mattias.forsblad@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 04/12] net: dsa: qca8k: Drop replies with wrong sequence numbers
Date: Mon, 20 Jul 2026 16:37:22 -0700 [thread overview]
Message-ID: <20260720233722.444585-1-kuba@kernel.org> (raw)
In-Reply-To: <20260703-net-next-dsa-rmu-v1-4-a03febf20bb4@padl.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
Subject: net: dsa: qca8k: Drop replies with wrong sequence numbers
The change makes qca8k_rw_reg_ack_handler() return early when the reply
sequence number does not match, rather than only setting ack on match.
The intent is to avoid signalling completion for a late reply that could
be mistaken for the next genuine reply.
> diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
> index b0cbe72c15b4..3b3fe9601617 100644
> --- a/drivers/net/dsa/qca/qca8k-8xxx.c
> +++ b/drivers/net/dsa/qca/qca8k-8xxx.c
> @@ -185,9 +185,9 @@ static void qca8k_rw_reg_ack_handler(struct dsa_switch *ds, struct sk_buff *skb)
> /* We can ignore odd value, we always round up them in the alloc function. */
> len *= sizeof(u16);
>
> - /* Make sure the seq match the requested packet */
> - if (get_unaligned_le32(&mgmt_ethhdr->seq) == mgmt_eth_data->seq)
> - mgmt_eth_data->ack = true;
> + /* Make sure the seq match the requested packet. If not, drop. */
> + if (get_unaligned_le32(&mgmt_ethhdr->seq) != mgmt_eth_data->seq)
> + return;
[High]
After this change, is mgmt_eth_data->ack ever assigned true anywhere in
the driver? A grep across drivers/net/dsa/qca/ shows five sites that
initialise it to false before dsa_inband_request(), five sites that read
it afterwards, and no remaining site that ever writes true.
The callers still do, for example in qca8k_read_eth():
mgmt_eth_data->ack = false;
ret = dsa_inband_request(&mgmt_eth_data->inband, skb,
QCA8K_ETHERNET_TIMEOUT);
...
ack = mgmt_eth_data->ack;
mutex_unlock(&mgmt_eth_data->mutex);
if (ret)
return ret;
if (!ack)
return -EINVAL;
With the assignment gone, does every successful reply now leave ack ==
false and cause qca8k_read_eth(), qca8k_write_eth() and the read/write/
clear paths in qca8k_phy_eth_command() to return -EINVAL on their fast
path?
The higher-level callers (qca8k_bulk_read(), qca8k_bulk_write(),
qca8k_regmap_update_bits(), qca8k_internal_mdio_read() and
qca8k_internal_mdio_write()) fall back to the slow MII path on error, so
the device keeps functioning, but is the Ethernet management fast path
effectively disabled between this patch and its follow-up cleanup?
Would it be cleaner to fold the removal of the ack field (and the
matching if (!ack) return -EINVAL checks in every caller) into this same
commit, so that each commit in the series is self-contained and bisects
cleanly?
next prev parent reply other threads:[~2026-07-20 23:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 7:30 [PATCH net-next 00/12] net: dsa: support for inband management of switches Luke Howard
2026-07-03 7:30 ` [PATCH net-next 01/12] net: dsa: qca8k: Move register access completion into DSA core Luke Howard
2026-07-20 23:37 ` Jakub Kicinski
2026-07-03 7:30 ` [PATCH net-next 02/12] net: dsa: qca8K: Move queuing for request frame into the core Luke Howard
2026-07-20 23:37 ` Jakub Kicinski
2026-07-03 7:30 ` [PATCH net-next 03/12] net: dsa: qca8k: dsa_inband_request: More normal return values Luke Howard
2026-07-03 7:30 ` [PATCH net-next 04/12] net: dsa: qca8k: Drop replies with wrong sequence numbers Luke Howard
2026-07-20 23:37 ` Jakub Kicinski [this message]
2026-07-03 7:30 ` [PATCH net-next 05/12] net: dsa: qca8k: Move request sequence number handling into core Luke Howard
2026-07-03 7:30 ` [PATCH net-next 06/12] net: dsa: qca8k: Refactor sequence number mismatch to use error code Luke Howard
2026-07-03 7:30 ` [PATCH net-next 07/12] net: dsa: qca8k: Pass error code from reply decoder to requester Luke Howard
2026-07-20 23:37 ` Jakub Kicinski
2026-07-03 7:30 ` [PATCH net-next 08/12] net: dsa: qca8k: Update error handling Luke Howard
2026-07-03 7:30 ` [PATCH net-next 09/12] net: dsa: qca8k: Move inband mutex into DSA core Luke Howard
2026-07-03 7:30 ` [PATCH net-next 10/12] net: dsa: qca8k: drop redundant mgmt_eth_data Luke Howard
2026-07-03 7:30 ` [PATCH net-next 11/12] net: dsa: Add helper to find ds_switch by index Luke Howard
2026-07-03 7:30 ` [PATCH net-next 12/12] net: dsa: validate source trunk against lags_len Luke Howard
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=20260720233722.444585-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=Ryan.Wilkins@telosalliance.com \
--cc=andrew@lunn.ch \
--cc=cedric.jehasse@gmail.com \
--cc=christoph.mellauner@joyned.at \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=gregory.clement@bootlin.com \
--cc=horms@kernel.org \
--cc=kieran@sienda.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukeh@padl.com \
--cc=mattias.forsblad@gmail.com \
--cc=max@huntershome.org \
--cc=mh@rme-audio.de \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=simon.gapp@gapp-audio.com \
--cc=tobias@waldekranz.com \
--cc=vivien.didelot@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