Reset logout method of RDMA network card, RDMA network card, system, chip, storage medium and program product

By first matching and scheduling the target queue in the RDMA network card, the problem of low efficiency in RDMA network card reset and deregistration is solved, and more efficient command processing is achieved.

CN121578869BActive Publication Date: 2026-03-27SHENZHEN JAGUAR MICROSYSTEMS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-26
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

When an RDMA network card receives a reset/deregistration command, it suffers from low reset/deregistration efficiency because it can only scan one buffer queue at a time, and other queues cannot participate in scheduling, resulting in low processing efficiency.

Method used

By first identifying the target queue associated with the reset/cancel command, the current scan queue is matched and the matched commands are scheduled. Then, the remaining queues are scheduled and matched until all commands are processed. A counter is used to update the scheduler in real time to optimize the scheduling strategy.

Benefits of technology

It improves the scheduling efficiency of pending commands, shortens the reset and deregistration processing time, and enhances the overall processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121578869B_ABST
    Figure CN121578869B_ABST
Patent Text Reader

Abstract

The application relates to a reset logout method of an RDMA network card, an RDMA network card, a system, a chip, a storage medium and a program product. The method comprises the following steps: receiving a reset logout command sent by a host; determining a target queue associated with the reset logout command, wherein the target queue caches to-be-processed commands; determining a current scanning queue from the target queue, matching the to-be-processed commands cached in the current scanning queue with the reset logout command, and scheduling the to-be-processed commands after the matching is completed; scheduling the to-be-processed commands cached in the remaining target queue, and matching the to-be-processed commands with the reset logout command after the scheduling is completed; wherein the remaining target queue is a queue other than the current scanning queue in the target queue; after the matching of all the to-be-processed commands cached in the current scanning queue is completed, a current scanning queue is determined again from the remaining scanning queue. The reset logout efficiency can be improved by adopting the method.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the chip technical field, in particular to a reset logout method of an RDMA network card, an RDMA network card, a system, a chip, a storage medium and a program product. BACKGROUND

[0002] When the remote direct memory access (RDMA) network card receives a reset logout command sent by a host, the RDMA network card needs to process all pending commands corresponding to all network card functions (Functions) or queue pairs (QP) related to the reset logout command buffered in the RDMA network card, and then return a response to the reset logout command to the host to complete the reset logout.

[0003] In the related art, the pending commands corresponding to the Functions or QPs related to the reset logout command in the RDMA network card can exist in multiple buffered queues. After the RDMA network card receives the reset logout command, the RDMA network card stops processing the buffered queues related to the reset logout command, records the number of pending commands in the buffered queues related to the reset logout command, and then reads the pending commands in the buffered queues related to the reset logout command one by one and matches them with the information carried by the reset logout command. If any pending command matches the information carried by the reset logout command, the pending command is marked with a discard flag and then written back to the cache. Only the scanned buffered queues can participate in queue scheduling, and the related buffered queues that have not been scanned are prohibited from participating in scheduling. When the scheduled pending command has a reset logout scan discard mark, the pending command is discarded directly.

[0004] However, since the RDMA network card can only scan one buffered queue at a time and the pending commands in the buffered queues related to the reset logout command can only participate in scheduling after the scanning of the buffered queues is completed, if a reset logout command has eight related buffered queues, when the first queue in the eight queues is scanned, the other seven queues cannot be scanned or normally participate in scheduling, which results in low reset logout efficiency. SUMMARY

[0005] Therefore, it is necessary to provide a reset logout method of an RDMA network card, an RDMA network card, a system, a chip, a storage medium and a program product capable of improving the reset logout efficiency.

[0006] In a first aspect, the application provides a reset logout method of an RDMA network card, the method comprising:

[0007] receiving a reset logout command sent by a host;

[0008] determining a target queue associated with the reset logout command, wherein the target queue stores pending commands to be processed;

[0009] determining a current scanning queue from the target queue, matching the pending commands stored in the current scanning queue with the reset logout command, and scheduling the pending commands which have completed the matching process;

[0010] scheduling the pending commands stored in the remaining target queues and matching the pending commands with the reset logout command after the scheduling is completed, wherein the remaining target queues are the queues in the target queue except the current scanning queue;

[0011] after the matching process of all the pending commands stored in the current scanning queue is completed, determining a current scanning queue again from the remaining scanning queues, matching the pending commands stored in the current scanning queue determined again with the reset logout command, and scheduling the pending commands stored in the remaining target queues determined again until the matching process of all the pending commands in the target queue with the reset logout command is completed, and generating a final reset logout response to the host, wherein the remaining scanning queues are the queues in the target queue except the completed scanning queues, and the completed scanning queues are the queues in which the matching process of all the pending commands stored in the queues with the reset logout command is completed.

[0012] In one embodiment, each target queue corresponds to a first counter value and a second counter value, wherein the first counter value represents the number of the pending commands in the corresponding target queue which have not been scheduled, and the second counter value represents the number of the pending commands in the corresponding target queue which have not been matched.

[0013] The determining a current scanning queue from the target queue, matching the pending commands stored in the current scanning queue with the reset logout command, and scheduling the pending commands which have completed the matching process specifically includes:

[0014] sequentially reading a pending command from the current scanning queue, and matching the read pending command with the reset logout object information in the reset logout command;

[0015] if the matching is successful, marking the pending command as discarded and writing it back to the current scanning queue, updating the second counter value corresponding to the current scanning queue, and continuing to read a pending command from the current scanning queue, otherwise, continuing to read the next pending command from the current scanning queue;

