public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][net-next] net/devlink: Move health recovery notification after abort check
@ 2026-02-12 10:57 lirongqing
  2026-02-12 12:07 ` Paolo Abeni
  0 siblings, 1 reply; 4+ messages in thread
From: lirongqing @ 2026-02-12 10:57 UTC (permalink / raw)
  To: Jiri Pirko, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev, linux-kernel
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

In devlink_health_report(), the DEVLINK_CMD_HEALTH_REPORTER_RECOVER
notification is sent immediately after setting the error state, before
checking if recovery should be aborted via devlink_health_recover_abort().

When devlink_health_recover_abort() returns true (e.g., due to rate
limiting), the recovery process terminates early, but userspace has already
received a notification implying that recovery is underway. This creates a
misleading view of the reporter's activity.

Move the notification after the abort check, ensuring it is only sent when
recovery will actually proceed. This aligns the notification with the
actual recovery behavior.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/devlink/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/devlink/health.c b/net/devlink/health.c
index 136a67c..e9999fc 100644
--- a/net/devlink/health.c
+++ b/net/devlink/health.c
@@ -665,7 +665,6 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
 	reporter->error_count++;
 	prev_health_state = reporter->health_state;
 	reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_ERROR;
-	devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER);
 
 	if (devlink_health_recover_abort(reporter, prev_health_state)) {
 		trace_devlink_health_recover_aborted(devlink,
@@ -686,6 +685,7 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
 	if (!reporter->auto_recover)
 		return 0;
 
+	devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER);
 	devl_lock(devlink);
 	ret = devlink_health_reporter_recover(reporter, priv_ctx, NULL);
 	devl_unlock(devlink);
-- 
2.9.4


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

* Re: [PATCH][net-next] net/devlink: Move health recovery notification after abort check
  2026-02-12 10:57 [PATCH][net-next] net/devlink: Move health recovery notification after abort check lirongqing
@ 2026-02-12 12:07 ` Paolo Abeni
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2026-02-12 12:07 UTC (permalink / raw)
  To: lirongqing, Jiri Pirko, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Simon Horman, netdev, linux-kernel

On 2/12/26 11:57 AM, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
> 
> In devlink_health_report(), the DEVLINK_CMD_HEALTH_REPORTER_RECOVER
> notification is sent immediately after setting the error state, before
> checking if recovery should be aborted via devlink_health_recover_abort().
> 
> When devlink_health_recover_abort() returns true (e.g., due to rate
> limiting), the recovery process terminates early, but userspace has already
> received a notification implying that recovery is underway. This creates a
> misleading view of the reporter's activity.
> 
> Move the notification after the abort check, ensuring it is only sent when
> recovery will actually proceed. This aligns the notification with the
> actual recovery behavior.
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

## Form letter - net-next-closed

We have already submitted our pull request with net-next material for v7.0,
and therefore net-next is closed for new drivers, features, code refactoring
and optimizations. We are currently accepting bug fixes only.

Please repost when net-next reopens after Feb 23rd.

RFC patches sent for review only are obviously welcome at any time.

See:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
-- 
pw-bot: defer


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

* [PATCH][net-next] net/devlink: Move health recovery notification after abort check
@ 2026-02-25  2:10 lirongqing
  2026-02-26  3:31 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: lirongqing @ 2026-02-25  2:10 UTC (permalink / raw)
  To: Jiri Pirko, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev, linux-kernel
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

In devlink_health_report(), the DEVLINK_CMD_HEALTH_REPORTER_RECOVER
notification is sent immediately after setting the error state, before
checking if recovery should be aborted via devlink_health_recover_abort().

When devlink_health_recover_abort() returns true (e.g., due to rate
limiting), the recovery process terminates early, but userspace has already
received a notification implying that recovery is underway. This creates a
misleading view of the reporter's activity.

Move the notification after the abort check, ensuring it is only sent when
recovery will actually proceed. This aligns the notification with the
actual recovery behavior.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/devlink/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/devlink/health.c b/net/devlink/health.c
index 136a67c..e9999fc 100644
--- a/net/devlink/health.c
+++ b/net/devlink/health.c
@@ -665,7 +665,6 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
 	reporter->error_count++;
 	prev_health_state = reporter->health_state;
 	reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_ERROR;
-	devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER);
 
 	if (devlink_health_recover_abort(reporter, prev_health_state)) {
 		trace_devlink_health_recover_aborted(devlink,
@@ -686,6 +685,7 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
 	if (!reporter->auto_recover)
 		return 0;
 
+	devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER);
 	devl_lock(devlink);
 	ret = devlink_health_reporter_recover(reporter, priv_ctx, NULL);
 	devl_unlock(devlink);
-- 
2.9.4


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

* Re: [PATCH][net-next] net/devlink: Move health recovery notification after abort check
  2026-02-25  2:10 lirongqing
@ 2026-02-26  3:31 ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2026-02-26  3:31 UTC (permalink / raw)
  To: lirongqing
  Cc: Jiri Pirko, David S . Miller, Eric Dumazet, Paolo Abeni,
	Simon Horman, netdev, linux-kernel

On Tue, 24 Feb 2026 21:10:03 -0500 lirongqing wrote:
> In devlink_health_report(), the DEVLINK_CMD_HEALTH_REPORTER_RECOVER
> notification is sent immediately after setting the error state, before
> checking if recovery should be aborted via devlink_health_recover_abort().
> 
> When devlink_health_recover_abort() returns true (e.g., due to rate
> limiting), the recovery process terminates early, but userspace has already
> received a notification implying that recovery is underway. This creates a
> misleading view of the reporter's activity.
> 
> Move the notification after the abort check, ensuring it is only sent when
> recovery will actually proceed. This aligns the notification with the
> actual recovery behavior.

Hm, we don't have solid documentation for this notification, but I
think it's supposed to be triggered on any change in the health state.
It's not just a notification that recovery has taken place.
devlink_health_reporter_state_update() for instance sends it whether
the update is healthy -> error or error -> healthy.
-- 
pw-bot: reject

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

end of thread, other threads:[~2026-02-26  3:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 10:57 [PATCH][net-next] net/devlink: Move health recovery notification after abort check lirongqing
2026-02-12 12:07 ` Paolo Abeni
  -- strict thread matches above, loose matches on Subject: below --
2026-02-25  2:10 lirongqing
2026-02-26  3:31 ` Jakub Kicinski

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