Command queue fast processing method, electronic device and storage medium
Patent Information
- Application Number
- CN202611425321.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-10-16
AI Technical Summary
[0003]由于若干个功能单元的请求命令队列均与网卡固件的请求命令队列进行命令传输,属于多对一的对应关系,因此,当命令队列处于高负载(即功能单元的命令数量过多)的情况时,若网卡固件的请求命令队列的队头的请求命令(即当前需要处理的请求命令)需要依赖其他信息的处理才能进行处理,则网卡固件就需要通知主机将这个依赖的信息发送过来,那么主机就会再生成一个该依赖信息对应的新的请求命令,此时如果网卡固件的请求命令队列满载,没有空余的槽位时,这个依赖信息的请求命令就无法入队,而队头的请求命令又因为无法进行处理导致不能出队,所以在此种情况下,网卡固件的请求命令队列就会卡死,队列中的命令无法处理,还没有入队的命令无法入队,导致功能单元和网卡固件之间的命令通讯发生故障,加大命令的处理时延
[0020] The command queue fast processing method of the present invention first polls the status sub-table corresponding to each functional unit in the command status table (the command status table stores the command status bits of the request commands corresponding to each storage space of each functional unit of the host). The storage space whose command status bit in the status sub-table of the currently polled functional unit is the second status bit (the second status bit indicates that there are pending request commands in the corresponding storage space that have not been moved to the pending request queue) is determined as the pending processing space. Then, the priority of the pending request commands stored in the pending processing space is checked. If the priority of all pending request commands stored in the pending processing space is the first priority, then the request commands in each pending processing space are moved to the pending request queue corresponding to the network card firmware. The command status bit of the storage space corresponding to the request command moved to the pending request queue in the command status table is adjusted from the second status bit to the third status bit (the third status bit indicates that there are request commands in the corresponding storage space that have been moved to the pending request queue but have not been processed). Furthermore, if the request command at the head of the pending request queue has a preceding command, the method proceeds. The request command is identified as a secondary processing command (the preceding command corresponding to the secondary processing command is the request command on which the secondary processing command depends for processing; that is, the secondary processing command can only be processed after the preceding command corresponding to the secondary processing command is processed). The secondary processing command is removed from the pending request queue and stored in the storage space corresponding to the secondary processing command. In addition, the command status bit of the storage space corresponding to the secondary processing command in the command status table is adjusted from the third status bit to the second status bit. The priority of the secondary processing command is set to the second priority, and the priority of the preceding command corresponding to the secondary processing command is set to the third priority (the processing degree of the third priority, the processing degree of the second priority, and the processing degree of the first priority decrease in that order). By establishing a command status table, the transmission status of the command of each functional unit is represented, so as to uniformly allocate commands for all functional units. Then, by assigning priority values to the request commands, the preceding command has the highest priority, so that the preceding command is processed first, avoiding the situation where the secondary processing command cannot be processed due to the preceding command not being processed, which would cause the pending request queue to be blocked.
Smart Images

