Method and device for improving performance of smart network card

By introducing a bitmap lock table structure into the smart network card, the problem of low reading and writing efficiency of table entries in the smart network card is solved, and more efficient data reading and writing performance is achieved.

CN113609339BActive Publication Date: 2025-02-21BEIJING HUIJUN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110898442.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-05
Publication Date
2025-02-21
Estimated Expiration
2041-08-05

AI Technical Summary

Technical Problem

The existing intelligent network cards are not very read and write efficient when handling multi-task data reading and writing, resulting in table entry reading and writing performance becoming a bottleneck in design.

Method used

By introducing a bitmap lock table structure, the execution request of each processing module is added to multiple locks, which reduces the probability of conflict of each lock and improves the read and write performance of table items. The specific steps include obtaining the table entry address, calculating the hash value, determining the locked state of the cell based on the hash value and the bitmap lock table, and determining whether the scheduler performs a read operation based on the locked state.

Benefits of technology

It realizes fast and efficient reading and writing data, reduces the probability of lock conflict, and improves the performance of the overall design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113609339B_ABST
    Figure CN113609339B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for improving the performance of a smart network card, wherein the method includes: obtaining the address of the table entry pointed to by the read request instruction of the current processing module; determining the hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-constructed bitmap lock table containing multiple cells; and determining whether the scheduler performs a read operation according to the locking state of the cell. The present disclosure introduces a bitmap lock table structure to disassemble a lock in the prior art into multiple locks, thereby reducing the conflict probability of each lock and improving the read and write performance of the table entry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for improving the performance of a smart network card. Background Art

[0002] In the design of smart network cards, many modules involve the reading and writing of table entries: for example, when implementing the switch acceleration function, a set of switch flow tables needs to be designed; when implementing the remote data access function, a set of receiving and sending connection tables needs to be implemented, etc. Generally, the capacity of these table entries is relatively large (millions of items) and needs to be stored in external storage devices. Limited by the maximum clock frequency and data width supported by the storage device, the read and write bandwidth of these table entries has a theoretical limit.

[0003] When processing multi-task data reading and writing, multiple task processors are often required to work simultaneously. When the processors work simultaneously, conflicts will occur between different task processors. Therefore, the table entry reading and writing performance often becomes the bottleneck of the entire design. Summary of the invention

[0004] The present disclosure provides a method and device for improving the performance of a smart network card, so as to solve the defect of low reading and writing efficiency in the prior art and realize fast and efficient reading and writing of data.

[0005] In a first aspect, the present disclosure provides a method for improving the performance of a smart network card, comprising:

[0006] Obtain the address of the table entry pointed to by the read request instruction of the current processing module;

[0007] Determine a hash value corresponding to the address according to the address of the entry;

[0008] Determine a locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing a plurality of cells;

[0009] The scheduler is determined whether to perform a read operation according to the locking state of the cell.

[0010] According to the method for improving the performance of the smart network card provided by the present disclosure, wherein, determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing multiple cell bits specifically includes:

[0011] Taking the hash value as the dividend and the depth of the bitmap lock table as the divisor to obtain a remainder;

[0012] Query the value of the number of bits in the cell corresponding to the remainder in the bitmap lock table;

[0013] The locking state of the cell is determined according to the value of the bit number.

[0014] According to the method for improving the performance of the smart network card provided by the present disclosure, the determining whether the scheduler performs a read operation according to the locked state specifically includes:

[0015] If the lock state of the cell is unlocked, the scheduler sends a read request instruction to the controller and changes the value of the bit number in the table to a locked state;

[0016] If the locking state of the cell is locked, the scheduler does not send the read request instruction to the controller.

[0017] According to the method for improving the performance of the smart network card provided by the present disclosure, if the lock state of the cell is unlocked, after the scheduler sends a read request instruction to the controller, it also includes:

[0018] After receiving the read request instruction from the scheduler, the controller reads the data of the table item corresponding to the cell, and sends the data of the table item to the current processing module.

