[PATCH openEuler-1.0-LTS 1/2] IB/mlx4: Use port iterator and validation APIs