net/mlx5: SWS, fix reformat id error handling
authorVlad Dogaru <vdogaru@nvidia.com>
Tue, 20 May 2025 18:46:39 +0000 (21:46 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 May 2025 03:44:21 +0000 (20:44 -0700)
commitca7690dae1269f454572c163ed5271feed060af5
treee96e75e091afc4c9b45e9cbe77fd5068d89cc037
parent945301db34f14eaa0be794458b67aead74ff79fa
net/mlx5: SWS, fix reformat id error handling

The firmware reformat id is a u32 and can't safely be returned as an
int. Because the functions also need a way to signal error, prefer to
return the id as an output parameter and keep the return code only for
success/error.

While we're at it, also extract some duplicate code to fetch the
reformat id from a more generic struct pkt_reformat.

Signed-off-by: Vlad Dogaru <vdogaru@nvidia.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1747766802-958178-2-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.c
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/fs_dr.h