Skip to contentSkip to conversation

net: mana: Reduce waiting time if HWC not responding

PATCH Applied Haiyang Zhang 4 participants 4 messages Sep 10, 2025 – Sep 14, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mana: Reduce waiting time if HWC not responding

From: Haiyang Zhang <[email protected]>

If HW Channel (HWC) is not responding, reduce the waiting time, so further steps will fail quickly.
This will prevent getting stuck for a long time (30 minutes or more), for example, during unloading while HWC is not responding.

---
 drivers/net/ethernet/microsoft/mana/hw_channel.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/microsoft/mana/hw_channel.c +6 -1
index ef072e24c46d..ada6c78a2bef 100644
@@ -881,7 +881,12 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,
 	if (!wait_for_completion_timeout(&ctx->comp_event,
 					 (msecs_to_jiffies(hwc->hwc_timeout)))) {
 		if (hwc->hwc_timeout != 0)
-			dev_err(hwc->dev, "HWC: Request timed out!\n");
+			dev_err(hwc->dev, "HWC: Request timed out: %u ms\n",
+				hwc->hwc_timeout);
+
+		/* Reduce further waiting if HWC no response */
+		if (hwc->hwc_timeout > 1)
+			hwc->hwc_timeout = 1;
 
 		err = -ETIMEDOUT;
 		goto out;
Signature · 1 line
2.34.1
reviewer
#1 lore raw
Quoted 17 lines · Haiyang Zhang

From: Haiyang Zhang <[email protected]>

If HW Channel (HWC) is not responding, reduce the waiting time, so further steps will fail quickly.
This will prevent getting stuck for a long time (30 minutes or more), for example, during unloading while HWC is not responding.

---
 drivers/net/ethernet/microsoft/mana/hw_channel.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/microsoft/mana/hw_channel.c +0 -0
index ef072e24c46d..ada6c78a2bef 100644

drivers/net/ethernet/microsoft/mana/hw_channel.c int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len, · line 889

Quoted 10 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +6 -1
@@ -881,7 +881,12 @@ int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len,
 	if (!wait_for_completion_timeout(&ctx->comp_event,
 					 (msecs_to_jiffies(hwc->hwc_timeout)))) {
 		if (hwc->hwc_timeout != 0)
-			dev_err(hwc->dev, "HWC: Request timed out!\n");
+			dev_err(hwc->dev, "HWC: Request timed out: %u ms\n",
+				hwc->hwc_timeout);
+
+		/* Reduce further waiting if HWC no response */
+		if (hwc->hwc_timeout > 1)
+			hwc->hwc_timeout = 1;

Hi,

Perhaps it is already the case, but I'm wondering if the configured value of hwc_timeout should be restored at some point.

Quoted 7 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +0 -0
 		err = -ETIMEDOUT;
 		goto out;
Signature · 1 line
2.34.1
maintainer
#2 lore raw
Quoted 53 lines

-----Original Message-----
From: Simon Horman <[email protected]>
Sent: Friday, September 12, 2025 8:29 AM
To: Haiyang Zhang <[email protected]>
Cc: [email protected]; [email protected]; Haiyang Zhang <[email protected]>; Dexuan Cui <[email protected]>; KY Srinivasan <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Long Li <[email protected]>; [email protected]; [email protected]; [email protected]; Konstantin Taranov <[email protected]>; Shiraz Saleem <[email protected]>; [email protected]; linux- [email protected]
Subject: [EXTERNAL] Re: [PATCH net-next] net: mana: Reduce waiting time if HWC not responding

Quoted 3 lines · Haiyang Zhang

From: Haiyang Zhang <[email protected]>

If HW Channel (HWC) is not responding, reduce the waiting time, so

further

Quoted 2 lines

steps will fail quickly.
This will prevent getting stuck for a long time (30 minutes or more),

for

Review

Quoted 8 lines

example, during unloading while HWC is not responding.

---
 drivers/net/ethernet/microsoft/mana/hw_channel.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/ethernet/microsoft/mana/hw_channel.c

drivers/net/ethernet/microsoft/mana/hw_channel.c int mana_hwc_send_request(struct hw_channel_context

Quoted 4 lines

index ef072e24c46d..ada6c78a2bef 100644

drivers/net/ethernet/microsoft/mana/hw_channel.c +0 -0
@@ -881,7 +881,12 @@ int mana_hwc_send_request(struct hw_channel_context

*hwc, u32 req_len,

drivers/net/ethernet/microsoft/mana/hw_channel.c int mana_hwc_send_request(struct hw_channel_context *hwc, u32 req_len, · line 889

Quoted 10 lines
drivers/net/ethernet/microsoft/mana/hw_channel.c +6 -1
 	if (!wait_for_completion_timeout(&ctx->comp_event,
 					 (msecs_to_jiffies(hwc->hwc_timeout)))) {
 		if (hwc->hwc_timeout != 0)
-			dev_err(hwc->dev, "HWC: Request timed out!\n");
+			dev_err(hwc->dev, "HWC: Request timed out: %u ms\n",
+				hwc->hwc_timeout);
+
+		/* Reduce further waiting if HWC no response */
+		if (hwc->hwc_timeout > 1)
+			hwc->hwc_timeout = 1;

Hi,

Quoted 2 lines

Perhaps it is already the case, but I'm wondering if the configured value of hwc_timeout should be restored at some point.

Yes it's already the case: when the driver does reset/recovery, or gets a timeout-value-message from the NIC, the time out value will be updated.

Thanks,
- Haiyang

#3 lore raw
In reply to Haiyang Zhang
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 10 Sep 2025 13:57:21 -0700 you wrote:

From: Haiyang Zhang <[email protected]>

If HW Channel (HWC) is not responding, reduce the waiting time, so further steps will fail quickly.
This will prevent getting stuck for a long time (30 minutes or more), for example, during unloading while HWC is not responding.

[...]

Here is the summary with links:
- [net-next] net: mana: Reduce waiting time if HWC not responding
https://git.kernel.org/netdev/net-next/c/c4deabbc1abe

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html