US meat processor Smithfield Foods has reported higher second-quarter earnings, as higher hog prices offset lower pork margins and a loss in its beef operations.