DMA transmission method and device

By allocating ring buffers and DMA descriptors in the SRIO link, data transmission of multiple DMA transmission channels is realized, which solves the problem that SRIO bandwidth cannot be effectively utilized in the prior art, and improves data transmission efficiency and reliability.

CN119003407APending Publication Date: 2024-11-22SHANGHAI SMARTLOGIC TECHNOLOGY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411103620.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing DMA transmission method cannot effectively utilize the bandwidth of the SRIO transmission path, resulting in the inadequate utilization of resources when efficient data transmission is required.

Method used

By initializing the SRIO link, establishing an SRIO communication link with the opponent, and allocating a sending ring buffer in the mapping address, opening the chain DMA transmission of the SRIO controller completes the interrupt, and allocating multiple empty DMA descriptors according to the pre-configuration. The DMA channel is allocated based on the issuance data, the number of descriptors is calculated, and if sufficient, data is issued to realize the data transmission of multiple DMA transmission channels.

Benefits of technology

The data transmission of multiple DMA transmission channels is realized, and the bandwidth of the SRIO transmission path is effectively utilized, which improves data transmission efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003407A_ABST
    Figure CN119003407A_ABST
Patent Text Reader

Abstract

The invention provides a DMA transmission method and device. The method comprises the steps that an SRIO link is initialized; establishing an SRIO communication link with an opposite terminal; establishing memory window mapping with the same mapping address with the opposite terminal; distributing a sending ring buffer area in the mapping address; opening a chained DMA (Direct Memory Access) of the SRIO controller to complete interruption; wherein the SRIO controller is provided with a plurality of DMA (Direct Memory Access) transmission channels; opening a chained DMA (Direct Memory Access) sending controller of the SRIO controller to finish interruption; distributing a plurality of empty DMA descriptions according to pre-configuration; distributing DMA channels according to the issued data; calculating the number of descriptors according to the issued data; determining whether the descriptors are sufficient or not according to the number; and if the descriptors are sufficient, issuing the issued data according to the descriptors. According to the method provided by the invention, data transmission of multiple DMA transmission channels can be realized, and the bandwidth of an SRIO transmission path is effectively utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a DMA transmission method and device. Background Art

[0002] DMA (Direct Memory Access) transmission mode is traditional block or single chain. Each DMA request can transmit a group of information, that is, a group of continuous data. This method is suitable for situations where a large amount of data needs to be transmitted continuously, and it can ensure that the bus control right is released only after the specified length of bytes is transmitted.

[0003] The existing DMA transmission method cannot effectively utilize the bandwidth of the SRIO (Serial RapidIO, high-speed serial IO port) transmission path. Summary of the invention

[0004] In order to solve one of the above technical defects, the present application provides a DMA transmission method and device.

[0005] In a first aspect of the present application, a DMA transmission method is provided, the method comprising:

[0006] Initialize the SRIO link;

[0007] Establish an SRIO communication link with the peer end;

[0008] Establish a memory window mapping with the same mapping address as the peer end;

[0009] Allocate a sending ring buffer in the mapping address; wherein the address of the sending ring buffer is the same as the address of the sending ring buffer of the opposite end;

[0010] Turn on the chained DMA transmission completion interrupt of the SRIO controller; wherein the SRIO controller has multiple DMA transmission channels;

[0011] Enable the chained DMA send controller completion interrupt of the SRIO controller;

[0012] Allocate multiple empty DMA descriptions according to pre-configuration;

[0013] Allocate DMA channels according to the sent data;

[0014] Calculate the number of descriptors based on the sent data;

[0015] Based on the quantity, determine whether the descriptor is sufficient;

[0016] If the descriptors are sufficient, the data to be sent is sent according to the descriptors.

[0017] Optionally, initialize the SRIO link, including:

[0018] The SRIO controller is powered on;

[0019] Configure SRIO clock, SRIO rate, and SRIO lane;

[0020] Enable receive IO, enable send IO, and enable DMA transfer controller;

[0021] Initialize the send link.

[0022] Optionally, establishing an SRIO communication link with a peer end includes:

[0023] Check whether the peer sending link has been initialized and established normally;

[0024] After the other end has established the sending link normally, initialize the receiving link;

[0025] Perform link synchronization alignment and lock with the peer end.

[0026] Optionally, sending the sent data according to the descriptor includes:

[0027] Fill the descriptor;

[0028] Write the sent data into the doorbell information;

[0029] Set the descriptor to a valid description;