[0019] According to the method for improving the performance of the smart network card provided by the present disclosure, wherein, if the locking state of the cell is locked, the scheduler does not send the read request instruction to the controller, and further includes:

[0020] The scheduler adds the read request instruction to a waiting list;

[0021] The scheduler continues to schedule the read request instructions of other processing modules in a polling scheduling manner, and determines whether to perform a read operation based on the value of the number of bits in the table corresponding to the read request instructions of the other processing modules, wherein the read requests of the other processing modules include the read request instructions stored in the waiting table.

[0022] According to the method for improving the performance of the smart network card provided by the present disclosure, the read request instructions stored in the waiting table participate in the polling scheduling in a first-in-first-out manner.

[0023] According to the method for improving the performance of the smart network card provided by the present disclosure, the table entry write operation after completing the table entry read operation includes:

[0024] After the processing module updates the data of the read table entry, a write request instruction is initiated;

[0025] Obtaining the address of the table entry targeted by the write request instruction;

[0026] The controller completes the write operation of the updated data after receiving the write request instruction;

[0027] After the write operation is completed, the scheduler updates the state of the cell corresponding to the write request instruction in the bitmap lock table to an unlocked state.

[0028] In a second aspect, the present disclosure provides a device for improving the performance of a smart network card, including:

[0029] A first processing module, used for obtaining the address of the table entry pointed to by the read request instruction of the current processing module;

[0030] A second processing module, used to determine a hash value corresponding to the address according to the address of the table entry;

[0031] A third processing module, configured to determine a locking state of a cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing a plurality of cells;

[0032] The fourth processing module is used to determine whether the scheduler performs a read operation according to the locking state of the cell.

[0033] In a third aspect, the present disclosure further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for improving the performance of a smart network card as described in any one of the above are implemented.

[0034] In a fourth aspect, the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for improving the performance of a smart network card.

[0035] The present disclosure provides a method and device for improving the performance of a smart network card, wherein the method obtains the address of the table entry pointed to by the read request instruction of the current processing module; then, determines the hash value corresponding to the address according to the address of the table entry; due to the uniqueness of the hash value, the address of a table entry can be uniqued, and then the locking state of the cell corresponding to the read request instruction is determined according to the hash value and a pre-built bitmap lock table containing multiple cells; thereby, it is equivalent to adding a lock to the execution request of each processing module, and then determining whether the scheduler performs a read operation according to the locking state of the cell. The present disclosure realizes the disassembly of a lock in the prior art into multiple locks by introducing a bitmap lock table structure, thereby reducing the probability of conflict for each lock and improving the read and write performance of the table entry. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 It is a schematic diagram of multi-port table entry read and write conflicts provided in the prior art;

[0038] Figure 2 It is a flowchart of a method for improving smart network card performance provided by the present disclosure;

[0039] Figure 3 It is a schematic diagram of an improved table entry read and write structure including a bitmap lock table provided by the present disclosure;

[0040] Figure 4 It is a schematic diagram of the "head blocking" effect after locking provided by the present disclosure;

[0041] Figure 5 The present disclosure provides an improved table entry read and write structure diagram including a waiting table;

[0042] Figure 6 is a schematic diagram of a read request scheduling process provided by the present disclosure;

[0043] Figure 7 is a schematic diagram of a write request scheduling process provided by the present disclosure;

[0044] Figure 8 It is a structural schematic diagram of a device for improving smart network card performance provided by the present disclosure;

[0045] Fig. 9 It is a schematic diagram of the structure of an electronic device provided by the present disclosure. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present disclosure.

[0047] Combine the following Figure 1-Figure 3 A method for improving the performance of a smart network card provided by an embodiment of the present disclosure is described, including:

[0048] Step 100: Obtain the address of the table entry pointed to by the read request instruction of the current processing module;

[0049] Specifically, in order to make full use of the bus bandwidth in the prior art, a multi-port read and write method is usually adopted in the hardware design: multiple processing modules (proc0, proc1, ..., procM) read and write the table entry contents in parallel, and a scheduler adopts a polling round-robin method to schedule these read and write requests in turn, and send these requests to the storage controller, which completes the reading and writing of the table entry contents stored in the storage device particles.

