1. Field of the Invention
The present invention relates to a data relaying apparatus and method for relaying data between data buses.
2. Description of the Related Art
In a server or personal computer for example, data may be transmitted/received between two buses having specifications different from each other.
As depicted in
In contrast, as depicted in
The present invention has been made in view of the above problems and it is therefore an object of the present invention to provide a data relaying apparatus and method capable of relaying data in a highly efficient manner even in a communication form in which an apparatus on the read request side receives data corresponding to a read request before issuing a read request for subsequent data.
According to a first aspect of the present invention there is provided a data relaying apparatus having a relaying part that acquires data stored in a storage apparatus via a second data bus in response to a data read request arriving from a data processing apparatus via a first data bus to relay the data to the data processing apparatus via the first data bus, comprising a temporary storage part that acquires data of a predetermined read-ahead size from the storage apparatus from a top address indicated by the data read request to temporarily store the data as temporary storage data, wherein each time a subsequent data read request is made, the relaying part reads out data of a transmission data size corresponding to a type of the subsequent data read request sequentially from a top position of the temporary storage data to relay the data to the data processing apparatus.
According to a second aspect of the present invention there is provided a data relaying method having a relaying step of acquiring data stored in a storage apparatus via a second data bus in response to a data read request arriving from a data processing apparatus via a first data bus to relay the data to the data processing apparatus via the first data bus, comprising a temporary storage step of acquiring data of a predetermined read-ahead size from the storage apparatus from a top address indicated by the data read request to temporarily store the data as temporary storage data, wherein at the relaying step, each time a data request is made, data of a transmission data size corresponding to a type of the data request is relayed sequentially from a top position of the temporary storage data to the data processing apparatus.
According to a data relaying apparatus and method of the present invention, data may be relayed in a highly efficient manner even in a communication form including an apparatus on the read request side that receives data corresponding to a read request before issuing a read request for subsequent data.
Embodiments according to the present invention will now be described in detail with reference to the accompanying drawings.
The data relaying apparatus 10 is a relaying apparatus such as a hub that relays data transmitted/received between a CPU 20 and a memory (storage apparatus) 40 via a local bus (first data bus) 30 and a PCI-Express bus (second data bus) 50. The data relaying apparatus 10 relays data via the local bus 30 to/from the CPU 20 and relays data via the PCI-Express bus 50 to/from the memory 40. When transmitting data from the local bus 30 to the PCI-Express bus 50, the data relaying apparatus 10 converts the data from the local bus 30 into a packet and transmits the packet to the PCI-Express bus 50. The data relaying apparatus 10 includes a relaying part 11 and a temporary storage part 12.
The relaying part 11 relays data transmitted/received between the CPU 20 and the memory (storage apparatus) 40 and is made up of a microprocessor, for example. The temporary storage part 12 is a memory such as a RAM that temporarily stores read data acquired by the relaying part 11 from the memory 40 via the PCI-Express bus 50.
Specifically, when receiving a data write request (hereinafter, simply, a write request), a data read request (hereinafter, simply, a read request), or write data via the local bus 30 from the CPU 20, the relaying part 11 converts the request or data into a packet and transmits the packet through the PCI-Express bus 50 to the memory 40. When receiving read data via the PCI-Express bus 50 from the memory 40, the relaying part 11 temporarily stores the data into the temporary storage part 12 and subsequently takes out and transmits the data via the local bus 30 to the CPU 20.
The CPU 20 is a data processing apparatus that acquires data from the memory 40 to perform an arithmetic process etc., and that executes a data process such as storing the data acquired by performing the arithmetic process etc., into the memory 40. The CPU 20 is connected to the local bus 30. The CPU 20 issues a write request and a read request in accordance with the progress of a data process. For example, if the local bus 30 is AHB (advanced high-performance bus), the CPU 20 issues a write or read request command of any one type of SINGLE (4 bytes), INC4 (16 bytes), INC8 (32 bytes), and INC16 (64 bytes).
The memory 40 is a storage medium such as a hard disc that stores data from the CPU 20 and other various data. The memory 40 is connected to the PCI-Express bus 50.
When receiving a read request from the CPU 20, the relaying part 11 determines whether read data corresponding to the read request is stored in the temporary storage part 12 (step S101).
If the relaying part 11 refers to the temporary storage part 12 and determines that the corresponding read data is not stored in the temporary storage part 12, the relaying part 11 transmits a read request to the memory 40 (step S102). Specifically, the relaying part 11 transmits to the memory 40 a read request indicating that data of a predetermined read ahead data size should be read out from a top address indicated by the read request from the CPU 20. The read ahead data size is a data size, for example, 256 bytes, and is set in advance in the relaying part 11. For example, if the top address indicated by the read request is 0000, the relaying part 11 transmits to the memory 40 a read request for data of a data size of 256 bytes from the address 0000. The read request is transmitted through a packet signal. In this way, the relaying part 11 converts the read request from the CPU 20 into a packet and transmits the packet to the memory 40.
After transmitting a read request, the relaying part 11 waits for the arrival of the read data corresponding to the read request from the memory 40 (S103). When receiving the read data from the memory 40, the relaying part 11 stores the read data into the temporary storage part 12 (S104). The relaying part 11 receives the read data through a packet signal. The data stored in the temporary storage part 12 and corresponding to the read request will hereinafter be referred to as temporary storage data.
The relaying part 11 then reads out data of a transmission data size corresponding to a type of the read request from the top position of the temporary storage data stored in the temporary storage part 12 (S105). For example, if the local bus 30 is AHB and the type of the read request is INC16 (64 bytes), the relaying part 11 reads data of 64 bytes from the top position of the temporary storage data.
If the relaying part 11 determines that the corresponding read data is stored in the temporary storage part 12 at step S101, the routine directly goes to the process of step S105 to execute the same process as described above.
The relaying part 11 transmits the data read out from the temporary storage part 12 via the local bus 30 to the CPU 20 (S106). The relaying part 11 executes the read relaying process routine each time a read request is made.
First, the CPU 20 transmits a read request (“REQUEST” of
The data relaying apparatus 10 refers to the temporary storage part 12 to determine whether the read data corresponding to the read request is stored in the temporary storage part 12 (step S101 of
When receiving the read data of the data size of 256 bytes corresponding to the read request from the memory 40, the data relaying apparatus 10 stores the read data into the temporary storage part 12 as the temporary storage data (step S104 of
The data relaying apparatus 10 reads out data of the transmission data size of 64 bytes corresponding to the read request type INC16 from the top position of the temporary storage data stored in the temporary storage part 12 (S105 of
The CPU 20 subsequently transmits a subsequent read request of INC16 (64 bytes) to the data relaying apparatus 10 (S221). The data relaying apparatus 10 receives the read request via the local bus 30 (S222). Since the data relaying apparatus 10 has acquired the 256-byte read data at step 213 and has transmitted the 64-byte read data thereof, the temporary storage data of the data size of 192 bytes is stored in the temporary storage part 12 at this point.
If the data relaying apparatus 10 refers to the temporary storage part 12 and determines that the read data corresponding to the read request is stored in the temporary storage part 12, the data relaying apparatus 10 reads data of the transmission data size of 64 bytes corresponding to the read request type INC16 from the top position of the temporary storage data stored in the temporary storage part 12 and transmits the data to the CPU 20 (S223). The CPU 20 receives the read data of the data size of 64 bytes (S224). Therefore, in the read process 2 (S221 to S224), unlike the read process 1 (S211 to S214), the data relaying apparatus 10 transmits the read data to the CPU 20 without transmitting a read request to the memory 40.
If the CPU 20 subsequently transmits a subsequent read request of INC16 (64 bytes) to the data relaying apparatus 10, the data relaying apparatus 10 executes the same process as described above (a read process 3 (S231 to S234), a read process 4 (S241 to S244)). In this way, the data relaying apparatus 10 can transmit continuous data of the read ahead data size of 256 bytes to the CPU 20 without accessing the memory 40.
As described above, when receiving a read request from the CPU 20, the data relaying apparatus 10 of this embodiment acquires data of a predetermined read-ahead size from the memory 40 from the top address indicated by the read request. The data relaying apparatus 10 stores the data into the temporary storage part 12 as the temporary storage data, reads out data of a data size corresponding to a read request from the top position of the temporary storage data each time the CPU 20 makes a read request, and relays the data to the CPU 20.
With this configuration, when the CPU 20 makes a read request for continuous read data for the second time or later, the data relaying apparatus 10 can transmit the read data corresponding to the read request to the CPU 20 without transmitting a read request to the memory 40. For example, assuming that a read data size of one read process in the conventional example depicted in
Therefore, the data relaying apparatus 10 of this embodiment can considerably improve a data read process speed as compared to a conventional case and relay data in a highly efficient manner even in the communication form including the apparatus on the read request side (the data relaying apparatus 10) that receives data corresponding to a read request before issuing a read request for subsequent data.
The data relaying apparatus 10 of this embodiment further includes a read-ahead size setting part 13. The read-ahead size setting part 13 sets a read-ahead size based on a type of a read request from the CPU 20 and is made up of a microprocessor, for example.
The read-ahead size setting part 13 determines whether a type of a read request received by the relaying part 11 is INC16 (64 bytes) (step S301). INC16 is a command for requesting the maximum data size among data sizes that may be requested for write/read in AHB and is issued from the CPU 20 when 64-byte or more data is read out.
If determining that the type of the read request is INC16 (64 bytes), the read-ahead size setting part 13 sets the read-ahead size to a read-ahead maximum size (step S302). The read-ahead maximum size is the maximum data size to be set as the read-ahead size and is set to, for example, 256 bytes in advance in the read-ahead size setting part 13 if it is known that 256-byte data is frequently relayed, for example.
If determining that the type of the read request is not INC16 (64 bytes), i.e., the type is any one of SINGLE (4 bytes), INC4 (16 bytes), and INC8 (32 bytes), the read-ahead size setting part 13 sets the read-ahead size based on a request dependent size (step S303). The request dependent size is a size corresponding to a read ahead request, i.e., a data size of 4 bytes in the case of SINGLE, 16 bytes in the case of INC4, or 32 bytes in the case of INC8. The read-ahead size setting part 13 sets the read-ahead size to a data size acquired by, for example, doubling the request dependent size, i.e., 8 bytes in the case of SINGLE, 32 bytes in the case of INC4, or 64 bytes in the case of INC8. For example, since INC8 is a request issued when data of a size of 32 to 64 bytes is read out, it is sufficient to preliminarily read the data of a size of 64 bytes, i.e., the double of 32 bytes and, therefore, a size twice as large as the request dependent size is set as the read-ahead size.
The CPU 20 transmits a read request of INC16 (64 bytes) (step S411) and the relaying part 11 of the data relaying apparatus 10 receives the read request. The read-ahead size setting part 13 determines that the read request is INC16, sets the read-ahead size to the read-ahead maximum size of 256 bytes, and transmits a read request to the memory 40 (S412).
The memory 40 reads out data of 256 bytes from the top address indicated by the read request and transmits the data to the data relaying apparatus 10. The relaying part 11 receives the read data of 256 bytes and the temporary storage part 12 temporarily stores the data as the temporary storage data (S413). The relaying part 11 transmits data of 64 bytes from the top of the temporary storage data stored in the temporary storage part 12 to the CPU 20 and the CPU 20 receives the data (S414).
The relaying part 11 sequentially transmits data of 64 bytes from the top of the temporary storage data stored in the temporary storage part 12 to the CPU 20 in response to a subsequent read request of INC 16 transmitted from the CPU 20 (S414 to S416).
As described above, if a read request of INC16 (64 bytes) is received from the CPU 20, data of the read-ahead maximum size of 256 bytes is acquired from the memory 40 and temporarily stored in the temporary storage part 12 and, therefore, it is not necessary to make a read request to the memory 40 for each subsequent read request from the CPU 20 and the data read time can be shortened.
The CPU 20 transmits a read request of INC8 (32 bytes) (step S421) and the relaying part 11 of the data relaying apparatus 10 receives the read request. The read-ahead size setting part 13 determines that the read request is INC16, sets the read-ahead size to 64 bytes twice as large as 32 bytes of the request dependent size, and transmits a read request to the memory 40 (S422).
The memory 40 reads out data of 64 bytes from the top address indicated by the read request and transmits the data to the data relaying apparatus 10. The relaying part 11 receives the read data of 64 bytes and the temporary storage part 12 temporarily stores the data as the temporary storage data (S423). The relaying part 11 transmits data of 32 bytes from the top of the temporary storage data stored in the temporary storage part 12 to the CPU 20 and the CPU 20 receives the data (S424).
The relaying part 11 sequentially transmits data of 16 bytes, 8 bytes, and 4 bytes from the top of the temporary storage data stored in the temporary storage part 12 to the CPU 20 in response to subsequent read requests of INC4 etc., transmitted from the CPU 20 (S424 to S426).
As described above, if a read request of INC8 (32 bytes) is received from the CPU 20, data of 64 bytes twice as large as 32 bytes of the request dependent size is acquired from the memory 40 and temporarily stored in the temporary storage part 12 and, therefore, it is not necessary to make a read request to the memory 40 for each subsequent read request from the CPU 20 and a data acquisition time (indicated by a dotted line) from the memory 40 can be reduced to shorten the data read time.
As described above, the data relaying apparatus 10 of this embodiment further includes the read-ahead size setting part 13 that sets the read-ahead size based on a type of a read request from the CPU 20. Since data of an appropriate size can be acquired from the memory 40 through the process by the read-ahead size setting part 13 described above, the data read time can be shortened.
In this case, the CPU 20 transmits INC16, which is a command for requesting 64 bytes, i.e., the maximum data size among data sizes that may be requested for read in AHB, to the data relaying apparatus 10 a total of eight times (steps S511, S521, . . . , S581). In response to a first read request (S511), the data relaying apparatus 10 first transmits a read request for data of the read maximum size of 256 bytes to the memory 40 (step S512). The data relaying apparatus 10 temporarily stores the 256-byte read data from the memory 40 as the temporary storage data into the temporary storage part 12 and transmits data of 64 bytes from the top of the temporary storage data to the CPU 20 (S513). In response to second to fourth read requests (S521, S531, S541), the data relaying apparatus 10 sequentially transmits data of 64 bytes from the top of the temporary storage data to the CPU 20 (S522, S532, S542). All the temporary storage data stored in the temporary storage part 12 are transmitted through these transmissions.
In response to a fifth read request (S551), the data relaying apparatus 10 transmits a read request for data of the read maximum size of 256 bytes to the memory 40 (step S552). The data relaying apparatus 10 temporarily stores the 256-byte data from the memory 40 as the temporary storage data into the temporary storage part 12 and transmits data of 64 bytes from the top of the temporary storage data to the CPU 20 (S553). In response to sixth to eighth read requests (S561, S571, S581), the data relaying apparatus 10 sequentially transmits data of 64 bytes from the top of the temporary storage data to the CPU 20 (S562, S572, S582).
With this data relaying process, the read time can considerably be shortened in the case of relaying 512-byte data. Assuming that the CPU 20 requires a time period of 1dt after transmitting the first read request to receive the read data corresponding to the request, a time required for the CPU 20 to acquire the 512-byte data is on the order of 2dt.
In this case, the CPU 20 transmits INC16, which is a command for requesting 64 bytes, i.e., the maximum data size among data sizes that may be requested for read in AHB, to the data relaying apparatus 10 a total of eight times (steps S611, S621, . . . , S681). In response to a first read request (S611), the data relaying apparatus 10 first transmits a read request for data of the read maximum size of 512 bytes to the memory 40 (step S612). The data relaying apparatus 10 temporarily stores the 512-byte read data from the memory 40 as the temporary storage data into the temporary storage part 12 and transmits data of 64 bytes from the top of the temporary storage data to the CPU 20 (S613). In response to second to eighth read requests (S621, S631, . . . , S681), the data relaying apparatus 10 sequentially transmits data of 64 bytes from the top of the temporary storage data to the CPU 20 (S622, S632, . . . , S682).
As described above, when the read-ahead maximum size is set to 512 bytes, a time required for the CPU 20 to acquire the 512-byte data is on the order of 1dt. As compared to the case that the read-ahead maximum size is set to 256 bytes, the read time can further be shortened by about 1dt.
The read-ahead size setting part 13 of this embodiment sets the read-ahead maximum size based on a type of a communication protocol. The PCI-Express bus 50 is connected to an Ethernet driver (transmitting part) 60 that transmits data in the memory 40. Ethernet is a registered trademark. A protocol analyzing part 61 performs the Ethernet protocol analysis of data transmitted by the Ethernet driver 60 to determine the type of the communication protocol. The protocol analyzing part 61 may perform the protocol analysis each time the Ethernet driver 60 transmits data or may perform the protocol analysis every few times of data transmissions. Types of communication protocols include FTP (File Transfer Protocol) and RTP (Real-time Transport Protocol), for example. The communication protocol type information acquired from the analysis by the protocol analyzing part 61 is transmitted by the Ethernet driver 60 via the PCI-Express bus 50 to the data relaying apparatus 10.
The read-ahead size setting part 13 receives the communication protocol type information from the Ethernet driver 60 via the PCI-Express bus 50 and sets the read-ahead maximum size depending on the type.
The communication protocol FTP is mainly used for data uploading/downloading applications for an apparatus such as a server (not depicted). Therefore, a data size of a communication object is relatively large and, for example, the read-ahead maximum size is set to a relatively large size such as 512 bytes in the case of FTP. The communication protocol RTP is mainly used for transmission/reception of audio data of VoIP (Voice over Internet Protocol). Therefore, a data size of a communication object is relatively small and, for example, the read-ahead maximum size is set to a relatively small size such as 128 bytes in the case of RTP.
When receiving the communication protocol type information from the Ethernet driver 60 via the PCI-Express bus 50 (step S701), the read-ahead size setting part 13 acquires a data size (protocol dependent size) corresponding to a protocol type indicated by the type information from the size correlation table (S702). For example, if the protocol type is FTP, the protocol dependent size of 512 bytes is acquired from the size correlation table (
When the relaying part 11 of the data relaying apparatus 10 receives the protocol type information from the Ethernet driver 60 (step S811), the read-ahead size setting part 13 sets the read maximum size (S812). If the protocol type information indicates, for example, FTP, the read-ahead size setting part 13 refers to the size correlation table (
The CPU 20 subsequently transmits a read request of a read data size of 512 bytes to the data relaying apparatus 10 (S813). When the read request is received, the relaying part 11 transmits a read request of the read maximum size of 512 bytes to the memory 40 (S814). The relaying part 11 receives the read data of 512 bytes from the memory 40, temporarily stores the data as the temporary storage data into the temporary storage part 12, and transmits the data of 512 bytes from the top of the temporary storage data (i.e., all the data) to the CPU 20 (S815).
By predicting a data size of a read request based on a protocol type and setting the size as the read-ahead maximum size as described above, the data relaying apparatus 10 can transmit a read request to the memory 40 only once to acquire all the read request data. Although a read request for 128 bytes is transmitted four times to the memory 40 to acquire data of 512 bytes in the conventional case, the data relaying apparatus 10 of this embodiment needs to transmit a read request only once to the memory 40 and thus can considerably shorten the time of reading data from the memory 40.
When the relaying part 11 of the data relaying apparatus 10 receives the protocol type information from the Ethernet driver 60 (step S821), the read-ahead size setting part 13 sets the read maximum size (S822). If the protocol type information indicates, for example, RTP, the read-ahead size setting part 13 refers to the size correlation table (
The CPU 20 subsequently transmits a read request of a read data size of 128 bytes to the data relaying apparatus 10 (S823). When the read request is received, the relaying part 11 transmits a read request of the read maximum size of 128 bytes to the memory 40 (S824). The relaying part 11 receives the read data of 128 bytes from the memory 40, temporarily stores the data as the temporary storage data into the temporary storage part 12, and transmits the data of 128 bytes from the top of the temporary storage data (i.e., all the data) to the CPU 20 (S825).
As described above, the data relaying apparatus 10 requests a read data of an appropriate size to the memory 40. Although a read request for 512 bytes is transmitted to the memory 40 in the conventional case, since the data relaying apparatus 10 of this embodiment transmits a read request for 128 bytes to the memory 40, the read data amount is reduced and the time of reading data from the memory 40 can considerably be shortened.
This embodiment is an example of the case that the protocol analyzing part is disposed on the outside of the data relaying apparatus 10, the protocol analyzing part may be disposed inside the data relaying apparatus 10. The protocol analyzing part 61 may have the size correspondence table (
Although the first to third embodiments are examples of the case that the second data bus is a PCI-Express bus, the data relaying apparatus of the present invention is applicable to the communication form that an apparatus on the read request side receives data corresponding to a read request before issuing a read request for subsequent data.
This application is based on Japanese Patent Application No. 2010-046704 which is herein incorporated by reference.
Number | Date | Country | Kind |
---|---|---|---|
2010-046704 | Mar 2010 | JP | national |