Link State Machine

Introduction

Figure 25-2 on page 603 illustrates the Link Layer state machine. It should be noted that the Physical Layer signals its current state (up or down) to the Link Layer. The actual signal name is immaterial, but the specification uses the name PhyLink. At a given moment in time, the Link Layer is in one of the following states:

  • LinkDown state. While in the LinkDown state, the Link Layer has the following operational characteristics:

    - The Link Layer's ability to transmit and receive data packets is disabled. Data packets are defined as all packet types other than SMPs or link-level Flow Control Packets (FCPs). See “Link-Level Flow Control” on page 637.

    - The Link Layer's ability to receive and send SMPs is disabled.

    - The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is disabled.

  • LinkInitialize state. Entered when the Physical Layer signals that it is operational. While in the LinkInitialize state, the Link Layer has the following operational characteristics:

    - The Link Layer's ability to transmit and receive data packets is disabled.

    - The Link Layer's ability to receive and send SMPs is enabled.

    - The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is enabled.

  • LinkArm state. Entered on receipt of an SMP commanding the state change. While in the LinkArm state, the Link Layer has the following operational characteristics:

    - In a CA, the port's ability to transmit data packets is disabled. In a switch design, the port may or may not be able to transmit data packets.

    - The Link Layer's ability to receive data packets is enabled.

    - The Link Layer's ability to receive and send SMPs is enabled.

    - The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is enabled.

  • LinkActive state. This is the fully operational state. While in the LinkActive state, the Link Layer has the following operational characteristics:

    - The Link Layer's ability to transmit and receive data packets is enabled.

    - The Link Layer's ability to receive and send SMPs is enabled.

    - The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is enabled.

  • LinkActDefer state. If the Physical Layer indicates that the external link has gone down, the Link Layer temporarily exits LinkActive and goes to LinkActDefer (Link Active Defer) until either the Physical Layer indicates that the external link is back up or until the LinkDownTimeout has expired (whichever occurs first). While in the LinkActDefer state, the Link Layer has the following operational characteristics:

    - The Link Layer's ability to transmit and receive data packets is disabled.

    - The Link Layer's ability to receive and send SMPs is disabled.

    - The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is disabled.

Figure 25-2. The Link State Machine


The subsections that follow provide a detailed description of each state.

LinkDown State

LinkDown Characteristics

While in the LinkDown state, the Link Layer has the following operational characteristics:

  • DataPktXmitEnable = False. The Link Layer's ability to transmit data packets is disabled.

  • DataPktRcvEnable = False. The Link Layer's ability to receive data packets is disabled.

  • SMPEnable = False. The Link Layer's ability to receive and send SMPs is disabled.

  • LinkPktEnable = False. The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is disabled.

  • The PortInfo.PortState attribute element is set to Down.

LinkDown Entry

The LinkDown state is entered under any of the following circumstances:

  1. On Reset assertion.

  2. PhyLink input signals Up-to-Down transition. In other words, the external link has gone down. Entry to the LinkDown state from each of the other states occurs under the following circumstances:

    - Entry from the LinkInitialize or LinkArm state is immediate when PhyLink transitions from Up to Down.

    - Entry from the LinkActive state is immediate upon receipt of a SubnSet(PortInfo) command changing PortInfo.PortState to the LinkDown state.

    - Entry from the LinkActDefer state occurs under either of the following circumstances:

    - Immediately upon receipt of a SubnSet(PortInfo) command changing the PortInfo.PortState atribute element to the LinkDown state.

    - When the PhyLink signal transitions from Up-to-Down, the Link Layer enters the LinkActDefer state and remains in it until either the PhyLink signal transitions back to the Up state, or the LinkDownTimeout expires, whichever occurs first. The LinkDownTimeout is 10ms +3%/–51% (it is implemented as a hardware timer, rather than as an attribute).

  3. Receipt of a command [via an SubnSet(PortInfo) SMP changing the state of the PortInfo.PortState attribute element] while in either the LinkActive or LinkActDefer state to return to the LinkDown state.

    Note that when the Physical Layer is signaling PhyLink Up and the port's Link Layer receives a command (via SMP) to enter the LinkDown state, the state machine's transition to the LinkDown state resets all link state machines. Since the Link Layer is receiving a PhyLink Up indication from the Physical Layer, the state machine will immediately transition from the LinkDown state to the LinkInitialize state. Thus the LinkDown command provides a way to re-initialize the Link Layer.