[0016] The difference between the first counter value and the second counter value is calculated in real time, so that the scheduler schedules the pending commands in the current scan queue cache according to the difference.

[0017] In one of the embodiments, the method further comprises:

[0018] For the remaining target queue, the first counter value corresponding to the remaining target queue is updated in real time, and the remaining target queue is scheduled and processed according to the corresponding first counter value.

[0019] In one of the embodiments, after the matching processing of all the pending commands in the current scan queue cache is completed, the current scan queue is determined again from the remaining scan queue, which specifically comprises:

[0020] A candidate queue with a non-zero first counter value is determined from the remaining scan queue, and the candidate queue is determined as the current scan queue determined again.

[0021] In one of the embodiments, the scheduling processing of the pending commands after the matching processing is completed specifically comprises:

[0022] In the case that the scheduled pending command includes the discard mark information, the pending command with the discard mark information is discarded;

[0023] In the case that the scheduled pending command does not include the discard mark information, the pending command is output.

[0024] In one of the embodiments, after the scheduling of the pending commands cached in the remaining target queue is completed, the matching processing with the reset logout command is performed, which specifically comprises:

[0025] In the case that the scheduled completed pending command matches the reset logout command, the scheduled completed pending command is discarded;

[0026] In the case that the scheduled completed pending command does not match the reset logout command, the scheduled completed pending command is output.

[0027] In a second aspect, the application provides an RDMA network card, and the method comprises:

[0028] The receiving module is configured to receive the reset logout command sent by the host;

[0029] a processing module configured to determine a target queue associated with the reset logout command, wherein the target queue stores pending commands to be processed; determine a current scanning queue from the target queue, and match the pending commands stored in the current scanning queue with the reset logout command;

[0030] a scheduler configured to schedule the pending commands that have completed the matching process;

[0031] The scheduler is further configured to schedule the pending commands stored in the remaining target queues.

[0032] The processing module is further configured to match the reset logout command with the pending commands stored in the remaining target queues after the scheduling of the pending commands stored in the remaining target queues is completed; wherein the remaining target queues are the queues in the target queue other than the current scanning queue; after the matching process of all the pending commands stored in the current scanning queue is completed, a current scanning queue is determined again from the remaining scanning queues, and the pending commands stored in the current scanning queue determined again are matched with the reset logout command, and the pending commands stored in the remaining target queues determined again are scheduled until the matching process of all the pending commands in the target queue with the reset logout command is completed, and a final reset logout response is generated for the host; the remaining scanning queues are the queues in the target queue other than the completed scanning queues; and the completed scanning queues are the queues in which the matching process of all the pending commands stored in the queues with the reset logout command is completed.

[0033] In one of the embodiments,

[0034] The RDMA network card comprises a plurality of first counters and second counters, each target queue corresponds to a first counter and a second counter, the first counter is configured to count the pending commands in the corresponding target queue that have not been scheduled to obtain a first counter value, and the second counter is configured to count the pending commands in the corresponding target queue that have not been matched to obtain a second counter value.

[0035] The processing module is further configured to read a pending command from the current scanning queue in sequence, and match the read pending command with the reset logout object information in the reset logout command; if the matching is successful, the pending command is marked as discarded and written back to the current scanning queue, the second counter value corresponding to the current scanning queue is updated, and a pending command in the current scanning queue is read again; otherwise, the next pending command in the current scanning queue is read again; the difference between the first counter value and the second counter value is calculated in real time.

[0036] The scheduler is configured to schedule the pending commands in the current scan queue cache according to the difference. In one embodiment, the processing module is further configured to update the first counter value corresponding to the remaining target queue in real time;

[0037] The scheduler is further configured to schedule and process the remaining target queue according to the corresponding first counter value.

[0038] In one embodiment, the processing module is further configured to determine a candidate queue with a non-zero first counter value from the remaining scan queue, and determine the candidate queue as the current scan queue again.

[0039] In one embodiment, the processing module is further configured to discard the pending command with the discard flag information if the scheduled pending command includes the discard flag information, and output the pending command if the scheduled pending command does not include the discard flag information.

[0040] In one embodiment, the processing module is further configured to discard the scheduled completed pending command if the scheduled completed pending command matches the reset logout command, and output the scheduled completed pending command if the scheduled completed pending command does not match the reset logout command.

[0041] In a third aspect, the present application further provides an RDMA system, comprising the RDMA network card and the host as described in the second aspect.

[0042] In a fourth aspect, the present application further provides a chip, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the first aspect when executing the computer program.

[0043] In a fifth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method in the first aspect when executed by a processor.

[0044] In a sixth aspect, the present application further provides a computer program product, comprising a computer program, and the computer program implements the steps of the method in the first aspect when executed by a processor.

[0045] The reset logout method of the RDMA network card, the RDMA network card, the system, the chip, the storage medium and the program product receive a reset logout command sent by a host; determine a target queue associated with the reset logout command, wherein the target queue caches a to-be-processed command; determine a current scanning queue from the target queue, match the to-be-processed command cached in the current scanning queue with the reset logout command, and schedule the to-be-processed command after the matching is completed; schedule the to-be-processed command cached in the remaining target queue, and match the to-be-processed command with the reset logout command after the scheduling is completed; wherein the remaining target queue is a queue in the target queue except the current scanning queue; after the matching of all the to-be-processed commands cached in the current scanning queue is completed, a current scanning queue is determined again from the remaining scanning queue, the to-be-processed command cached in the current scanning queue determined again is matched with the reset logout command, and the to-be-processed command cached in the remaining target queue determined again is scheduled until the matching of all the to-be-processed commands in the target queue with the reset logout command is completed, a final reset logout response is generated to the host, the remaining scanning queue is a queue in the target queue except the completed scanning queue, and the completed scanning queue is a queue in which the matching of all the to-be-processed commands cached in the queue with the reset logout command is completed. Since the current scanning queue is matched first and then scheduled, and the to-be-processed command after the matching is completed can be directly scheduled without waiting for the current scanning queue to complete the matching. At the same time, the target queue except the current scanning queue can be scheduled first and then matched, thereby improving the efficiency of the to-be-processed command participating in the scheduling and speeding up the processing efficiency of the logout processing command. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without any creative effort.

