Carroll suffered medial ligament damage after coming on as a substitute in the goalless draw at Southampton on February 11.
He was forced to play on as manager Sam Allardyce had used all three substitutes and goalkeeper Adrian had been sent off for handling outside his area.
After the surgery, Carroll tweeted: ???Surgery went great and glad to be put back together into one piece! Now I just need some entertainment to keep me occupied! #bored.”
Carroll???s injury is the latest in a long line of fitness problems to beset the former Newcastle and Liverpool striker.
He missed the first three months of the season after tearing ankle ligaments on a pre-season tour of New Zealand and was forced to sit out most of the last campaign with a heel problem.
Carroll also picked up a hamstring injury in September 2012 in his first game on loan with West Ham from Liverpool before injuring his knee against Manchester United shortly after his return to the side.
West Ham have been linked with a move for out-of-contract former Paris Saint-Germain forward Nene but have yet to sign anyone as cover for Carroll.