[0030] After the downlink data is sent, a sending completion interrupt is sent to itself and a doorbell interrupt is sent to the other end, wherein the doorbell interrupt carries the information of this sending.

[0031] Optionally, after determining whether the descriptor is sufficient, the method further includes:

[0032] If the descriptors are insufficient, turn on the DMA self-test module to check whether the DMA status is normal;

[0033] If the DMA status is normal, after waiting for the descriptor to be sufficient, the step of sending the sent data according to the descriptor is executed;

[0034] If the DMA status is abnormal, the DMA module recovery process is entered. If it is restored to normal, the step of calculating the number of descriptors based on the sent data and subsequent steps are executed; if it cannot be restored to normal, the abnormality is reported.

[0035] Optionally, after sending the sent data according to the descriptor, the method further includes:

[0036] If a sending completion interrupt is received within the preset time, the sending completion description is recycled;

[0037] If the send completion interrupt is not received within the preset time, perform the following steps:

[0038] Check the link;

[0039] If the link is abnormal, the link is restored; if the link cannot be restored, the abnormality is reported;

[0040] If the link is normal, or the link is abnormal but the link is restored, the DMA transmission is restored; if the DMA transmission cannot be restored, the abnormality is reported; if the DMA transmission is restored, a link recovery request is sent to the other end, and after the link is synchronized with the other end again, the step of allocating the DMA channel according to the sent data and subsequent steps are repeated.

[0041] Optionally, after allocating the send ring buffer in the mapped address, further comprising:

[0042] Open the doorbell interruption;

[0043] Receive doorbell information;

[0044] Parse doorbell information;

[0045] Store the parsed data into the receiving data queue.

[0046] Optionally, the method further includes:

[0047] If a link recovery request is received, the link recovery is performed. If the link recovery is successful, the steps of initializing the SRIO link and subsequent steps are repeated. If the link recovery is unsuccessful, an exception is reported.

[0048] Optionally, the method involves one high-performance microprocessor board; the high-performance microprocessor board includes four high-performance microprocessors; the high-performance microprocessors are connected in sequence via an SRIO bus;

[0049] Alternatively, the method involves two high-performance microprocessor boards; the high-performance microprocessor boards are interconnected through an SRIO switch; each high-performance microprocessor board includes a link synchronization module, a link recovery module, a DMA transmission management module, and a DMA transmission recovery module; the link synchronization modules, link recovery modules, DMA transmission management modules, and DMA transmission recovery modules in the two high-performance microprocessor boards are interconnected.

[0050] In a second aspect of the present application, a DMA transmission device is provided, which relates to a high-performance microprocessor board; the high-performance microprocessor board includes four high-performance microprocessors; the high-performance microprocessors are connected in sequence through an SRIO bus;

[0051] Alternatively, the device involves two high-performance microprocessor boards; the high-performance microprocessor boards are interconnected through an SRIO switch; each high-performance microprocessor board includes a link synchronization module, a link recovery module, a DMA transmission management module, and a DMA transmission recovery module; the link synchronization modules, link recovery modules, DMA transmission management modules, and DMA transmission recovery modules in the two high-performance microprocessor boards are interconnected;

[0052] The device executes the method as described in the first aspect above.

[0053] The present application provides a DMA transmission method and device, the method comprising: initializing an SRIO link; establishing an SRIO communication link with the opposite end; establishing a memory window mapping with the opposite end having the same mapping address; allocating a send ring buffer in the mapping address; wherein the address of the send ring buffer is the same as the address of the send ring buffer of the opposite end; opening the chained DMA send completion interrupt of the SRIO controller; wherein the SRIO controller has multiple DMA transmission channels; opening the chained DMA send controller completion interrupt of the SRIO controller; allocating multiple empty DMA descriptions according to pre-configuration; allocating DMA channels according to the sent data; calculating the number of descriptors according to the sent data; determining whether the descriptors are sufficient according to the number; and if the descriptors are sufficient, sending the sent data according to the descriptors. The method provided by the present application can realize data transmission of multiple DMA transmission channels and effectively utilize the bandwidth of the SRIO transmission path. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0055] Figure 1 A schematic diagram of the overall structure of a single high-performance microprocessor board provided in an embodiment of the present application;

[0056] Figure 2 A detailed structural diagram of a single high-performance microprocessor board provided in an embodiment of the present application;

[0057] Figure 3 A DMA transmission logic diagram of a single high-performance microprocessor board provided in an embodiment of the present application;

[0058] Figure 4 A schematic diagram of the overall structure of a dual high-performance microprocessor board provided in an embodiment of the present application;

