The link might be down due to one of the following issues:
cable issues,
unsupported speeds,
configuration issues
Run mlx5cmd -dbg -pddrinfo and check the following lines in the output presented:
Troubleshooting Info:Messages: Indicates the issue that requires attention.
Operational Info:Active link speed: The active speed displayed in bit mask. The list of bits are stated below.Supported speeds: The supported speed displayed in bit mask. The list of bits are stated below.