Figure CN122924966A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of command processing, and in particular to a method for fast processing of command queues, an electronic device, and a storage medium. Background Technology
[0002] When several functional units on the host communicate with the network interface card (NIC) firmware via commands, a command queue is established for each functional unit and a command queue for the NIC firmware. The command queue includes a request command queue (used to store request commands) and a response command queue (used to store response commands). When any functional unit issues a request command, it first stores the request command in the request command queue corresponding to that functional unit, and then sends it to the request command queue corresponding to the NIC firmware. After the request command is processed, the response command corresponding to the request command is sent from the response command queue of the NIC firmware to the response command queue of the corresponding functional unit.
[0003] Since the request command queues of several functional units all transmit commands to the request command queue of the network card firmware in a many-to-one correspondence, when the command queue is under high load (i.e., the number of commands from the functional units is too large), if the request command at the head of the network card firmware's request command queue (i.e., the request command that needs to be processed) requires the processing of other information before it can be processed, the network card firmware needs to notify the host to send this dependent information. Then the host will generate a new request command corresponding to this dependent information. If the network card firmware's request command queue is full and there are no empty slots, the request command with this dependent information cannot be enqueued, and the request command at the head of the queue cannot be dequeued because it cannot be processed. Therefore, in this case, the network card firmware's request command queue will be stuck, the commands in the queue cannot be processed, and the commands that have not yet been enqueued cannot be enqueued, causing a failure in command communication between the functional units and the network card firmware, increasing the command processing latency. Summary of the Invention
[0004] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows:
[0005] According to one aspect of this application, a method for fast processing of command queues is provided, comprising:
[0006] Step S100: Poll the status sub-table corresponding to each functional unit in the preset command status table, and determine the storage space where the command status bit in the status sub-table of the currently polled functional unit is the second status bit as the space to be processed.
[0007] The command status table stores the command status bits of the request commands corresponding to each storage space of each functional unit of the host; the second status bit indicates that there are pending request commands in the corresponding storage space that have not been moved to the pending request queue.
[0008] Step S200: If the priority of all pending request commands stored in the pending processing space is the first priority, then move the request command in each pending processing space to the pending request queue corresponding to the network card firmware.
[0009] Step S300: Adjust the command status bit of the storage space corresponding to the request command that has been moved to the pending request queue from the second status bit to the third status bit in the command status table.
[0010] The third status bit indicates that there is a request command in the corresponding storage space that has been moved to the queue of pending requests but has not been processed;
[0011] Step S400: If there is a preceding command in the request command at the head of the pending request queue, the request command is determined as a secondary processing command.
[0012] The preceding command corresponding to the secondary processing command is the request command on which the secondary processing command depends for processing. The secondary processing command can only be processed after the preceding command corresponding to the secondary processing command has been processed.
[0013] Step S500: Remove the secondary processing command from the pending request queue and store it in the storage space corresponding to the secondary processing command;
[0014] Step S600: Adjust the command status bit of the storage space corresponding to the secondary processing command in the command status table from the third status bit to the second status bit;
[0015] Step S700: Set the priority of the secondary processing command to the second priority, and set the priority of the preceding command corresponding to the secondary processing command to the third priority.
[0016] The processing intensity of the third priority, the second priority, and the first priority decreases in that order.
[0017] According to another aspect of this application, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the aforementioned command queue fast processing method.
[0018] According to another aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0019] The present invention has at least the following beneficial effects:
[0020] The command queue fast processing method of the present invention first polls the status sub-table corresponding to each functional unit in the command status table (the command status table stores the command status bits of the request commands corresponding to each storage space of each functional unit of the host). The storage space whose command status bit in the status sub-table of the currently polled functional unit is the second status bit (the second status bit indicates that there are pending request commands in the corresponding storage space that have not been moved to the pending request queue) is determined as the pending processing space. Then, the priority of the pending request commands stored in the pending processing space is checked. If the priority of all pending request commands stored in the pending processing space is the first priority, then the request commands in each pending processing space are moved to the pending request queue corresponding to the network card firmware. The command status bit of the storage space corresponding to the request command moved to the pending request queue in the command status table is adjusted from the second status bit to the third status bit (the third status bit indicates that there are request commands in the corresponding storage space that have been moved to the pending request queue but have not been processed). Furthermore, if the request command at the head of the pending request queue has a preceding command, the method proceeds. The request command is identified as a secondary processing command (the preceding command corresponding to the secondary processing command is the request command on which the secondary processing command depends for processing; that is, the secondary processing command can only be processed after the preceding command corresponding to the secondary processing command is processed). The secondary processing command is removed from the pending request queue and stored in the storage space corresponding to the secondary processing command. In addition, the command status bit of the storage space corresponding to the secondary processing command in the command status table is adjusted from the third status bit to the second status bit. The priority of the secondary processing command is set to the second priority, and the priority of the preceding command corresponding to the secondary processing command is set to the third priority (the processing degree of the third priority, the processing degree of the second priority, and the processing degree of the first priority decrease in that order). By establishing a command status table, the transmission status of the command of each functional unit is represented, so as to uniformly allocate commands for all functional units. Then, by assigning priority values to the request commands, the preceding command has the highest priority, so that the preceding command is processed first, avoiding the situation where the secondary processing command cannot be processed due to the preceding command not being processed, which would cause the pending request queue to be blocked. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1A flowchart of a command queue fast processing method provided in an embodiment of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] This application proposes a fast command queue processing method, such as... Figure 1 As shown, it includes:
[0025] Step S100: Poll the status sub-table corresponding to each functional unit in the preset command status table, and determine the storage space where the command status bit in the status sub-table of the currently polled functional unit is the second status bit as the space to be processed.
[0026] The command status table stores the command status bits of the request commands corresponding to each storage space of each functional unit of the host.
[0027] The command status table consists of a status sub-table corresponding to each functional unit. Each status sub-table corresponding to a functional unit includes the command status bit of the request command corresponding to each storage space of that functional unit.
[0028] Specifically, the command status table is A=(A1,A2,...,A...). i ,...,A f );
[0029] Where i = 1, 2, ..., f; f is the number of functional units of the host computer; A i This is the status sub-table corresponding to the i-th functional unit of the host;
[0030] A i =(A i1 A i2 ,...,A ig ,...,A ih ); g = 1, 2, ..., h; h is the amount of storage space in each functional unit of the host; A ig This is the command status bit of the request command corresponding to the g-th storage space of the i-th functional unit of the host;
[0031] A ig The initial state bit is the first state bit.
[0032] The first status bit indicates that there are no pending request commands in the corresponding storage space.
[0033] Furthermore, in A ig When the corresponding storage space contains pending request commands, A will be... ig The state is changed from the first state bit to the second state bit.
[0034] The second status bit indicates that there are pending request commands in the corresponding storage space that have not been moved to the pending request queue.
[0035] Furthermore, in A ig When the corresponding storage space contains request commands to be processed, the command flag bit corresponding to that storage space is set to the first flag bit.
[0036] The first flag indicates that the command stored in the corresponding storage space is a request command.
[0037] Step S200: If the priority of all pending request commands stored in the pending processing space is the first priority, then move the request command in each pending processing space to the pending request queue corresponding to the network card firmware.
[0038] The queue of pending requests is a first-in, first-out (FIFO) queue.
[0039] Furthermore, step S200 includes steps S210-S230:
[0040] Step S210: If there is a request command with the third priority among all the pending request commands stored in the pending space, move the request command with the third priority to the pending request queue corresponding to the network card firmware.
[0041] The third priority request command is represented by the priority of the preceding command.
[0042] Step S220: If there are no request commands with the third priority but there are request commands with the second priority stored in all pending processing spaces, move the request commands with the second priority to the pending request queue corresponding to the network card firmware.
[0043] The third priority is higher than the second priority. Requests with the third priority are processed first, so that preceding requests are moved to the queue of pending requests first, thereby speeding up the processing progress of the queue of pending requests.
[0044] Step S230: If all pending request commands stored in all pending spaces have the highest priority, move the request command in each pending space to the pending request queue corresponding to the network card firmware.
[0045] By assigning different priorities to request commands, requests with higher processing levels are given priority to enter the pending request queue, thus avoiding blockage of the pending request queue caused by preceding commands being located after the corresponding request commands.
[0046] Step S300: Adjust the command status bit of the storage space corresponding to the request command that has been moved to the pending request queue from the second status bit to the third status bit in the command status table.
[0047] The third status bit indicates that there is a request command in the corresponding storage space that has been moved to the queue of pending requests but has not been processed.
[0048] Step S400: If there is a preceding command in the request command at the head of the pending request queue, the request command is determined as a secondary processing command.
[0049] The preceding command corresponding to the secondary processing command is the request command on which the secondary processing command depends for processing. That is, the secondary processing command can only be processed after the preceding command corresponding to the secondary processing command has been processed.
[0050] Furthermore, step S400 also includes steps S410-S420:
[0051] Step S410: If there is no preceding command in the request command at the head of the pending request queue, the request command is determined as a processing command.
[0052] Step S420: After a processing command is completed and the response command corresponding to the processing command is stored in the storage space corresponding to the processing command, the command flag bit of the storage space corresponding to the response command is set to the second flag bit.
[0053] The second flag indicates that the command stored in the corresponding storage space is a response command.
[0054] When the functional unit corresponding to a processing command receives a response command sent by the network card firmware, it stores the response command in the storage space corresponding to the processing command, so that the response command overwrites the processing command, and each storage space contains only one command, thereby reducing space occupancy.
[0055] After the response command corresponding to a processing command is stored in the storage space corresponding to the processing command, and the command flag bit of the storage space corresponding to the response command is set to the second flag bit, the command status bit of the storage space corresponding to the processing command in the command status table is adjusted from the third status bit to the first status bit.
[0056] Based on the processing status of the request commands in each storage space, three status bits are adjusted for each storage space so that the location of the request commands in each storage space can be known by checking the command status table.
[0057] Step S500: Remove the secondary processing command from the pending request queue and store it in the storage space corresponding to the secondary processing command;
[0058] When there are secondary processing commands, in order to ensure the processing efficiency of the pending request queue and prevent the queue from becoming blocked, the secondary processing commands are first dequeued (without command processing) so that the pending request queue can process the request commands after the secondary processing commands normally.
[0059] Step S600: Adjust the command status bit of the storage space corresponding to the secondary processing command in the command status table from the third status bit to the second status bit;
[0060] Step S700: Set the priority of the secondary processing command to the second priority, and set the priority of the preceding command corresponding to the secondary processing command to the third priority.
[0061] The processing intensity of the third priority, the second priority, and the first priority decreases in that order.
[0062] After the secondary processing command is dequeued, since there is a preceding command for the secondary processing command, the priority of the corresponding preceding command is adjusted to the highest (i.e., the third priority), and the priority of the secondary processing command is adjusted to the second highest (i.e., the second priority). This ensures that the corresponding preceding command enters the pending request queue before the secondary processing command, and the preceding command is processed before the secondary processing command. When the secondary processing command is at the head of the pending request queue, the corresponding preceding command has already been processed, and the secondary processing command can also be processed. This speeds up the command processing in the pending request queue while also ensuring the processing order of the secondary processing command and the corresponding preceding command.
[0063] The command queue fast processing method of the present invention first polls the status sub-table corresponding to each functional unit in the command status table, and determines the storage space where the command status bit of the current polled functional unit's status sub-table is the second status bit as the processing space. Then, it checks the priority of the pending request commands stored in the processing space. If the priority of all pending request commands stored in the processing space is the first priority, then the request commands in each processing space are moved to the pending request queue corresponding to the network card firmware. The command status bit of the storage space corresponding to the request command moved to the pending request queue in the command status table is adjusted from the second status bit to the third status bit. Furthermore, if the request command at the head of the pending request queue has a preceding command, that request command is determined to be the second priority. The secondary processing command removes the secondary processing command from the pending request queue and stores it in the corresponding storage space. It also adjusts the command status bit of the storage space corresponding to the secondary processing command in the command status table from the third status bit to the second status bit, sets the priority of the secondary processing command to the second priority, and sets the priority of the preceding command corresponding to the secondary processing command to the third priority. This is done by establishing a command status table to represent the transmission status of commands for each functional unit, enabling unified command allocation across all functional units. Furthermore, by assigning priority values to request commands, the preceding command has the highest priority, ensuring its priority processing and preventing secondary processing commands from being unable to be processed due to unprocessed preceding commands, thus avoiding congestion in the pending request queue.
[0064] Furthermore, since the response command queues of several functional units all transmit commands to the response command queue of the network interface card (NIC) firmware in a many-to-one correspondence, when a response command from the NIC firmware's response command queue needs to be sent to the corresponding functional unit, an interrupt notification must first be sent to the functional unit to inform it that the response command can be retrieved. However, since the interrupt notification does not contain an identifier for the corresponding storage space, the functional unit, upon receiving the interrupt notification, only knows that the response command should be retrieved, but does not know which storage space the response command should be stored in. The functional unit will then process all... The storage space is traversed to determine the storage space where the corresponding request command is located. If the number of storage spaces is small or the corresponding request command is located in an earlier storage space, the time consumed by this traversal method is acceptable. However, if the number of storage spaces is large, this traversal method is too time-consuming and will increase the processing latency of the network card firmware's response command queue. Therefore, this application also proposes a command processing response interruption notification method, applied to the steps after the request command at the head of the pending request queue corresponding to the network card firmware has been processed, specifically steps S0100-S0600:
[0065] Step S0100: After the request command at the head of the pending request queue corresponding to the network card firmware is processed, the request command is identified as the target request command, and the target response command corresponding to the target request command is generated.
[0066] Step S0200: When the functional unit corresponding to the target request command receives the response interrupt notification sent by the network card firmware, the storage space corresponding to the command status bit that is the third status bit in the command status table among the several storage spaces of the functional unit corresponding to the target request command is determined as the first space, and step S0300 is executed.
[0067] In addition, step S0200 also includes steps S0201-S0203:
[0068] Step S0201: Store the identifier of the storage space corresponding to the target request command in a preset response status table;
[0069] The response status table stores the identifier of the storage space where each request command that has generated a corresponding response command is located.
[0070] Step S0202: When the functional unit corresponding to the target request command receives the response interrupt notification sent by the network card firmware, it retrieves the identifier of the storage space corresponding to the target request command from the response status table and identifies the identifier as the target identifier.
[0071] Step S0203: Store the target response command in the storage space corresponding to the target identifier so that the target response command overwrites the target request command, and then execute step S0500.
[0072] Step S0300: Determine the first space where the command flag bit is the first flag bit as the second space;
[0073] Step S0400: Traverse each second space. If the request command in any second space is the target request command, then store the target response command in the second space so that the target response command overwrites the target request command.
[0074] Step S0500: Set the command flag bit of the second space to the second flag bit;
[0075] Step S0600: After the target response command is stored in the second space, the command status bit in the second space of the command status table is adjusted from the third status bit to the first status bit.
[0076] Steps S0201-S0203 involve establishing a response status table, retrieving the identifier of the storage space corresponding to the target request command from the response status table, and determining the storage space corresponding to the response command. Steps S0200-S0500 involve traversing each second space to determine the storage space corresponding to the response command. By using the above two methods to determine the storage space corresponding to the response command, the storage space where the response command is stored can be quickly determined from several storage spaces, thereby speeding up the processing of the response command queue of the network card firmware.
[0077] The command processing response interruption notification method of the present invention, after the request command at the head of the pending request queue corresponding to the network card firmware is processed, determines the request command as the target request command and generates a target response command corresponding to the target request command. When the functional unit corresponding to the target request command receives the response interruption notification sent by the network card firmware, the storage space corresponding to the command status bit with the third status bit in the command status table of the functional unit corresponding to the target request command is determined as the first space, and the first space with the command flag bit as the first flag bit is determined as the second space. Each second space is traversed. If any request command in the second space is a target request command, then the target response command is stored in the second space so that the target response command overwrites the target request command. The command flag bit of the second space is set to the second flag bit. After the target response command is stored in the second space, the command status bit of the second space in the command status table is adjusted from the third status bit to the first status bit. By checking the command status bit of the storage space and the command flag bit of each storage space in the command status table, the storage space of the response command can be quickly located, reducing the processing latency of the response command queue of the network card firmware.
[0078] Furthermore, when the command queue is under high load (i.e., the number of commands from a functional unit is too large), if a functional unit malfunctions, it is necessary to pause the command transmission in the request command queue of that functional unit and discard any unprocessed request commands that have already been sent to the network card firmware's request command queue. However, since the network card firmware's request command queue is under high load, the commands preceding the command to be discarded must be processed before the command can be discarded. The system cannot allow the waiting time for commands to be discarded to be too long. Therefore, this application also proposes a command exception handling method, applied to scenarios where functional units malfunction, including steps S00100-S00600:
[0079] Step S00100: When any functional unit of the host malfunctions, that functional unit is identified as the malfunctioning unit.
[0080] Step S00200: Set the command status bit corresponding to each storage space of the abnormal unit in the preset command status table to the first status bit;
[0081] Step S00300: If there is a pending request command sent by an abnormal unit in the pending request queue corresponding to the network card firmware, then obtain the request command at the head of the pending request queue.
[0082] Step S00400: If the request command at the current head of the pending request queue is not a pending request command sent by an abnormal unit, then proceed to step S00500.
[0083] If the request command at the head of the pending request queue is a pending request command sent by an abnormal unit, then proceed to step S00600.
[0084] Step S00500: Remove the request command from the pending request queue and store it in the storage space corresponding to the request command, then return to step S00400;
[0085] Step S00600: Discard the request command. If there are still pending request commands sent by the abnormal unit in the pending request queue after the discard, return to step S00400.
[0086] If there are no pending request commands sent by the abnormal unit in the discarded pending request queue, then the request command at the current head of the pending request queue will be processed.
[0087] The command exception handling method of the present invention, when any functional unit of the host malfunctions, identifies the functional unit as an exception unit, sets the command status bit corresponding to each storage space of the exception unit in the command status table to a first status bit, the first status bit indicating that there are no pending request commands in the corresponding storage space, that is, no request commands are transmitted to the network card firmware, and suspends the transmission of request commands of the exception unit. If there are pending request commands sent by the exception unit in the pending request queue corresponding to the network card firmware, the pending request commands sent by the exception unit need to be discarded, that is, the request command at the head of the pending request queue is obtained. If the request command at the current head of the pending request queue is not sent by the exception unit... If a request command is to be processed, it is removed from the pending request queue and stored in the corresponding storage space. In other words, request commands that do not need to be discarded are dequeued first. If the request command at the head of the pending request queue is a pending request command sent by an abnormal unit, it is discarded. If there are no pending request commands sent by abnormal units in the pending request queue after discarding, the request command at the current head of the pending request queue is processed. This method of quickly removing the request commands that need to be discarded from the pending request queue of the network card firmware by dequeuing the request commands that need to be discarded first achieves fast processing of the request commands that need to be discarded.
[0088] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.
[0089] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0090] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0091] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0092] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”
[0093] An electronic device according to this embodiment of the invention. The electronic device is merely an example and should not be construed as limiting the functionality or scope of the embodiments of the invention.
[0094] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and buses connecting different system components (including memory and processor).
[0095] The storage device stores program code that can be executed by the processor to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of the present invention.
[0096] The storage may include readable media in the form of volatile storage, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).
[0097] The storage may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0098] A bus can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus architectures.
[0099] Electronic devices can also communicate with one or more external devices (such as keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable users to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (such as routers, modems, etc.). This communication can be performed through input / output (I / O) interfaces. Furthermore, electronic devices can also communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapters.
[0100] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0101] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.
[0102] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0103] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0104] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0105] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0106] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0107] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0108] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for fast processing of command queues, characterized in that, include: Step S100: Poll the status sub-table corresponding to each functional unit in the preset command status table, and determine the storage space where the command status bit in the status sub-table of the currently polled functional unit is the second status bit as the space to be processed. The command status table stores the command status bit of the request command corresponding to each storage space of each functional unit of the host; the second status bit indicates that there is a pending request command in the corresponding storage space that has not been moved to the pending request queue. Step S200: If the priority of all pending request commands stored in the pending processing space is the first priority, then move each request command in the pending processing space to the pending request queue corresponding to the network card firmware. Step S300: Adjust the command status bit of the storage space corresponding to the request command that has been moved to the pending request queue from the second status bit to the third status bit in the command status table. The third status bit indicates that there is a request command in the corresponding storage space that has been moved to the pending request queue but has not been processed; Step S400: If there is a preceding command in the request command at the head of the pending request queue, the request command is determined as a secondary processing command. The preceding command corresponding to the secondary processing command is the request command on which the secondary processing command depends for processing. The secondary processing command can only be processed after the preceding command corresponding to the secondary processing command has been processed. Step S500: Remove the secondary processing command from the pending request queue and store it in the storage space corresponding to the secondary processing command; Step S600: Adjust the command status bit of the storage space corresponding to the secondary processing command in the command status table from the third status bit to the second status bit; Step S700: Set the priority of the secondary processing command to the second priority, and set the priority of the preceding command corresponding to the secondary processing command to the third priority; The processing intensity of the third priority, the second priority, and the first priority decreases sequentially.
2. The method according to claim 1, characterized in that, The command status table A=(A1,A2,...,A... i ,...,A f ); where i = 1, 2, ..., f; f is the number of functional units of the host computer; A i This is the status sub-table corresponding to the i-th functional unit of the host; A i =(A i1 A i2 ,...,A ig ,...,A ih ); g = 1, 2, ..., h; h is the amount of storage space in each functional unit of the host; A ig This is the command status bit of the request command corresponding to the g-th storage space of the i-th functional unit of the host; A ig The initial state bit is the first state bit; the first state bit indicates that there are no pending request commands in the corresponding storage space.
3. The method according to claim 2, characterized in that, In A ig When the corresponding storage space contains pending request commands, A will be... ig The state is changed from the first state bit to the second state bit.
4. The method according to claim 3, characterized in that, In A ig When the corresponding storage space contains a request command to be processed, set the command flag bit corresponding to that storage space to the first flag bit. The first flag indicates that the command stored in the corresponding storage space is a request command.
5. The method according to claim 4, characterized in that, Step S200 includes: Step S210: If there is a request command with a priority of third priority among all the pending request commands stored in the pending processing space, move the request command with the third priority to the pending request queue corresponding to the network card firmware. Step S220: If there are no request commands with the third priority but there are request commands with the second priority stored in all the pending request commands stored in the pending request space, move the request commands with the second priority to the pending request queue corresponding to the network card firmware. Step S230: If the priority of all pending request commands stored in all pending spaces is the first priority, move the request command in each pending space to the pending request queue corresponding to the network card firmware.
6. The method according to claim 5, characterized in that, Step S400 further includes: Step S410: If there is no preceding command for the request command at the head of the pending request queue, the request command is determined as a processing command. Step S420: After the processing command is completed and the response command corresponding to the processing command is stored in the storage space corresponding to the processing command, the command flag bit of the storage space corresponding to the response command is set to the second flag bit. The second flag indicates that the command stored in the corresponding storage space is a response command.
7. The method according to claim 6, characterized in that, When the functional unit corresponding to the first processing command receives the response command corresponding to the first processing command sent by the network card firmware, it stores the response command in the storage space corresponding to the first processing command so that the response command overwrites the first processing command.
8. The method according to claim 7, characterized in that, After the response command corresponding to the first processing command is stored in the storage space corresponding to the first processing command, and the command flag bit of the storage space corresponding to the response command is set to the second flag bit, the command status bit of the storage space corresponding to the first processing command in the command status table is adjusted from the third status bit to the first status bit.
9. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the method as described in any one of claims 1-8.
10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.