[0059] Figure 5A detailed structural diagram of a dual high-performance microprocessor board provided in an embodiment of the present application;

[0060] Figure 6 A DMA transmission logic diagram of a dual high-performance microprocessor board provided in an embodiment of the present application;

[0061] Figure 7 A schematic diagram of a DMA transmission method provided in an embodiment of the present application;

[0062] Figure 8 A schematic diagram of a flow chart of a DMA transmission method performed by a sender provided in an embodiment of the present application;

[0063] Fig. 9 A flowchart of a DMA transmission method executed by a receiver provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0065] In the process of implementing the present application, the inventors found that the existing DMA transmission method cannot effectively utilize the bandwidth of the SRIO transmission path.

[0066] In view of the above problems, the present application provides a DMA transmission method and device, the method comprising: initializing the SRIO link; establishing an SRIO communication link with the opposite end; establishing a memory window mapping with the opposite end having the same mapping address; allocating a send ring buffer in the mapping address; wherein the address of the send ring buffer is the same as the address of the send ring buffer of the opposite end; opening the chained DMA send completion interrupt of the SRIO controller; wherein the SRIO controller has multiple DMA transmission channels; opening the chained DMA send controller completion interrupt of the SRIO controller; allocating multiple empty DMA descriptions according to pre-configuration; allocating DMA channels according to the sent data; calculating the number of descriptors according to the sent data; determining whether the descriptors are sufficient according to the number; if the descriptors are sufficient, sending the sent data according to the descriptors. The method provided by the present application can realize data transmission of multiple DMA transmission channels and effectively utilize the bandwidth of the SRIO transmission path.

[0067] This embodiment provides a DMA (Direct Memory Access) transmission method, which is implemented by a DMA transmission device.

[0068] The DMA transmission device may involve one high-performance microprocessor board or two high-performance microprocessor boards when implemented.

[0069] The DMA transmission device involves a high-performance microprocessor board. Figure 1 As shown, 5G wireless data can enter the high-performance microprocessor board through the data input module. After the high-performance microprocessor board parses the data, it sends the data to the core network through the data output module.

[0070] The DMA transmission device involves a detailed structural diagram of a high-performance microprocessor board. Figure 2 As shown, Figure 2 It mainly shows the interconnection of the high-performance microprocessors inside the high-performance microprocessor board. The high-performance microprocessor board includes 4 high-performance microprocessors. The high-performance microprocessors are connected in turn through the SRIO (Serial RapidIO, high-speed serial IO port) bus. In other words, the 4 high-performance microprocessors in the high-performance microprocessor board are interconnected through the SRIO bus, and the 5G wireless data is sent to the core network through a 4-stage pipeline composed of 4 high-performance microprocessors. Figure 2 In the example, the data flow between the four high-performance microprocessors is data input module → high-performance microprocessor 0 → high-performance microprocessor 1 → high-performance microprocessor 2 → high-performance microprocessor 3 → data output module. The data transmission between high-performance microprocessors is mainly DMA transmission, and the control transmission is mainly SRIO maintenance control packets.

[0071] The DMA transmission device involves a DMA transmission logic diagram of a high-performance microprocessor board. Figure 3 As shown in the figure, the SRIO controller has 6 DMA transmission channels. The DMA transmission between two high-performance microprocessors involving two DMA transmission devices has a total of 6 DMA channels, multi-channel pipeline operation, seamless connection, better utilization of bandwidth, and higher transmission efficiency.

[0072] The overall structure diagram of the DMA transmission device involving two high-performance microprocessor boards is as follows Figure 4 As shown, the high-performance microprocessor boards are interconnected through the SRIO switch. After two high-performance microprocessor boards are interconnected through the SRIO switch, the interconnection of eight high-performance microprocessors on the dual boards can be realized, which has good scalability.

[0073] The detailed structural diagram of the DMA transmission device involving two high-performance microprocessor boards is shown in Figure 5As shown, each high-performance microprocessor board includes a link synchronization module, a link recovery module, a DMA transfer management module, and a DMA transfer recovery module. The link synchronization modules, link recovery modules, DMA transfer management modules, and DMA transfer recovery modules in the two high-performance microprocessor boards are interconnected. Between the two high-performance microprocessors, there are link synchronization modules interconnected, link recovery modules interconnected, DMA transfer management modules interconnected, and DMA transfer recovery modules interconnected. It can be seen that the DMA transfer device provided in this embodiment has high reliability and stability.