[0050] Combination Figure 1 Assume that there are two processing modules Proc0 and Proc1, and each processing module processes the table entry by adding 1 to the table entry content. At time t1, proc0 reads the table entry Entry0 content (assuming that the table entry content Entry0.Data = 0 at this time); at time t2, proc1 also initiates the operation of reading the table entry Entry0 content, and reads the content Entry0.Data = 0; at time t3, proc0 writes Entry0.Data = 1 back to the table entry Entry0; at time t4, proc1 writes Entry0.Data = 1 back to the table entry Entry0. In this way, after being processed by proc0 and proc1, the content in Entry0 only increases by 1, which is obviously inconsistent with the expected result.

[0051] Since the external memory is divided into multiple table entries, a multi-port read and write method is adopted: multiple processing modules (proc0, proc1, ..., procM) read and write the table entry contents in parallel, and each processing module needs to determine the addresses of different table entries when performing read and write operations on a table entry.

[0052] Step 200: Determine a hash value corresponding to the address according to the address of the entry;

[0053] Specifically, after obtaining the address of the table entry that each processing module is to perform a read operation on, a hash algorithm is applied to the address to obtain a hash value of each table entry address. The hash algorithm maps a binary value of arbitrary length to a shorter binary value of fixed length, and this small binary value is called a hash value. The hash value is a unique and extremely compact numerical representation of a piece of data. If a plaintext is hashed and even only one letter of the paragraph is changed, subsequent hashes will produce different values. It is computationally impossible to find two different inputs that hash to the same value, so the hash value of the data can verify the integrity of the data. Therefore, by performing a hash algorithm on the address, the address is made unique and the representation of the address is converted into binary form.

[0054] Step 300: determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing multiple cells;

[0055] Specifically, refer to Figure 3 As shown, in the present disclosure, a bitmap lock table locker-Bitmap is constructed, and the bitmap lock table locker-Bitmap contains multiple cells. The bitmap lock table locker-Bitmap is essentially a lock. Compared with the previous single lock, it is multiple locks. The use of multiple locks is equivalent to dividing the large table items in the storage device into small table items, each small table item has a lock. The greater the depth of the bitmap lock table locker-Bitmap, the more locks there are, and the lower the probability of conflict of small table items. Of course, from the perspective of hardware implementation, the bitmap lock table locker-Bitmap structure cannot be designed to be as deep as the size of the storage device table items (millions).

[0056] Preferably, in the present disclosure, the depth of the bitmap lock table locker-Bitmap is a table of powers of 2 such as 128, 256, 512, 1024, etc. In the present disclosure, according to the hash value of the address of the table item obtained in the above steps and the preset bitmap lock table locker-Bitmap, the cell corresponding to each table item address in the bitmap lock table locker-Bitmap is determined. Since the bitmap lock table locker-Bitmap is a multi-unit table composed of bits 0 or 1, the bit value in each cell is 0 or 1. Bit 0 can be set to represent an unlocked state, and bit 1 can represent a locked state.

[0057] Step 400: Determine whether the scheduler performs a read operation according to the locking state of the cell.

[0058] Specifically, when the bit value of the cell corresponding to the read request instruction is 0, it means that it is not locked, and the scheduler can execute the content of the read request instruction. When the bit value of the table corresponding to the read request instruction is 1, it means that the cell is locked and the scheduler cannot execute the corresponding read operation.

[0059] The method for improving the performance of the smart network card provided by the present disclosure is to obtain the address of the table item pointed to by the read request instruction of the current processing module; then, determine the hash value corresponding to the address according to the address of the table item; due to the uniqueness of the hash value, the address of a table item can be uniqued, and then determine the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing multiple cells; thereby, it is equivalent to adding a lock to the execution request of each processing module, and then determining whether the scheduler performs a read operation according to the locking state of the cell. The present disclosure realizes the disassembly of a lock in the prior art into multiple locks by introducing a bitmap lock table structure, thereby reducing the probability of conflict for each lock and improving the read and write performance of the table item.

