This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2004-381785, filed on Dec. 28, 2004; the entire contents of which are incorporated herein by reference.
1. Field
The present invention relates to a receiver, a transceiver, a receiving method and a transceiving method, for example, suitable for PCI Express Standard or the like to make high speed transmission possible.
2. Description of the Related Art
Apparatuses adapted to high speed data transmission have been developed in recent years. For example, in a computer system, PCI Express has been standardized as a high speed bus used for data transmission among a CPU, a memory, a graphic controller, a storage device and a peripheral device.
Generally, flow control is performed for ensuring data transmission between a transmitter and a receiver. Flow control is provided for deciding the quantity of data to be transmitted (transmission speed) in order to prevent a receive buffer from overflowing.
For example, JP-A-11-327938 has disclosed a method for dynamically performing flow control. In the method disclosed in JP-A-11-327938, flow control is performed in accordance with each application. That is, dynamic control is performed so that packets which will be received in the future are managed by each application to increase the capacity of the receive buffer allocated to an application protocol of high priority.
In the method disclosed in JP-A-11-327938, it is however necessary to support flow control for each application. Moreover, it is impossible to perform flow control in accordance with each data type such as each packet type, so that the buffer cannot be used efficiently.
On the contrary, in PCI Express Standard, the receive buffer is allocated in accordance with each packet type as described in PCI Express Base Specification 1.0a, PCI-SIG 2.6, Ordering and Receive Buffer Flow Control, pp. 100. In PCI Express Standard, information of capacity of the receive side buffer (receive buffer) allocated in accordance with each packet type (i.e. credit value) is compared with the quantity of transmitted data on the transmit side. That is, information of buffer capacity is first sent from the receive side to the transmit side to thereby initialize flow control on the transmit side. The transmit side judges whether data can be transmitted or not, on the basis of the comparison between the credit value and the quantity of data to be transmitted.
The allocation of the receive buffer in accordance with each packet type, however, may be sometimes inappropriate. That is, there is some case where a relatively small capacity is allocated to a packet type relatively large in the quantity of data to be transmitted while a relatively large capacity is allocated to a packet type relatively small in the quantity of data to be transmitted. In this case, if flow control is performed in accordance with the initial value of the allocated capacity, it may be impossible to transmit data though there is a vacancy in the receive buffer. There is a problem that efficiency in use of the receive buffer is lowered.
The invention provides a receiver, a transceiver, a receiving method and a transceiving method in which the allocation of a receive buffer in accordance with each data type can be changed flexibly to improve efficiency in use of the receive buffer to thereby make data transmission more efficient.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate presently preferred embodiments of the invention, and together with the general description given above and the detailed description of the preferred embodiments given below, serve to explain the principles of the invention.
Embodiments of the invention will be described below in detail with reference to the drawings.
For example, a transmitter 1 and a receiver 11 satisfy PCI Express Standard. The transmitter 1 is equivalent to a root complex in PCI Express Standard while the receiver 11 is equivalent to an end point in PCI Express Standard.
Incidentally,
In architecture of PCI Express, there is provided a hierarchical structure composed of a transaction layer, a data link layer and a physical layer. The transmitter 1 transmits packets (transaction packets: TLPs) in the transaction layer located in the top-most position of the hierarchical structure. TLPs have three packet types, namely, Posted, Non-posted and Completion. Each TLP is formed from arrangement of a header and data. One of the three packet types is set in each of the header and data. That is, TLPs can have six data types.
In PCI Express, independent virtual communication paths called “virtual channels (VCs)” can be set. Independent receive buffers are set in the virtual channels respectively, so that flow control is performed independently.
The transmitter 1 can output TLPs of six data types in accordance with each virtual channel. For example, when the number of virtual channels is 8, the number of data types allowed to be output from the transmitter 1 is 48.
The receiver 11 receives TLPs from the transmitter 1. The receiver 11 has a receive buffer 12. The receive buffer 12 has a region 12a for storing headers included in the received TLPs, and a region 12b for storing data included in the TLPs. The region 12a contains a region PH for storing Posted type headers, a region NPH for storing Non-posted type headers, and a region CplH for storing Completion type headers. The region 12b contains a region PD for storing Posted type data, a region NPD for storing Non-posted type data, and a region CplD for storing Completion type data.
The receiver 11 is configured so that received data are stored in the regions of the receive buffer 12 respectively in accordance with the data types. The data stored in the receive buffer 12 are read out successively by an end point side software.
A buffer control circuit 13 which serves as first and second buffer controllers allocates respective sizes of the regions PH, NPH, CplH, PD, NPD and CplD in the receive buffer 12. That is, the buffer control circuit 13 allocates capacity in accordance with each data type. The capacity allocated in accordance with each data type is managed as the initial value of flow control by the buffer control circuit 13.
The buffer control circuit 13 is provided to transmit the capacity of the region allocated in accordance with each data type as an initial credit value to the transmitter 1. A packet (data link layer packet: DLLP) generated in the data link layer is used for transmission of the credit value.
When data stored in the receive buffer 12 are read out and the region of the receive buffer 12 is opened, the buffer control circuit 13 performs an updating process for increasing the credit value of the opened region by the opened capacity. The buffer control circuit 13 is provided to transmit the updated credit value to the transmitter 1.
The transmitter 1 receives the credit value transmitted by DLLP. The total quantity of data (the sum of consumed credit values) transmitted by the transmitter 1 is stored in a transmit quantity memory 3 of the transmitter 1. A transmit control circuit 2 compares the total quantity of transmitted data with the received credit value to thereby judge whether data is to be transmitted or not. That is, when there is some data to be transmitted to the receiver 11, the transmit control circuit 2 of the transmitter 1 compares the total quantity of already transmitted data with the credit value received from the receiver 11. The transmit control circuit 2 operates so that data to be transmitted is transmitted as TLP to the receiver 11 when the total quantity of transmitted data (the sum of consumed credit values) subtracted from the received credit value is larger than the quantity of data to be transmitted, and that data to be transmitted is not transmitted when the difference between the credit value and the sum of consumed credit values is smaller than the quantity of data to be transmitted.
In this embodiment, the buffer control circuit 13 is provided so that allocation of the receive buffer 12 into regions in accordance with data types can be changed. The hatched portions in
The buffer control circuit 13 calculates statistics for the data type of the received TLP, that is, traffic statistics. The buffer control circuit 13 makes a decision on the basis of the calculated traffic statistics as to whether the capacity of each region of the receive buffer 12 is to be increased or not, and as to the quantity of increase in capacity.
Whenever the capacity allocated to each region of the receive buffer 12 is changed, the buffer control circuit 13 updates the credit value in accordance with the size of the increased region and transmits the updated credit value to the transmitter 1. Incidentally, flow control is not applied to DLLP, so that DLLP can be always transmitted/received.
Next, the operation of the embodiment configured as described above will be described with reference to
At the time of initialization of flow control, the receiver 11 sets the minimum capacity required for data transmission from the transmitter 1 in the receive buffer 12. In this case, if the quantity of transmission in accordance with each data type can be predicted, the buffer control circuit 13 may set the credit value of a specific data type and the reserved region of the receive buffer to be larger than those of other data types in accordance with the prediction. The buffer control circuit 13 transmits the set initial credit value to the transmitter 1 by DLLP (step S1).
Here, assume that the transmitter 1 transmits predetermined TLP. For example, assume that the receiver 11 has a memory, so that the transmitter 1 transmits TLP to be written into the memory. The TLP to be written into the memory is a Posted type packet.
Just after initialization of flow control, there is no data stored in the receive buffer 12, so that the transmitter 1 can transmit TLP. When the transmitter 1 transmits TLP to be written in the memory, the total credit value consumed in the Posted type is increased by the quantity of transmitted data. The total credit value consumed is stored in the transmit quantity memory 3.
On the other hand, upon reception of the TLP from the transmitter 1, the receiver 11 increases the sum of the received Posted type credit values by the quantity of received data. Incidentally, the sum of the received credit values is equal to the sum of the consumed credit values on the transmit side. The sum of the received credit values is used for monitoring overflow etc. of the receive buffer 12. The TLP received in the receiver 11 is stored in the Posted type regions PH and PD in the receive buffer 12.
Moreover, assume that the transmitter 1 transmits TLP to be written in the memory. In this case, the transmit control circuit 2 of the transmitter 1 compares the credit value transmitted from the receiver 11 with the sum of the consumed credit values stored in the transmit quantity memory 3 (step S11). Data is transmitted when the sum of the consumed credit values subtracted from the received credit value is larger than the quantity of data to be transmitted, and data is not transmitted when the sum of the consumed credit values subtracted from the received credit value is smaller than the quantity of data to be transmitted (step S12).
Assuming now that (received credit value−the sum of consumed credit values)>(the quantity of data to be transmitted), then the transmitter 1 transmits the data to the receiver 11 (step S13). The transmit control circuit 2 generates the new sum of consumed credit values by adding the quantity of transmitted data to the sum of consumed credit values stored in the transmit quantity memory 3 (step S14).
On the other hand, the receiver 11 stores the received data in the storage region of a corresponding data type in the receive buffer 12. Here, assume that the data stored in the receive buffer 12 is read out by an end point side application. As a result, the corresponding region of the receive buffer 12 is opened so that data of a data type corresponding to the region can be stored. The buffer control circuit 13 updates the credit value of the corresponding data type by the vacant capacity due to reading when the buffer control circuit 13 makes a decision in the step S2 that the storage region of the receive buffer 12 is opened. The buffer control circuit 13 sends the increased credit value to the transmitter 1 by DLLP (step S3).
Updating the credit value and transmitting the updated credit value are performed whenever the storage region of the receive buffer 12 is opened due to reading of data from the receive buffer 12. Accordingly, the transmitter 1 can grasp the capacity of data allowed to be transmitted.
Here, assume that the receiver 11 increases the allocated capacity of a specific data type. For example, when lots of Posted type data are transmitted from the transmitter 1, the buffer control circuit 13 of the receiver 11 decides whether the capacity of the region PD for storing the Posted type data is to be increased or not (step S5), for example, by referring to traffic statistics of TLP (step S4). When the allocated region is increased, the buffer control circuit 13 updates the credit value by the increased capacity and sends the updated credit value to the transmitter 1 (step S6). Incidentally, the updated credit value may be sent at the same time when the credit value is updated in accordance with opening of the storage region of the receive buffer 12. That is, in this case, the credit value obtained by adding (a credit value corresponding to the opened storage region+a credit value corresponding to increase in allocation of the receive buffer) to the initial credit value is sent.
After that, the transmitter 1 can accordingly transmit a sufficient quantity of data to the receiver 11 with respect to the Posted type data. Similarly, the buffer control circuit 13 can increase the region (credit value) allocated to each data type as long as the capacity of the receive buffer 12 permits. Accordingly, for example, even in the case where the initial credit value in accordance with each data type cannot satisfy the quantity of data to be actually transmitted in accordance with each data type, the allocation in accordance with each data type can be changed dynamically to improve efficiency in use of the receive buffer 12.
As described above, in this embodiment, because the allocation of capacity of the receive buffer in accordance with each data type can be changed dynamically, efficiency in use of the receive buffer can be improved to attain higher data transmission speed.
For example, a small capacity is allocated to the receive buffer for each data type in advance so that a new capacity is reserved in the receive buffer on the basis of statistics of traffic actually flowing as TLP to thereby change the receive buffer dynamically. As a result, improvement in efficiency in use of the receive buffer can be attained to contribute to improvement in throughput. Incidentally, this embodiment can be achieved in the range of PCI Express Standard.
Although this embodiment has been described on the case where the transmitter 1 is equivalent to a root complex in PCI Express Standard while the receiver 11 is equivalent to an end point in PCI Express Standard, the root complex and the end point used actually can transmit data to each other and receive data from each other and have the same configuration as the transmitter 1 and the receiver 11.
This embodiment is different from the first embodiment in that a receiver 21 having a buffer control circuit 23 as first to third buffer controllers instead of the buffer control circuit 13 is used in this embodiment.
In PCI Express Standard, the initial credit value once set cannot be reduced because of its specification limit. Therefore, in this embodiment, the allocated capacity for a data type corresponding to the opened region can be reduced equivalently in such a manner that the credit value is not updated when the storage region of the receive buffer 12 is opened.
That is, the buffer control circuit 23 does not update the credit value for a data type as a subject of reduction of the allocated capacity even in the case where a corresponding region of the receive buffer 12 is opened due to reading of data stored in the receive buffer 12. Or the buffer control circuit 23 sets the credit value of the opened storage region for a data type as a subject of reduction of the allocated capacity to be zero or a capacity smaller than the opened capacity regardless of the opened capacity when the corresponding region of the receive buffer 12 is opened.
Incidentally, the process for increasing the allocated capacity of the receive buffer is the same as that in the first embodiment.
The other configuration is the same as in the first embodiment.
Next, the operation of the embodiment configured as described above will be described with reference to
Assume now that in step S2 shown in
As a result, in this case, the quantity of data allowed to be transmitted by the transmitter 1 is increased with respect to data of a data type corresponding to the opened region.
On the other hand, when the opened region corresponds to the data type allowed to reduce the allocated capacity, in step S13, the buffer control circuit 23 updates the credit value by adding a credit value smaller than the opened storage region's value or does not update the credit value by regarding the storage region as being unopened.
As a result, in this case, the quantity of data allowed to be transmitted does not change though the data is of a data type corresponding to the opened region. Moreover, because the region is opened, the opened region can be allocated to a region of another data type when the same buffer control as in the first embodiment is performed. Accordingly, the receive buffer 12 can be used more effectively.
In the example shown in
This embodiment is different from the second embodiment in that a receiver 31 having a buffer control circuit 33 instead of the buffer control circuit 23 is used in this embodiment.
In PCI Express Standard, it is possible to transmit TLPs having no influence on components (hereinafter referred to as “dummy TLPs”). The transmitter 1 can transmit such dummy TLPs to the receiver 31. The receiver 31 does not store the received dummy TLPs in the receive buffer 12 though the receiver 31 receives the dummy TLP.
That is, the buffer control circuit 33 of the receiver 31 does not increase the credit value of a corresponding data type even in the case where the region of the receive buffer 12 in which the dummy TLPs should be stored is actually opened. That is, in the transmitter 1 transmitting the dummy TLPs, the quantity of transmittable data with respect to the same data type as that of the dummy TLPs is reduced by the capacity of the dummy TLPs.
In this embodiment, to output the dummy TLPs from the transmitter 1, the buffer control circuit 33 of the receiver 31 transmits an instruction to the transmitter 1 so that the dummy TLPs corresponding to the data type as a subject of reduction of the allocated capacity of the receive buffer can be forcedly transmitted from the transmitter 1.
For example, this instruction is Vendor Specific DLLP. Information such as data type as a subject of reduction of the allocated capacity, header/data, VC and the quantity of reduction is stored in the DLLP. On the other hand, the transmitter 1 transmits TLPs of the data type as a subject of reduction of the allocated capacity of the receive buffer to the receiver 31 on the basis of the information of the Vendor Specific DLLP given from the receiver 31.
Incidentally, the process for increasing the allocated capacity of the receive buffer is the same as that in the first embodiment.
Next, the operation of the embodiment configured as described above will be described with reference to
In step S11 shown in
Upon reception of the Vendor Specific DLLP, the transmitter 1 transmits dummy TLPs of the corresponding data type (step S24). As a result, with respect to the data type of the dummy TLPs, the consumed total credit value stored in the transmit quantity memory 3 is increased by the quantity of data of the dummy TLPs.
On the other hand, upon reception of the dummy TLPs, the buffer control circuit 33 of the receiver 31 does not update the credit value with respect to the data type of the dummy TLPs (step S25). That is, the total credit value consumed in the transmitter 1 is increased by the quantity of data of the dummy TLPs, whereas the credit value does not change though the receive buffer 12 is opened. Accordingly, the quantity of data which can be transmitted from the transmitter 1 is reduced equivalently with respect to data of the same data type as that of the dummy TLPs.
Incidentally, the buffer control circuit 33 may transmit the updated credit value by adding a capacity smaller than the quantity of data of the dummy TLPs to the credit value. Also in this case, with respect to data of the same data type as that of the dummy TLPs, the quantity of data which can be transmitted from the transmitter 1 is reduced.
Moreover, because the region is opened, the opened region can be allocated to a region of another data type when the same buffer control as in the first embodiment is performed. Accordingly, the receive buffer 12 can be used more effectively.
In the example shown in
Incidentally, because the dummy TLPs must not be TLPs having influence on components, for example, it is preferable that Vendor Defined Message is used in the case of Posted credit. It is preferable that Memory Read Request or the like for an address region as having no influence is used in the case of Non-Posted credit.
In the example shown in
In PCI Express Standard, in the case of Completion credit, Completion type data without any request is not permitted. Therefore, in this case, the receiver 31 issues a specific Non-Posted type request to the transmitter 1 to generate Completion to thereby achieve reduction in allocated capacity actively. When a specific TLP such as a Non-Posted type request transmitted as dummy data is transmitted, it is preferable that the TLP is distinguished from other TLPs flowing in general traffic so as to be left out of consideration of traffic statistics of TLPs.
Incidentally, in each of the aforementioned embodiments, increase/reduction in allocated capacity of the receive buffer in accordance with each data type is performed on the basis of traffic statistics of transmitted TLPs. FIGS. 8 to 10 are tables for explaining the method for increasing/reducing the allocated capacity of the receive buffer on the basis of such traffic statistics.
Traffic statistics can be calculated from a receive history recorded in the receiver.
The buffer control circuit in the receiver decides increase/reduction in allocated capacity of the receive buffer 12 in accordance with each data type on the basis of the result of
Incidentally, the buffer control circuit need not allocate capacity in proportion to the capacity ratio. The buffer control circuit may perform increase/reduction in buffer allocation actually while comparing the calculated receive buffer capacity ratio with the current buffer allocation.
Incidentally, because the receiver manages the receive buffer of TLPs, it is efficient to take statistics about TLPs received in the receiver.
As described above, because the allocated capacity of the receive buffer in accordance with each data type is updated in accordance with the trend of actual TLP traffic in any one of the aforementioned embodiments, efficiency in use of the receive buffer can be improved to enlarge throughput.
Therefore, in this embodiment, the transmitter 1 gives an instruction such as Vendor Specific DLLP to the receiver to exclude the influence of the credit value so that the allocated capacity of the receive buffer can be forcedly changed.
This embodiment is different from
Incidentally, the ordinary process for increasing the allocated capacity of the receive buffer 12 on the basis of traffic statistics and the process of reducing the allocated capacity of the receive buffer 12 are the same as those in the third embodiment.
Next, the operation of the embodiment configured as described above will be described with reference to
Assume now that the transmitter 41 cannot transmit TLPs of Completion type data because of shortage of credit. In this case, the process goes from step S30 to step S31 in
The buffer control circuit 52 of the receiver 51 preferentially increases the allocated capacity of the region CplD for storing Completion type data in accordance with the received receive buffer reserve request. At the same time, the buffer control circuit 52 transmits Vendor Specific DLLP as a buffer reduction request of the Posted type data storage region to the transmitter 41 so that the allocation of the Posted type data storage region currently low in frequency in use can be changed to the allocation of the region CplD (step S32).
The transmitter 41 transmits Vendor Defined Message as a dummy Posted message to the receiver 51 in accordance with the buffer reduction request (step S34). As a result, the buffer control circuit 52 of the receiver 51 reduces the Posted type data storage region (step S25).
As described above, in this embodiment, the allocation of the receive buffer for the data type short of credit can be forcedly increased from the transmitter side, so that the problem in disabled transmission of a specific TLP can be avoided. As a result, transaction latency of TLPs can be shortened to achieve efficient transmission.
A root complex (RC) 62 equivalent to the transmitter according to any one of the aforementioned embodiments is formed as an IC chip mounted on a main board 61. A processor 63 provided as an IC, a memory controller 64, an I/O controller 65, etc. are disposed near the RC 62 and connected by a parallel or serial bus 66.
A port (not shown) of the RC 62 is connected to a slot 67 via a transmission path 68. An end point device 71 is connected to the slot 67. An end point (EP) 72 equivalent to the receiver according to any one of the aforementioned embodiments is mounted on the end point device 71. For example, when the end point device 71 is a graphic device, a graphic controller 73 and a graphic memory 74 are further mounted as well as the EP 72. Data transmission between the processor 63 and the graphic controller 73 is performed speedily and efficiently by the RC 62 and the EP 72.
In this embodiment, the hierarchical structure of from a mechanical layer and a physical layer as lower layers to an interface of applications as an upper layer is used like the hierarchical structure of PCI Express. Like mounting of a general system, software is often used for mounting the upper layer while hardware is often used for mounting the lower layer. As shown in
As shown in
Number | Date | Country | Kind |
---|---|---|---|
P2004-381785 | Dec 2004 | JP | national |