[0047] Figure 1 An application environment diagram of a reset logout method of an RDMA network card provided by an embodiment of the present application;

[0048] Figure 2 A flowchart of a reset logout method of an RDMA network card provided by an embodiment of the present application;

[0049] Figure 3 A principle diagram of a reset logout method of an RDMA network card provided by an embodiment of the present application;

[0050] Figure 4A flowchart of another reset logout method of an RDMA network card provided by the embodiment of the present application is shown in the figure.

[0051] Figure 5 A structure diagram of an RDMA network card provided by the embodiment of the present application is shown in the figure.

[0052] Figure 6 A structure diagram of a computer device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0054] To solve the above problems, the embodiment of the present application provides a reset logout method of an RDMA network card, an RDMA network card, a system, a chip, a storage medium and a program product. For the current scan queue, the matching is performed first and then the scheduling is performed, and the to-be-processed command whose matching processing is completed can be directly scheduled without waiting for the current scan queue to complete the matching. At the same time, for the target queue outside the current scan queue, the scheduling can be performed first and then the matching is performed, thereby improving the efficiency of the to-be-processed command participating in the scheduling and speeding up the processing efficiency of the logout processing command.

[0055] The application scenario of the reset logout method of the RDMA network card provided by the embodiment of the present application is described below.

[0056] The reset logout method of the RDMA network card provided by the embodiment of the present application can be applied to, for example, Figure 1The application environment shown. The host 101 sends the reset logoff command of the RDMA network card to the RDMA network card 102. The RDMA network card 102 determines the target queue associated with the reset logoff command, wherein the target queue buffers the to-be-processed command. Secondly, the RDMA network card 102 determines a current scanning queue from the target queue, matches the to-be-processed command buffered in the current scanning queue with the reset logoff command, and schedules the to-be-processed command matched. Thirdly, the RDMA network card 102 schedules the to-be-processed command buffered in the remaining target queue, and matches the reset logoff command after the scheduling is completed; wherein the remaining target queue is the queue in the target queue except the current scanning queue. Finally, the RDMA network card 102 determines a current scanning queue from the remaining scanning queue after the matching of all the to-be-processed commands buffered in the current scanning queue is completed, and matches the to-be-processed command buffered in the current scanning queue determined again with the reset logoff command, and schedules the to-be-processed command buffered in the remaining target queue determined again, until the matching of all the to-be-processed commands in the target queue with the reset logoff command is completed, and the final reset logoff response is generated to the host. The remaining scanning queue is the queue in the target queue except the completed scanning queue, and the completed scanning queue is the queue in which the matching of all the to-be-processed commands buffered in the queue with the reset logoff command is completed.

[0057] It should be understood that the reset logoff method of the RDMA network card can be applied to the interaction between the RDMA network card and the host.

[0058] In an exemplary embodiment, as shown in Figure 2 A flowchart of a reset logoff method of an RDMA network card is provided, which is applied to the RDMA network card, and includes S201 to S205:

[0059] S201, receiving the reset logoff command of the RDMA network card sent by the host.

[0060] In the present application, when the reset logoff of the RDMA network card is required, the host can send the reset logoff command to the RDMA network card.

[0061] It should be understood that the reset logoff of the RDMA network card is used to restart the state of the RDMA network card or release the resource of the RDMA, so as to avoid the data loss, connection exception and system crash of the RDMA network card.

[0062] In some embodiments, the reset logout object information can be included in the reset logout command of the RDMA network card. Accordingly, after receiving the reset logout command of the RDMA network card, the RDMA network card can send a response to the reset logout command to the host after processing the target queue corresponding to the function ID and the queue pair indicated by the reset logout object information, so as to complete the reset logout of the RDMA network card.

[0063] For example, the reset logout object information at least includes a function ID and a queue pair number indicating the function ID and the queue pair to be reset logged out. Alternatively, the reset logout object information at least includes a function ID indicating the function ID to be reset logged out.

[0064] S202, determine a target queue associated with the reset logout command, wherein the target queue buffers a to-be-processed command.

[0065] It should be understood that the embodiments of the present application do not limit how to determine the target queue associated with the reset logout command.

[0066] In some embodiments, the RDMA network card can determine whether each buffer queue belongs to the buffer queue corresponding to the reset logout object information in the reset logout command. In the case that the buffer queue belongs to the buffer queue corresponding to the reset logout object information in the reset logout command, the RDMA network card determines that the buffer queue is the target queue associated with the reset logout command. In the case that the buffer queue does not belong to the buffer queue corresponding to the reset logout object information, the RDMA network card determines that the buffer queue is a queue not associated with the reset logout command.

[0067] For example, the reset logout object information at least includes a function ID and a queue pair number indicating the function ID and the queue pair to be reset logged out. Alternatively, the reset logout object information at least includes a function ID indicating the function ID to be reset logged out.

