Method and device for accessing queue pair information of transceiving queue pair and computer equipment
By splitting and scheduling queue-to-information access requests in the RDMA network and assigning access locks to each sub-access request, the atomicity and cache consistency of queue-to-information in high concurrent access scenarios is solved, and stable and efficient queue-to-information access is achieved.
Patent Information
- Application Number
- CN202411723236.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In RDMA network, in high concurrent access scenarios, ensuring the atomicity and cache consistency of the queue to information is a major challenge.
By receiving a queue pair information access request for a sending and receiving queue pair, multiple target queue pair information are determined, the access request is split into sub-access requests, and these sub-access requests are written to the schedule queue. Based on the scheduling of multiple scheduling queues, each sub-access request is assigned, sent to the target information table for access, and access response information is generated, and the comprehensive access response information is finally returned.
By assigning an access lock to each sub-access request, the queue's access operation to information is ensured in an orderly manner, thereby realizing the atomicity and cache consistency of the queue's information.
Smart Images

Figure CN119621276A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium and computer program product for accessing queue pair information of a transceiver queue pair. Background Art
[0002] In an RDMA (Remote Direct Memory Access) network, communication between the sender and the receiver is achieved through a queue pair (QP). In the process of QP sending and receiving packets, it usually involves access to queue pair information (QPC, Queue Pair Context), such as read operations or write operations.
[0003] Currently, the scale of QPs in RDMA networks can reach hundreds of thousands or even millions, so access to QPCs is often highly concurrent. In high-concurrency access scenarios, ensuring the atomicity and cache consistency of QPCs is a huge challenge. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for accessing queue pair information of a sending and receiving queue pair that can ensure the atomicity and cache consistency of the queue pair information in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for accessing queue pair information of a sending and receiving queue pair, comprising:
[0006] receiving a queue pair information access request for a sending and receiving queue pair;
[0007] Determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information;
[0008] Write each sub-access request into the corresponding dispatch queue;
[0009] Based on the scheduling of multiple scheduling queues, a corresponding access lock is allocated to each sub-access request, and based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information of each sub-access request is generated;
[0010] Returning the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
[0011] In one of the embodiments, each target information table corresponds to a plurality of scheduling queues, and the scheduling queue to which each sub-access request is written is a target scheduling queue of the sub-access request in the plurality of scheduling queues of the corresponding target information table;
[0012] The method of allocating a corresponding access lock to each sub-access request based on the scheduling of the plurality of scheduling queues, and sending each sub-access request to a corresponding target information table based on the access lock of each sub-access request includes:
[0013] Perform queue scheduling processing on each target information table concurrently, determine a queue to be scheduled from multiple scheduling queues of the target information table for each target information table, and allocate a corresponding access lock to a target sub-access request in the queue to be scheduled; the target sub-access request is a sub-access request at the head of the queue to be scheduled;
[0014] In the case where the access lock corresponding to the target sub-access request is successfully allocated, sending the target sub-access request to the corresponding target information table;
[0015] In the case that the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request is written into the queue to be scheduled again.
[0016] In one embodiment, allocating a corresponding access lock to the target sub-access request in the queue to be scheduled includes:
[0017] Determining a target lock type corresponding to the target sub-access request based on the request type of the queue for the information access request;
[0018] Determine the number of allocated send-receive queues under the target lock type;
[0019] In the case where the allocated number is less than the corresponding number threshold, an access lock of the target lock type is allocated to the target sub-access request, and the allocated number is increased to determine that the access lock corresponding to the target sub-access request is allocated successfully;
[0020] In a case where the allocated number is equal to the corresponding number threshold, determining that the allocation of the access lock corresponding to the target sub-access request fails;
[0021] The method further comprises:
[0022] After generating access response information of the target sub-access request, the number of allocated locks of the transceiver queue under the lock type of the access lock of the target sub-access request is reduced.
[0023] In one embodiment, each information table corresponds to a plurality of scheduling queues;
[0024] The step of writing each sub-access request into a corresponding scheduling queue includes:
[0025] For each sub-access request, determining a target scheduling queue of the sub-access request from a plurality of scheduling queues in a target information table corresponding to the sub-access request according to a hash value of a queue pair identifier of the transceiver queue pair;
[0026] The sub-access request is written into the target scheduling queue.
[0027] In one embodiment, the determining a plurality of target queue pair information for the queue pair information access request, and splitting the queue pair information access request into at least one sub-access request based on the plurality of target queue pair information, comprises:
[0028] Using the request type of the queue for information access request and the interface identifier of the interface sending the queue for information access request as the request information of the queue for information access request;
[0029] Based on the request information, query the pre-built mapping relationship between the request information and the queue pair information to determine the multiple target queue pair information for which the queue pair information access request is directed;
[0030] Based on the multiple target queue pair information, query the mapping relationship between the pre-constructed queue pair information and the information table, and determine at least one target information table for storing each target queue pair information in the pre-constructed multiple information tables; the pre-constructed multiple information tables are used to store the queue pair information of each transceiver queue pair;
[0031] The queue information access request is split into sub-access requests for each target information table.
[0032] In one of the embodiments, the queue pair information access request is multiple, and each queue pair information access request corresponds to a transceiver queue pair;
[0033] The method further comprises:
[0034] For each queue-to-information access request, determining the request quantity of each sub-access request of the queue-to-information access request;
[0035] When the number of access response messages corresponding to the information access request of the queue reaches the number of requests, the access response messages corresponding to the information access request of the queue are combined to obtain the comprehensive access response information of the information access request of the queue.
[0036] In a second aspect, the present application further provides a device for accessing queue pair information of a transceiver queue pair, including:
[0037] A request receiving module, used for receiving a queue pair information access request for a sending and receiving queue pair;
[0038] a request splitting module, used to determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information;
[0039] A request writing module, used to write each sub-access request into a corresponding scheduling queue;
[0040] An information access module, configured to allocate a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, send each sub-access request to the corresponding target information table based on the access lock of each sub-access request, so as to access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request;
[0041] The information return module is used to return the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
[0042] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0043] receiving a queue pair information access request for a sending and receiving queue pair;
[0044] Determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information;
[0045] Write each sub-access request into the corresponding dispatch queue;
[0046] Based on the scheduling of multiple scheduling queues, a corresponding access lock is allocated to each sub-access request, and based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information of each sub-access request is generated;
[0047] Returning the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
[0048] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0049] receiving a queue pair information access request for a sending and receiving queue pair;
[0050] Determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information;
[0051] Write each sub-access request into the corresponding dispatch queue;
[0052] Based on the scheduling of multiple scheduling queues, a corresponding access lock is allocated to each sub-access request, and based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information of each sub-access request is generated;
[0053] Returning the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
[0054] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0055] receiving a queue pair information access request for a sending and receiving queue pair;
[0056] Determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information;
[0057] Write each sub-access request into the corresponding dispatch queue;
[0058] Based on the scheduling of multiple scheduling queues, a corresponding access lock is allocated to each sub-access request, and based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information of each sub-access request is generated;
[0059] Returning the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
[0060] The above-mentioned queue pair information access method, device, computer equipment, computer-readable storage medium and computer program product of the transceiver queue pair first receive a queue pair information access request for the transceiver queue pair; then, determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information; then, write each sub-access request into a corresponding scheduling queue; then, based on the scheduling of multiple scheduling queues, allocate a corresponding access lock to each sub-access request, and based on the access lock of each sub-access request, send each sub-access request to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request; finally, return the comprehensive access response information of the queue pair information access request to the sender of the queue pair information access request; the comprehensive access response information includes the access response information of each sub-access request. In this way, by assigning a corresponding access lock to each sub-access request of the queue's information access request, and based on the access lock of each sub-access request, sending each sub-access request to the corresponding target information table, so as to access the target queue information corresponding to each sub-access request, the orderliness of the queue's access to the information can be guaranteed based on the access lock, thereby ensuring the atomicity and cache consistency of the queue's access to the information. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 is a schematic diagram of a queue pair information management system in one embodiment;
[0063] Figure 2 A schematic flow chart of a method for accessing queue pair information of a sending and receiving queue pair in one embodiment;
[0064] Figure 3 A flowchart of the steps of allocating a corresponding access lock to each sub-access request based on scheduling of multiple scheduling queues and sending each sub-access request to a corresponding target information table based on the access lock of each sub-access request in one embodiment;
[0065] Figure 4 A flowchart of steps for allocating corresponding access locks to target sub-access requests in a queue to be scheduled in one embodiment;
[0066] Figure 5 A flowchart of the steps of determining multiple target queue pair information targeted by a queue pair information access request and splitting the queue pair information access request into at least one sub-access request based on the multiple target queue pair information in one embodiment;
[0067] Figure 6 A schematic flow chart of a method for accessing queue pair information of a sending and receiving queue pair in another embodiment;
[0068] Figure 7 A structural block diagram of a device for accessing queue pair information for sending and receiving queue pairs in one embodiment;
[0069] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0072] The method for accessing queue pair information of a transmitting and receiving queue pair provided in the embodiment of the present application can be applied to the following examples: Figure 1 The queue pair information management system shown in the figure. The queue pair information management system is mounted on a server. It is understandable that it can also be mounted on a terminal, or on a system including a server and a terminal, and is implemented through the interaction between the server and the terminal. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services; the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, etc.
[0073] See also Figure 1 The queue information management system includes a request parsing module, an information table management module, an information table module and a response generation module.
[0074] It should be noted that the sender and the receiver in the RDMA network communicate through the send-receive queue pair QP. During the communication process, the sender and the receiver need to obtain the corresponding queue pair information QPC from the queue pair information management system.
[0075] Among them, see Figure 1 , the sending end sends a queue pair information access request for accessing the queue pair information QPC to the queue pair information management system through the sending interface, and receives the response information returned by the queue pair information management system through the sending interface; the receiving end sends a queue pair information access request for accessing the queue pair information QPC to the queue pair information management system through the receiving interface, and receives the response information returned by the queue pair information management system through the receiving interface. Among them, the sending interface and the receiving interface are both communication interfaces between the sending end and the receiving end.
[0076] Specifically, the request parsing module is used to parse the received queue pair information access request, determine the multiple target queue pair information targeted by the queue pair information access request, split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information, and send each sub-access request to the information table management module.
[0077] An information table management module is used to write each sub-access request into a corresponding scheduling queue, allocate a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, and send each sub-access request to the corresponding target information table based on the access lock of each sub-access request to access the target queue pair information in the target information table corresponding to each sub-access request.
[0078] The information table module includes multiple pre-built information tables, which are used to store queue pair information of each sending and receiving queue pair; the information table module is used to generate access response information for each sub-access request after the access of each sub-access request is completed, and send the access response information of each sub-access request to the response generation module.
[0079] The response generation module is used to generate comprehensive access response information of the queue to the information access request based on the access response information of each sub-access request, and return the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request.
[0080] In an exemplary embodiment, Figure 2 As shown, a method for accessing queue pair information of a transmitting and receiving queue pair is provided, and the method is applied to Figure 1 The queue pair information management system shown is used as an example to illustrate the following steps:
[0081] Step S202: receiving a queue pair information access request for a sending and receiving queue pair.
[0082] The sending and receiving queue pair refers to QP (Queue Pair). In the RDMA network, the communication between the sender and the receiver is realized through the sending and receiving queue pair QP.
[0083] The queue pair information access request is used to request access to queue pair information; the queue pair information refers to QPC (QueuePair Context). In the process of QP sending and receiving packets, access to the queue pair information QPC is usually involved, for example, a read operation or a write operation needs to be performed on the queue pair information QPC.
[0084] Among them, see Figure 1 The sending interface and the receiving interface are both communication interfaces between the sending end and the receiving end. The queue pair information management system receives the queue pair information access request based on the sending interface and the receiving interface.
[0085] In a specific application, multiple queue pair information access requests may exist simultaneously in the queue pair information management system to improve the access efficiency of queue pair information; the multiple queue pair information access requests may be for different transceiver queue pairs or for the same transceiver queue pair.
[0086] Step S204: determine multiple target queue pair information for which the queue pair information access request is directed, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information.
[0087] Among them, the queue pair information management system has a plurality of pre-built information tables, which are used to store the queue pair information QPC of each transceiver queue pair QP; see Figure 1 ,The queue information management system stores multiple pre-built information tables in the information table module.
[0088] Each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information.
[0089] Specifically, see Figure 1 The request parsing module of the queue pair information management system first parses the queue pair information access request to determine multiple target queue pair information that the queue pair information access request needs to access; then, the request parsing module determines at least one information table that the queue pair information access request needs to access from multiple pre-built information tables based on the multiple target queue pair information, as the target information table of the queue pair information access request; then, the request parsing module splits the queue pair information access request into at least one sub-access request based on the target information table, each sub-access request corresponds to a target information table, which is used to request access to the target queue pair information in the corresponding target information table.
[0090] For example, assuming that the request parsing module parses and obtains that the queue pair information QPC that the queue pair information access request 1 needs to access is QPC1, QPC2 and QPC3, then the target queue pair information targeted by the queue pair information access request 1 is QPC1, QPC2 and QPC3; and among them, QPC1 and QPC2 are stored in information table 1, and QPC3 is stored in information table 2, then the target information tables of the queue pair information access request 1 are information table 1 and information table 2; therefore, the request parsing module splits the queue pair information access request 1 into sub-access request 1-1 for information table 1 and sub-access request 1-2 for information table 2, so as to request access to QPC1 and QPC2 in information table 1, and to request access to QPC3 in information table 2.
[0091] Step S206: write each sub-access request into the corresponding scheduling queue.
[0092] Among them, see Figure 1 The queue pair information management system has multiple scheduling queues in the information table management module. Further, each target information table corresponds to multiple scheduling queues.
[0093] The scheduling queue corresponding to each sub-access request is one of the multiple scheduling queues of the target information table corresponding to the sub-access request.
[0094] Specifically, see Figure 1 After splitting the queue information access request into multiple sub-access requests, the request parsing module sends the multiple sub-access requests to the information table management module of the queue information management system; the information table management module writes each sub-access request into the corresponding scheduling queue, and each sub-access request waits for scheduling in the scheduling queue.
[0095] Step S208, based on the scheduling of multiple scheduling queues, allocate a corresponding access lock for each sub-access request, and based on the access lock of each sub-access request, send each sub-access request to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request.
[0096] The information table management module is equipped with a scheduling algorithm for scheduling multiple scheduling queues, including but not limited to RR (Round-Robin) polling scheduling algorithm, WRR (Weighted Round Robin) weighted polling scheduling algorithm, etc.
[0097] Specifically, see Figure 1 The information table management module schedules multiple scheduling queues, takes out a sub-access request from the scheduling queue each time, and assigns a corresponding access lock to the sub-access request. When the sub-access request is assigned a corresponding access lock, the sub-access request is sent to the corresponding target information table stored in the information table module of the queue pair information management system to access the target queue pair information in the target information table.
[0098] After the access of the sub-access request is completed, the information table module generates access response information of the sub-access request and sends it to the response generation module of the queue information management system.
[0099] Step S210: Return the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request.
[0100] The comprehensive access response information includes access response information of each sub-access request.
[0101] Among them, see Figure 1 The sending interface and the receiving interface are both communication interfaces between the sending end and the receiving end. The queue pair information management system returns the queue pair information access request based on the sending interface and the receiving interface.
[0102] Specifically, see Figure 1The response generation module combines the access response information of each sub-access request received to obtain the comprehensive access response information of the queue to information access request corresponding to each sub-access request, and returns the comprehensive access response information to the sender of the queue to information access request through the interface for receiving the queue to information access request.
[0103] In the above-mentioned method for accessing queue pair information of a transceiver queue pair, first, the queue pair information management system receives a queue pair information access request for the transceiver queue pair; then, the queue pair information management system determines multiple target queue pair information targeted by the queue pair information access request, and based on the multiple target queue pair information, splits the queue pair information access request into at least one sub-access request; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information; then, the queue pair information management system writes each sub-access request into a corresponding scheduling queue; then, the queue pair information management system allocates a corresponding access lock for each sub-access request based on the scheduling of multiple scheduling queues, and based on the access lock of each sub-access request, sends each sub-access request to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and generates access response information for each sub-access request; finally, the queue pair information management system returns the comprehensive access response information of the queue pair information access request to the sender of the queue pair information access request; the comprehensive access response information includes the access response information of each sub-access request. In this way, by assigning a corresponding access lock to each sub-access request of the queue-to-information access request, and based on the access lock of each sub-access request, sending each sub-access request to the corresponding target information table to access the target queue-to-information corresponding to each sub-access request, the queue-to-information management system can ensure the orderliness of the queue-to-information access operations based on the access lock, thereby ensuring the atomicity and cache consistency of the queue-to-information.
[0104] In an exemplary embodiment, each target information table corresponds to a plurality of scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue of the sub-access request among the plurality of scheduling queues in the corresponding target information table.
[0105] For example, assume that the queue's information access request 1 is split into sub-access request 1-1 for information table 1 and sub-access request 1-2 for information table 2, the queue's information access request 2 is split into sub-access request 2-1 for information table 1 and sub-access request 2-2 for information table 2, and the queue's information access request 3 is split into sub-access request 3-1 for information table 1 and sub-access request 3-2 for information table 2, and assume that information table 1 corresponds to scheduling queue 1-1 and scheduling queue 1-2; if the target scheduling queue of sub-access request 1-1 and sub-access request 3-1 in the multiple scheduling queues of information table 1 is scheduling queue 1-1, and the target scheduling queue of sub-access request 2-1 in the multiple scheduling queues of information table 1 is scheduling queue 1-2, then the information table management module writes sub-access request 1-1 and sub-access request 3-1 into scheduling queue 1-1, and writes sub-access request 2-1 into scheduling queue 1-2.
[0106] like Figure 3 As shown, the above step S208, based on the scheduling of multiple scheduling queues, allocates a corresponding access lock to each sub-access request, and based on the access lock of each sub-access request, sends each sub-access request to the corresponding target information table, specifically includes the following steps:
[0107] Step S302 , performing queue scheduling processing on each target information table concurrently, determining a queue to be scheduled from multiple scheduling queues of the target information table for each target information table, and allocating a corresponding access lock to the target sub-access request in the queue to be scheduled.
[0108] Step S304: When the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table.
[0109] Step S306: When the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request is written into the queue to be scheduled again.
[0110] The target sub-access request is the sub-access request at the head of the queue to be scheduled.
[0111] Specifically, see Figure 1 The information table management module can concurrently perform queue scheduling processing on each target information table, that is, perform queue scheduling processing on multiple target information tables at the same time.
[0112] The queue scheduling process for each target information table is as follows:
[0113] See also Figure 1The information table management module also includes a scheduler, which is equipped with a scheduling algorithm. The scheduler first determines the queue to be scheduled in the multiple scheduling queues of the target information table based on the scheduling algorithm, and determines the sub-access request at the head of the queue to be scheduled as the target sub-access request in the scheduling queue, and takes out the target sub-access request; then, the scheduler allocates a corresponding access lock to the target sub-access request in the queue to be scheduled, and if the corresponding access lock is successfully allocated to the target sub-access request, the scheduler sends the target sub-access request to the corresponding target information table to enable the target queue to access the information, or, if the access lock fails to be allocated to the target sub-access request, the scheduler writes the target sub-access request into the queue to be scheduled again, waiting for the next scheduling.
[0114] For example, assume that information table 1 corresponds to scheduling queue 1-1 and scheduling queue 1-2, and scheduling queue 1-1 contains sub-access request 1-1 and sub-access request 3-1, and scheduling queue 1-2 contains sub-access request 1-2.
[0115] If in the first scheduling, the scheduler determines that the queue to be scheduled is scheduling queue 1-1, then the information table management module takes out the sub-access request 1-1 currently at the head of the queue from scheduling queue 1-1 and allocates a corresponding access lock to it. Assuming that the allocation fails, the scheduler writes the sub-access request 1-1 into scheduling queue 1-1 again.
[0116] If in the second scheduling, the scheduler determines that the queue to be scheduled is scheduling queue 1-2, then the scheduler takes out the sub-access request 2-1 currently at the head of the queue from scheduling queue 1-2 and allocates a corresponding access lock to it. Assuming the allocation is successful, the scheduler sends the sub-access request 2-1 to information table 1.
[0117] If in the third scheduling, the scheduler determines that the queue to be scheduled is scheduling queue 1-1, then the scheduler takes out the sub-access request 3-1 currently at the head of the queue from scheduling queue 1-1 and allocates a corresponding access lock to it. Assuming the allocation is successful, the scheduler sends the sub-access request 3-1 to information table 1.
[0118] If in the fourth scheduling, the scheduler determines that the queue to be scheduled is scheduling queue 1-1, then the scheduler takes out the sub-access request 1-1 currently at the head of the queue from scheduling queue 1-1 and allocates a corresponding access lock to it. Assuming the allocation is successful, the scheduler sends the sub-access request 1-1 to information table 1.
[0119] In this embodiment, firstly, concurrent access to different target information tables can be achieved through the concurrent queue scheduling processing of each target information table by the scheduler, thereby improving the access efficiency; secondly, through the allocation of access locks to target sub-access requests by the scheduler, and different processing when the allocation is successful or failed, it can be ensured that each sub-access request accesses the queue information in sequence with the access lock, thereby ensuring the orderliness of the access operation to the queue information, that is, ensuring the atomicity and cache consistency of the queue information.
[0120] In an exemplary embodiment, Figure 4 As shown, in the above step S302, the corresponding access lock is allocated to the target sub-access request in the queue to be scheduled, which specifically includes the following steps:
[0121] Step S402: determining a target lock type corresponding to a target sub-access request based on the request type of the queue for the information access request.
[0122] Step S404, determining the number of allocated sending and receiving queue pairs under the target lock type.
[0123] Step S406, when the allocated number is less than the corresponding number threshold, allocate an access lock of the target lock type to the target sub-access request, increase the allocated number, and determine that the access lock corresponding to the target sub-access request is allocated successfully.
[0124] Step S408: When the number of allocated locks is equal to the corresponding number threshold, it is determined that the allocation of the access lock corresponding to the target sub-access request fails.
[0125] The method for accessing queue pair information of a sending and receiving queue pair provided in the present application also includes the following steps:
[0126] Step S410 , after generating access response information of the target sub-access request, reducing the number of allocated locks of the transceiver queue under the lock type of the access lock of the target sub-access request.
[0127] Among them, the request type of the queue for the information access request is used to characterize the type of access operation of the queue for the information access request, the access operation includes but is not limited to read operation and write operation, and the request type includes but is not limited to read request corresponding to read operation and write request corresponding to write operation; in specific applications, the queue carries the corresponding request type for information access request, and in the process of splitting the queue for information access request, the sub-access request will also carry the request type carried by the queue to which it belongs for the information access request.
[0128] Among them, queues of different request types need to allocate access locks of different lock types for information access requests, and the lock types include but are not limited to read locks corresponding to read requests and write locks corresponding to write requests.
[0129] The target lock type is the lock type of the access lock to be allocated to the target sub-access request.
[0130] In this embodiment, the queue pair information management system configures a number threshold for each transceiver queue pair under different lock types, so as to constrain the number of locks that can be allocated to the transceiver queue pair under different lock types.
[0131] Furthermore, in a specific application, the queue pair information management system will also record the number of allocated locks under different lock types for each sending and receiving queue pair.
[0132] Specifically, the specific process of allocating a corresponding access lock to each target sub-access request is as follows:
[0133] First, the scheduler determines the request type of the queue to which the target sub-access request belongs for the information access request, and based on the request type, determines the lock type of the access lock to be assigned to the target sub-access request to obtain the target lock type corresponding to the target sub-access request.
[0134] See also Figure 1 ,The request scheduling queue also includes a lock allocation controller, and the number threshold and the number of ,allocated locks for each sending and receiving queue pair under different ,lock types are recorded in the lock allocation controller.
[0135] After determining the target lock type of the target sub-access request, the lock allocation controller first determines the allocated number of the transceiver queue pairs corresponding to the target sub-access request under the target lock type; if the allocated number is less than the number threshold of the transceiver queue pairs corresponding to the target sub-access request under the target lock type, an access lock with the target lock type corresponding to the target sub-access request is allocated, and the allocated number is increased to determine that the access lock corresponding to the target sub-access request is successfully allocated; if the allocated number is equal to the number threshold of the transceiver queue pairs corresponding to the target sub-access request under the target lock type, it is determined that the access lock corresponding to the target sub-access request has failed to be allocated.
[0136] For example, assuming that the queue pair information access request corresponding to the target sub-access request is a write request, the scheduler determines that a write lock needs to be allocated for the target sub-access request, and therefore determines that the target lock type corresponding to the target sub-access request is a write lock; further assume that the number threshold of the sending and receiving queue pairs corresponding to the target sub-access request under the write lock is 99.
[0137] If the number of allocated send and receive queues under the write lock corresponding to the current target sub-access request is 80, which is less than the number threshold of 99, then the lock allocation controller allocates a write lock for the target sub-access request and increases the allocated number by 1. After the target sub-access request successfully accesses the corresponding target information table, the lock allocation controller releases the allocated write lock and reduces the allocated number by 1.
[0138] If the number of allocated sending and receiving queues corresponding to the current target sub-access request under the write lock is 99, which is equal to the number threshold of 99, then the lock allocation controller determines that the allocation of the access lock corresponding to the target sub-access request has failed, and informs the scheduler of the allocation failure. The scheduler then writes the target sub-access request again into the scheduling queue to which the target sub-access request originally belonged.
[0139] In this embodiment, the lock allocation controller configures the number thresholds of each transceiver queue pair under different lock types, and records the allocated number of each transceiver queue pair under different lock types, so as to determine whether the corresponding access lock can be allocated for the target sub-access request. Based on the access lock, the orderliness of the queue's access operations to the information can be guaranteed, thereby ensuring the atomicity and cache consistency of the queue's information.
[0140] In an exemplary embodiment, each information table corresponds to multiple scheduling queues.
[0141] The above-mentioned step S206, writing each sub-access request into the corresponding scheduling queue, specifically includes the following contents: for each sub-access request, according to the hash value of the queue pair identifier of the transmitting and receiving queue pair, determine the target scheduling queue of the sub-access request in the multiple scheduling queues of the target information table corresponding to the sub-access request; write the sub-access request into the target scheduling queue.
[0142] Among them, the queue pair identifier refers to information that can uniquely identify the sending and receiving queue pair; in specific applications, the queue pair information access request carries the queue pair identifier of the targeted sending and receiving queue pair, and in the process of splitting the queue pair information access request, the sub-access request will also carry the request type carried by the queue pair information access request to which it belongs.
[0143] Specifically, the information table management module calculates the hash value of the queue pair identifier for each sub-access request based on the queue pair identifier and hash function of the transmitting and receiving queue pair corresponding to the sub-access request, and uses the hash value to determine the target scheduling queue of the sub-access request from multiple scheduling queues in the target information table corresponding to the sub-access request, and then writes the sub-access request into the target scheduling queue.
[0144] In this embodiment, the information table management module can determine the target scheduling queue from multiple scheduling queues in the target information table corresponding to the sub-access request according to the hash value of the queue pair identifier of the transceiver queue pair corresponding to the sub-access request, thereby realizing the writing of the sub-access request.
[0145] In an exemplary embodiment, Figure 5 As shown, the above step S204, determining multiple target queue pair information targeted by the queue pair information access request, and splitting the queue pair information access request into at least one sub-access request based on the multiple target queue pair information, specifically includes the following steps:
[0146] Step S502: Use the request type of the queue for information access request and the interface identifier of the interface that sends the queue for information access request as request information of the queue for information access request.
[0147] Step S504: Based on the request information, query the pre-built mapping relationship between the request information and the queue pair information to determine the multiple target queue pair information for which the queue pair information access request is directed.
[0148] Step S506: Based on the multiple target queue pair information, query the mapping relationship between the pre-constructed queue pair information and the information table, and determine at least one target information table for storing each target queue pair information in the pre-constructed multiple information tables.
[0149] Step S508: split the queue information access request into sub-access requests for each target information table.
[0150] The pre-built multiple information tables are used to store queue pair information of each sending and receiving queue pair.
[0151] The interface identifier is information that can uniquely identify the interface.
[0152] The mapping relationship between the request information and the queue pair information is used to represent the mapping relationship between the request information of each queue pair information access request and the queue pair information requested to be accessed by the queue pair information access request.
[0153] The mapping relationship between the queue pair information and the information table is used to represent the mapping relationship between each queue pair information and the information table storing the queue pair information.
[0154] Specifically, the request parsing module uses the request type of the queue pair information access request and the interface identifier of the interface that sends the queue pair information access request as the request information of the queue pair information access request; then, the request parsing module queries the mapping relationship between the pre-constructed request information and the queue pair information based on the request information, and determines in each queue pair information the queue pair information that the queue pair information access request with the request information needs to access, and obtains multiple target queue pair information targeted by the queue pair information access request; then, the request parsing module queries the mapping relationship between the pre-constructed queue pair information and the information table based on the multiple target queue pair information, and determines in the multiple information tables the information table storing each target queue pair information, thereby obtaining at least one target information table; finally, the request parsing module splits the queue pair information access request into at least one sub-access request based on the at least one target information table, and each sub-access request corresponds to a target information table, which is used to request access to the target queue pair information in the corresponding target information table.
[0155] In this embodiment, firstly, the request parsing module can determine which queue pair information needs to be obtained for queue pair information access requests with which request information based on the mapping relationship between pre-constructed request information and queue pair information, thereby obtaining multiple target queue pair information targeted by the queue pair information access requests; secondly, the request parsing module can determine in which information table each target queue pair information is stored based on the mapping relationship between pre-constructed queue pair information and information tables, thereby obtaining at least one target information table, and further being able to split the queue pair information access request into at least one sub-access request.
[0156] In an exemplary embodiment, there are multiple queue pair information access requests, and each queue pair information access request corresponds to a transmitting and receiving queue pair.
[0157] The queue pair information access method for the receiving and sending queue pair provided in the present application also includes the following contents: for each queue pair information access request, determining the request quantity of each sub-access request of the queue pair information access request; when the number of information of each access response information corresponding to the queue pair information access request reaches the request quantity, combining the access response information corresponding to the queue pair information access request to obtain the comprehensive access response information of the queue pair information access request.
[0158] The queue-to-information access request carries a corresponding request identifier, which is information that can uniquely identify the queue-to-information access request. In a specific application, during the splitting of the queue-to-information access request, the sub-access request will also carry the request identifier carried by the queue-to-information access request to which it belongs.
[0159] The access response information corresponding to the information access request of the queue refers to the access response information of each sub-access information of the information access request of the queue.
[0160] Specifically, there may be multiple queue pair information access requests in the queue pair information management system at the same time; for each queue pair information access request, the request parsing module will determine the request quantity of each sub-access request after splitting the queue pair information access request into at least one sub-access request, and then bind the request identifier of the queue pair information access request and the request quantity and send them to the response generation module.
[0161] After generating access response information for each sub-access request, the information table module sends the access response information to the response generation module; wherein the access response information carries the request identifier carried by the corresponding sub-access request.
[0162] Then, for each request identifier (the queue to which it belongs, the information access request), the response generation module counts the number of access response messages received corresponding to the request identifier (the queue to which it belongs, the information access request). When the number of messages corresponding to the request identifier (the queue to which it belongs, the information access request) reaches the number of requests corresponding to the request identifier (the queue to which it belongs, the information access request), it means that all sub-access requests of the queue to which the request identifier belongs, the information access request have completed the access operation. Therefore, the access response messages corresponding to the request identifier (the queue to which it belongs, the information access request) are combined to obtain the comprehensive access response information of the queue to which the request identifier corresponds,
[0163] In this embodiment, the response generation module can determine whether each queue's sub-access requests for information access requests have completed the access operation based on the number of requests and the amount of information corresponding to each queue's information access request, and generate comprehensive access response information if the access operation has been completed, thereby realizing access response in high-concurrency access scenarios.
[0164] In an exemplary embodiment, the information table management module is divided into multiple sub-management modules, each sub-management module corresponds to an information table and is used to schedule multiple scheduling queues of an information table. The sub-access request corresponding to each information table is scheduled through the sub-management module corresponding to the information table.
[0165] In an exemplary embodiment, if Figure 6 As shown, another method for accessing queue pair information of a transmitting and receiving queue pair is provided, and this method is applied to Figure 1 The queue pair information management system shown is used as an example to illustrate the following steps:
[0166] Step S602: receiving multiple queue information access requests.
[0167] Step S604: determining the target queue pair information of each queue pair information access request based on the target queue pair information of each queue pair information access request.
[0168] Step S606: The request type of each queue's information access request and the interface identifier of the interface that sends each queue's information access request are used as request information of each queue's information access request.
[0169] Step S608: Based on the request information of each queue pair information access request, the pre-built mapping relationship between the request information and the queue pair information is queried to determine the target queue pair information of each queue pair information access request.
[0170] Step S610: Based on the target queue pair information of each queue pair information access request, query the pre-built mapping relationship between the queue pair information and the information table to determine the target information table corresponding to each queue pair information access request.
[0171] Step S612: split each queue pair information access request into multiple sub-access requests based on the target information table corresponding to each queue pair information access request.
[0172] Step S614: write each sub-access request into a target scheduling queue among the multiple scheduling queues in the corresponding target information table.
[0173] Step S616, queue scheduling processing is performed concurrently on multiple target information tables. For each target information table, a queue to be scheduled is determined in multiple scheduling queues of the target information table, and a corresponding access lock is allocated to the target sub-access request in the queue to be scheduled.
[0174] Step S618, for each target sub-access request, if the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table and generate access response information of the sub-access request.
[0175] Step S620 , for each target sub-access request, if the allocation of the access lock corresponding to the target sub-access request fails, write the target sub-access request into the queue to be scheduled again.
[0176] Step S622, for each queue to information access request, when the number of information of each access response information corresponding to the queue to information access request reaches the number of request of each sub-access request of the queue to information access request, combine the access response information corresponding to the queue to information access request to obtain the comprehensive access response information of the queue to information access request.
[0177] Step S624: Return the comprehensive access response information of each queue to the information access request to the sender of each queue to the information access request.
[0178] In this embodiment, a corresponding access lock is assigned to each sub-access request of the queue to access information, and based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue information corresponding to each sub-access request. The orderliness of the queue's access to information can be guaranteed based on the access lock, thereby ensuring the atomicity and cache consistency of the queue to the information.
[0179] In order to more clearly illustrate the method for accessing queue pair information of a transceiver queue pair provided in the embodiment of the present application, the following is a specific embodiment of the method for accessing queue pair information of the transceiver queue pair, but it should be understood that the embodiment of the present application is not limited to this. In one exemplary embodiment, the present application also provides a RDMA high-concurrency access control method based on a distributed lock, which is applied to Figure 1 The queue pair information management system shown specifically includes the following contents:
[0180] The queue pair information management system mainly consists of four sub-modules, see Figure 1 , which are request parsing module, information table management module, information table module and response generation module.
[0181] The request parsing module is mainly used to receive and parse QPC read and write requests, and is used to process QPC read and write requests sent by interfaces in the sending and receiving directions of data packets, including but not limited to sending interfaces and receiving interfaces. The request parsing module determines the QPC parameters required for each request based on the input interface and request type, splits a single read and write request into several concurrent sub-requests and sends them to the information table management module of the QPC table where the required QPC parameters are located for the next step of processing.
[0182] Information table management module: mainly responsible for the caching, scheduling, concurrent access control, etc. of the read and write requests of the QPC table. The information table management module consists of a scheduling input queue, a scheduling output queue, a scheduler, and a lock allocation controller for concurrent access control. The lock allocation controller is mainly responsible for allocating and releasing the read and write locks of each QP. Each QPC table is equipped with a lock allocation controller. For each sub-request, the lock must be obtained before it can be forwarded to the corresponding QPC table for parameter reading and writing to ensure the atomicity and cache consistency of parameter reading and writing. If the sub-request fails to obtain the read-write lock, the scheduler will re-add the sub-request back to the end of the corresponding scheduling input queue and wait for the next scheduling cycle.
[0183] Information table module: mainly used to cache QPC parameters and is responsible for the reading and writing of QPC parameters. There will be multiple QPC tables in the information table module, and the QPC parameters cached in each QPC table are different.
[0184] Response generation module: mainly responsible for integrating the read and write responses returned by each QPC table, generating a comprehensive response and returning it to the sender of the read and write request.
[0185] In this embodiment, the RDMA high-concurrency access control method based on distributed locks includes the following steps:
[0186] Step 1: The request parsing module receives the QPC request and stores it in the request cache queue.
[0187] Step 2: The request parsing module takes a QPC request from the request cache queue, determines the QPC parameters that need to be processed for the QPC request based on the interface ID (Module ID) of the interface that sends the QPC request and the request type (Req type) of the QPC request, decomposes it into QPC sub-requests for several QPC tables, and sends them to the information table management module of the corresponding QPC tables.
[0188] Step 3: The request parsing module sends the request information of the currently processed QPC request to the response generation module. The request information includes but is not limited to Module ID, Req ID (QPC request ID), Req_type, and QPN (ID of the QP corresponding to the QPC request). The response generation module will cache the request information by Req ID, and will record how many QPC tables need to wait for read and write responses based on Req_type for the currently processed QPC request. When the response generation module receives the various read and write responses of the QPC request, it generates a combined comprehensive response and returns the comprehensive response based on the Module ID.
[0189] In addition to the above step 3, the following steps are also included:
[0190] Step 4: The information table management module obtains the Queue ID of the scheduling queue based on the hash function according to the QPN of the QPC request, where Queue ID = Hash (QPN), and then writes the QPC request and its request information into the corresponding scheduling queue.
[0191] Step 5: The scheduler of the information table management module reads the head request of the queue to be processed according to the scheduling algorithm, and sends the request information of the head request to the lock allocation controller to obtain the read-write lock of the QPC sub-request to determine whether the current QPC sub-request can be scheduled out. In addition, the scheduling algorithm of the scheduler is configurable, including but not limited to RR polling scheduling, WRR weighted polling scheduling and other algorithms.
[0192] Step 6: After receiving the request to acquire the lock, the lock allocation controller queries the corresponding lock table according to the QPN to see whether a lock can be allocated for the QPC sub-request. In the lock table, each QPN contains the RD_Lock_Num parameter and the WR_Lock_Num parameter, which respectively indicate the number of read locks and write locks that have been allocated to the QPN, and their initial values are 0. At the same time, the lock table also contains the MAX_RD_LOCK parameter and the MAX_WR_LOCK parameter, which respectively indicate the maximum number of read locks and write locks that can be allocated by the QPN.
[0193] The basic steps to determine whether each QPN can allocate a lock are as follows:
[0194] Step 6.1: Determine whether the QPC sub-request is a read request or a write request according to Req_Type. If it is a read request, go to step 6.2; if it is a write request, go to step 6.3.
[0195] Step 6.2: Read the WR_Lock_Num parameter according to the QPN. If WR_Lock_Num is less than MAX_WR_LOCK, a write lock can be allocated for the QPN, and WR_Lock_Num is increased by 1, and a response of successful locking is sent to the scheduler. If WR_Lock_Num is equal to MAX_WR_LOCK, the QPN is full of write locks that can be allocated, and a response of failed locking is sent to the scheduler.
[0196] Step 6.3: Read the RD_Lock_Num parameter according to the QPN. If RD_Lock_Num is less than MAX_RD_LOCK, a read lock can be allocated for the QPN, and RD_Lock_Num is increased by 1, and a response of successful locking is sent to the scheduler; if RD_Lock_Num is equal to MAX_RD_LOCK, the QPN is fully allocated with read locks, and a response of failed locking is returned to the scheduler.
[0197] Step 7: The scheduler receives the lock request response from the lock allocation controller. If the lock is successful, the currently processed QPC sub-request is forwarded to the corresponding QPC table for processing, and the process goes to step 8; if the lock fails, the QPC sub-request and its request information are re-added to the scheduling queue corresponding to its QPN, waiting for the next scheduling, and going to step 5.
[0198] Step 8: The QPC table determines the request type of the QPC sub-request based on Req type. If it is a write request, the relevant QPC parameters of the corresponding QP are updated according to the QPN; if it is a read request, the relevant QPC parameters of the corresponding QP are read according to the QPN. After the QPC sub-request is processed, the QPC table will generate a read-write response and send it to the response generation module, and then go to step 10; at the same time, the read-write lock release request of the QPN is sent to the information table management module, and the request carries the QPN and Req Type, and then go to step 9.
[0199] Step 9: The lock allocation controller receives the read-write lock release request from the QPC table, updates the lock table according to the QPN and Req type carried in the read-write lock release request, and releases the allocated read-write lock. The basic steps for read-write lock release are as follows:
[0200] Step 9.1: The lock allocation controller reads the lock table according to the QPN and determines whether the currently released lock is a read lock or a write lock according to the Req type.
[0201] Step 9.2: If it is a read lock, reduce the RD_Lock_Num parameter corresponding to the QPN by 1 and the process ends.
[0202] Step 9.3: If it is a write lock, reduce the WR_Lock_Num parameter corresponding to QPN by 1 and the process ends.
[0203] Step 10: After receiving the read and write responses of the QPC table, the response generation module determines whether the read and write responses of the QPC request in each QPC table have been received by using the Req ID. If all have been received, the response generation module generates a combined comprehensive response and returns the comprehensive response according to the Module ID, and then deletes the cached request information of the Req ID. If not completed, repeat step 10 to continue waiting for all the read and write responses of the QPC tables to be received.
[0204] In this embodiment, firstly, the QPC parameters are maintained in a table based on the read-write scenario of QPC, an information table management module is designed based on each QPC table, and the read-write lock allocation is maintained for each QPC table, which can not only ensure the concurrent read-write consistency requirements of different parameters, but also have good scalability. Secondly, the allocation of read-write locks is maintained based on QPN, ensuring that the QPC parameters of the sending and receiving data packets of the same QP are updated in a global order, ensuring the atomicity of the reading and writing of the same QPC parameters; in addition, for the same QPN, the number of read-write locks allocated to the same QPN is controlled by the RD_LOCK_NUM parameter and the WR_LOCK_NUM parameter, which can effectively improve the read-write concurrency of the same QPN; at the same time, for different QPNs, the allocation of read-write locks does not affect each other, which greatly improves the concurrency between different QPNs. Thirdly, the QPC request is decomposed into QPC sub-requests of several QPC tables through the request parsing module, and then the read and write response requests of different QPC tables are merged into a comprehensive response and returned through the response generation module. This method can concurrently access different QPC tables for different QPC requests, improve the read and write efficiency of QPC, and shorten the processing delay of QPC requests.
[0205] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0206] Based on the same inventive concept, the embodiment of the present application also provides a device for accessing queue pair information of a transceiver queue pair for implementing the method for accessing queue pair information of the transceiver queue pair involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the device for accessing queue pair information of one or more transceiver queue pairs provided below can be referred to the limitations of the method for accessing queue pair information of the transceiver queue pair above, and will not be repeated here.
[0207] In an exemplary embodiment, Figure 7As shown, a device for accessing queue pair information of a transceiver queue pair is provided, comprising: a request receiving module 702, a request splitting module 704, a request writing module 706, an information access module 708 and an information returning module 710, wherein:
[0208] The request receiving module 702 is used to receive a queue pair information access request for a sending and receiving queue pair.
[0209] The request splitting module 704 is used to determine multiple target queue pair information targeted by the queue pair information access request, and based on the multiple target queue pair information, split the queue pair information access request into at least one sub-access request; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information.
[0210] The request writing module 706 is used to write each sub-access request into the corresponding scheduling queue.
[0211] The information access module 708 is used to allocate a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, and based on the access lock of each sub-access request, send each sub-access request to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request.
[0212] The information return module 710 is used to return the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
[0213] In an exemplary embodiment, each target information table corresponds to a plurality of scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue of the sub-access request among the plurality of scheduling queues in the corresponding target information table.
[0214] The information access module 708 is also used to perform queue scheduling processing on each target information table concurrently. For each target information table, a queue to be scheduled is determined in multiple scheduling queues of the target information table, and a corresponding access lock is allocated to the target sub-access request in the queue to be scheduled; the target sub-access request is the sub-access request at the head of the queue to be scheduled; when the access lock corresponding to the target sub-access request is successfully allocated, the target sub-access request is sent to the corresponding target information table; when the access lock corresponding to the target sub-access request fails to be allocated, the target sub-access request is written into the queue to be scheduled again.
[0215] In an exemplary embodiment, the information access module 708 is further used to determine the target lock type corresponding to the target sub-access request based on the request type of the queue for the information access request; determine the number of allocated pairs of the transceiver queue under the target lock type; when the allocated number is less than the corresponding number threshold, allocate an access lock of the target lock type corresponding to the target sub-access request, and increase the allocated number to determine that the access lock corresponding to the target sub-access request is allocated successfully; when the allocated number is equal to the corresponding number threshold, determine that the access lock corresponding to the target sub-access request fails to be allocated;
[0216] In an exemplary embodiment, the information access module 708 is further configured to reduce the number of allocated locks of the receiving and sending queue under the lock type of the access lock of the target sub-access request after generating the access response information of the target sub-access request.
[0217] In an exemplary embodiment, each information table corresponds to multiple scheduling queues.
[0218] The request writing module 706 is also used to determine the target scheduling queue of each sub-access request from multiple scheduling queues in the target information table corresponding to the sub-access request according to the hash value of the queue pair identifier of the sending and receiving queue pair; and write the sub-access request into the target scheduling queue.
[0219] In an exemplary embodiment, the request splitting module 704 is also used to use the request type of the queue pair information access request and the interface identifier of the interface sending the queue pair information access request as the request information of the queue pair information access request; based on the request information, query the mapping relationship between the pre-built request information and the queue pair information, and determine the multiple target queue pair information targeted by the queue pair information access request; based on the multiple target queue pair information, query the mapping relationship between the pre-built queue pair information and the information table, and determine at least one target information table for storing each target queue pair information in the pre-built multiple information tables; the pre-built multiple information tables are used to store the queue pair information of each sending and receiving queue pair; split the queue pair information access request into sub-access requests for each target information table.
[0220] In an exemplary embodiment, there are multiple queue pair information access requests, and each queue pair information access request corresponds to a transmitting and receiving queue pair.
[0221] The information return module 710 is also used to determine the request quantity of each sub-access request of the queue to the information access request for each queue; when the information quantity of each access response information corresponding to the queue to the information access request reaches the request quantity, the access response information corresponding to the queue to the information access request is combined to obtain the comprehensive access response information of the queue to the information access request.
[0222] Each module in the above-mentioned queue pair information access device of the transceiver queue pair can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0223] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store queue pair information of each transceiver queue pair. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for accessing queue pair information of a transceiver queue pair is implemented.
[0224] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0225] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0226] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0227] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0228] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0229] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0230] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for accessing queue pair information of a transmitting and receiving queue pair, characterized in that: The method comprises: receiving a queue pair information access request for a sending and receiving queue pair; Determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information; Write each sub-access request into the corresponding dispatch queue; Based on the scheduling of multiple scheduling queues, a corresponding access lock is allocated to each sub-access request, and based on the access lock of each sub-access request, each sub-access request is sent to the corresponding target information table to access the target queue pair information in the target information table corresponding to each sub-access request, and access response information of each sub-access request is generated; Returning the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
2. The method according to claim 1, characterized in that Each target information table corresponds to a plurality of scheduling queues, and the scheduling queue to which each sub-access request is written is the target scheduling queue of the sub-access request among the plurality of scheduling queues in the corresponding target information table; The method of allocating a corresponding access lock to each sub-access request based on the scheduling of the plurality of scheduling queues, and sending each sub-access request to a corresponding target information table based on the access lock of each sub-access request includes: Perform queue scheduling processing on each target information table concurrently, determine a queue to be scheduled from multiple scheduling queues of the target information table for each target information table, and allocate a corresponding access lock to a target sub-access request in the queue to be scheduled; the target sub-access request is a sub-access request at the head of the queue to be scheduled; If the access lock corresponding to the target sub-access request is successfully allocated, sending the target sub-access request to the corresponding target information table; In the case that the allocation of the access lock corresponding to the target sub-access request fails, the target sub-access request is written into the queue to be scheduled again.
3. The method according to claim 2, characterized in that The allocating a corresponding access lock to the target sub-access request in the queue to be scheduled includes: Determining a target lock type corresponding to the target sub-access request based on the request type of the queue for the information access request; Determine the number of allocated send-receive queues under the target lock type; In the case where the allocated number is less than the corresponding number threshold, an access lock of the target lock type is allocated to the target sub-access request, and the allocated number is increased to determine that the access lock corresponding to the target sub-access request is allocated successfully; In a case where the allocated number is equal to the corresponding number threshold, determining that the allocation of the access lock corresponding to the target sub-access request fails; The method further comprises: After generating access response information of the target sub-access request, the number of allocated locks of the transceiver queue under the lock type of the access lock of the target sub-access request is reduced.
4. The method according to claim 1, characterized in that Each information table corresponds to multiple dispatch queues; The step of writing each sub-access request into a corresponding scheduling queue includes: For each sub-access request, determining a target scheduling queue of the sub-access request from a plurality of scheduling queues in a target information table corresponding to the sub-access request according to a hash value of a queue pair identifier of the transceiver queue pair; The sub-access request is written into the target scheduling queue.
5. The method according to any one of claims 1 to 4, characterized in that: The determining of a plurality of target queue pair information for which the queue pair information access request is directed, and splitting the queue pair information access request into at least one sub-access request based on the plurality of target queue pair information, comprises: Using the request type of the queue for information access request and the interface identifier of the interface sending the queue for information access request as the request information of the queue for information access request; Based on the request information, query the pre-built mapping relationship between the request information and the queue pair information to determine the multiple target queue pair information for which the queue pair information access request is directed; Based on the multiple target queue pair information, query the mapping relationship between the pre-constructed queue pair information and the information table, and determine at least one target information table for storing each target queue pair information in the pre-constructed multiple information tables; the pre-constructed multiple information tables are used to store the queue pair information of each transceiver queue pair; The queue information access request is split into sub-access requests for each target information table.
6. The method according to any one of claims 1 to 4, characterized in that: There are multiple queue pair information access requests, and each queue pair information access request corresponds to a sending and receiving queue pair; The method further comprises: For each queue-to-information access request, determining the request quantity of each sub-access request of the queue-to-information access request; When the number of access response messages corresponding to the information access request of the queue reaches the number of requests, the access response messages corresponding to the information access request of the queue are combined to obtain the comprehensive access response information of the information access request of the queue.
7. A device for accessing queue pair information of a transmitting and receiving queue pair, characterized in that: The device comprises: A request receiving module, used for receiving a queue pair information access request for a sending and receiving queue pair; a request splitting module, used to determine multiple target queue pair information targeted by the queue pair information access request, and split the queue pair information access request into at least one sub-access request based on the multiple target queue pair information; each sub-access request corresponds to a target information table, and each target information table stores at least one target queue pair information; A request writing module, used to write each sub-access request into a corresponding scheduling queue; An information access module, configured to allocate a corresponding access lock to each sub-access request based on the scheduling of multiple scheduling queues, send each sub-access request to the corresponding target information table based on the access lock of each sub-access request, so as to access the target queue pair information in the target information table corresponding to each sub-access request, and generate access response information for each sub-access request; The information return module is used to return the comprehensive access response information of the queue to the information access request to the sender of the queue to the information access request; the comprehensive access response information includes the access response information of each sub-access request.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Distributed database system and transaction processing method
CN107977376A
High-concurrency request asynchronous processing method, device, computer equipment and storage medium
CN110532111A
Access request response method and device and distributed system
CN114625489A
Storage data access method and device, electronic equipment and storage medium
CN115114042A
Distributed concurrent request processing method and device
CN118331729A
Cited By
Queue pair context access method and apparatus for send / receive queue pair, and computer device
WO2026114040A1