[0060] According to the method for improving the performance of the smart network card provided by an embodiment of the present disclosure, the determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing multiple cell bits specifically includes:

[0061] Taking the hash value as the dividend and the depth of the bitmap lock table as the divisor to obtain a remainder;

[0062] Query the value of the number of bits in the cell corresponding to the remainder in the bitmap lock table;

[0063] The locking state of the cell is determined according to the value of the bit number.

[0064] Specifically, before initiating table entry reading and writing, each processing module proc0, proc1, ..., procM first sends the table entry address it requests to the AddrHash module. The AddrHash module calculates a HASH value for the address using a certain HASH algorithm, and then modulo the HASH value by the depth of the bitmap lock table locker-Bitmap to make it fall within the range of the bitmap lock table locker-Bitmap.

[0065] Assume that the address of a table entry is converted to a hash value of 11111111, and the depth of the bitmap lock table locker-Bitmap is 128. Then 11111111 is converted to a decimal number of 255, and the remainder obtained by taking 255 as the dividend and 128 as the divisor is 127. Then, the bit value of the byte in the 127th cell of the bitmap lock table locker-Bitmap is queried based on the remainder 127. If the bit value in the cell is 0, it means that the cell is unlocked, and if the bit value in the cell is 1, it means that the cell is locked.

[0066] According to the method for improving the performance of the smart network card provided by the present disclosure, the determining whether the scheduler performs a read operation according to the locked state specifically includes:

[0067] If the lock state of the cell is unlocked, the scheduler sends a read request instruction to the controller and changes the value of the bit number in the table to a locked state;

[0068] If the locking state of the cell is locked, the scheduler does not send the read request instruction to the controller.

[0069] Specifically, combined Figure 3 The present disclosure adds a bitmap lock table locker-Bitmap table after the scheduler arbitor scheduling module. If the cell of the bitmap lock table locker-Bitmap table corresponding to the scheduled read request is '0', it means that no other module is currently locking these table items, and the current request can be executed. The scheduler sends this request to the controller and sets the corresponding bit in the bitmap lock table locker-Bitmap table to '1' to lock the current operation.

[0070] If the byte value in the cell of the locker-Bitmap table corresponding to the scheduled read request is already '1', it means that other modules are already operating these table entries, and the scheduler stops scheduling until the corresponding bit in LOCKER_BITMAP is unlocked.

[0071] According to the method for improving the performance of the smart network card provided by the present disclosure, if the lock state of the cell is unlocked, after the scheduler sends a read request instruction to the controller, it also includes:

[0072] After receiving the read request instruction from the scheduler, the controller reads the data of the table item corresponding to the cell, and sends the data of the table item to the current processing module.

[0073] Specifically, after reading the value in the storage, the controller sends the value to the processing module that issued the read request instruction to complete the read operation.

[0074] According to the method for improving the performance of the smart network card provided by the present disclosure, wherein, if the locking state of the cell is locked, the scheduler does not send the read request instruction to the controller, and further includes:

[0075] The scheduler adds the read request instruction to a waiting list;

[0076] The scheduler continues to schedule the read request instructions of other processing modules in a polling scheduling manner, and determines whether to perform a read operation based on the value of the number of bits in the table corresponding to the read request instructions of the other processing modules, wherein the read requests of the other processing modules include the read request instructions stored in the waiting table.

[0077] Specifically, in the above text, by adding the locker-Bitmap table, each task is locked separately. Although the correctness of the result can be guaranteed, the overall read and write performance will be reduced. What is more troublesome is that it will also introduce the "head blocking" effect. Figure 4 As shown, it is assumed that the 0th processing module proc0 first initiates the operation of reading table entry Entry0, and then the 1st processing module proc1 initiates the operation of reading table entry Entry0, table entry Entry1, and table entry Entry2. Before the 0th processing module proc0 writes back the result of table entry Entry0 and unlocks it, the above read operation of proc1 can only wait. In fact, the operations of proc1 reading Entry1 and Entry2 do not conflict with the operation of proc0 reading Entry0, but since the header request of reading Entry0 is blocked, subsequent requests are blocked. The emergence of the "head blocking" effect further reduces the performance of table entry reading and writing.

