Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: netc: break tstamp_queue walk on first non-expired skb
@ 2026-11-30  8:29 wei.fang
  2026-12-04  5:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: wei.fang @ 2026-11-30  8:29 UTC (permalink / raw)
  To: xiaoning.wang, andrew, olteanv, davem, edumazet, kuba, pabeni,
	richardcochran
  Cc: wei.fang, imx, netdev

From: Wei Fang <wei.fang@nxp.com>

Replace the continue with break in netc_port_tstamp_timeout_work().

The tstamp_queue is a bounded (max 16) skb queue. New SKBs are appended
at the tail, and each SKB’s ptp_tx_time is later than the timestamps of
earlier entries. skb_queue_walk_safe() walks from the head, so when the
first non-expired SKB is reached all following SKBs are guaranteed to be
non-expired. Normally, the queue rarely contains expired SKBs, stopping
the walk early avoids unnecessary checks and improves efficiency.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
 drivers/net/dsa/netc/netc_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/netc/netc_ptp.c b/drivers/net/dsa/netc/netc_ptp.c
index a7ab62f76e35..46aa3b7ba2d2 100644
--- a/drivers/net/dsa/netc/netc_ptp.c
+++ b/drivers/net/dsa/netc/netc_ptp.c
@@ -37,7 +37,7 @@ static void netc_port_tstamp_timeout_work(struct work_struct *work)
 	skb_queue_walk_safe(&np->tstamp_queue, skb, skb_tmp) {
 		if (time_is_after_jiffies64(NETC_SKB_CB(skb)->ptp_tx_time +
 					    NETC_TSTAMP_TIMEOUT))
-			continue;
+			break;
 
 		dev_dbg_ratelimited(np->switch_priv->dev,
 				    "Port %d ts_req_id %u which seems lost\n",
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: dsa: netc: break tstamp_queue walk on first non-expired skb
  2026-11-30  8:29 [PATCH net-next] net: dsa: netc: break tstamp_queue walk on first non-expired skb wei.fang
@ 2026-12-04  5:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-12-04  5:00 UTC (permalink / raw)
  To: Wei Fang
  Cc: xiaoning.wang, andrew, olteanv, davem, edumazet, kuba, pabeni,
	richardcochran, wei.fang, imx, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Willem de Bruijn <willemb@google.com>:

On Mon, 30 Nov 2026 16:29:08 +0800 you wrote:
> From: Wei Fang <wei.fang@nxp.com>
> 
> Replace the continue with break in netc_port_tstamp_timeout_work().
> 
> The tstamp_queue is a bounded (max 16) skb queue. New SKBs are appended
> at the tail, and each SKB’s ptp_tx_time is later than the timestamps of
> earlier entries. skb_queue_walk_safe() walks from the head, so when the
> first non-expired SKB is reached all following SKBs are guaranteed to be
> non-expired. Normally, the queue rarely contains expired SKBs, stopping
> the walk early avoids unnecessary checks and improves efficiency.
> 
> [...]

Here is the summary with links:
  - [net-next] net: dsa: netc: break tstamp_queue walk on first non-expired skb
    https://git.kernel.org/netdev/net-next/c/503f683265b3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-04  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  8:29 [PATCH net-next] net: dsa: netc: break tstamp_queue walk on first non-expired skb wei.fang
2026-12-04  5:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox