A method and system for distributing credit using a fiber channel switch
element is provided. The switch element includes, a wait threshold
counter that is used to set up a status for a port that has to wait for
certain duration to send a frame due to lack of buffer to buffer credit;
a credit module that controls buffer to buffer credit for a transmit
segment of the fiber channel switch element; and a virtual lane credit
module with a counter that is incremented every time a frame assigned to
a virtual lane is sent and decreased every time a VC_RDY is received. The
method includes, determining if a VC_RDY primitive is received; and
allocating credit to a virtual lane that is not at its maximum credit,
after the VC_RDY primitive is received.