[0068] For example, the function ID indicated by the reset logout object information is the network card function A and the queue pair B to be reset logged out. The buffer queue belonging to the network card function A or the queue pair B in the RDMA network card can be determined as the target queue associated with the reset logout command. The buffer queue not belonging to the network card function A or the queue pair B in the RDMA network card can be determined as a queue not associated with the reset logout command.

[0069] S203, determine a current scanning queue from the target queue, match and process the to-be-processed command buffered in the current scanning queue with the reset logout command, and schedule the to-be-processed command after the matching and processing is completed.

[0070] It should be understood that, in order to realize the optimization of the scheduling strategy in the target queue scanning process, the first counter value (node_cnt_list_N) and the second counter value (node_cnt_scan_N) can be used to maintain the number of pending commands in the target queue according to the embodiments of the present application.

[0071] In the above method, each target queue corresponds to a first counter value and a second counter value, the first counter value is used to represent the number of pending commands in the corresponding target queue which have not been scheduled, and the second counter value is used to represent the number of pending commands in the corresponding target queue which have not been processed by matching.

[0072] For example, each target queue corresponds to a first counter value and a second counter value respectively. When the RDMA network card receives the reset logout command, the first counter value and the second counter value corresponding to the target queue associated with the reset logout command are updated, and the initial values of the first counter value and the second counter value are set to the number of pending commands in the target queue associated with the reset logout command at present. The first counter value and the second counter value corresponding to other cache queues not associated with the reset logout command are fixed as 0.

[0073] For example, the RDMA network card can update the initial value of the first counter value of the target queue N to the number of pending commands in the target queue N at present when receiving the reset logout command. During the processing of the reset command scanning queue, when the back-end queue scheduling logic schedules a pending command of the target queue N, the first counter value is reduced by 1 until the first counter value is reduced to 0. When the first counter value is reduced to 0, it indicates that all the pending commands in the target queue N before the RDMA network card receives the reset logout command have been processed, and subsequent matching processing of the target queue N is not required. When the target queue N is scheduled to be scanned, if the first counter value is not reduced to 0, the number of pending commands corresponding to the first counter value is matched and processed.

[0074] It should be understood that, in the process of matching and scheduling the pending commands cached in the current scanning queue with the reset logout command, the first counter value and the second counter value are updated in real time, and the scheduling of the pending commands cached in the current scanning queue is performed according to the first counter value and the second counter value.

[0075] In some embodiments, after determining the target queue associated with the reset logout command, a pending command can be read from the current scanning queue in sequence, and the read pending command is matched with the reset logout object information in the reset logout command.

[0076] If the matching is successful, the RDMA card can write back the to-be-processed command with the discard mark into the current scanning queue, update the second counter value corresponding to the current scanning queue, and continue to read a to-be-processed command in the current scanning queue. If the matching is unsuccessful, the RDMA card can continue to read the next to-be-processed command in the current scanning queue.

[0077] For example, when the target queue in the scanning state, for example, the target queue N is in the current scanning state, the RDMA card reads a to-be-processed command for matching. If the matching is successful, the to-be-processed command is written back into the current scanning queue with the discard mark, and the second counter value corresponding to the current scanning queue is updated. The second counter value is reduced by one each time the RDMA card matches a to-be-processed command with the discard mark, until the second counter value is reduced to 0, and the matching processing of the current scanning queue is completed.

[0078] For example, the to-be-processed commands in the current scanning queue whose matching processing is completed can participate in scheduling one by one without waiting for all the to-be-processed commands in the current scanning queue to complete the matching before participating in scheduling. In the scheduling process, if the to-be-processed command whose matching processing is completed includes the discard mark information, the RDMA card can discard the to-be-processed command with the discard mark information. If the to-be-processed command whose matching processing is completed does not include the discard mark information, the RDMA card can output the to-be-processed command.

[0079] For the target queue in the non-current scanning state (i.e., the non-current scanning target queue), the second counter value can also be updated when the to-be-processed command in the non-current scanning queue is scheduled. When the target queue N is in the non-current scanning state, the to-be-processed command in the target queue N can normally participate in scheduling, and after the scheduling is completed, the first counter value is reduced by one. The processing module can quickly perform matching on the to-be-processed command whose scheduling is completed, and thus the second counter value can also be updated when the to-be-processed command in the non-current scanning queue is scheduled.

[0080] In some embodiments, when the current scanning queue is determined, the first counter value can be referred to, the candidate queue with the non-zero first counter value can be selected, and the candidate queue can be determined as the current scanning queue determined again. That is, the number of to-be-processed commands in the target queue with the first counter value of 0 that have not been scheduled is 0, and thus it is not necessary to perform matching processing again, and the target queue can be directly skipped to select other target queues as the current scanning queue.

[0081] For example, if there are multiple non-zero candidate queues, the RDMA network card can determine any one of the non-zero candidate queues as the current scanning queue. For example, the current scanning queue can be determined from the non-zero candidate queues in a preset order between the queues. For example, the current scanning queue can also be randomly determined from the non-zero candidate queues.

[0082] It should be understood that the process of matching the to-be-processed command with the reset logout object information can determine whether the to-be-processed command belongs to the to-be-processed command process corresponding to the reset logout object information based on the use or attribution information of the to-be-processed command. If the to-be-processed command belongs to the to-be-processed command corresponding to the reset logout object information, it is determined that the matching is successful. If the to-be-processed command does not belong to the to-be-processed command corresponding to the reset logout object information, it is determined that the matching fails. For the to-be-processed command that matches successfully, a discard flag information can be added.

[0083] S204, scheduling the to-be-processed commands cached in the remaining target queues, and performing matching processing with the reset logout command after the scheduling is completed.

[0084] Among them, the remaining target queue is a queue in the target queue except the current scanning queue.

[0085] It should be understood that the RDMA network card can only scan one target queue at a time. When the current scanning queue is in the scanning state, the to-be-processed commands cached in the remaining target queues except the current scanning queue in the other target queues can be directly scheduled without waiting for the current scanning queue to complete the scanning, so that the scheduling efficiency can be obviously improved and the reset logout process can be accelerated.

[0086] In some embodiments, for the remaining target queue, the RDMA network card can also update the first counter value corresponding to the remaining target queue in real time, and schedule the remaining target queue according to the corresponding first counter value.

[0087] For example, during the processing of the current scanning queue, the post-stage queue scheduling logic schedules the to-be-processed commands corresponding to the first counter value of the remaining target queue. Each time a to-be-processed command of the remaining target queue is scheduled, the first counter value is reduced by 1, and correspondingly, the remaining schedulable to-be-processed commands in the subsequent remaining target queue are reduced by 1, until the first counter value is reduced to 0, indicating that all to-be-processed commands of the remaining target queue received by the RDMA network card before the reset logout command have been processed, and subsequent matching processing of the remaining target queue is not required.

[0088] In some embodiments, the scheduling processing is performed on the to-be-processed commands that have completed the matching processing, and specifically includes: in a case where the to-be-processed command that has completed the scheduling matches the reset logout command, discarding the to-be-processed command that has completed the scheduling; and in a case where the to-be-processed command that has completed the scheduling does not match the reset logout command, outputting the to-be-processed command that has completed the scheduling.

[0089] It should be noted that the matching logic of the to-be-processed commands cached in the remaining target queue is consistent with the matching logic of the to-be-processed commands cached in the current scanning queue, and both are to-be-processed commands corresponding to the reset logout object information of the reset logout command, which will not be described herein again.

[0090] It should be noted that the matching processing on the current scanning queue and the scheduling processing on the remaining target queue are performed simultaneously, that is, S203 and S204 do not have a sequence of execution.

[0091] S205, after the matching processing on the to-be-processed commands cached in the current scanning queue is completed, determining again a current scanning queue from the remaining scanning queue, performing matching processing on the to-be-processed commands cached in the current scanning queue determined again and the reset logout command, and scheduling the to-be-processed commands cached in the remaining target queue determined again until the matching processing on all the to-be-processed commands in the target queue and the reset logout command is completed, and generating a final reset logout response to the host.

[0092] The remaining scanning queue is a queue in the target queue except the completed scanning queue, and the completed scanning queue is a queue in which the matching processing on all the to-be-processed commands cached in the queue and the reset logout command is completed.

[0093] In some embodiments, after the matching processing on all the to-be-processed commands cached in the current scanning queue is completed, the RDMA card can determine a candidate queue with a first counter value of zero from the remaining scanning queue, and determine the candidate queue as the current scanning queue determined again.

[0094] That is, the number of to-be-processed commands in the target queue with the first counter value of zero that have not been scheduled is 0, and therefore, the matching processing is not needed and the target queue can be directly skipped to select other target queues as the current scanning queue determined again.

[0095] For example, the current scanning queue determined again can be determined from the candidate queues with the non-zero first counter value in a preset order. For example, the current scanning queue determined again can also be determined randomly from the candidate queues with the non-zero first counter value.

[0096] It should be noted that the matching processing of the re-determined current scanning queue cached pending commands and the reset logout command is consistent with the logic of matching the cached pending commands in the current scanning queue with the reset logout command, and the embodiments of the present application do not repeat the description. The scheduling of the re-determined remaining target queue cached pending commands is consistent with the logic of scheduling the cached pending commands in the remaining target queue, and the embodiments of the present application do not repeat the description.

[0097] In some embodiments, after completing the matching processing of all the pending commands in the target queue and the reset logout command, the RDMA network card can generate a final reset logout response to the host, thereby indicating that the RDMA network card completes the reset logout.

[0098] Exemplary, Figure 3 The principle schematic diagram of a reset logout method of an RDMA network card provided by the embodiments of the present application is as follows: Figure 3 When receiving the reset logout queue of the RDMA network card, the RDMA network card can determine whether each cached queue is associated with the reset logout command, and scan and mark the target queue associated with the reset logout command. If the current cached queue 0, cached queue 1, cached queue N-1 and cached queue N of the RDMA network card are all associated with the current reset logout command, then the cached queue 0, cached queue 1, cached queue N-1 and cached queue N are all target queues. Subsequently, the RDMA network card can determine that the cached queue 0 is the current scanning queue, match the cached pending commands in the cached queue 0 with the reset logout command, and schedule the pending commands after completing the matching processing. During the scanning of the cached queue 0, the pending commands cached in the remaining cached queue 1, cached queue N-1 and cached queue N can all directly participate in the queue scheduling of the scheduling unit, and after completing the scheduling, the matching processing with the reset logout command is performed. After completing the matching processing of all the pending commands in the cached queue 0, a current scanning queue can be determined again from the cached queue 1, cached queue N-1 and cached queue N, and the re-determined current scanning queue cached pending commands are matched with the reset logout command, and the re-determined remaining target queue cached pending commands are scheduled, and the cycle is repeated until the matching processing of all the pending commands in the target queue and the reset logout command is completed, and a final reset logout response is generated to the host.