LinkDown Exit

The Link Layer automatically exits the LinkDown state and enters the LinkInitialize state when the Physical Layer signals PhyLink = Up to the Link Layer (i.e., when the external link is up).

LinkInitialize State

LinkInitialize Characteristics

While in the LinkInitialize state, the Link Layer has the following operational characteristics:

  • DataPktXmitEnable = False. The Link Layer's ability to transmit data packets is disabled.

  • DataPktRcvEnable = False. The Link Layer's ability to receive data packets is disabled.

  • SMPEnable = True. The Link Layer's ability to receive and send SMPs is enabled.

  • LinkPktEnable = True. The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is enabled.

  • The PortInfo.PortState attribute element is set to Initialize.

LinkInitialize Entry

The LinkInitialize state is only entered from the LinkDown state when the PhyLink signal is in the Up state.

LinkInitialize Exit

The Link Layer exits the LinkInitialize state under either of the following circumstances:

  • If the Physical Layer sets the PhyLink signal to Down, the Link Layer transitions back to the LinkDown state.

  • If the PhyLink signal from the Physical Layer remains set to Up and the port's Link Layer receives a SubnSet(PortInfo) command to change PortInfo.PortState to the LinkArm state.

ActiveEnable Flag Set False on Exit from LinkInitialize State

The Link Layer becomes fully operational when it enters the LinkActive state. At that time, it can both transmit and receive data packets with the device on the other end of the link. However, it is imperative that the port not transmit any data packets until its transmitter has received an indication from the receiver on the opposite end of the link that it does, in fact, have sufficient buffer space to receive one or more data packets.

The ActiveEnable flag prevents a premature transition from LinkArm to LinkActive. It is set to false when the LinkInitialize state is exited. It is not set to true until a link Flow Control Packet with the “normal” flow control Op code (1h) has been received (see “Link-Level Flow Control” on page 637 for more information on link-level flow control) and has passed the checks of the link packet check state machine while in the LinkArm state. Then and only then does the transmitter know how much space is available in the receiver's buffer. See “LinkArm Exit” on page 607 for more information.

LinkArm State

LinkArm Characteristics

While in the LinkArm state, the Link Layer has the following operational characteristics:

  • DataPktXmitEnable = ForwardInArm:

    - In a CA, ForwardInArm is set false, disabling the port's ability to transmit data packets.

    - In a switch design, ForwardInArm may be either true or false and the port therefore may or may not be able to transmit data packets.

  • DataPktRcvEnable = True. The Link Layer's ability to receive data packets is enabled.

  • SMPEnable = True. The Link Layer's ability to receive and send SMPs is enabled.

  • LinkPktEnable = True. The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is enabled.

  • The PortInfo.PortState attribute element is set to LinkArm.

LinkArm Entry

The LinkArm state is entered from either of the following two states:

  • From LinkInitialize state. LinkArm is entered from the LinkInitialize state when both of the following are true:

    - The Physical Layer is signaling Up on PhyLink and

    - a SubnSet(PortInfo) SMP is received commanding the Link Layer to transition PortInfo.PortState to the LinkArm state.

  • From LinkActive state. LinkArm is entered from the LinkActive state when both of the following are true:

    - The Physical Layer is signaling Up on PhyLink and

    - a SubnSet(PortInfo) SMP is received commanding the Link Layer to transition PortInfo.PortState to the LinkArm state.

LinkArm Exit

The Link Layer exits the LinkArm state under either of the following circumstances:

  • LinkArm ==> LinkDown. If the PhyLink signal transitions from Up-to-Down, the Link Layer exits the LinkArm state and enters the LinkDown state.

  • LinkArm ==> LinkActive. When all of the following four conditions are satisfied, the Link Layer exits the LinkArm state and enters the LinkActive state:

    1. The PhyLink signal = Up.

    2. ActiveEnable flag = true, indicating that a link-level Flow Control Packet has been received from the receiver on the other end of the link. For more information, refer to “ActiveEnable Flag Set False on Exit from LinkInitialize State” on page 606.

    3. An SMP packet is received setting PortInfo.PortState = to either Active or ActiveTrigger. Note that even though the Link Layer has been commanded to enter the Active state, it cannot do so until an ActiveTrigger event occurs (refer to the next step).

    4. An ActiveTrigger event is detected. Rather than transitioning from LinkArm to LinkActive due to the receipt of a command, a port's Link Layer automatically makes the transition if this event is detected. The nature of the event depends on whether the device is a router or a CA, or a switch:

      - If the device is a router or a CA, the trigger event occurs upon the port's reception of a data packet (not an SMP) which passes the VCRC check on the port.

      - For switches, the trigger event occurs upon reception of a data packet (not an SMP) which passes the VCRC check on any port of the switch. One data packet's passage through the network causes the armed ports in its path to transition to the LinkActive state.

