An apparatus and a method for sender-initiated credit recovery in a
closed-loop credit based flow control system, includes assigning a number
of credits to a sender unit in the credit based flow control system. The
method also includes decrementing a credit count in the sender unit in
response to the sender sending data to the receiver and incrementing the
credit count in the sender unit in response to receiving returned credits
from the receiver unit. The method also includes determining if a loss or
gain in the number of credits in the credit based flow control system has
occurred and adjusting the credit count based on the determined loss or
gain.