[0074] The DMA transmission device involves a DMA transmission logic diagram of two high-performance microprocessor boards. Figure 6 As shown in the figure, the circular DMA transmission between DMA channels is Figure 6 It can be seen that the transmission ring on the sending side is composed of n DMA transmission chains, and the receiving side only needs to open up the corresponding address space for data reception. In addition, the DMA transmission chains are independent of each other, and the next DMA transmission chain can be filled without waiting for the previous chain transmission chain to complete the transmission. The DMA transmission controller will automatically perform DMA transmission after detecting that the chain is valid, reducing the synchronization waiting time of single chain or block transmission, thereby further improving the transmission efficiency of the device.

[0075] Therefore, the DMA transmission method provided in this embodiment can realize receiving and sending at the same time, that is, the sender and receiver of DMA exist in a high-performance microprocessor at the same time, that is, a high-performance microprocessor can receive and send at the same time.

[0076] The DMA transmission method provided by this embodiment is described below by taking the sender as an example. Figure 7 , the implementation process of this method is:

[0077] 701, initialize the SRIO link.

[0078] The initialization process of step 701 is as follows:

[0079] 701-1, the SRIO controller is powered on.

[0080] 701-2, configure SRIO clock, SRIO rate, and SRIO lane.

[0081] 701-3, enable receiving IO, enable sending IO, and enable DMA transfer controller.

[0082] 701-4, initialize the sending link.

[0083] In step 701, the system is powered on normally to perform various necessary initializations, such as SRIO controller power-on enablement, SRIO clock configuration, SRIO rate configuration, SRIO lane configuration, enable receive IO, enable send IO, enable DMA transfer controller, and initialize the send link.

[0084] 702, establish an SRIO communication link with the peer end.

[0085] The implementation process of step 702 is:

[0086] 702-1, check whether the sending link of the other end is initialized and established normally.

[0087] 702-2, after the other end has established the sending link normally, the receiving link is initialized.

[0088] 702-3, perform link synchronization alignment and locking with the peer end.

[0089] In step 702, the link synchronization will be waited for, such as detecting whether the sending link of the other end is initialized and established normally through the link synchronization module. After the sending link of the other end is established normally, the respective receiving links are initialized. After the receiving link is initialized, the link synchronization alignment and locking are started. After the sending and receiving links at both ends are synchronized, aligned and locked, the link synchronization module sets the link to a normal synchronization state.

[0090] At this point, the sender and receiver have established a normal SRIO communication link.

[0091] 703, establish a memory window mapping with the same mapping address as the peer end.

[0092] The receiving address is the same as the receiving address of the other end.

[0093] Through step 703, a memory window mapping can be established with the receiving party, such as configuring respective data receiving windows according to the initial agreement (ie, the physical address space where the data from the SRIO bus is stored).

[0094] In addition, a peer mapping space is established in this step, that is, the receiving addresses on both sides are the same. This processing can ensure that the two high-performance microprocessors for sending and receiving use the same set of codes.

[0095] 704, allocate a send ring buffer in the mapping address.

[0096] The address of the sending ring buffer is the same as the address of the sending ring buffer at the other end.

[0097] For example, the sender and receiver open up another address in their respective address spaces for data transmission.

[0098] The ring buffer in this step is also a peer space, that is, the addresses of both sides are the same. These address spaces are used by users to fill in user data.

[0099] 705, turn on the chained DMA send completion interrupt of the SRIO controller.

[0100] Among them, the SRIO controller has multiple DMA transmission channels.

[0101] The chained DMA send completion interrupt can be enabled by step 705, such as opening the chained DMA send completion interrupt of the SRIO controller. The purpose of this step is that when a chain of chained DMA is sent, the sender knows that the chain has been sent and does not need to wait for completion in polling.

[0102] 706, enable the chained DMA send controller completion interrupt of the SRIO controller.

[0103] Step 706 can enable DMA transmission, such as turning on the DMA transmission controller of the SRIO controller. The DMA transmission controller will constantly check the DMA descriptor, and once the descriptor is valid, the transmission is turned on. The purpose of this step is that after the user calls the transmission interface, there is no need to block and wait for the transmission to complete, and the user can do other things, which greatly improves the efficiency of the user.

[0104] 707, allocate multiple empty DMA descriptions according to pre-configuration.

[0105] In step 707, a number of empty DMA descriptors will be allocated according to pre-configuration (such as user configuration). For example, the specific number of descriptors is configured according to the needs of the user's actual project, that is, the physical address space occupied by the descriptor is allocated in advance. Subsequent descriptors will automatically form descriptor chains one by one according to the user's call. All descriptor chains form a descriptor ring, which can be used repeatedly.