[0099] The reset logout method of the RDMA network card provided in the embodiments of the present application comprises the following steps: receiving a reset logout command sent by a host; determining a target queue associated with the reset logout command, wherein the target queue stores to-be-processed commands; determining a current scanning queue from the target queue, performing matching processing on the to-be-processed commands stored in the current scanning queue and the reset logout command, and performing scheduling processing on the to-be-processed commands for which the matching processing is completed; performing scheduling on the to-be-processed commands stored in the remaining target queues and performing matching processing on the to-be-processed commands after the scheduling is completed; wherein the remaining target queues are the queues in the target queue except the current scanning queue; after the matching processing on all the to-be-processed commands stored in the current scanning queue is completed, a current scanning queue is determined again from the remaining scanning queues, matching processing is performed on the to-be-processed commands stored in the current scanning queue determined again and the reset logout command, and the to-be-processed commands stored in the remaining target queues determined again are scheduled until the matching processing on all the to-be-processed commands in the target queue and the reset logout command is completed, and a final reset logout response is generated to the host; the remaining scanning queues are the queues in the target queue except the completed scanning queues; and the completed scanning queues are the queues in which the matching processing on all the to-be-processed commands stored in the queues and the reset logout command is completed. Since the current scanning queue is matched first and then scheduled, and the to-be-processed commands for which the matching processing is completed can be directly scheduled without waiting for the current scanning queue to complete the matching, meanwhile, the target queues except the current scanning queue can be scheduled first and then matched, thereby improving the efficiency of the to-be-processed commands participating in the scheduling and speeding up the processing efficiency of the logout processing command.

[0100] In one exemplary embodiment, as shown in Figure 4 Another flowchart of a reset logout method of an RDMA network card is provided, which is applied to an RDMA network card and comprises the following steps S301 to S317.

[0101] S301, receiving a reset logout command of an RDMA network card sent by a host.

[0102] S302, determining whether any cache queue is a target queue associated with the reset logout command, wherein the target queue stores to-be-processed commands.

[0103] If yes, S303 is performed, and if no, S312 is performed.

[0104] S303, updating a first counter value and a second counter value to the number of to-be-processed commands of the target queue.

[0105] S304, updating the queue number of the target queue in the scanning state.

[0106] S305, determining whether the target queue is the current scanning queue according to the queue number of the target queue in the scanning state.

[0107] If yes, S306 is executed, and if no, S312 is executed.

[0108] S306, determining whether the first counter value of the current scanning queue is not 0.

[0109] If yes, S307 is executed, and if no, S311 is executed.

[0110] S307, matching the cached pending command in the current scanning queue with the reset logout object information in the reset logout command, and adding discard mark information to the matched pending command.

[0111] S308, updating the first counter value and the second counter value.

[0112] S309, the matched processing completed pending command enters the queue scheduling.

[0113] S310, determining whether the second counter value is 0.

[0114] If yes, S311 is executed, and otherwise, S307 is executed.

[0115] S311, determining whether the current scanning queue is the last target queue of the scanning associated with the current reset logout command.

[0116] If yes, S301 is executed, and otherwise, S304 is executed.

[0117] S312, the cached pending command in the target queue enters the queue scheduling.

[0118] After S309 and S312, S313 is executed.

[0119] S313, scheduling the pending command entering the queue scheduling.

[0120] S314, determining whether there is discard mark information in the scheduled pending command.

[0121] If yes, S316 is executed, and if no, S315 is executed.

[0122] S315, determining whether the scheduled pending command matches the reset logout command.

[0123] If yes, S316 is executed, and if no, S317 is executed.

[0124] S316, discarding the scheduled pending command.

[0125] S317, output the scheduled to-be-processed command.

[0126] It should be noted that the updating of the first counter value and the second counter value described in S308 is for two counters of the current scanning queue, and the second counter value is only decreased by 1 after one to-be-processed command is matched, and the first counter value is only decreased by 1 after one to-be-processed command is scheduled by the queue. Meanwhile, the two counters of the target queue not in scanning are decreased by 1 after one to-be-processed command is scheduled by the queue.

[0127] The reset logout method of the RDMA network card provided by the embodiment of the present application comprises the following steps: receiving a reset logout command sent by a host; determining a target queue associated with the reset logout command, wherein the target queue stores to-be-processed commands; determining a current scanning queue from the target queue, matching the to-be-processed commands stored in the current scanning queue with the reset logout command, and scheduling the to-be-processed commands whose matching is completed; scheduling the to-be-processed commands stored in the remaining target queues and matching the to-be-processed commands with the reset logout command after the scheduling is completed; wherein the remaining target queues are the queues in the target queue except the current scanning queue; after the matching of all the to-be-processed commands stored in the current scanning queue is completed, determining a current scanning queue again from the remaining scanning queues, matching the to-be-processed commands stored in the current scanning queue determined again with the reset logout command, and scheduling the to-be-processed commands stored in the remaining target queues determined again until the matching of all the to-be-processed commands in the target queue with the reset logout command is completed, generating a final reset logout response to the host; the remaining scanning queues are the queues in the target queue except the completed scanning queue, and the completed scanning queue is the queue in which the matching of all the to-be-processed commands stored in the queue with the reset logout command is completed. Since the current scanning queue is matched first and then scheduled, and the to-be-processed commands whose matching is completed can be directly scheduled without waiting for the completion of the matching of the current scanning queue. Meanwhile, the target queues except the current scanning queue can be scheduled first and then matched, thereby improving the efficiency of the to-be-processed commands participating in the scheduling and speeding up the processing efficiency of the logout processing command.

[0128] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.