[0078] Therefore, in the embodiment of the present disclosure, by introducing the waiting table WAITING_TABLE structure, the request with "head blocking" is put into WAITING_TABLE first, and the subsequent requests are not blocked, thereby achieving the purpose of improving the reading and writing performance of the table items as a whole.

[0079] Combination Figure 5 As shown, specifically, when a request of a certain module encounters "head blocking", the scheduler still schedules the request, but does not send it to the controller. Instead, it sends the request to the waiting table WAITING_TABLE. At this time, the scheduler arbitor will not be blocked, and it can continue to schedule requests from other modules in a round-robin manner. The requests in the WAITING_TABLE are also a source of the scheduler and will be scheduled. In this way, the requests that were previously placed in the waiting table WAITING_TABLE because the table entry was locked will eventually be scheduled out. Like requests from other modules, the requests in the waiting table WAITING_TABLE will still check the lock status in the locker-Bitmap table. If it is still locked, the request will continue to be scheduled to the waiting table WAITING_TABLE. Otherwise, it will be scheduled to the controller.

[0080] According to the method for improving the performance of the smart network card provided by the present disclosure, the read request instructions stored in the waiting table participate in the polling scheduling in a first-in-first-out manner.

[0081] Specifically, the waiting table WAITING_TABLE can be implemented with a FIFO (FIRST IN FIRST OUT), and the additional resources are not much. The introduction of the locker-Bitmap table further improves the performance of table entry reading and writing, improves the utilization of the storage bus, and ultimately improves the performance of the entire design.

[0082] According to the method for improving the performance of the smart network card provided by the present disclosure, the table entry write operation after completing the table entry read operation includes:

[0083] After the processing module updates the data of the read table entry, a write request instruction is initiated;

[0084] Obtaining the address of the table entry targeted by the write request instruction;

[0085] The controller completes the write operation of the updated data after receiving the write request instruction;

[0086] After the write operation is completed, the scheduler updates the state of the cell corresponding to the write request instruction in the bitmap lock table to an unlocked state.

[0087] Specifically, after reading the value of the table entry in the read request instruction and updating the data, the processing module writes the updated data back to the table entry.

[0088] When writing the data of a table entry back to the table entry, a write request instruction needs to be issued, and the write request instruction corresponds to the address of a table entry. Since the cells in the bitmap lock table are still locked when the processing module performs read and write operations, there is no need to judge the state of the bitmap lock table. The processing module directly sends the data to the controller, and the controller performs the corresponding data write operation to the corresponding table entry.

[0089] However, after the write operation is completed, the value in the cell corresponding to the write operation in the locker-Bitmap table needs to be changed to 0 to change it to an unlocked state. There are two specific ways. One is to separately store the position of the cell in the locker-Bitmap table corresponding to the read operation. After the write operation is completed, the position of the cell is directly found to change the cell from a locked state to an unlocked state.

[0090] Alternatively, the location of the cell is not stored, and the hash value is recalculated according to the address targeted by the write operation instruction, the location of the corresponding cell is determined according to the hash value, and the value of the cell is changed from 1 to 0, so that it is in a locked open state.

[0091] For the above method, taking a complete read and write operation as an example, it can be expressed as:

[0092] refer to Figure 6 When the read request of the current module is scheduled, the table entry address is first hashed, and the hash result is used as an index to search the bitmap lock table locker-Bitmap table (the table is initialized to all '0' when powered on). If the corresponding BIT is '1', it means that the content of the table entry to be read is being rewritten by other modules, so the read request is placed in the waiting table WAITING_TABLE and waits for the next round of scheduling; if the corresponding BIT is '0', it means that the table entry to be read has not been processed by other modules. The scheduler modifies the corresponding bit in the bitmap lock table locker-Bitmap table to '1', locks the table entry, and sends the request to the controller to read the content of the table entry. At this point, the read request scheduling is completed.

