]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: Refactor HCA cap 2 setting
authorMark Bloch <mbloch@nvidia.com>
Thu, 23 Oct 2025 09:16:59 +0000 (12:16 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 28 Oct 2025 10:11:27 +0000 (11:11 +0100)
commit075e85a1261e4653c2068e68a8c91da6c7bc4e60
treebf669882182679825966c5eddf4db3ee97455afa
parentcd36818c34ac5ff7f6a50ce88822c7bbb5ac9e0d
net/mlx5: Refactor HCA cap 2 setting

Refactor HCA capability 2 setting logic to be more structured and
conditional. Move the sw_vhca_id_valid setting inside proper conditional
checks and prepare the function for additional capability settings.

The refactoring:
- Always copy current capabilities to set_hca_cap buffer.
- Apply sw_vhca_id_valid setting only when conditions are met.
- Improve code readability and maintainability.

This cleanup prepares the handle_hca_cap_2() function for the upcoming
balance ID capability setting.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1761211020-925651-5-git-send-email-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/main.c