[0129] Based on the same inventive concept, the embodiments of the present application also provide an RDMA network card for implementing the reset logout method of the RDMA network card involved above. The implementation scheme for solving the problem provided by the RDMA network card is similar to the implementation scheme described in the above method, so the specific limitations in one or more RDMA network card embodiments provided below can refer to the limitations of the reset logout method of the RDMA network card in the above text, and will not be repeated here.

[0130] In one exemplary embodiment, as shown in Figure 5 An RDMA network card 400 is provided, comprising a receiving module 401, a processing module 402 and a scheduler 403, wherein:

[0131] The receiving module 401 is configured to receive a reset logout command sent by a host;

[0132] The processing module 402 is configured to determine a target queue associated with the reset logout command, wherein the target queue stores pending commands; determine a current scanning queue from the target queue, and perform matching processing on the pending commands stored in the current scanning queue and the reset logout command;

[0133] The scheduler 403 is configured to perform scheduling processing on the pending commands whose matching processing is completed;

[0134] The scheduler 403 is further configured to perform scheduling on the pending commands stored in the remaining target queues,

[0135] The processing module 402 is further configured to perform matching processing on the reset logout command after scheduling of the pending commands cached in the remaining target queues is completed; the remaining target queues are the queues in the target queues except the current scanning queue; after matching processing of all the pending commands cached in the current scanning queue is completed, a current scanning queue is determined again from the remaining scanning queues, and the pending commands cached in the current scanning queue determined again are matched with the reset logout command, and the pending commands cached in the remaining target queues determined again are scheduled until matching processing of all the pending commands in the target queues and the reset logout command is completed, and a final reset logout response is generated and sent to the host; the remaining scanning queues are the queues in the target queues except the completed scanning queues; the completed scanning queues are the queues in which the matching processing of all the pending commands cached in the queues and the reset logout command is completed.

[0136] In one of the embodiments, the RDMA network card comprises a plurality of first counters and second counters, each target queue corresponds to a first counter and a second counter, the first counter is used to count the pending commands in the corresponding target queue that have not been scheduled to obtain a first counter value, and the second counter is used to count the pending commands in the corresponding target queue that have not been matched to obtain a second counter value.

[0137] The processing module 402 is further configured to sequentially read a pending command from the current scanning queue, and match the read pending command with the reset logout object information in the reset logout command; if the matching is successful, the pending command is marked as discarded and written back to the current scanning queue, the second counter value corresponding to the current scanning queue is updated, and a pending command in the current scanning queue is read again; otherwise, the next pending command in the current scanning queue is read again; the difference between the first counter value and the second counter value is calculated in real time.

[0138] The scheduler 403 is configured to schedule the pending commands cached in the current scanning queue according to the difference.

[0139] In one of the embodiments, the processing module 402 is further configured to update the first counter value corresponding to the remaining target queues in real time.

[0140] The scheduler 403 is further configured to schedule the remaining target queues according to the corresponding first counter values.

[0141] In one of the embodiments, the processing module 402 is further configured to determine a candidate queue with a non-zero first counter value from the remaining scanning queues, and determine the candidate queue as the current scanning queue determined again.

[0142] In one of the embodiments, the processing module 402 is further configured to discard the to-be-processed command with the discard flag information in a case where the to-be-processed command is scheduled to include the discard flag information, and output the to-be-processed command in a case where the to-be-processed command is scheduled to not include the discard flag information.

[0143] In one of the embodiments, the processing module 402 is further configured to discard the to-be-processed command in a case where the to-be-processed command is scheduled to match the reset logout command, and output the to-be-processed command in a case where the to-be-processed command is scheduled to not match the reset logout command.

[0144] The modules in the host described above can be implemented by software, hardware, or a combination thereof, in whole or in part. The modules described above can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.

[0145] In one of the exemplary embodiments, a computer device is provided, which can be a network device, and an internal structure diagram of the computer device can be as shown in Figure 6 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. 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. The processor of the computer device is configured 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 operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a reset logout method of an RDMA network card.

[0146] Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0147] In one of the exemplary embodiments, an RDMA system is provided, which includes the RDMA network card and the host described above.

[0148] In an exemplary embodiment, a chip is provided, comprising a memory and a processor, the memory storing a computer program, the processor implementing the reset logout method of the RDMA network card when executing the computer program.

[0149] In an exemplary embodiment, a computer readable storage medium is provided, having stored thereon a computer program, the computer program being executed by a processor to implement the reset logout method of the RDMA network card.

[0150] In an exemplary embodiment, a computer program product is provided, comprising a computer program, the computer program being executed by a processor to implement the reset logout method of the RDMA network card.

[0151] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to 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. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., and is not limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., and is not limited thereto.

[0152] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, it should be considered as the scope of the present application.

[0153] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for resetting and deregistering an RDMA network card, characterized in that, The method includes: Receive reset / deregistration command sent by the host; Identify the target queue associated with the reset / deregistration command, wherein the target queue caches commands to be processed; A current scan queue is determined from the target queue, and the pending commands cached in the current scan queue are matched with the reset and deregistration commands. The pending commands that have been matched are then scheduled for processing. The pending commands cached in the remaining target queue are scheduled, and after scheduling is completed, they are matched with the reset and deregistration commands; wherein, the remaining target queue is the queue in the target queue other than the current scan queue; After matching all pending commands cached in the current scan queue, a new current scan queue is determined from the remaining pending scan queues. The pending commands cached in the newly determined current scan queue are then matched with the reset / deregistration command. The pending commands cached in the newly confirmed remaining target queues are also scheduled until all pending commands in the target queues are matched with the reset / deregistration command. Finally, a reset / deregistration response is generated and sent to the host. The remaining pending scan queues are the target queues excluding the queues that have been scanned. The queues that have been scanned are the queues in which all pending commands cached in the queues have been matched with the reset / deregistration command.

