Backport missing mlx5 fixes after 50b2412b7e7