[0093] The scheduling of write requests is as follows Figure 7 As shown, when the processing module updates the table entry content and initiates a write request, it first performs a HASH on the table entry address, uses the HASH result as an index to query the section lock table locker-Bitmap table, sends the write request to the controller, and at the same time changes the content in the section lock table locker-Bitmap table from '1' to '0' to unlock the table entry. At this point, the write request scheduling is completed.

[0094] Combination Figure 8 As shown, the present disclosure provides a device for improving the performance of a smart network card, including:

[0095] A first processing module 81 is used to obtain the address of the table entry pointed to by the read request instruction of the current processing module;

[0096] A second processing module 82, configured to determine a hash value corresponding to the address according to the address of the entry;

[0097] A third processing module 8, configured to determine a locking state of a cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing a plurality of cells;

[0098] The fourth processing module 84 is used to determine whether the scheduler performs a read operation according to the locking state of the cell.

[0099] Since the device provided in the embodiments of the present disclosure can be used to execute the method described in the above embodiments, its working principle and beneficial effects are similar, so they will not be described in detail here. For specific contents, please refer to the introduction of the above embodiments.

[0100] The device for improving the performance of the smart network card provided by the present disclosure obtains the address of the table item pointed to by the read request instruction of the current processing module; then, determines the hash value corresponding to the address according to the address of the table item; due to the uniqueness of the hash value, the address of a table item can be uniqued, and then the locking state of the cell corresponding to the read request instruction is determined according to the hash value and a pre-built bitmap lock table containing multiple cells; thus, it is equivalent to adding a lock to the execution request of each processing module, and then determining whether the scheduler performs a read operation according to the locking state of the cell. The present disclosure realizes the disassembly of a lock in the prior art into multiple locks by introducing a bitmap lock table structure, thereby reducing the probability of conflict for each lock and improving the read and write performance of the table item.

[0101] According to the device for improving the performance of the smart network card provided by the present disclosure, the third processing module 83 is specifically used for:

[0102] Taking the hash value as the dividend and the depth of the bitmap lock table as the divisor to obtain a remainder;

[0103] Query the value of the number of bits in the cell corresponding to the remainder in the bitmap lock table;

[0104] The locking state of the cell is determined according to the value of the bit number.

[0105] According to the device for improving the performance of the smart network card provided by the present disclosure, the fourth processing module 84 is specifically used to:

[0106] If the lock state of the cell is unlocked, the scheduler sends a read request instruction to the controller and changes the value of the bit number in the table to a locked state;

[0107] If the locking state of the cell is locked, the scheduler does not send the read request instruction to the controller.

[0108] According to the device for improving the performance of the smart network card provided by the present disclosure, the fourth processing module is further used to:

[0109] After receiving the read request instruction from the scheduler, the controller reads the data of the table item corresponding to the cell, and sends the data of the table item to the current processing module.

[0110] According to the device for improving the performance of the smart network card provided by the present disclosure, the fourth processing module 84 is further used to:

[0111] The scheduler adds the read request instruction to a waiting list;

[0112] The scheduler continues to schedule the read request instructions of other processing modules in a polling scheduling manner, and determines whether to perform a read operation based on the value of the number of bits in the table corresponding to the read request instructions of the other processing modules, wherein the read requests of the other processing modules include the read request instructions stored in the waiting table.

[0113] According to the device for improving the performance of a smart network card provided by the present disclosure, the read request instructions stored in the waiting table participate in the polling scheduling in a first-in-first-out manner.

[0114] According to the device for improving the performance of the smart network card provided by the present disclosure, the device further includes:

[0115] A fifth processing module, configured to initiate a write request instruction after the processing module updates the data of the read table item;

[0116] A sixth processing module, used to obtain the address of the table entry targeted by the write request instruction;

[0117] A seventh processing module, configured for the controller to complete a write operation of the updated data after receiving the write request instruction;

[0118] An eighth processing module is used for the scheduler to update the state of the cell corresponding to the write request instruction in the bitmap lock table to an unlocked state after the write operation is completed.

