CN113609339A - Method and device for improving performance of intelligent network card - Google Patents
Method and device for improving performance of intelligent network card Download PDFInfo
- Publication number
- CN113609339A CN113609339A CN202110898442.2A CN202110898442A CN113609339A CN 113609339 A CN113609339 A CN 113609339A CN 202110898442 A CN202110898442 A CN 202110898442A CN 113609339 A CN113609339 A CN 113609339A
- Authority
- CN
- China
- Prior art keywords
- cell
- bitmap
- scheduler
- request instruction
- address
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000012545 processing Methods 0.000 claims abstract description 73
- 238000004590 computer program Methods 0.000 claims description 11
- 230000002708 enhancing effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- COCAUCFPFHUGAA-MGNBDDOMSA-N n-[3-[(1s,7s)-5-amino-4-thia-6-azabicyclo[5.1.0]oct-5-en-7-yl]-4-fluorophenyl]-5-chloropyridine-2-carboxamide Chemical compound C=1C=C(F)C([C@@]23N=C(SCC[C@@H]2C3)N)=CC=1NC(=O)C1=CC=C(Cl)C=N1 COCAUCFPFHUGAA-MGNBDDOMSA-N 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9014—Indexing; Data structures therefor; Storage structures hash tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/526—Mutual exclusion algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present disclosure provides a method and an apparatus for improving performance of an intelligent network card, wherein the method includes: acquiring the address of a table item pointed by a reading request instruction of a current processing module; determining a hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the reading request instruction according to the hash value and a bit bitmap locking table which is constructed in advance and contains a plurality of cells; and determining whether the scheduler executes the read operation according to the locking state of the cell. According to the method and the device, a bitmap lock table structure is introduced, one lock in the prior art is disassembled into a plurality of locks, the collision probability of each lock is reduced, and the table entry read-write performance is improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for improving performance of an intelligent network card.
Background
Many modules in the design of intelligent network cards involve the reading and writing of entries: for example, when the switch acceleration function is realized, a set of switch flow tables needs to be designed; when the remote data access function is realized, a set of receiving and sending connection tables and the like need to be realized. These entries are typically large (millions) and need to be stored in an external storage device. The read and write bandwidths of these entries are limited by the maximum clock frequency and data width supported by the memory device, which is a theoretical limit.
When processing multitask data reading and writing, multiple task processors are often required to work simultaneously, and when the processors work simultaneously, conflicts can occur among different task processors, so that the entry reading and writing performance often becomes a bottleneck of the whole design.
Disclosure of Invention
The invention provides a method and a device for improving the performance of an intelligent network card, which are used for solving the defect of low read-write efficiency in the prior art and realizing the purpose of quickly and efficiently reading and writing data.
In a first aspect, the present disclosure provides a method for improving performance of an intelligent network card, including:
acquiring the address of a table item pointed by a reading request instruction of a current processing module;
determining a hash value corresponding to the address according to the address of the table entry;
determining the locking state of the cell corresponding to the reading request instruction according to the hash value and a bit bitmap locking table which is constructed in advance and contains a plurality of cells;
and determining whether the scheduler executes the read operation according to the locking state of the cell.
The method for improving the performance of the intelligent network card provided by the disclosure includes the steps of determining a locking state of a cell corresponding to the read request instruction according to the hash value and a pre-constructed bitmap lock table containing a plurality of cell bits;
obtaining a remainder by taking the hash value as a dividend and taking the depth of the bitmap lock table as a divisor;
inquiring the value of the bit number in the cell corresponding to the remainder in the bitmap lock table;
and determining the locking state of the cell according to the value of the bit number.
According to the method for improving the performance of the intelligent network card provided by the present disclosure, the determining whether the scheduler executes the read operation according to the locking state specifically includes:
if the locking state of the cells is unlocked, the scheduler sends a reading request instruction to the controller, and changes the value of the bit number in the table into the locking state;
if the locked state of the cell is locked, the scheduler does not send the read request command to the controller.
The method for improving the performance of the smart network card according to the present disclosure, wherein if the locked state of the cell is unlocked, the method further includes, after the scheduler sends a read request command to the controller:
and after receiving the reading request instruction of the scheduler, the controller reads the data of the table entry corresponding to the cell and sends the data of the table entry to the current processing module.
The method for improving performance of an intelligent network card according to the present disclosure, wherein if the locked state of the cell is locked, the scheduler does not send the read request command to the controller, and further includes:
adding, by the scheduler, the read request instruction to a wait table;
and the scheduler continues to schedule the reading request instructions of other processing modules in a polling scheduling mode, and determines whether to execute the reading operation according to the value of the bit number in the table corresponding to the reading request instructions of the other processing modules, wherein the reading requests of the other processing modules comprise the reading request instructions stored in the waiting table.
According to the method for improving the performance of the intelligent network card, provided by the disclosure, the read request instruction stored in the waiting table participates in the polling scheduling in a first-in first-out mode.
According to the method for improving the performance of the intelligent network card, provided by the disclosure, the table entry write operation after the table entry read operation is completed comprises the following steps:
after the processing module finishes updating the read data of the table entry, a write request instruction is initiated;
acquiring the address of the table entry aimed at by the write request instruction;
the controller completes the write operation of the updated data after receiving the write request instruction;
and 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 be an unlocked state.
In a second aspect, the present disclosure provides a device for improving performance of an intelligent network card, including:
the first processing module is used for acquiring the address of the table item pointed by the reading request instruction of the current processing module;
the second processing module is used for determining a hash value corresponding to the address according to the address of the table entry;
a third processing module, configured to determine, according to the hash value and a pre-constructed bitmap lock table including multiple cells, a lock state of a cell corresponding to the read request instruction;
and the fourth processing module is used for determining whether the scheduler executes the read operation according to the locking state of the cell.
In a third aspect, the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the computer program to implement the steps of any one of the above methods for improving the performance of the intelligent network card.
In a fourth aspect, the present disclosure also provides a non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for improving the performance of the smart network card as described in any one of the above.
According to the method and the device for improving the performance of the intelligent network card, the address of a table entry pointed by a reading request instruction of a current processing module is obtained; then, determining a 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 one table entry can be normalized, and then the locking state of the cell corresponding to the reading request instruction is determined according to the hash value and a bit bitmap lock table which is constructed in advance and contains a plurality of cells; this corresponds to adding a lock to the execution request of each processing module, and then determining whether the scheduler is to execute a read operation based on the locked state of the cell. The method and the device realize that one lock in the prior art is disassembled into a plurality of locks by introducing the bitmap lock table structure, reduce the conflict probability of each lock and improve the table entry read-write performance.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a diagram illustrating a multi-port table entry read-write collision in the prior art;
fig. 2 is a schematic flow chart of a method for improving the performance of an intelligent network card according to the present disclosure;
FIG. 3 is a schematic diagram of an improved table entry read/write structure including a bitmap lock table according to the present disclosure;
FIG. 4 is a schematic illustration of the "head drag" effect provided by the present disclosure after locking;
FIG. 5 is a diagram illustrating an improved table entry read/write structure including a wait table according to the present disclosure;
FIG. 6 is a schematic diagram of a read request scheduling process provided by the present disclosure;
FIG. 7 is a schematic diagram of a write request scheduling process provided by the present disclosure;
fig. 8 is a schematic structural diagram of the apparatus for improving the performance of the intelligent network card provided by the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device provided by the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present disclosure, belong to the protection scope of the embodiments of the present disclosure.
A method for improving the performance of the intelligent network card according to the embodiment of the present disclosure is described below with reference to fig. 1 to fig. 3, where the method includes:
step 100: acquiring the address of a table item pointed by a reading request instruction of a current processing module;
specifically, in order to fully utilize the bus bandwidth in the prior art, a multi-port read-write mode is generally adopted in hardware design: and a plurality of processing modules (proc0, proc1, … and procM) read and write the table entry contents in parallel, sequentially schedule the read and write requests by a scheduler in a polling round-robin mode, send the requests to the storage controller, and finish the read and write of the table entry contents stored in the storage device particles by the storage controller.
Assume in connection with fig. 1 that there are two processing modules Proc0, Proc1, each processing an entry with 1 added to the entry content. Reading the Entry0 content at time instant t1 (assuming that the Entry content Entry0.data ═ 0 at this time instant); at time t2, proc1 also initiates a table Entry0 content reading operation, and reads the content Entry0.data ═ 0; writing Entry0.data ═ 1 back to Entry0 at time proc0 t 3; at time t4, proc1 writes Entry0.data ═ 1 back to Entry0. Thus, the content in Entry0 is increased by only 1 by proc0 and proc1, and obviously, the result does not match the expected result.
Because the external memory is divided into a plurality of table entries, a multi-port read-write mode is adopted: the multiple processing modules (proc0, proc1, …, procM) read and write the table entry content in parallel, and each processing module needs to determine the address of a different table entry when reading and writing one table entry.
Step 200: determining a hash value corresponding to the address according to the address of the table entry;
specifically, after the address of the entry to be read by each processing module is obtained, a hash algorithm is applied to the address to obtain a hash value of each entry address. The hash algorithm maps an arbitrary length binary value to a shorter fixed length binary value, this small binary value being referred to as the hash value. Hash values are a unique and extremely compact representation of a piece of data as a value. If a piece of plaintext is hashed and even if only one letter of the piece is altered, the subsequent hash will produce a different value. It is computationally infeasible to find two different inputs whose hash is the same value, so the hash value of the data can verify the integrity of the data. Therefore, the address is normalized by performing a hash algorithm on the address, and the representation of the address is converted into a binary form.
Step 300: determining the locking state of the cell corresponding to the reading request instruction according to the hash value and a bit bitmap locking table which is constructed in advance and contains a plurality of cells;
specifically, referring to fig. 3, in the present disclosure, by constructing a Bitmap lock table locker-Bitmap, which contains a plurality of cells, the Bitmap lock table locker-Bitmap is also essentially a lock, and is a multi-lock compared to the previous single lock. The adoption of a plurality of locks is equivalent to dividing a large table entry in the storage device into a small table entry, and each small table entry is a lock. The greater the pocket-Bitmap depth of the Bitmap lock table, the more locks, the lower the collision probability of relatively small table entries. Of course, from a hardware implementation perspective, the Bitmap lock table locker-Bitmap structure may not be designed as deep as the size of a storage device table entry (in the millions).
Preferably, in the present disclosure, the depth of the Bitmap lock table locker-Bitmap is 128, 256, 512, 1024, etc. of the power of 2 value table. In the present disclosure, according to the hash value of the address of the table entry obtained in the above step and the preset Bitmap lock table locker-Bitmap, a cell corresponding to each table entry address in the Bitmap lock table locker-Bitmap is determined. Since the Bitmap lock table locker-Bitmap is a multi-cell table composed of bits 0 or 1, the bit value in each cell is 0 or 1. Bit 0 may be set to indicate an unlocked state and bit 1 may be set to indicate a locked state.
Step 400: and determining whether the scheduler executes the read operation according to the locking state of the cell.
Specifically, when the bit value of the cell corresponding to the read request command is 0, indicating that the cell is not locked, the scheduler may execute the content of the read request command. When the bit value of the table corresponding to the read request command is 1, it means that the cell is in a locked state, and the scheduler cannot execute the corresponding read operation.
According to the method for improving the performance of the intelligent network card, the address of the table entry pointed by the reading request instruction of the current processing module is obtained; then, determining a 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 one table entry can be normalized, and then the locking state of the cell corresponding to the reading request instruction is determined according to the hash value and a bit bitmap lock table which is constructed in advance and contains a plurality of cells; this corresponds to adding a lock to the execution request of each processing module, and then determining whether the scheduler is to execute a read operation based on the locked state of the cell. The method and the device realize that one lock in the prior art is disassembled into a plurality of locks by introducing the bitmap lock table structure, reduce the conflict probability of each lock and improve the table entry read-write performance.
The method for improving the performance of the intelligent network card provided by the embodiment of the disclosure includes determining a locking state of a cell corresponding to the read request instruction according to the hash value and a pre-constructed bitmap lock table containing a plurality of cells, and specifically includes;
obtaining a remainder by taking the hash value as a dividend and taking the depth of the bitmap lock table as a divisor;
inquiring the value of the bit number in the cell corresponding to the remainder in the bitmap lock table;
and determining the locking state of the cell according to the value of the bit number.
Specifically, before initiating entry reading and writing, each processing module proc0, proc1, …, procM sends an entry address requested by the processing module proc0, proc1, and procM sends the entry address to the AddrHash module, the AddrHash module calculates a HASH value from the address by using a HASH algorithm, and then the HASH value is used to take the surplus of the bit Bitmap lock table locker-Bitmap table depth, so that the HASH value falls into the bit Bitmap lock table locker-Bitmap table range.
Suppose that the address of an entry is 11111111 after being converted into a hash value, and the depth of the Bitmap lock table locker-Bitmap is 128. The number 11111111 is converted into a decimal number and then is 255, the remainder obtained by taking 255 as dividend and 128 as divisor is 127, and the bit value of the byte in the 127 th cell in the Bitmap lock table locker-Bitmap table is inquired according to the remainder 127. If the bit value in the cell is 0, it indicates that the cell is in the unlocked state, and if the bit value in the cell is 1, it indicates that the cell is in the locked state.
According to the method for improving the performance of the intelligent network card provided by the present disclosure, the determining whether the scheduler executes the read operation according to the locking state specifically includes:
if the locking state of the cells is unlocked, the scheduler sends a reading request instruction to the controller, and changes the value of the bit number in the table into the locking state;
if the locked state of the cell is locked, the scheduler does not send the read request command to the controller.
Specifically, in conjunction with fig. 3, the present disclosure adds a Bitmap lock table locker-Bitmap table after the scheduler arbitor scheduling module. If the cell of the bitmAN _ SN lock table locker-Bitmap table corresponding to the scheduled read request is '0', which indicates that no other module locks the table entries currently, the current request can be executed, the scheduler sends the request to the controller, and simultaneously, the corresponding bit in the bitmAN _ SN lock table locker-Bitmap table is set to '1' to lock the current operation.
If the byte value in the cell of the bit Bitmap lock table LOCKER-Bitmap table corresponding to the scheduled read request is already '1', which indicates that other modules are already operating the table entries, the scheduler stops scheduling until the corresponding bit in the LOCKER _ BITMAP is unlocked.
The method for improving the performance of the smart network card according to the present disclosure, wherein if the locked state of the cell is unlocked, the method further includes, after the scheduler sends a read request command to the controller:
and after receiving the reading request instruction of the scheduler, the controller reads the data of the table entry corresponding to the cell and sends the data of the table entry to the current processing module.
Specifically, after reading the value stored in the memory, the controller sends the value to the processing module that issued the read request instruction, and completes the read operation.
The method for improving performance of an intelligent network card according to the present disclosure, wherein if the locked state of the cell is locked, the scheduler does not send the read request command to the controller, and further includes:
adding, by the scheduler, the read request instruction to a wait table;
and the scheduler continues to schedule the reading request instructions of other processing modules in a polling scheduling mode, and determines whether to execute the reading operation according to the value of the bit number in the table corresponding to the reading request instructions of the other processing modules, wherein the reading requests of the other processing modules comprise the reading request instructions stored in the waiting table.
In particular, in the above, by adding the Bitmap lock table locker-Bitmap table, separate locking of each task is realized, and although the correctness of the result can be ensured, the overall read-write performance is reduced, and more troublesome is that a "head block" effect is introduced. As shown in fig. 4, it is assumed that the 0 th processing module proc0 initiates the operation of reading the table Entry0, and the 1 st processing module proc1 initiates the operations of reading the table Entry0, the table Entry1 and the table Entry 2. The read operation of proc1 may only wait until the 0 th processing module proc0 module writes the Entry0 result back and unlocks. In fact, proc1 reads Entry1 and Entry2 do not conflict with the read Entry0 operation of proc0, but this head request is blocked due to read Entry0, resulting in the subsequent requests being blocked. The occurrence of the head block effect further reduces the performance of reading and writing the table entries.
Therefore, in the embodiment of the present disclosure, by introducing the WAITING TABLE wait _ TABLE structure, the request with the "head block" is first put into wait _ TABLE, and the subsequent request is not blocked, thereby achieving the purpose of improving the TABLE entry read-write performance as a whole.
Referring to fig. 5, it is specifically shown that when a request of a certain module has a "head block", the scheduler still schedules the request, but does not send the request to the controller, but sends the request to the wait TABLE wait _ TABLE, and at this time, the scheduler arbitor is not blocked, and it can continue to schedule requests of other modules in round-robin polling manner. The request in the wait _ TABLE is also scheduled as a source of the scheduler. Thus, requests previously placed into the wait TABLE wait _ TABLE because the entry is locked will eventually still be dispatched. As with the requests of other modules, the request in the wait TABLE WAITING _ TABLE will still look at the lock status in the Bitmap lock TABLE locker-Bitmap TABLE, and if it is still a lock, the request is continuously dispatched to the wait TABLE WAITING _ TABLE, otherwise, to the controller.
According to the method for improving the performance of the intelligent network card, provided by the disclosure, the read request instruction stored in the waiting table participates in the polling scheduling in a first-in first-out mode.
Specifically, the wait TABLE wait _ TABLE may be implemented with a FIFO (FIRST IN FIRST OUT), with little additional resources. The introduction of the Bitmap lock table locker-Bitmap table further improves the table entry reading and writing performance, improves the utilization rate of the storage bus, and finally improves the performance of the whole design.
According to the method for improving the performance of the intelligent network card, provided by the disclosure, the table entry write operation after the table entry read operation is completed comprises the following steps:
after the processing module finishes updating the read data of the table entry, a write request instruction is initiated;
acquiring the address of the table entry aimed at by the write request instruction;
the controller completes the write operation of the updated data after receiving the write request instruction;
and 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 be an unlocked state.
Specifically, after reading the value of the entry in the read request instruction and performing data update, the processing module writes the updated data back to the entry.
When data of a table entry is written back to the table entry, a write request instruction needs to be sent, and the write request instruction corresponds to an address of the table entry. Because the cells in the bitmap lock table are still in the locked state when the processing module performs the read-write operation, the processing module directly sends the data to the controller without judging the state of the bitmap lock table, and the controller performs the corresponding data write operation on the corresponding table entry.
However, after the write operation is completed, the value in the cell corresponding to the write operation in the Bitmap lock table locker-Bitmap table needs to be changed to 0, so that the cell is changed to the unlocked state. The specific mode includes two modes, one mode is to separately store the position of the cell in the Bitmap lock table locker-Bitmap table corresponding to the read operation, directly find the position of the cell after the write operation is completed, and change the cell from the locked state to the locked state.
Or not storing the position of the cell, recalculating the hash value according to the address aimed by the write operation instruction, determining the position of the corresponding cell according to the hash value, and changing the numerical value of the cell from 1 to 0 to enable the cell to be in a locked open state.
For the above method, taking a complete read/write operation as an example, it can be expressed as:
referring to fig. 6, when a read request to a current module is scheduled, first, HASH is performed on an entry address, and a HASH result is used as an index to search a Bitmap lock TABLE locker-Bitmap TABLE (the TABLE is electrically initialized to all '0'), if a corresponding BIT is '1', it indicates that the contents of an entry to be read are being rewritten by other modules, so that the read request is put into a wait TABLE wait _ TABLE to wait for a next round of scheduling; if the corresponding BIT is '0', the table entry to be read is not processed by other modules, the scheduler modifies the corresponding BIT in the locker-Bitmap table of the Bitmap lock table into '1', the table entry is locked, meanwhile, the request is sent to the controller, the content of the table entry is read, and the read request scheduling is completed.
As shown in fig. 7, when the processing module finishes updating the table entry content and initiates a write request, first, HASH is performed on the table entry address, the HASH result is used as an index to query the node lock table locker-Bitmap table, the write request is sent to the controller, and meanwhile, the content in the node lock table locker-Bitmap table is changed from '1' to '0', and the table entry is unlocked, so that the write request is scheduled completely.
Referring to fig. 8, the present disclosure provides a device for improving performance of an intelligent network card, including:
the first processing module 81 is configured to obtain an address of a table entry pointed by a current processing module reading request instruction;
the second processing module 82 is configured to determine, according to the address of the table entry, a hash value corresponding to the address;
a third processing module 8, configured to determine, according to the hash value and a pre-constructed bitmap lock table including multiple cells, a lock state of a cell corresponding to the read request instruction;
a fourth processing module 84, configured to determine whether the scheduler performs a read operation according to the locked state of the cell.
Since the apparatus provided by the embodiment of the present disclosure can be used for executing the method described in the above embodiment, and the operation principle and the beneficial effect are similar, detailed descriptions are omitted here, and specific contents can be referred to the description of the above embodiment.
According to the device for improving the performance of the intelligent network card, the address of the table entry pointed by the reading request instruction of the current processing module is obtained; then, determining a 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 one table entry can be normalized, and then the locking state of the cell corresponding to the reading request instruction is determined according to the hash value and a bit bitmap lock table which is constructed in advance and contains a plurality of cells; this corresponds to adding a lock to the execution request of each processing module, and then determining whether the scheduler is to execute a read operation based on the locked state of the cell. The method and the device realize that one lock in the prior art is disassembled into a plurality of locks by introducing the bitmap lock table structure, reduce the conflict probability of each lock and improve the table entry read-write performance.
According to the apparatus for improving the performance of the intelligent network card provided by the present disclosure, the third processing module 83 is specifically configured to;
obtaining a remainder by taking the hash value as a dividend and taking the depth of the bitmap lock table as a divisor;
inquiring the value of the bit number in the cell corresponding to the remainder in the bitmap lock table;
and determining the locking state of the cell according to the value of the bit number.
According to the device for improving the performance of the intelligent network card provided by the present disclosure, the fourth processing module 84 is specifically configured to:
if the locking state of the cells is unlocked, the scheduler sends a reading request instruction to the controller, and changes the value of the bit number in the table into the locking state;
if the locked state of the cell is locked, the scheduler does not send the read request command to the controller.
According to the device for improving the performance of the intelligent network card provided by the disclosure, the fourth processing module is further configured to:
and after receiving the reading request instruction of the scheduler, the controller reads the data of the table entry corresponding to the cell and sends the data of the table entry to the current processing module.
According to the apparatus for improving the performance of the smart network card provided by the present disclosure, the fourth processing module 84 is further configured to:
adding, by the scheduler, the read request instruction to a wait table;
and the scheduler continues to schedule the reading request instructions of other processing modules in a polling scheduling mode, and determines whether to execute the reading operation according to the value of the bit number in the table corresponding to the reading request instructions of the other processing modules, wherein the reading requests of the other processing modules comprise the reading request instructions stored in the waiting table.
According to the device for improving the performance of the intelligent network card, provided by the disclosure, the read request instruction stored in the waiting table participates in the polling scheduling in a first-in first-out mode.
According to the device that promotes intelligent network card performance that this disclosure provided, wherein, still include:
the fifth processing module is used for initiating a write request instruction after the processing module finishes updating the read data of the table entry;
a sixth processing module, configured to obtain an address of an entry to which the write request instruction is directed;
a seventh processing module, configured to complete a write operation of the updated data after the controller receives the write request instruction;
and the eighth processing module is configured to update, by the scheduler, 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.
Fig. 9 illustrates a physical structure diagram of an electronic device, and as shown in fig. 9, 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 via the communication bus 940. Processor 910 may invoke logic instructions in memory 930 to perform a method for enhancing the performance of a smart network card, the method comprising: acquiring the address of a table item pointed by a reading request instruction of a current processing module; determining a hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the reading request instruction according to the hash value and a bit bitmap locking table which is constructed in advance and contains a plurality of cells; and determining whether the scheduler executes the read operation according to the locking state of the cell.
Furthermore, the logic instructions in the memory 930 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present disclosure also provides a computer program product, including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer being capable of executing a method for improving the performance of a smart network card provided by the above methods, the method including: acquiring the address of a table item pointed by a reading request instruction of a current processing module; determining a hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the reading request instruction according to the hash value and a bit bitmap locking table which is constructed in advance and contains a plurality of cells; and determining whether the scheduler executes the read operation according to the locking state of the cell.
In yet another aspect, the present disclosure also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the method for improving the performance of the smart network card provided in the foregoing aspects, the method comprising: acquiring the address of a table item pointed by a reading request instruction of a current processing module; determining a hash value corresponding to the address according to the address of the table entry; determining the locking state of the cell corresponding to the reading request instruction according to the hash value and a bit bitmap locking table which is constructed in advance and contains a plurality of cells; and determining whether the scheduler executes the read operation according to the locking state of the cell.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solutions of the present disclosure, not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.
Claims (10)
1. A method for improving the performance of an intelligent network card is characterized by comprising the following steps:
acquiring the address of a table item pointed by a reading request instruction of a current processing module;
determining a hash value corresponding to the address according to the address of the table entry;
determining the locking state of the cell corresponding to the reading request instruction according to the hash value and a bit bitmap locking table which is constructed in advance and contains a plurality of cells;
and determining whether the scheduler executes the read operation according to the locking state of the cell.
2. The method for improving the performance of the intelligent network card according to claim 1, wherein the 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 a plurality of cells specifically comprises;
obtaining a remainder by taking the hash value as a dividend and taking the depth of the bitmap lock table as a divisor;
inquiring the value of the bit number in the cell corresponding to the remainder in the bitmap lock table;
and determining the locking state of the cell according to the value of the bit number.
3. The method of claim 1, wherein the determining whether the scheduler executes the read operation according to the locked state specifically includes:
if the locking state of the cells is unlocked, the scheduler sends a reading request instruction to the controller, and changes the value of the bit number in the table into the locking state;
if the locked state of the cell is locked, the scheduler does not send the read request command to the controller.
4. The method as claimed in claim 3, wherein if the cell is not locked, the method further comprises, after the scheduler sends a read request command to the controller:
and after receiving the reading request instruction of the scheduler, the controller reads the data of the table entry corresponding to the cell and sends the data of the table entry to the current processing module.
5. The method as claimed in claim 3, wherein if the cell is locked, the scheduler does not send the read request command to the controller, and further comprising:
adding, by the scheduler, the read request instruction to a wait table;
and the scheduler continues to schedule the reading request instructions of other processing modules in a polling scheduling mode, and determines whether to execute the reading operation according to the value of the bit number in the table corresponding to the reading request instructions of the other processing modules, wherein the reading requests of the other processing modules comprise the reading request instructions stored in the waiting table.
6. The method for improving the performance of an intelligent network card according to claim 5, wherein the read request commands stored in the waiting list participate in the polling scheduling in a first-in first-out manner.
7. The method for improving the performance of the intelligent network card according to claim 4, wherein the table entry write operation after the table entry read operation is completed comprises:
after the processing module finishes updating the read data of the table entry, a write request instruction is initiated;
acquiring the address of the table entry aimed at by the write request instruction;
the controller completes the write operation of the updated data after receiving the write request instruction;
and 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 be an unlocked state.
8. The utility model provides a promote device of intelligent network card performance which characterized in that includes:
the first processing module is used for acquiring the address of the table item pointed by the reading request instruction of the current processing module;
the second processing module is used for determining a hash value corresponding to the address according to the address of the table entry;
a third processing module, configured to determine, according to the hash value and a pre-constructed bitmap lock table including multiple cells, a lock state of a cell corresponding to the read request instruction;
and the fourth processing module is used for determining whether the scheduler executes the read operation according to the locking state of the cell.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for enhancing the performance of the intelligent network card according to any one of claims 1 to 7 when executing the program.
10. A non-transitory computer readable storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for enhancing the performance of a smart network card according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110898442.2A CN113609339A (en) | 2021-08-05 | 2021-08-05 | Method and device for improving performance of intelligent network card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110898442.2A CN113609339A (en) | 2021-08-05 | 2021-08-05 | Method and device for improving performance of intelligent network card |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113609339A true CN113609339A (en) | 2021-11-05 |
Family
ID=78307228
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110898442.2A Pending CN113609339A (en) | 2021-08-05 | 2021-08-05 | Method and device for improving performance of intelligent network card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113609339A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6182186B1 (en) * | 1998-06-30 | 2001-01-30 | Sun Microsystems, Inc. | Method and apparatus that utilizes lock states to lock resources |
CN102957492A (en) * | 2011-08-18 | 2013-03-06 | 盛科网络(苏州)有限公司 | Method and device for locking 64B/67B coding boundary |
CN107562648A (en) * | 2016-07-01 | 2018-01-09 | 北京忆恒创源科技有限公司 | Without lock FTL access methods and device |
CN109992526A (en) * | 2019-04-10 | 2019-07-09 | 苏州浪潮智能科技有限公司 | A kind of read-write management method and relevant apparatus |
US20190303468A1 (en) * | 2018-04-03 | 2019-10-03 | Sap Se | Database lock management with cache-optimized hash table |
CN111400307A (en) * | 2020-02-20 | 2020-07-10 | 上海交通大学 | Persistent hash table access system supporting remote concurrent access |
CN111858075A (en) * | 2020-06-30 | 2020-10-30 | 广东浪潮大数据研究有限公司 | Deadlock detection method, system, equipment and readable storage medium |
CN113010325A (en) * | 2021-03-16 | 2021-06-22 | 北京百度网讯科技有限公司 | Method and device for realizing read-write lock and electronic equipment |
-
2021
- 2021-08-05 CN CN202110898442.2A patent/CN113609339A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6182186B1 (en) * | 1998-06-30 | 2001-01-30 | Sun Microsystems, Inc. | Method and apparatus that utilizes lock states to lock resources |
CN102957492A (en) * | 2011-08-18 | 2013-03-06 | 盛科网络(苏州)有限公司 | Method and device for locking 64B/67B coding boundary |
CN107562648A (en) * | 2016-07-01 | 2018-01-09 | 北京忆恒创源科技有限公司 | Without lock FTL access methods and device |
US20190303468A1 (en) * | 2018-04-03 | 2019-10-03 | Sap Se | Database lock management with cache-optimized hash table |
CN109992526A (en) * | 2019-04-10 | 2019-07-09 | 苏州浪潮智能科技有限公司 | A kind of read-write management method and relevant apparatus |
CN111400307A (en) * | 2020-02-20 | 2020-07-10 | 上海交通大学 | Persistent hash table access system supporting remote concurrent access |
CN111858075A (en) * | 2020-06-30 | 2020-10-30 | 广东浪潮大数据研究有限公司 | Deadlock detection method, system, equipment and readable storage medium |
CN113010325A (en) * | 2021-03-16 | 2021-06-22 | 北京百度网讯科技有限公司 | Method and device for realizing read-write lock and electronic equipment |
Non-Patent Citations (1)
Title |
---|
北目町小秋刀: "ext2通过block bitmap确定block是否被使用,大致算法是怎样的?", Retrieved from the Internet <URL:《https://www.zhihu.com/question/357625846》> * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108572876B (en) | Method and device for realizing read-write lock | |
US20110265098A1 (en) | Message Passing with Queues and Channels | |
CN110188110B (en) | Method and device for constructing distributed lock | |
CN104065636B (en) | Data processing method and system | |
CN107077390A (en) | A kind of task processing method and network interface card | |
CN106095604A (en) | The communication method between cores of a kind of polycaryon processor and device | |
CN109886859A (en) | Data processing method, system, electronic equipment and computer readable storage medium | |
CN113205417B (en) | Alliance chain oriented transaction parallel processing method and system | |
CN103544153A (en) | Data updating method and system based on database | |
CN103336672B (en) | Method for reading data, device and computing device | |
CN108369562A (en) | Intelligently encoding memory architecture with enhanced access scheduling device | |
US20100192161A1 (en) | Lock Free Queue | |
CN109218385B (en) | Method and device for processing data | |
CN117785490A (en) | Training architecture, method, system and server of graph neural network model | |
CN113609339A (en) | Method and device for improving performance of intelligent network card | |
CN107832121B (en) | Concurrency control method applied to distributed serial long transactions | |
US10447607B2 (en) | System and method for dequeue optimization using conditional iteration | |
CN110716814B (en) | Performance optimization method and device for inter-process large-data-volume communication | |
CN112068948B (en) | Data hashing method, readable storage medium and electronic device | |
CN115129432A (en) | Transaction processing method and device, electronic equipment and medium | |
US6636883B1 (en) | Mechanism for passing information between queuing and de-queuing processes | |
CN111966486A (en) | Data acquisition method, FPGA system and readable storage medium | |
CN113296895B (en) | Transaction processing system, transaction processing method and device | |
CN115951844B (en) | File lock management method, equipment and medium of distributed file system | |
CN114356834A (en) | Method and system for communication between processors without lock |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |