Re: [PATCH net] net/mlx5: Check max_macs devlink param value against max capability

From: Alexander Lobakin

Date: Thu Jun 11 2026 - 11:48:41 EST


From: Tariq Toukan <tariqt@xxxxxxxxxx>
Date: Thu, 11 Jun 2026 16:52:30 +0300

> From: Dragos Tatulea <dtatulea@xxxxxxxxxx>
>
> The max_macs devlink param is checked against the FW max value only at
> param register time (driver load) and inside the validate callback
> (devlink param set). The stored DRIVERINIT value persists across FW
> resets and devlink reloads without any further checks against the max.
>
> If the FW link type changes from Ethernet to IB and a FW reset happens,
> the MAX cap for log_max_current_uc_list will become zero, but the
> previously stored max_macs value remains and is unconditionally
> programmed into the HCA caps in handle_hca_cap(). FW will then return a
> syndrome during SET_HCA_CAP:
>
> mlx5_cmd_out_err:839:(pid 3831): SET_HCA_CAP(0x109) op_mod(0x0) failed,
> status bad parameter(0x3), syndrome (0x537801), err(-22)
> set_hca_cap:907:(pid 3831): handle_hca_cap failed
>
> This results in a failure to register the RDMA device.
>
> This patch skips programming log_max_current_uc_list when the MAX
> capability is 0 (in case of IB).
>
> Fixes: 8680a60fc1fc ("net/mlx5: Let user configure max_macs generic param")
> Signed-off-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
> Reviewed-by: Yael Chemla <ychemla@xxxxxxxxxx>
> Reviewed-by: Carolina Jubran <cjubran@xxxxxxxxxx>
> Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>

Reviewed-by: Alexander Lobakin <aleksander.lobakin@xxxxxxxxx>

Thanks,
Olek