mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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:
parent
95e26588c8
commit
d5e77e4d30
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user