The subject matter disclosed herein generally relates to techniques to manage bit receive rates.
IEEE standard 802.3x, Specification for 802.3 Full Duplex Operation (1997) describes an Ethernet “flow control” protocol. Flow control is a mechanism for preventing a network interface device from being overrun by transmitting “pause frames” (commonly called XOFF frames). When an Ethernet controller determines that the incoming frame rate may lead to buffer overflow, the Ethernet controller may send an XOFF frame to its link partner. The XOFF frame informs the link partner to not send traffic to the network interface device for some specified window of time. This delay allows the network interface device to process its backlog of traffic and free storage for subsequent traffic, thereby reducing the likelihood of dropping any incoming frames/packets. The controller may then explicitly send an XON frame to request resuming transmission.
One prior art technique commonly used by network drivers is for an inflow threshold value to be set to a worst-case level to avoid packet loss. However, this technique may not provide optimal inflow for all network interface device conditions such as where the network interface device can receive more traffic than permitted by the inflow threshold value. Another prior art technique is to set an inflow threshold value to a specific non-worst-case level. However, some network conditions may result in inflow packet loss and accompanying performance degradation. In addition, this technique also limits inflow when the network interface device can receive more traffic than permitted by the inflow threshold value. Techniques are needed to flexibly adjust inflow threshold rates.
Note that use of the same reference numbers in different figures indicates the same or like elements.
Interface 108 may provide intercommunication between host system 102 and NID 110 as well as other devices such as a storage device (not depicted), and/or network cards (not depicted). Interface 108 may be compatible with Ten Gigabit Attachment Unit Interface (XAUI) (described in IEEE 802.3, IEEE 802.3ae, and related standards), universal serial bus (USB), IEEE 1394, Peripheral Component Interconnect (PCI) described for example at Peripheral Component Interconnect (PCI) Local Bus Specification, Revision 2.2, Dec. 18, 1998 available from the PCI Special Interest Group, Portland, Oreg., U.S.A. (as well as revisions thereof), PCI-x described in the PCI-X Specification Rev. 1.0a, Jul. 24, 2000, available from the aforesaid PCI Special Interest Group, Portland, Oreg., U.S.A. (as well as revisions thereof), ten bit interface (TBI), serial ATA described for example at “Serial ATA: High Speed Serialized AT Attachment,” Revision 1.0, published on Aug. 29, 2001 by the Serial ATA Working Group (as well as related standards), and/or parallel ATA (as well as related standards).
NID 110 may support multiple speeds of traffic transmitted bi-directionally between interface 108 and link partner 118. With respect to traffic from link partner 118 to NID 110, in one implementation, NID 110 may control when traffic is transmitted by link partner 118 to NID 110. With respect to traffic from interface 108 to NID 110, controller 112 may not fetch traffic from interface 108 unless it has enough internal storage. One implementation of NID 110 may include controller 112, storage device 114, and physical layer interface 116. NID 110 may be implemented as any or a combination of hardwired logic, software stored by a memory device and executed by a microprocessor, firmware, an application specific integrated circuit (ASIC), and/or a field programmable gate array (FPGA).
Controller 112 may determine a storage threshold of storage device 114. For example, controller 112 may utilize a process described with respect to
For example,
In one implementation, controller 112 may re-calculate the threshold value periodically as its environment changes. One example of an environment change is when the physical medium 117 is unplugged, then re-connected to a link partner of different speed. Another example of an environment change is a change of the type or length of physical medium 117. Such changes could potentially change factors such as (a) link speed of network 120, (b) signal propagation speed through physical medium 117, and/or (c) length of physical medium 117. In one embodiment, a user could trigger an update of the threshold value by changing some of configuration parameters such as (a) link speed of physical medium 117 and (b) maximum frame size transmitted by network 120. Other changes may trigger re-calculation of the threshold value.
Controller 112 may also perform medium access control (MAC) processing of data in compliance with Ethernet as well as IEEE 802.3x. For example, controller 112 may add the framing bytes (e.g., Ethernet preamble, start-of-frame delimiter and CRC) to Ethernet compliant packets from host system 102.
For example,
Storage device 114 may include a linear bi-directional queue for transferring data and information between interface 108 to physical medium 117 and vice versa. Storage device 114 may store traffic received from link partner 118 as well as traffic received from interface 108. For example, storage device 114 may be implemented as a flash memory device. Controller 112 may utilize direct memory access (DMA) techniques to transfer traffic from storage device 114 to host system 102 and vice versa. Controller 112 may control the location in storage device 114 in which traffic is stored. Controller 112 may monitor the storage capacity of storage device 114.
In one implementation, to provide intercommunication between storage device 114 and physical layer interface 116, interfaces compatible with the following standards may be used: a Gigabit Media Independent Interface (GMII) (described in IEEE 802.3, IEEE 802.3ae, and related standards) or Ten Gigabit Media Independent Interface (XGMII) compatible interface (described for example in IEEE 802.3ae).
Physical layer interface 116 may interface storage device 114 with the physical medium 117. Physical medium 117 may provide intercommunication between physical layer interface 116 and link partner 118. For example, physical medium 117 may be implemented using a 10GBase-LR link or 10GBase-SR link (although other physical links may be used).
Link partner 118 may provide intercommunication between NID 110 and network 120. Link partner 118 may be implemented as a switch or a hub that transfers traffic transmitted in accordance with Ethernet (described in IEEE 802.3 and related standards).
Network 120 may be any network such as the Internet, an intranet, a local area network (LAN), storage area network (SAN), a wide area network (WAN), or wireless network. Network 120 may utilize any communications standards. Network 120 may receive and provide packets encapsulated according to Ethernet as described in versions of IEEE 802.3.
Action 410 may include collecting the relevant host device interface parameters such as bus speed and width of interface 108. Bus speed may be measured in cycles per second (Hz) of interface 108 (hereafter “BS”). Width refers to the amount of bits that can be transmitted through interface 108 in a single cycle (measured in bits) (hereafter “BW”). For example, controller 112 may determine bus speed and width of interface 108.
Action 415 may include determining the appropriate flow control threshold to apply to storage device 114. For example action 415 may determine the threshold using the following relationship:
Flow control threshold=(Total capacity of storage device 114)−(safety margin), where
The amount of bits that might arrive to NID 110 from link partner 118 while controller 112 locally prepares the XOFF frame for transmission may include a sum of: (i) bits that arrive to NID 110 from link partner 118 while controller 112 recognizes capacity of storage device 114 has exceeded a threshold and controller 112 prepares the outgoing XOFF frame; (ii) total bits in any currently-transmitted packets from link partner 118 to NID 110 to be completely received by NID 110; and (iii) standard Ethernet inter-packet gap (IPG) (in bits). An Ethernet device leaves at least an IPG-worth of space between successive transmitted packets. The IPG affects how much packet data can physically be transmitted/received in any fixed period of time. In Ethernet, the IPG is 12 bytes. In one implementation, the amount of bits that might arrive to NID 110 from link partner 118 while controller 112 locally prepares the XOFF frame for transmission may be represented as:
LS*pd+(F*8)+(IPG*8), where
The amount of bits that might arrive to NID 110 from link partner 118 while the XOFF frame is in transit from NID 110 to link partner 118 may include the sum of: (i) bits that arrive to NID 110 from link partner 118 while NID 110 places contents of the XOFF frame on physical medium 117 and (ii) bits that arrive to NID 110 from link partner 118 while the first bit of the XOFF propagates through the physical medium and reaches link partner 118. The amount of bits that might arrive to NID 110 from link partner 118 while the XOFF is in transit from NID 110 to link partner 118 may be represented as:
(xs*8)+(L/PS)*LS, where
The amount of bits that might arrive to NID 110 from link partner 118 while link partner 118 processes the XOFF frame may include bits that arrive to NID 110 during the maximum time allowed for XOFF frame processing, as specified by the IEEE 802.3x specification. The amount of bits that might arrive to NID 110 from link partner 118 while link partner 118 processes the XOFF frame may be represented by:
N*pq, where
The amount of bits that link partner 118 might have transmitted to NID 110 while link partner 118 processes the XOFF frame may include the sum of: (i) bits that arrive to NID 110 while link partner 118 places the contents of its last packet after processing the XOFF frame on physical medium 117 and (ii) bits that arrive to NID 110 from link partner 118 while the first bit of the XOFF frame propagates through physical medium 117 and reaches controller 112. The amount of bits that link partner 118 might have transmitted to NID 110 while link partner 118 processes the XOFF frame may be represented as:
(F*8)+(L/PS)*LS, where
The amount of bits drained from storage device 114 during performance of (a) through (d) may be the product of (i) speed of interface 108; (ii) width of interface 108; and (iii) percent utilization of interface 108. The amount of bits drained from storage device 114 during performance of (a) through (d) may be represented as:
(BS*BW*bu)*(Total Incoming Data/LS), where
Action 420 may include the controller 112 applying the determined flow control threshold.
The drawings and the forgoing description gave examples of the present invention. While a demarcation between operations of elements in examples herein is provided, operations of one element may be performed by one or more other elements. The scope of the present invention, however, is by no means limited by these specific examples. Numerous variations, whether explicitly given in the specification or not, such as differences in structure, dimension, and use of material, are possible. The scope of the invention is at least as broad as given by the following claims.