2. The method according to claim 1, characterized in that, Each target queue corresponds to a first counter value and a second counter value. The first counter value is used to represent the number of unscheduled pending commands in the corresponding target queue, and the second counter value is used to represent the number of pending commands in the corresponding target queue that have not been matched. The step of determining a current scan queue from the target queue, matching the pending commands cached in the current scan queue with the reset / cancellation command, and scheduling the pending commands after the matching process is completed specifically includes: One command to be processed is read sequentially from the current scan queue, and the read command to be processed is matched with the reset / cancellation object information in the reset / cancellation command; If a match is successful, the pending command is marked as discarded and written back to the current scan queue, and the second counter value corresponding to the current scan queue is updated. Then, the system continues to read one pending command from the current scan queue. Otherwise, the system continues to read the next pending command from the current scan queue. The difference between the first counter value and the second counter value is calculated in real time, so that the scheduler can schedule the pending commands in the current scan queue cache according to the difference.

3. The method according to claim 2, characterized in that, The method further includes: For the remaining target queue, the first counter value corresponding to the remaining target queue is updated in real time, and the remaining target queue is scheduled according to the corresponding first counter value.

4. The method according to claim 3, characterized in that, The step of determining a new current scan queue from the remaining queues after matching all pending commands cached in the current scan queue specifically includes: From the remaining queues to be scanned, determine a candidate queue with a non-zero first counter value, and then determine the candidate queue as the current scan queue to be determined again.

5. The method according to claim 2, characterized in that, The scheduling and processing of pending commands after matching is completed specifically includes: If the scheduled pending command includes the discard flag information, discard the pending command containing the discard flag information; If the discard flag information is not included in the scheduled pending commands, the pending commands are output.

6. The method according to claim 1, characterized in that, The process of scheduling pending commands cached in the remaining target queue and matching them with the reset / cancellation command after scheduling is completed specifically includes: If the scheduled pending command matches the reset / cancellation command, the scheduled pending command is discarded. If the pending command completed by the scheduling does not match the reset / cancel command, the pending command completed by the scheduling is output.

7. An RDMA network card, characterized in that, The RDMA network card includes: The receiving module is used to receive reset and deregistration commands sent by the host. The processing module is used to determine a target queue associated with the reset / deregistration command, wherein the target queue caches commands to be processed; determine a current scan queue from the target queue, and match the commands to be processed cached in the current scan queue with the reset / deregistration command; The scheduler is used to schedule and process pending commands after the matching process is completed. The scheduler is also used to schedule the pending commands cached in the remaining target queue. The processing module is further configured to perform matching processing with the reset / deregistration command after the scheduling of pending commands cached in the remaining target queue is completed; wherein, the remaining target queue is the queue in the target queue other than the current scan queue; after the matching processing of all pending commands cached in the current scan queue is completed, a new current scan queue is determined from the remaining pending scan queue, and the pending commands cached in the newly determined current scan queue are matched with the reset / deregistration command, and the pending commands cached in the newly confirmed remaining target queue are scheduled, until the matching processing of all pending commands in the target queue with the reset / deregistration command is completed, and a final reset / deregistration response is generated for the host, wherein, the remaining pending scan queue is the queue in the target queue other than the completed scan queue, and the completed scan queue is the queue in which all pending commands cached in the queue have completed the matching processing with the reset / deregistration command.

8. The RDMA network card according to claim 7, characterized in that, The RDMA network card includes multiple first counters and second counters. Each target queue corresponds to a first counter and a second counter. The first counter is used to count the unscheduled pending commands in the corresponding target queue to obtain a first counter value. The second counter is used to count the pending commands in the corresponding target queue that have not been matched to obtain a second counter value. The processing module is further configured to sequentially read a command to be processed from the current scan queue, and match the read command to be processed with the reset / deregistration object information in the reset / deregistration command; if the match is successful, the command to be processed is marked as discarded and written back to the current scan queue, and the second counter value corresponding to the current scan queue is updated, and the module continues to read a command to be processed from the current scan queue; otherwise, the module continues to read the next command to be processed from the current scan queue. The difference between the first counter value and the second counter value is calculated in real time. The scheduler is used to schedule the pending commands in the current scan queue cache according to the difference.

9. The RDMA network card according to claim 8, characterized in that: The processing module is also used to update the first counter value corresponding to the remaining target queue in real time; The scheduler is also used to schedule the remaining target queue according to the corresponding first counter value.

10. The RDMA network card according to claim 9, characterized in that, The processing module is further configured to determine a candidate queue with a non-zero first counter value from the remaining queues to be scanned, and to determine the candidate queue as the current scan queue to be determined again.

11. The RDMA network card according to claim 8, characterized in that, The processing module is further configured to discard the pending command with the discard flag information if the scheduled pending command includes the discard flag information; and to output the pending command if the scheduled pending command does not include the discard flag information.

12. The RDMA network card according to claim 7, characterized in that, The processing module is further configured to discard the scheduled pending command if it matches the reset / cancellation command; and to output the scheduled pending command if it does not match the reset / cancellation command.

13. An RDMA system, characterized in that, Includes the RDMA network card and host as described in any one of claims 7 to 12.

14. A chip comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • RDMA network card sending queue performance isolation method and RDMA network card

    CN116800684A

  • RDMA engine, queue pair management method thereof and chip

    CN117896336A