LinkActive State

LinkActive Characteristics

While in the LinkActive state, the Link Layer has the following operational characteristics:

  • DataPktXmitEnable = True. The Link Layer's ability to transmit data packets is enabled.

  • DataPktRcvEnable = True. The Link Layer's ability to receive data packets is enabled.

  • SMPEnable = True. The Link Layer's ability to receive and send SMPs is enabled.

  • LinkPktEnable = True. The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is enabled.

  • The PortInfo.PortState attribute element is set to Active.

In other words, the Link Layer is fully operational.

LinkActive Entry

The LinkActive state is entered from either of the following states:

  • LinkArm-to-LinkActive. For a description of the circumstances under which LinkActive is entered from the LinkArm state, refer to the second bullet item under “LinkArm Exit” on page 607.

  • LinkActDefer-to-LinkActive. For a description of the circumstances under which LinkActive is entered from the LinkActDefer state, refer to “LinkActDefer Exit” on page 609.

LinkActive Exit

The Link Layer exits the LinkActive state under two circumstances:

  1. LinkActive-to-LinkActDefer. The Link Layer exits LinkActive and enters LinkActDefer if the PhyLink signal transitions to the Down state, thereby indicating that the external link has become inoperative for any reason. For detail on the LinkActDefer state, refer to “LinkActDefer State” on page 609.

  2. LinkActive-to-LinkDown. The Link Layer exits LinkActive and enters LinkDown if a remote_init event occurs. This event occurs if the Link Layer's receive logic receives a link Flow Control Packet containing the Flow Control Initialize opcode (0h) and the packet has passed the checks of the link packet check state machine. For more information on link-level Flow Control, refer to “Link-Level Flow Control” on page 637.

LinkActDefer State

LinkActDefer Characteristics

The port's Link Layer enters the LinkActDefer state if the external link goes down (i.e., the PhyLink signal transitions to the Down state). While in the LinkActDefer state, the Link Layer has the following operational characteristics:

  • DataPktXmitEnable = False. The Link Layer's ability to transmit data packets is disabled.

  • DataPktRcvEnable = False. The Link Layer's ability to receive data packets is disabled.

  • SMPEnable = False. The Link Layer's ability to receive and send SMPs is disabled.

  • LinkPktEnable = False. The Link Layer's ability to receive and send Link Layer Flow Control Packets (FCPs) is disabled.

  • The PortInfo.PortState attribute element automatically changes to the ActiveDefer state.

LinkActDefer Entry

The LinkActDefer state is entered from the LinkAct state if the external link goes down (i.e., the PhyLink signals transitions to the Down state).

LinkActDefer Exit

The Link Layer exits the LinkActDefer state under either of the following circumstances:

  1. LinkActDefer to LinkActive. The Link Layer transitions back to the fully operational LinkActive state if the external link becomes operational again (i.e., the PhyLink signal changes to the Up state) before the LinkDownTimeout elapses. The LinkDownTimeout is 10ms +3%/-51%.

  2. LinkActDefer to LinkDown. The Link Layer transitions to the LinkDown state under either of the following circumstances:

    - If the external link does not become operational again (i.e., the PhyLink signal does not change to the Up state) before the LinkDownTimeout elapses.

    - If a remote_init event occurs. This event occurs if the Link Layer's receive logic receives a link Flow Control Packet containing the flow control initialize opcode (0h) and the packet has passed the checks of the link packet check state machine. For more information on link-level flow control, refer to “Link-Level Flow Control” on page 637.

While it remains in the LinkActDefer state, the Link Layer may process packets already received. It will drop packets presented to it for transmission. The purpose of this state is to allow for retraining of the external link without requiring reinitialization of the Link and higher layers (i.e., the Network and Transport layers).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.183.86