The 32-year-old, who missed a large chunk of last season with a hamstring problem, lasted only 34 minutes of the 2-1 second-round win over the Sky Bet League Two side on Tuesday.
Capped 44 times by France, Diarra has failed to earn a regular place in the West Ham side since joining from Marseille at the start of last season and was loaned to Rennes in January.
Allardyce confirmed the knee injury and believes it has ended Diarra's season just two weeks into the new campaign.
"Alou got injured the other night unfortunately," Allardyce said.
"The injury is more serious than we expected and it is an ACL [anterior cruciate ligament] reconstruction unfortunately.
"That will probably finish his season, that is a big blow to us in squad terms. He was hoping to forge his way into the side this season but, obviously with the injury, now that wont be the case."
- Sports & Recreation