net/mlx5: devcom, add DEVCOM_CANT_FAIL for non-rollback events

Some devcom events are not expected to fail. Rather than attempting
a rollback that may not be meaningful, allow callers to pass
DEVCOM_CANT_FAIL as the rollback_event to indicate that the event
handler should not fail. If it does, emit a warning and stop
propagating to further peers, but skip the rollback path.

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260612113904.537595-4-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Shay Drory 2026-06-12 14:38:52 +03:00 committed by Jakub Kicinski
parent 95e26588c8
commit d5e77e4d30
2 changed files with 8 additions and 1 deletions

View File

@ -306,8 +306,13 @@ int mlx5_devcom_locked_send_event(struct mlx5_devcom_comp_dev *devcom,
if (pos != devcom && data) {
err = comp->handler(event, data, event_data);
if (err)
if (err && rollback_event != DEVCOM_CANT_FAIL) {
goto rollback;
} else if (err && rollback_event == DEVCOM_CANT_FAIL) {
WARN_ONCE(1, "devcom component %d event %d failed: %d\n",
comp->id, event, err);
return err;
}
}
}

View File

@ -46,6 +46,8 @@ mlx5_devcom_register_component(struct mlx5_devcom_dev *devc,
void *data);
void mlx5_devcom_unregister_component(struct mlx5_devcom_comp_dev *devcom);
#define DEVCOM_CANT_FAIL (INT_MAX)
int mlx5_devcom_locked_send_event(struct mlx5_devcom_comp_dev *devcom,
int event, int rollback_event,
void *event_data);