The superconductivity and magnetic phenomena of the rare earth iron pnictides RFePO (R = La, Sm) are analyzed using ab initio density functional theory in the local density approximation (LDA) with the on-site Hubbard Ueff parameter (LDA + U). The results of the magnetic properties, band structures and Fermi surfaces of the recently synthesized tetragonal layered iron pnictides superconductor SmFePO are presented in comparison with the superconductor LaFePO. The anti-ferromagnetic state [Sm: AFM, Fe AFM_stripe] is found to be the most stable than the other possible phases, which is in agreement with experiment. The effect of the Hubbard correction is investigated and is found to be a necessary requirement for the accurate description of both the electronic structure and the Fermi surfaces.