[0106] 708, allocating DMA channels according to the sent data.

[0107] For example, if the SRIO controller has a total of 6 DMA transmission channels, the 6 channels are 6 entries, each of which can send and receive different data content. Users can use different channels to transmit different data according to their needs. This can increase the reliability of data transmission and avoid data confusion caused by different data sharing the same channel.

[0108] 709, calculate the number of descriptors according to the sent data.

[0109] In step 709, the number of required descriptors can be calculated based on the sent data (such as data sent by the user). For example, based on the length of the user data, the large data can be split into multiple small blocks, and the multiple small blocks are respectively placed in descriptors to form a descriptor chain. In this way, the number of small blocks is the number of descriptors.

[0110] When the data is small, a single descriptor can also be chained.

[0111] 710 , determine whether the descriptors are sufficient based on the quantity.

[0112] In step 710, a determination will be made as to whether the descriptors are sufficient, such as whether the current descriptors are sufficient. When the user sends too fast and a large number of descriptors are accumulated, the unsent descriptors cannot be occupied. Only when the unused descriptors meet the user's needs can they be sent. This ensures that the system has a certain degree of data reliability.

[0113] 711. If the descriptors are sufficient, the data to be sent is sent according to the descriptors.

[0114] The issuing process of step 711 is as follows:

[0115] 711-1, fill the descriptor.

[0116] After executing step 711-1 to fill the descriptors, the required descriptors will be combined into a DMA transfer chain, the DMA transfer chain will be hung in the ring buffer, and then step 711-2 will be executed.

[0117] 711-2, write the sent data into the doorbell information.

[0118] 711-3, set the descriptor to a valid description.

[0119] For example, configure the chained DMA descriptor as a valid descriptor.

[0120] 711-4, after the sending of the downlink data is completed, a sending completion interrupt is sent to itself and a doorbell interrupt is sent to the other end.

[0121] The doorbell interruption carries the information sent this time.

[0122] When the descriptor is sufficient, the descriptor filling can be started through step 711, and the specific sending information can be written into the doorbell information, and the descriptor can be set as a valid description. When the controller detects the valid descriptor, it will automatically perform the DMA sending operation, and when the transmission is completed, it will send a sending completion interrupt to itself and a doorbell interrupt to the other end. The doorbell interrupt carries the sending information, including address information and descriptor information.

[0123] In addition, after executing step 711 to send the sent data according to the descriptor, a received interrupt judgment will also be performed, that is, if the sending completion interrupt is received within the preset time length, the sending completion description will be recovered. If the sending completion interrupt is not received within the preset time length, the link is checked. If the link is abnormal, the link is restored, and if the link cannot be restored, an abnormality report is performed. If the link is normal, or the link is abnormal but the link is restored, the DMA transmission is restored. If the DMA transmission cannot be restored, an abnormality report is performed. If the DMA transmission is restored, a link recovery request is sent to the other end (such as restarting the transmission service, sending a maintenance package to notify the other end), and after the link is synchronized with the other end again, the step of allocating the DMA channel according to the sent data and subsequent steps are repeated.

[0124] That is to say, after executing step 711 and sending the sent data according to the descriptor, it will be determined whether a sending completion interruption is received. If a sending completion interruption is received, the sending completion description is recovered. After the recovery is completed, the current sending is completed. If the sending interruption wait times out, the link check is started. If the link is abnormal, the link recovery module is turned on and the link recovery is attempted. If the link cannot be recovered, an abnormality report is made to the general control manager. If the link can be recovered normally, the DMA transmission recovery module is turned on and the DMA transmission recovery is attempted. If the recovery cannot be made, an abnormality report is made to the general control manager. If the recovery is successful, a notification is sent to the other end to notify the other end to perform link recovery. When the transmission links at both ends are synchronized again, the link is restored to normal at this time. If the two ends cannot be synchronized, an abnormality report is made to the general control manager.

[0125] Through the above judgment, the DMA transmission method provided in this embodiment can have a high reliability and reduce the investment of labor cost to a great extent.

[0126] If the descriptor is insufficient, the following steps are performed:

[0127] 301, open the DMA self-test module to check whether the DMA status is normal.

[0128] 302, if the DMA status is normal, wait until the descriptor is sufficient, and then execute the step of sending the data according to the descriptor (ie, step 711).

[0129] 303, if the DMA state is abnormal, enter the DMA module recovery process, if it is restored to normal, execute the step of calculating the number of descriptors according to the sent data and subsequent steps. If it cannot be restored to normal, report the abnormality.