[0119] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor (processor) 910, a communication interface (Communications Interface) 920, a memory (memory) 930 and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call the logic instructions in the memory 930 to execute a method for improving the performance of the smart network card, the method comprising: obtaining the address of the table entry pointed to by the current processing module read request instruction; determining the hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-constructed bitmap lock table containing multiple cells; determining whether the scheduler performs a read operation according to the locking state of the cell.

[0120] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0121] On the other hand, the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute a method for improving the performance of a smart network card provided by the above-mentioned methods, the method including: obtaining the address of the table entry pointed to by the read request instruction of the current processing module; determining the hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing multiple cells; determining whether the scheduler performs a read operation according to the locking state of the cell.

[0122] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the above-mentioned method for improving the performance of a smart network card, the method comprising: obtaining the address of the table entry pointed to by the read request instruction of the current processing module; determining the hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table containing multiple cells; determining whether the scheduler performs a read operation according to the locking state of the cell.

[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A method for improving the performance of a smart network card, characterized in that: include: Obtain the address of the table entry pointed to by the read request instruction of the current processing module; Determine a hash value corresponding to the address according to the address of the entry; Determine the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table locker-Bitmap containing multiple cells; The scheduler is determined whether to perform a read operation according to the locking state of the cell.

2. The method for improving the performance of a smart network card according to claim 1, characterized in that: Determining the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built lock table containing a plurality of cell bitmaps specifically includes: Taking the hash value as the dividend and the depth of the bitmap lock table as the divisor to obtain a remainder; Query the value of the number of bits in the cell corresponding to the remainder in the bitmap lock table; The locking state of the cell is determined according to the value of the bit number.

3. The method for improving the performance of a smart network card according to claim 1, characterized in that: The determining whether the scheduler performs a read operation according to the locked state specifically includes: If the lock state of the cell is unlocked, the scheduler sends a read request instruction to the controller and changes the value of the bit number in the cell to a locked state; If the locking state of the cell is locked, the scheduler does not send the read request instruction to the controller.

4. The method for improving the performance of a smart network card according to claim 3, characterized in that: If the locking state of the cell is unlocked, after the scheduler sends a read request instruction to the controller, the method further includes: After receiving the read request instruction from the scheduler, the controller reads the data of the table item corresponding to the cell, and sends the data of the table item to the current processing module.

5. The method for improving the performance of a smart network card according to claim 3, characterized in that: If the locking state of the cell is locked, the scheduler does not send the read request instruction to the controller, and further includes: The scheduler adds the read request instruction to a waiting list; The scheduler continues to schedule the read request instructions of other processing modules in a polling scheduling manner, and determines whether to perform a read operation based on the value of the number of bits in the table corresponding to the read request instructions of the other processing modules, wherein the read requests of the other processing modules include the read request instructions stored in the waiting table.

6. The method for improving the performance of a smart network card according to claim 5, characterized in that: The read request instructions stored in the waiting table participate in the polling scheduling in a first-in-first-out manner.

7. The method for improving the performance of a smart network card according to claim 4, characterized in that: The table entry write operation after completing the table entry read operation includes: After the processing module updates the data of the read table entry, a write request instruction is initiated; Obtaining the address of the table entry targeted by the write request instruction; The controller completes the write operation of the updated data after receiving the write request instruction; After the write operation is completed, the scheduler updates the state of the cell corresponding to the write request instruction in the bitmap lock table to an unlocked state.

8. A device for improving the performance of a smart network card, characterized in that: include: A first processing module, used for obtaining the address of the table entry pointed to by the read request instruction of the current processing module; A second processing module, used to determine a hash value corresponding to the address according to the address of the table entry; A third processing module is used to determine the locking state of the cell corresponding to the read request instruction according to the hash value and a pre-built bitmap lock table locker-Bitmap containing multiple cells; The fourth processing module is used to determine whether the scheduler performs a read operation according to the locking state of the cell.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for improving the performance of the smart network card as described in any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for improving the performance of a smart network card as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Read-write management method and related device

    CN109992526A