mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luke Howard <lukeh@padl.com>
To: 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>,
	 Vivien Didelot <vivien.didelot@gmail.com>,
	 Gregory CLEMENT <gregory.clement@bootlin.com>,
	Andrew Lunn <andrew@lunn.ch>,  Simon Horman <horms@kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	 Tobias Waldekranz <tobias@waldekranz.com>
Cc: Cedric Jehasse <cedric.jehasse@gmail.com>,
	 Kieran Tyrrell <kieran@sienda.com>,
	Max Holtmann <mh@rme-audio.de>,  Max Hunter <max@huntershome.org>,
	 Christoph Mellauner <christoph.mellauner@joyned.at>,
	 Simon Gapp <simon.gapp@gapp-audio.com>,
	 Ryan Wilkins <Ryan.Wilkins@telosalliance.com>,
	 Mattias Forsblad <mattias.forsblad@gmail.com>,
	netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Luke Howard <lukeh@padl.com>
Subject: [PATCH net-next 04/12] net: dsa: qca8k: Drop replies with wrong sequence numbers
Date: Fri, 03 Jul 2026 17:30:23 +1000	[thread overview]
Message-ID: <20260703-net-next-dsa-rmu-v1-4-a03febf20bb4@padl.com> (raw)
In-Reply-To: <20260703-net-next-dsa-rmu-v1-0-a03febf20bb4@padl.com>

From: Andrew Lunn <andrew@lunn.ch>

A response with the wrong sequence number is likely to be a late
arriving responses, which the driver has already given up waiting for.
Drop it rather than signalling the complete. If the complete was
signalled, this late response could take the place of the genuine
reply which is soon to follow.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/qca/qca8k-8xxx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
index b0cbe72c15b4c..3b3fe96016176 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;
 
 	if (cmd == MDIO_READ) {
 		u32 *val = mgmt_eth_data->data;

-- 
2.43.0


  parent reply	other threads:[~2026-07-03  7:30 UTC|newest]

Thread overview: 13+ 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-03  7:30 ` [PATCH net-next 02/12] net: dsa: qca8K: Move queuing for request frame into the core Luke Howard
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 ` Luke Howard [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-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=20260703-net-next-dsa-rmu-v1-4-a03febf20bb4@padl.com \
    --to=lukeh@padl.com \
    --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=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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