[0130] That is to say, when the descriptors are insufficient, the DMA self-test module will be turned on to check the DMA-related registers to see whether the current DMA status is normal. If it is normal, the system will continue to wait. If it is abnormal, the system will enter the DMA module recovery process. If it recovers to normal, the system will enter the process of waiting for the user to send the data. If it cannot recover normally, the system will enter the abnormal reporting process and report to the general control manager.

[0131] The above process is a data transmission process using the sender as an example. During this period, the sender can also serve as a receiver to receive data sent by other senders. For example, after allocating the send ring buffer in the mapping address, it will:

[0132] 401, interruption in opening doorbell.

[0133] Step 401 may enable the doorbell interrupt, such as turning on the interrupt of the receiver's doorbell, so that the sender can receive the doorbell interrupt sent by the sender after completing the sending.

[0134] 402, receiving doorbell information.

[0135] 403, parsing doorbell information.

[0136] In step 403, the received data can be parsed according to the doorbell interrupt information, such as parsing the address and length of the data from the compressed sending information in the interrupt information according to the received doorbell interrupt, storing it in the receiving data queue, and feeding it back to the user for reception.

[0137] 404, store the parsed data into the receiving data queue.

[0138] At the same time, during the entire execution of the DMA transmission method provided in this embodiment, a link recovery judgment is performed. If a link recovery request is received, the link recovery is performed. If the link recovery is successful, step 701 (i.e., initializing the SRIO link) and subsequent steps are performed, and then the receiving wait is entered. If the link recovery is unsuccessful, an abnormality report is performed.

[0139] During the link recovery judgment process, when a link recovery request is received from the other end, it indicates that a link failure has occurred. The link recovery module on the receiving end is immediately turned on. If the link recovery is successful, the receiving wait state continues. If the link recovery is unsuccessful, the abnormality is reported to the general control server.

[0140] From the above process, it can be seen that the sender and receiver of DMA exist in a high-performance microprocessor at the same time, that is, a high-performance microprocessor can receive and send at the same time.

[0141] Below Figure 8 The process shown again introduces the process of the sender executing the DMA transmission method provided in this embodiment.

[0142] 1. Initialize the SRIO link;

[0143] 2. Establish an SRIO communication link with the peer end;

[0144] 3. Establish a memory window mapping with the same mapping address as the peer end;

[0145] 4. Allocate the send ring buffer in the mapped address;

[0146] 5. Enable the chained DMA send completion interrupt of the SRIO controller;

[0147] 6. Open the chained DMA send controller completion interrupt of the SRIO controller;

[0148] 7. Allocate multiple empty DMA descriptions according to pre-configuration;

[0149] 8. Allocate DMA channels according to the sent data;

[0150] 9. Calculate the number of descriptors based on the sent data;

[0151] 10. Based on the quantity, determine whether the descriptors are sufficient;

[0152] 11. If the descriptor is sufficient, then:

[0153] (1) Filling the descriptor;

[0154] (2) Organize the required descriptors into a DMA transfer chain;

[0155] (3) Hang the DMA transfer chain into the ring buffer;

[0156] (4) Write the sent data into the doorbell information;

[0157] (5) Set the descriptor to a valid description;

[0158] (6) The controller detects a valid descriptor and sends it automatically;

[0159] (7) After receiving the sending completion interrupt, the descriptor is recovered and the user is waiting to send it down. Then, step 8 (allocating the DMA channel according to the sent data) and subsequent steps are executed.

[0160] (8) If the waiting timeout period has expired and the sending completion terminal is still not received, then:

[0161] A. Check the link;

[0162] B. If the link is normal, perform a DMA check;

[0163] a. If DMA is normal, restart the transmission service, send a maintenance package to notify the other end, wait for the other end to be ready, wait for the user to send it after the other end is ready, and then execute step 8 (allocate DMA channels according to sent data) and subsequent steps. If the other end is not ready, report the exception;

[0164] b. If DMA is abnormal, perform DMA recovery. If DMA is recovered, execute step a (i.e. restart the transmission service) and subsequent steps; if DMA is not recovered, report the abnormality;

