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 term 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."
West Ham's Portuguese striker Ricardo Vaz Te wants to leave the Premier League club, meanwhile.
Allardyce told reporters Vaz Te had handed in a transfer request and West Ham would be "more than happy" to accommodate it if a club came in with the right offer before Monday's transfer deadline.
"He might leave now, if anybody's going to leave now it would be Vaz. You don't keep anybody that doesn't want to stay," the club website quoted Allardyce as saying ahead of West Ham's weekend match at home to Stoke City.
"I would expect that in the next few days that we probably will have an inquiry."