Abstract:
An apparatus and method for passing messages through a bus-to-bus bridge while maintaining ordering. The method comprises passing messages into a message container in the bus bridge without using the bridge buffer, setting a flag that tracks all the writes in the write queue ahead of when the message was put into the message container, blocking the receiving device on the bus connected to the bridge from accessing the message container until the flag is cleared, and clearing the flag when all the writes put into the write queue ahead of when the flag was set have been written to local memory on the receiving bus, then allowing the device on the receiving bus that is the intended recipient to receive the message.

Description:
BACKGROUND 
     In distributed microprocessing systems, typically each processor and the devices associated with that processor are connected to a bus. Multiple processors and devices can be connected to a single bus. Processors and devices can transmit information across the bus. In many systems today, to allow more total devices, multiple busses are connected by bus bridges that allow devices on one bus to access devices on another bus. Some bus bridges are unidirectional, meaning information can only flow in one direction, while other bus bridges are bi-directional, meaning information can flow in both directions. A bus bridge will forward read or write transaction requests that originate on one bus to another bus in the system. Typically, the first device to request access to the bus is granted access to the bus for a predetermined period of time. Most bridges use some form of “round-robin” rules to control traffic on the bus, wherein the most recent device that has been granted access to the bridge to transmit information will become last in line to gain access again, and the least recent device that has a request pending will be the next to be granted access to the bridge. This logic is designed to ensure that each device has equal access to the bus. 
     Bus to bus bridges forward standard transactions like memory reads, memory writes, I/O reads and I/O writes from a device connected to one bus on the bridge to a device on another bus on the bridge. Some bridges also forward a type of transaction called a “message”. The act of forwarding a message from one side of the bridge to the other is called “message passing”. Messages are typically stored in a message container inside the bridge. When a message is being forwarded across a bridge, it typically generates an interrupt to let the CPU on the receiving end know that the message has arrived. The receiving CPU typically clears the interrupt by zeroing out some or all of the message after the message has been read. In some systems, the receiving CPU will send a message to the sending CPU to indicate that the message has been received. In a system in which the receiving CPU does not send such a message, the sending CPU will typically poll the message container to determine if the message has been zeroed out so it can determine when the message has been received. 
     Messages are typically sent for the purpose of informing a receiving CPU that a certain block of data has been read or written to memory. In order to minimize latency in the system, bridges typically “post” writes in the bridge. This means that the bridge accepts write data into the bridge to the extent of its buffering capability, thus completing the write transaction on the sending bus as soon as possible. The bridge then begins to write the data in its buffers onto the local memory of the appropriate receiving bus. However, the amount of time this can take may vary because the bridge may not gain ownership of the receiving bus right away, and because the receiving bus may force the bridge to break up the write into multiple transactions which themselves may be interleaved with transactions of other devices. The consequence of this is that the write transaction is complete on the sending bus for an indeterminate amount of time before it is actually completed on the receiving bus. Therefore, if the sending CPU sends a message that it has completed a write function, some portions of the write transaction may still be in the bus bridge waiting to complete the entire write transaction. This could cause incorrect data to be received if the message that the write transaction was completed is received by the receiving CPU before all the blocks of the write transaction are received into memory on the bus on the destination side of the bridge. To overcome this problem, the messages must follow the same set of ordering rules that are followed by normal write transactions being sent across the bridge. 
     One solution to this problem has been to put the messages themselves in the same queue as the transactions. A bridge typically has one or more write buffers that receive write blocks. Each buffer can accommodate a block of the size that can be managed easily by the bridge. If a message is put into the write queue with the write transaction, after the last block of the write data, then the message will be placed into the queue behind the transaction, and into a subsequent write buffer. This ensures the message will not be sent until the last block of the write is sent. When the message gets to the top of the queue, it is put into the message container, rather than being written into the destination bus memory, and the interrupt is generated. However, even if a particular block of data is smaller than the buffer size, it is typically put into a buffer by itself, and no additional data is put into that particular buffer. This is because managing transactions of varying sizes in a buffer is difficult for a bridge, and so bridges are usually not configured that way. A message is typically of a small size. By putting a message into the write queue, it will occupy an entire buffer that could be used for subsequent write transactions, instead. This reduces system performance. 
     Accordingly, a continuing search has been directed to the development of systems and methods which can send a message to the message container without having to utilize the write queue, while still maintaining ordering of the data in the write queue and the subsequent message. 
     SUMMARY 
     The present invention, accordingly, provides a system and method that involves putting the message directly into the message container without having to utilize the write queue, and ensuring the message is sent in order by setting a flag in the bridge logic that keeps track of which buffers in the queue were pending when the message was received, and not sending the message until all those buffers have been emptied. 
     The invention comprises a method and apparatus for delivering an incoming message in a system comprising a bus bridge and at least two buses connected to the bus bridge. A message from a device on a first bus on the bus bridge is transmitted into a message container on the bus bridge. The bus bridge tracks all data write functions in buffers on the bus bridge when the message is received in the message container. The system sets a flag that blocks generation of an interrupt indicating to a receiving device on a second bus on the bus bridge that the message is in the message container. The flag being set also prevents the receiving device on the second bus from accessing the message in the message container. When all data write functions in the bus bridge buffer being tracked have been written, the system sends a signal that clears the flag so the receiving device on the second bus can read the message in the message container. 
     The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention. It should be appreciated by those skilled in the art that the conception and the specific embodiment disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present invention. It should also be realized by those skilled in the art that such equivalent constructions do not depart from the spirit and scope of the invention as set forth in the appended claims. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     For a more complete understanding of the present invention, and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which: 
     FIG. 1 is a high-level conceptual block diagram of a microprocessor system through which messages could be passed; 
     FIG. 2 is a high-level conceptual block diagram illustrating a portion of a microprocessor system incorporating the message passing system of the present invention; and 
     FIG. 3 is a flow chart representing the processing flow utilizing the bus bridge message passing system of the present invention. 
    
    
     DETAILED DESCRIPTION 
     In the discussion of the FIGURES, the same reference numerals will be used throughout to refer to the same or similar components. In the interest of conciseness, well-known elements and details, such as timing considerations and the like have been omitted inasmuch as such details are not considered necessary to obtain a complete understanding of the present invention, and are considered to be within the skills of persons of ordinary skill in the relevant art. 
     FIG. 1 represents a typical system configuration  10  that could utilize the present invention to pass messages across the bus bridge without having to utilize the bus bridge buffer to send the message. In the configuration of the system  10  shown in FIG. 1, there are two buses  14 ,  44  connected to the bus bridge  20 . The buses are bi-directional, and pass information, including data and commands, into and out of the devices connected to that bus. The bus bridge  20  is bi-directional, but systems with unidirectional bridges also exist. Unidirectional bus bridges  20  only process information in a single direction, while bi-directional bus bridges  20  process information in both directions. The first bus  14  has two processors  12 ,  12 ′, a network I/O device  16 , and local memory  18  connected to the bus  14 . The second bus  44  has three processors  42 ,  42 ′,  42 ″, a network I/O device  46 , and local memory  48  connected to the bus  44 . Data that is to be sent from a device connected to one bus to a device on another bus is typically placed in the local memory of the destination bus. If a processor  12  on the first bus  14  needs to write data to a processor  42 ′ on the second bus  44 , the first processor  12  will output a write request onto the bus  14  where it will be accepted by the bus bridge  20 . When the bus bridge  20  has sufficient resources, it will accept the write request and place it in a buffer on the bus bridge  20 . If the block of data to be written is large, the data to be written will be broken into transactions of a size that can be managed by the system and the bridge  20 . Each write transaction will run on the first bus  14  and will be posted into a buffer on the bus bridge  20 . When all the data to be written has been placed on the first bus  14 , the first processor  12  considers the write operation to be complete. The first processor  12  then sends a message that the write is complete to the message container  30  in the bus bridge  20 . As each data transaction is placed in a buffer on the bus bridge  20 , the bus bridge  20  will route the data onto the bus  44  for the appropriate processor  42 ′ connected to the bus bridge  20  that is to be the recipient of the write being executed by the first processor  12 . The bus bridge  20  will place the data into the local memory  48  on the receiving bus  44 . The processor  42 ′ that is to be the recipient of the of the data will read the data from the local memory  48  when it receives the message that the data to be read is in local memory  48 . 
     FIG. 2 depicts a system  100  of the present invention that is designed to pass messages across the bus bridge without having to utilize the bus bridge buffer to send the message. When the first processor  12  has placed all the blocks of data to be written for the write command into the bus bridge  20 , the processor  12  considers the write transaction to be complete. The processor  12  then sends a message  102  indicating that the write is complete. The message  102  is placed in the message container  30  on the bus bridge  20 . Because the sending bus will not generate a message until it considers the write is complete, ordering is always maintained on the sending bus. The ordering problems only arise once at least a portion of the write data and message are placed into the bus bridge  20 . 
     When the message  102  is placed in the message container  30  on the bus bridge  20 , the bus bridge logic circuitry  110  sets a flag called MASK_MESSAGE  150  and polls the bus bridge  20  to determine which write buffers currently contain data to be written. This information is stored in a bus bridge ordering logic circuit  120  in the bus bridge logic circuitry  110 . Setting the MASK_MESSAGE flag  150  blocks generation of an interrupt  160  to the receiving processor  42 ′ that would indicate to the receiving processor  42 ′ that a message has been sent and is waiting for it in the message container  30 . 
     Additionally, because the receiving processor  42 ′ may not use interrupts, but may poll the message container  30  to see if there are messages intended for the receiving processor  42 ′ in the message container  30 , the MASK_MESSAGE flag  150  being set also prevents the receiving processor  42 ′ from accessing the message container  30 . In one embodiment of the present invention, this is accomplished by making the message container  30  send a “retry” to all access requests when the MASK_MESSAGE flag  150  is set. In another embodiment of the present invention, this is accomplished by allowing the receiving processor  42 ′ to access the message in the message container  30 , but setting the “message valid” field associated with the message to zero when the MASK_MESSAGE flag  150  is set. In this way, the receiving processor  42 ′ can access the message in the message container  30 , but will ignore the message, believing it to be invalid. 
     When all the write buffers tracked by the bus bridge ordering circuit  120  because they contained data ahead of the message have delivered the data to the appropriate receiving bus, the ordering circuit  120  sends a signal  140  to the bus bridge logic circuitry  110  to clear the MASK_MESSAGE flag  150 . This unblocks generation of the interrupt  160 , allowing the message container  30  to indicate to the receiving processor  42 ′ that a message has arrived, and allows the receiving processor  42 ′ to access the message container  30  and receive and read the message. 
     In one embodiment of the present invention, the bus bridge  20  supports data flow in two directions. In this situation, a second flag, MASK_MESSAGE2  152  exists that can also be set by the bus bridge logic circuitry  110  and masks flow of messages in the other direction on the bus bridge  20 . 
     FIG. 3 shows the logic flow  200  that occurs in a system of the present invention that is designed to pass messages across the bus bridge without having to utilize the bus bridge buffer to send the message. In step  202 , a processor has placed all the data to be written for a particular write command onto the bus, and sends a message to the message container on the bus bridge indicating that the write is complete. At step  204 , when the message is placed in the message container on the bus bridge, the MASK_MESSAGE flag is set. This blocks generation of an interrupt that would tell the receiving processor that a message is waiting for it in the message container, and prevents the receiving processor from accessing the message container. Additionally, when the MASK_MESSAGE flag is set, at step  206  the bus bridge logic circuitry identifies the write buffers currently containing data to be written. At step  208 , the bus bridge continually polls the bridge buffers to determine when all the buffers identified as containing data to be written at step  206  have written all the data in the buffer to the appropriate receiving bus. At that point the bus bridge will clear the MASK_MESSAGE flag. At step  210 , when the all the data in the buffers has been written to memory on the receiving bus, the MASK_MESSAGE flag is cleared, the bus bridge will generate an interrupt to the receiving processor to tell it there is a message waiting for it in the message container, and will allow the receiving processor to access the message container. 
     Having thus described the present invention by reference to certain of its preferred embodiments, it is noted that the embodiments disclosed are illustrative rather than limiting in nature and that a wide range of variations, modifications, changes, and substitutions are contemplated in the foregoing disclosure and, in some instances, some features of the present invention may be employed without a corresponding use of the other features. Many such variations and modifications may be considered obvious and desirable by those skilled in the art based upon a review of the foregoing description of preferred embodiments. Accordingly, it is appropriate that the appended claims be construed broadly and in a manner consistent with the scope of the invention. It is further noted that, unless indicated otherwise, all functions described herein are performed by a processor such as a computer or electronic data processor in accordance with code such as computer program code, software, or integrated circuits that are coded to perform such functions.