[0165] C. If the link is abnormal, restore the link. If the link cannot be restored, report the abnormality. If the link is restored, execute step B (i.e., perform DMA

[0166] 12. If the descriptors are insufficient, then: turn on the DMA self-check module to check whether the DMA status is normal. If the DMA status is normal, wait for the descriptors to be sufficient, and then execute step 9 (i.e., calculate the number of descriptors based on the sent data) and subsequent steps. If the DMA status is abnormal, try to recover the DMA. If the recovery is successful, execute step 9 (i.e., calculate the number of descriptors based on the sent data) and subsequent steps; if it cannot be restored to normal, then report the exception.

[0167] In addition, while the sending end is executing the above process, data can also be received. The receiving process is to execute steps 401 to 404 after executing step 4 (i.e. allocating a sending ring buffer in the mapping address). For details, see the introduction of steps 401 to 404 above, which will not be repeated here.

[0168] At the same time, in the implementation Figure 8 In the process shown, link recovery judgment is performed. If a link recovery request is received, link recovery is performed. If the link recovery is successful, step 1 (i.e., initializing the SRIO link) and subsequent steps are executed, and then the receiving wait is entered. If the link recovery is unsuccessful, an abnormality report is performed.

[0169] Below Fig. 9 The process shown introduces the process of the receiver executing the DMA transmission method provided in this embodiment.

[0170] 1. Initialize the SRIO link;

[0171] The system is powered on normally to perform necessary initialization, such as enabling the SRIO controller, configuring the SRIO clock, configuring the SRIO rate, configuring the SRIO lane, enabling receive IO, enabling transmit IO, enabling the DMA transfer controller, and initializing the transmit link.

[0172] 2. Establish an SRIO communication link with the peer end;

[0173] For example, the link synchronization module is used to detect whether the sending link of the other end has been initialized and established normally. After the sending link of the other end is established normally, the respective receiving links are initialized. After the receiving link is initialized, the link synchronization alignment and locking are started. After the sending and receiving links at both ends are synchronized, aligned and locked, the link synchronization module sets the link to a normal synchronization state.

[0174] At this point, the sender and receiver have established a normal SRIO communication link.

[0175] 3. Establish a memory window mapping with the same mapping address as the peer end;

[0176] The receiving address is the same as the receiving address of the other end.

[0177] Establish a memory window mapping with the sending end, such as configuring each data receiving window according to the initial agreement (that is, the data coming from the SRIO bus is stored in which physical address space).

[0178] In addition, a peer mapping space is established in this step, that is, the receiving addresses on both sides are the same. This processing can ensure that the two high-performance microprocessors for sending and receiving use the same set of codes.

[0179] 4. Allocate the send ring buffer in the mapped address;

[0180] The address of the sending ring buffer is the same as the address of the sending ring buffer at the other end.

[0181] For example, the sender and receiver open up another address in their respective address spaces for data transmission.

[0182] The ring buffer in this step is also a peer space, that is, the addresses of both sides are the same. These address spaces are used by users to fill in user data.

[0183] 5. Open the doorbell interruption;

[0184] 6. Receive doorbell information;

[0185] 7. Parse doorbell information;

[0186] 8. Store the parsed data into the receiving data queue.

[0187] At the same time, in the implementation Fig. 9In the process shown, link recovery judgment is performed. If the link recovery module receives a link recovery request, link recovery is performed. If the link recovery is successful, step 1 (i.e., initializing the SRIO link) and subsequent steps are executed, and then the receiving wait is entered. If the link recovery is unsuccessful, an abnormality report is performed.

[0188] In addition, while the receiving end is executing the above process, data can also be sent. The sending process is as follows: Figure 7 As shown, no further description is given here.

[0189] The receiving side can automatically enter the link and DMA transmission repair process after receiving the abnormality detected by the sending side. In normal transmission mode, the sending data address of the sending side can be quickly parsed.

[0190] The sender and receiver of the above DMA exist in a high-performance microprocessor at the same time, that is, a high-performance microprocessor can receive and send at the same time.

[0191] This embodiment provides a DMA transmission method, initializing the SRIO link; establishing an SRIO communication link with the opposite end; establishing a memory window mapping with the opposite end with the same mapping address; allocating a send ring buffer in the mapping address; wherein the address of the send ring buffer is the same as the address of the send ring buffer of the opposite end; turning on the chained DMA send completion interrupt of the SRIO controller; wherein the SRIO controller has multiple DMA transmission channels; turning on the chained DMA send controller completion interrupt of the SRIO controller; allocating multiple empty DMA descriptions according to pre-configuration; allocating DMA channels according to the sent data; calculating the number of descriptors according to the sent data; determining whether the descriptors are sufficient according to the number; if the descriptors are sufficient, sending the sent data according to the descriptors. The method provided in this embodiment can realize data transmission of multiple DMA transmission channels and effectively utilize the bandwidth of the SRIO transmission path.

[0192] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0193] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0194] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0196] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0197] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A DMA transmission method, characterized in that: The method comprises: Initialize the SRIO link; Establish an SRIO communication link with the peer end; Establish a memory window mapping with the same mapping address as the peer end; Allocate a sending ring buffer in the mapping address; wherein the address of the sending ring buffer is the same as the address of the sending ring buffer of the opposite end; Turning on the chained DMA transmission completion interrupt of the SRIO controller; wherein the SRIO controller has multiple DMA transmission channels; Enable the chained DMA send controller completion interrupt of the SRIO controller; Allocate multiple empty DMA descriptions according to pre-configuration; Allocate DMA channels according to the sent data; Calculate the number of descriptors based on the sent data; Based on the quantity, determining whether the descriptor is sufficient; If the descriptors are sufficient, the sending data is sent according to the descriptors.

