Packet Receive State Machine

Refer to Figure 25-19 on page 656.

Figure 25-19. Packet Receive State Machine


When Link Down, Discard or Corrupt Inbound Packets

If the Link Layer receives any packets while any of the following conditions are true, the packet will either be discarded or, if the receiving device is a switch or a router, corrupted and passed on to the next external link:

  • Reset is asserted to the Link Layer.

  • PhyLink = Down. The external link is down.

  • PortState = Down. The Link Layer has been commanded to enter the Down state (via an SMP).

While the port's Link Layer is in the Up state (the external link is up and the Link Layer is in the LinkInitialize, LinkArm, or LinkAct state), the Link Layer processes the byte stream received from the Physical Layer as shown in Figure 25-19 on page 656.

Physical Layer/Link Layer Interface

Figure 25-18 on page 655 illustrates the simplified interconnect between the Link and Physical Layers. As long as the external link is operational (the PhyLinkStat signal indicates this), the Link Layer receives a constant character stream of 8-bit characters (on RcvStream) along with a data/control signal (RcvControl) indicating whether the 8-bit character currently being presented on RcvStream is a data character, a control character (Idle, SDP, SLP, EGP, or EBP), or an error character.

Figure 25-18. Physical Layer/Link Layer Interface


What Does “Error” Mean?

In Figure 25-19 on page 656, several references are made to “Error.” This means that when the Physical Layer presented the character to the Link Layer, it indicated that an error was detected in that character. Characters are received over the wire as 10-bit serial characters. The Physical Layer then attempts to convert the 10-bit character into a valid 8-bit control or data character. If it cannot do so (in other words, the character is corrupted), the Physical Layer indicates this to the Link layer. This type of error is referred to as a code violation.

Test Each Byte Once

Each character received from the Physical Layer is tested once by the Packet Receive state machine and causes at most one state transition. For example, when the receipt of an SLP character causes a transition from the Receive Data Packet state to the Bad Packet state, that SLP does not cause a further transition from the Bad Packet state to the Receive Link Packet state.

Good Packet Is Passed to Data Packet or Link Packet Checker

Figure 25-19 on page 656 pictures the packet being passed to the Link Packet Check or Data Packet Check state machine when the receipt of a packet has been completed and no errors are found. The packet is then passed to one of the following:

  • The Link Packet Check state machine. See “” on page 661.

  • The Data Packet Check state machine. See “Data Packet Check” on page 658.

While this is one way of doing it, a particular design may actually start streaming the packet to the Link Packet Check or Data Packet Check state machine before the entire packet has been received and processed by the Packet Receive state machine. For more information, refer to “Packet Can Be Streamed through a Switch or Router” on page 657.

CA Passes Packet to Next Layer When All Checks Are Completed

A CA port's Link Layer is not permitted to pass a data packet to the Network Layer and subsequently on to the Transport Layer (i.e., to a QP) until the packet has passed all checks of the Packet Receive and Data Packet Check state machines. If an error is detected wherein the state machine says that the packet may be either discarded or corrupted, it must be discarded rather than passed to the higher layers.

Packet Can Be Streamed through a Switch or Router

A switch or a router entre port's Link Layer may begin to forward a data packet to the selected exit port's Link Layer before the entire packet has been received when the packet passes all checks of the Data Packet Check state machine (see “Data Packet Check” on page 658) that require discard of the packet on failure. These are checks on the LRH fields and the LRH is at the front end of the packet. If any subsequently received character causes a transition to the Marked Bad Packet or Bad Packet state and the switch or router has begun forwarding the packet through the selected exit port, the switch or router must corrupt the packet.

Corrupting a Packet

A switch or a router corrupts a packet by placing the 1's complement of the calculated VCRC in the VCRC field, and it also ends the packet with an EBP delimiter.

The switch or router may truncate (i.e., shorten) the packet rather than send the entire packet as it was received. If a switch or router is forwarding a corrupted packet that is longer than indicated by the LRH:PktLen, then it must shorten the packet to less than or equal to the LRH:PktLen value.

Local-Link Versus Remote Link Errors

Errors that cause entry to the Bad Packet Discard and Bad Packet states are due to an error that occurred on the external link connected to the receiving port.

Packets received with no code violation errors that start with an SDP and end with an EBP were forwarded by a switch or a router ealier in the packet's flight path that experienced an error on its entre port while it was streaming a packet from the entre port to the exit port. These packets cause entry to the Marked Bad Packet state.

Link Packets Never End with an EBP

Since link packets (i.e., FCPs) are never forwarded by switches or routers, they should never end with an EBP.

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

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