2. The method according to claim 1, characterized in that The initializing the SRIO link includes: The SRIO controller is powered on; Configure SRIO clock, SRIO rate, and SRIO lane; Enable receive IO, enable send IO, and enable DMA transfer controller; Initialize the send link.

3. The method according to claim 1, characterized in that The establishing of the SRIO communication link with the opposite end includes: Check whether the peer sending link has been initialized and established normally; After the other end has established the sending link normally, initialize the receiving link; Perform link synchronization alignment and lock with the peer end.

4. The method according to claim 1, characterized in that: The sending data according to the descriptor includes: Fill the descriptor; Writing the sent data into the doorbell information; Set the descriptor to a valid description; After the downlink data is sent, a sending completion interrupt is sent to itself and a doorbell interrupt is sent to the other end, wherein the doorbell interrupt carries the information of this sending.

5. The method according to claim 1, characterized in that After determining whether the descriptor is sufficient, the method further includes: If the descriptors are insufficient, turn on the DMA self-test module to check whether the DMA status is normal; If the DMA state is normal, after waiting for sufficient descriptors, the step of sending the data according to the descriptors is executed; If the DMA status is abnormal, the DMA module recovery process is entered. If it is restored to normal, the step of calculating the number of descriptors based on the sent data and subsequent steps are executed; if it cannot be restored to normal, the abnormality is reported.

6. The method according to claim 1, characterized in that After sending the sending data according to the descriptor, the method further includes: If a sending completion interrupt is received within the preset time, the sending completion description is recycled; If the send completion interrupt is not received within the preset time, perform the following steps: Check the link; If the link is abnormal, the link is restored; if the link cannot be restored, the abnormality is reported; If the link is normal, or the link is abnormal but the link is restored, the DMA transmission is restored; if the DMA transmission cannot be restored, the abnormality is reported; if the DMA transmission is restored, a link recovery request is sent to the other end, and after the link is synchronized with the other end again, the step of allocating the DMA channel according to the sent data and subsequent steps are repeated.

7. The method according to claim 1, characterized in that After allocating the sending ring buffer in the mapping address, the method further includes: Open the doorbell interruption; Receive doorbell information; Parse doorbell information; Store the parsed data into the receiving data queue.

8. The method according to claim 7, characterized in that The method further comprises: If a link recovery request is received, link recovery is performed. If the link recovery is successful, the steps of initializing the SRIO link and subsequent steps are repeated. If the link recovery is unsuccessful, an abnormality report is performed.

9. The method according to claim 1, characterized in that: The method involves one high-performance microprocessor board; the high-performance microprocessor board includes four high-performance microprocessors; the high-performance microprocessors are connected in sequence via an SRIO bus; Alternatively, the method involves two high-performance microprocessor boards; the high-performance microprocessor boards are interconnected through an SRIO switch; each high-performance microprocessor board includes a link synchronization module, a link recovery module, a DMA transmission management module, and a DMA transmission recovery module; the link synchronization modules, link recovery modules, DMA transmission management modules, and DMA transmission recovery modules in the two high-performance microprocessor boards are interconnected.

10. A DMA transmission device, characterized in that: The device involves a high-performance microprocessor board; the high-performance microprocessor board includes four high-performance microprocessors; the high-performance microprocessors are connected in sequence through an SRIO bus; Alternatively, the apparatus involves two high performance microprocessor boards; The high-performance microprocessor boards are interconnected through an SRIO switch; each high-performance microprocessor board includes a link synchronization module, a link recovery module, a DMA transmission management module, and a DMA transmission recovery module; the link synchronization modules, link recovery modules, DMA transmission management modules, and DMA transmission recovery modules in two high-performance microprocessor boards are interconnected; The device executes the method according to any one of claims 1 to 9.