CN118312243B - EBPF unloading method of intelligent network card, programmable RSS (really simple syndication) method and device based on eBPF unloading - Google Patents
EBPF unloading method of intelligent network card, programmable RSS (really simple syndication) method and device based on eBPF unloading Download PDFInfo
- Publication number
- CN118312243B CN118312243B CN202410733319.9A CN202410733319A CN118312243B CN 118312243 B CN118312243 B CN 118312243B CN 202410733319 A CN202410733319 A CN 202410733319A CN 118312243 B CN118312243 B CN 118312243B
- Authority
- CN
- China
- Prior art keywords
- ebpf
- program
- network card
- intelligent network
- offloaded
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44594—Unloading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a eBPF unloading method of an intelligent network card, a programmable RSS method and a device based on eBPF unloading, wherein the unloading method comprises the steps of adopting a general register of the intelligent network card to map a general register and a stack frame base address register of a eBPF program to be unloaded, adopting a local memory of the intelligent network card to provide memory support for a stack when the eBPF program is unloaded, adopting a transfer register of the intelligent network card as a cache memory when the eBPF program is unloaded to process a message, providing a displayed cache memory read-write instruction, and adopting the intelligent network card to provide a memory read-write instruction with the maximum preset bit number for the eBPF program to be unloaded; instructions in the program instruction set to be offloaded eBPF are translated into stream processing engine instructions based on a model map of the program to be offloaded eBPF. The invention greatly enhances the programming capability of a user on a network data surface by means of the programmable capability of the many-core network card, and improves the usability by compiling complex details of programming a user shielding network card processor through jit.
Description
Technical Field
The invention relates to the technical field of intelligent network cards, in particular to a eBPF unloading method of an intelligent network card, an RSS (really simple syndication) method and an RSS device based on eBPF unloading.
Background
The intelligent network card is a future data center programmable network solution, can help a CPU to lighten network load and improve system processing speed, can support virtual network functions and network security functions, and is used for constructing an efficient and flexible data center infrastructure. EBPF is a technology based on eBPF virtual machine and eBPF verifier, so that the user can execute the security restricted code in the kernel, and the application range is very wide, and the technology is used in aspects of kernel tracking, performance analysis, security, storage and the like. The existing intelligent network card eBPF unloading method has higher program complexity, lower flexibility and higher introduction cost.
The RSS technology is an indispensable capability of the network card, and through the multi-queue technology and hash, a hash value is obtained according to five-tuple calculation of the message, and different messages of the five-tuple are hashed to different network card queues according to the difference of the hash values, so that a host side can realize load sharing of the CPU by binding the CPU with the network card queues. But the availability of the RSS technology based on the intelligent network card is low.
Disclosure of Invention
The application aims to provide a eBPF unloading method of an intelligent network card, a eBPF unloading-based programmable RSS method and a eBPF unloading-based programmable RSS device, which are used for solving the problems that the existing unloading method of the intelligent network card eBPF is higher in program complexity, lower in flexibility, higher in introduction cost and lower in RSS technology availability depending on the intelligent network card.
In a first aspect, the present application provides a eBPF unloading method of an intelligent network card, including:
Mapping a general register of an intelligent network card and a stack frame base address register of a to-be-offloaded eBPF program, providing memory support for a stack when an offloaded eBPF program runs by adopting a local memory of the intelligent network card, using a transfer register of the intelligent network card as a cache memory when the offloaded eBPF program processes a message, providing a displayed cache memory read-write instruction, and providing a memory read-write instruction with the maximum preset bit number for the offloaded eBPF program by the intelligent network card so as to realize model mapping of the to-be-offloaded eBPF program on the intelligent network card;
Translating instructions in the program instruction set to be offloaded eBPF into stream processing engine instructions supported by the offloaded eBPF program based on a model mapping of the program to be offloaded eBPF;
The uninstall eBPF program is a eBPF program from the program to be uninstalled eBPF to the intelligent network card.
In an embodiment of the present application, the step of translating the instruction set of the program to be offloaded eBPF into the stream processing engine instruction supported by the offloaded eBPF program based on the model map of the program to be offloaded eBPF includes:
scanning the to-be-offloaded eBPF program instruction set, and translating the to-be-offloaded eBPF program instruction set into an original instruction set supported by the intelligent network card processor based on model mapping of the to-be-offloaded eBPF program;
scanning the original instruction set to re-link the code segments in the original instruction set based on the code segment linking mode in the program instruction set to be uninstalled eBPF.
In one embodiment of the present application, the instructions in the program instruction set to be offloaded eBPF are translated into the original instruction set supported by the intelligent network card processor:
When a call instruction is scanned, all instructions corresponding to a called sub-process are required to be scanned so as to judge whether the R6 register-R9 register is modified by the called sub-process, if so, the R6 register-R9 register is written into a stack, the return address of the called sub-process is stored in a preset register, the called sub-process is executed, and after the called sub-process is finished, the instructions are inserted to transfer to the stored return address;
Wherein the R6 register-R9 register is eBPF call specifications that specify protection by callees.
In one embodiment of the present application, based on the model mapping of the program to be offloaded eBPF, the translating the instruction set of the program to be offloaded eBPF into the original instruction set supported by the intelligent network card processor includes:
the instruction bit width of the universal register to be offloaded eBPF programs is embodied based on the instruction bit width of the universal register of the intelligent network card, and the maximum memory read-write instruction of the eBPF programs to be offloaded is replaced by the maximum memory read-write instruction with preset digits of the intelligent network card;
When the type of the instruction sequence data identified by the eBPF checker in the uninstall eBPF program is a message type, the corresponding instruction sequence data is read into a transfer register corresponding to the uninstall eBPF program from a low-level memory, and then the corresponding instruction sequence data is loaded into a general register corresponding to the uninstall eBPF program.
In an embodiment of the present application, performing the model mapping of the program to be offloaded eBPF on the intelligent network card further includes:
the intelligent network card adopts a content addressing memory to assist the unloading eBPF program to index eBPF map, and the type eBPF map is array or hash.
In an embodiment of the present application, performing the model mapping of the program to be offloaded eBPF on the intelligent network card further includes:
The intelligent network card provides eBPF dedicated TLV message queues based on pcie engine and dma engine, eBPF dedicated TLV message queues are used as PERF EVENT ARRAY type eBPF map.
In an embodiment of the present application, the intelligent network card is a Corigine intelligent network card.
In a second aspect, the present application provides a programmable RSS method based on eBPF offload, comprising:
Acquiring configured queue map and ctrl map, wherein the queue map and ctrl map are realized by adopting ebpf map structures, the queue map is used for storing queue information participating in hash, and the ctrl map is used for storing hash algorithm type and tunneling information;
Analyzing an input message through the type of a hash algorithm in the ctrl map based on tunneling information in the ctrl map to obtain a five-tuple hash value of the input message;
Acquiring a queue index of an input message hash queue based on the five-tuple hash value, and assigning the queue index to an rx_queue_ind in eBPF context;
wherein, adopted eBPF program is uninstalled eBPF program uninstalled to intelligent network card by eBPF uninstalling method of intelligent network card.
In one embodiment of the present application, obtaining the queue index of the input message hash queue based on the five-tuple hash value includes:
and acquiring the queue index of the message hash queue based on a hash mode of a hash algorithm or a SYMMETRIC RSS mode.
In a third aspect, a programmable RSS device based on eBPF offloading includes a configuration file acquisition module, a quintuple hash value acquisition module, and a queue index assignment module;
the configuration file acquisition module is used for acquiring configured queue map and ctrl map, wherein the queue map and ctrl map are both realized by adopting ebpf map structures, the queue map is used for storing queue information participating in hash, and the ctrl map is used for storing hash algorithm type and tunneling information;
The five-tuple hash value acquisition module is used for analyzing the input message through the hash algorithm type in the ctrl map based on the tunneling information in the ctrl map to acquire the five-tuple hash value of the input message;
The queue index assignment module is configured to obtain a queue index of an input message hash queue based on the five-tuple hash value, and assign the queue index to an rx_queue_ind in eBPF context;
Wherein, the adopted eBPF program is an unloading eBPF program which is unloaded onto the intelligent network card by the eBPF unloading method of the intelligent network card.
One or more embodiments of the above-described solution may have the following advantages or benefits compared to the prior art:
By applying the eBPF unloading method of the intelligent network card provided by the embodiment of the invention, the programming capability of a user on a network data plane is greatly enhanced by combining the programmable capability of the many-core network card with the basic framework of the kernel eBPF, and the complex details of programming a user shielding network card processor are compiled through jit, so that the usability is improved. The programmable RSS method based on eBPF unloading realizes the programmable RSS technology, provides a programmable data plane for users, has extremely high availability depending on eBPF ecology, and reduces the introduction cost of the users.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention, without limitation to the invention. In the drawings:
fig. 1 is a schematic flow chart of a eBPF unloading method of an intelligent network card according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of a programmable RSS method based on eBPF offloading according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a programmable RSS device based on eBPF unloading according to an embodiment of the present application.
Detailed Description
The following will describe embodiments of the present invention in detail with reference to the drawings and examples, thereby solving the technical problems by applying technical means to the present invention, and realizing the technical effects can be fully understood and implemented accordingly. It should be noted that, as long as no conflict is formed, each embodiment of the present invention and each feature of each embodiment may be combined with each other, and the formed technical solutions are all within the protection scope of the present invention.
EBPF refers to extended Berkeley PACKET FILTER, an extended berkeley packet filter. In general, to add new functionality to a kernel, it is necessary to modify the kernel source code or write the kernel module to implement. And eBPF allows the program to run without modifying the kernel source code or adding additional kernel modules. eBPF was developed from a BPF (also known as cBPF: classification Berkeley PACKET FILTER), which was specially created for filtering network packets. However, as eBPF continues to improve and strengthen, existing eBPF is no longer limited to filtering network packets.
EBPF led to the development of new generation tools in the fields of networking, security, user program tracking, and performance troubleshooting, which are no longer dependent on only existing kernel functions, but rather implement runtime programming without affecting execution efficiency and security. In most cases, a user needs to add new load balancing logic and configuration by modifying kernel codes, so that a load balancing program is often too high in coupling degree with the kernel, and meanwhile, the service interruption is caused by the need of reloading the program.
The following embodiment of the application provides a eBPF unloading method of an intelligent network card, a eBPF unloading-based programmable RSS method and a eBPF unloading-based programmable RSS device, and solves the problems of higher program complexity, lower flexibility, higher introduction cost and lower RSS technology availability depending on the intelligent network card in the existing unloading method of the intelligent network card eBPF.
The following will explain the principles and implementation modes of a eBPF unloading method of an intelligent network card, a programmable RSS method and a programmable RSS device based on eBPF unloading in detail, which enable those skilled in the art to understand the eBPF unloading method of the intelligent network card, the programmable RSS method and the programmable RSS device based on eBPF unloading in detail.
As shown in fig. 1, the embodiment provides a eBPF unloading method of an intelligent network card, which includes the following steps.
Step S101, mapping the program model to be unloaded eBPF on the intelligent network card.
Specifically, eBPF programs to be offloaded onto the intelligent network card are taken as programs to be offloaded eBPF, and eBPF programs which are already offloaded onto the intelligent network card are taken as programs to be offloaded eBPF. eBPF programs typically have 10 32/64 bit general purpose registers, a read-only 32/64 bit stack frame base register, support procedure call instructions and maximum 32/64 bit mem read and write instructions, eBPF instruction set is a typical general purpose 64 bit risc instruction set.
In the process of mapping the program to be offloaded eBPF to the intelligent network card, a general register of the intelligent network card is required to be used for mapping a general register of the program to be offloaded eBPF and a stack frame base address register, a local memory of the intelligent network card is used for providing memory support for a stack when the program to be offloaded eBPF runs, a transfer register of the intelligent network card is used as a cache memory when the program to be offloaded eBPF processes a message, a displayed cache memory read-write instruction is provided, and the intelligent network card provides a memory read-write instruction with the maximum preset bit number for the program to be offloaded eBPF.
For example, for Corigine's intelligent network card, corigine flow process core as a domain-specific network stream processing engine, there is an engine architecture more suitable for packet processing, where each stream processing core supports 256 general 32-bit registers (divided into ab bank), 512 32-bit transfer registers (caches), 4 x 1k local mem (SRAM), and supports bulk mem read/write instructions of up to 128 bytes based on-chip bus support, in addition to Corigine network cards providing cluster TARGET MEM supporting stream processor cluster sharing for storing shared data such as messages.
When the to-be-offloaded eBPF program is mapped to the Corigine intelligent network card in a model mode, in order to fully play the field advantage of the stream processing engine, two 32-bit general registers are used for mapping one to-be-offloaded eBPF-bit general register, two 32-bit general registers are used for mapping one read-only 64-bit stack frame base address register, 4 x 1K local mem memory is used for providing support for an offloaded eBPF program runtime stack, a transfer register is used as a cache memory of a message, an explicit cache memory read-write instruction is provided, and a maximum 128-byte bulk mem read-write instruction is provided for an offloaded eBPF program.
In addition to the above, in view of practicality and economy, the eBPF unloading method of the intelligent network card according to the embodiment of the present invention optimizes eBPF map unloading in the process of mapping the program to be unloaded eBPF to the intelligent network card.
The map of specific array and hash types can provide data storage and query requirements in most network application scenes, so that the query efficiency is critical to the overall performance of eBPF programs. eBPF's map index is based on map id and ELEMENT KEY, when the offloaded eBPF program contains more maps and the element size in the maps is more, the query and read/write to the maps significantly reduce the performance of eBPF programs. Therefore, CAM (Content Addressable Memory) is introduced into the intelligent network card, namely CAM hardware is adopted to assist map index. The specific intelligent network card uses the cooperation of map id and ELEMENT KEY as CAM key, and uses the data address on map as the value stored by CAM to help the network card to make hardware index to map. The above arrangement greatly improves the query performance of eBPF programs.
PERF EVENT ARRAY is further provided for eBPF program to output internal state to host computer, so as to improve debuggeability of uninstalled program. PERF EVENT ARRAY MAP is used for outputting some needed data to the user, which does not have a storage query function of the data, and does not need to occupy special storage on the device, but in the uninstalled scene, when the user accesses PERF EVENT ARRAY MAP by using bpf_perf_event_output () interface, the network card firmware needs to cooperate with the network card driver to report the data needed by the user to the user state. To achieve this function, the intelligent network card in the embodiment of the present invention provides eBPF dedicated TLV message queues based on pcie engine and dma engine. The network card firmware encapsulates the message according to the structure defined by the perf_event_map, and sends the message content to the memory prepared by the host side driver through the dma engine, and the network card driver analyzes the message according to the perf_event_map and reports the message to the uninstallation eBPF program. The function greatly facilitates the user to observe, debug and uninstall eBPF programs, and improves eBPF availability.
Step S102, based on the model mapping of the program to be offloaded eBPF, the instructions in the program instruction set to be offloaded eBPF are translated into stream processing engine instructions supported by the program to be offloaded eBPF.
Specifically, after the intelligent network card finishes the model mapping of the eBPF program to be offloaded, the instruction set instruction corresponding to the eBPF instruction set of the eBPF program to be offloaded is translated into a stream processing engine instruction, and the stream processing engine instruction is a processing instruction supported by the eBPF program to be offloaded mapped by the intelligent network card. The translation of instructions in the program instruction set to be offloaded eBPF specifically includes: the whole translation process needs two instruction sequence scans, scans the eBPF program instruction set to be offloaded for the first time, and then translates the instructions in the eBPF program instruction set to be offloaded into the original instruction set (namely fpc instruction set and generated jit mirror image) supported by the intelligent network card processor based on the mapping relation of the eBPF program model to be offloaded. Because the translation of the instruction is not simple one-to-one mapping, the generated jit images need to be re-linked, so that relocation of the jump instruction is realized, and the call of the built-in help function of the network card and the read-write of the offloaded map are realized in the eBPF program. The original instruction set is also scanned to re-link the code segments in the original instruction set based on the code segment linking in the program instruction set to be offloaded eBPF.
Further, translating the instructions in the program instruction set to be offloaded eBPF into the original instruction set supported by the intelligent network card processor includes: the method comprises the steps of reflecting a general register instruction form of a program to be uninstalled eBPF based on the general register instruction form of the intelligent network card, and replacing a maximum memory read-write instruction of the program to be uninstalled eBPF with a memory read-write instruction with a maximum preset bit number of the intelligent network card; when the type of the instruction sequence data identified by the eBPF checker in the uninstall eBPF program is a message type, the corresponding instruction sequence data is read into a transfer register corresponding to the uninstall eBPF program from the low-level memory, and then the corresponding instruction sequence data is loaded into a general register corresponding to the uninstall eBPF program.
The procedure call instruction of the normal eBPF procedure can be split into three parts, firstly, a register is saved for a caller to a stack space, and the return address of the subprocess of the callee is saved to the stack space; and secondly, jumping to the starting address of the called sub-process to execute the instruction. And thirdly, after the execution of the subprocess is finished, restoring the register of the caller, restoring the stack base address register, and jumping the execution flow according to the return address in the stack space.
Because the intelligent network card does not support the procedure call instruction natively, in order to implement the procedure call instruction procedure of the eBPF program, in the procedure of translating the instruction set instruction of the program to be offloaded eBPF into the original instruction set supported by the intelligent network card processor: when the Jit scans to the call instruction, it needs to further scan all instructions corresponding to the callee subprocess, and determine whether the callee subprocess modifies the R6 register-R9 register, if so, write the R6 register-R9 register into the stack (eBPF call specification specifies that the R6 register-R9 register is protected by the callee), save the return address of the callee subprocess into the preset register (in this embodiment, the Jit saves it with two fixed-number gprs registers), then execute the callee subprocess, and insert a jump instruction to transfer to the saved return address after the callee subprocess ends.
More specifically, when mapping the program model to be offloaded eBPF into the intelligent network card of Corigine, the method for translating the instructions in the program instruction set to be offloaded eBPF into the original instruction set supported by the intelligent network card processor specifically includes: for the eBPF 64-bit ALU instruction, two 32-bit ALUs are assembled; based on eBPF verifier data flow analysis, identifying a continuous memory read-write instruction sequence, and replacing the continuous memory read-write instruction sequence with bulk mem read-write of a flow processing engine; if eBPF verifier indicates that the PTR type is the pointer ptr_to_packet of the message type, the message needs TO be read into a transfer register from a low-level memory CTM as a cache, then data is loaded into a destination general register from the transfer register (two 32-bit general register maps), and finally the cache is written back TO the low-level memory when the eBPF program ends or the cache content needs TO be refreshed.
The purpose of the eBPF program offloaded onto the intelligent network card is to accelerate the processing capability of the data packet of the protocol stack, so the eBPF offloaded referred to by the present invention only considers the application of eBPF in the network module, including but not limited to eBPF XDP, eBPF CLS, etc. In addition, offloading eBPF programs offloaded onto the intelligent network card trades off flexibility against security, allowing eBPF programs limited memory access in the kernel, but performs a more rigorous check on pointers in eBPF programs in the offloading scenario, allowing only programs to access eBPF context, eBPF runtime stacks, eBPF map and network packet memory, which limits reduce program complexity in the offloading scenario without unduly limiting the flexibility of eBPF programs.
According to the eBPF unloading method of the intelligent network card, provided by the embodiment of the invention, the programming capability of a user on a network data surface is greatly enhanced by means of the programmable capability of the many-core network card and the combination of the basic framework of the kernel eBPF, and the complex details of programming a user shielding network card processor are compiled through jit, so that the usability is improved.
As shown in fig. 2, the present embodiment provides a programmable RSS method based on eBPF unloading, which includes the following steps.
Step S201, obtain the configured queue map and ctrl map.
Specifically, a queue map and a ctrl map are configured based on user requirements, wherein the queue map and the ctrl map are both implemented by adopting ebpf map structures, the queue map is used for storing queue information participating in hashing, and the ctrl map is used for storing a hash algorithm type and tunneling information. It should be noted that, ctrl map may store multiple hash algorithm types supported, and when in use, a proper hash algorithm type may be selected for use.
Step S202, based on tunneling information in the ctrl map, analyzing the input message through the hash algorithm type in the ctrl map to obtain a five-tuple hash value of the input message.
Specifically, based on tunneling information in ctrl map, judging whether the input message supports tunneling, selecting a proper hash type from the stored hash types, and based on tunneling information, analyzing the input message by the selected hash type to obtain a five-tuple hash value corresponding to the input message.
Step S203, a queue index of the input message hash queue is obtained based on the five-tuple hash value, and the queue index is assigned to the rx_queue_ind in eBPF context.
Specifically, the queue index of the hash queue of the input message may be obtained based on a hash manner of a hash algorithm, so that the input message is hashed randomly into a different queue. The queue index of the message hash queue may also be obtained based on a SYMMETRIC RSS-way hashing such that the incoming message is hashed into a different queue. After the queue index of the input message hash queue is obtained, the queue index of the input message hash queue can be assigned to the rx_queue_ind in eBPF context.
It should be noted that, the intelligent network card of the method runs on the intelligent network card, and eBPF programs on the intelligent network card are unloaded to the intelligent network card based on eBPF unloading method of the intelligent network card.
The programmable RSS method based on eBPF unloading realizes the programmable RSS technology, is provided for users to be able to form a data plane, has extremely high availability depending on eBPF ecology, and reduces the introduction cost of the users. The user can implement the allocation logic that he wants to use in his own RSS program. For example, network traffic may be distributed to different CPU cores for concurrent processing according to different IP addresses, protocols, and other features. The programmable RSS technology further improves the ability of RSS. The programmable RSS method based on eBPF unloading can direct the message of the designated quintuple to the user designated queue for processing, and support tunneling, and the programmable RSS is performed by the message quintuple in the tunnel.
As shown in fig. 3, the embodiment provides a programmable RSS device based on eBPF offloading, which includes a configuration file obtaining module, a quintuple hash value obtaining module, and a queue index assignment module.
The configuration file acquisition module is used for acquiring the configured queue map and ctrl map, wherein the queue map and ctrl map are realized by adopting ebpf map structures, the queue map is used for storing queue information participating in hash, and the ctrl map is used for storing hash algorithm and tunneling information.
The five-tuple hash value acquisition module is used for analyzing the input message through a hash algorithm in the ctrl map based on tunneling information in the ctrl map to acquire the five-tuple hash value of the input message.
The queue index assignment module is used for acquiring the queue index of the input message hash queue based on the five-tuple hash value, and assigning the queue index to the rx_queue_ind in eBPF context.
Wherein, the adopted eBPF program is unloaded onto the intelligent network card by the eBPF unloading method of the intelligent network card.
The programmable RSS device based on eBPF unloading realizes the programmable RSS technology, is provided for a user to be programmable into a data plane, has extremely high availability depending on eBPF ecology, and reduces the introduction cost of the user. The user can implement the allocation logic that he wants to use in his own RSS program. For example, network traffic may be distributed to different CPU cores for concurrent processing according to different IP addresses, protocols, and other features. The programmable RSS technology further improves the ability of RSS. The embodiment of the invention can direct the message of the designated quintuple to the user designated queue for processing based on eBPF unloaded programmable RSS device, and support tunnel penetration, and perform programmable RSS with the message quintuple in the tunnel.
The descriptions of the processes or structures corresponding to the drawings have emphasis, and the descriptions of other processes or structures may be referred to for the parts of a certain process or structure that are not described in detail.
The above embodiments are merely illustrative of the principles of the present application and its effectiveness, and are not intended to limit the application. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the application. Accordingly, it is intended that all equivalent modifications and variations of the application be covered by the claims, which are within the ordinary skill of the art, be within the spirit and scope of the present disclosure.
Claims (8)
1. A eBPF offload method for an intelligent network card, comprising:
mapping a general register of an intelligent network card and a stack frame base address register of a to-be-offloaded eBPF program, providing memory support for a stack when an offloaded eBPF program runs by adopting a local memory of the intelligent network card, using a transfer register of the intelligent network card as a cache memory when the offloaded eBPF program processes a message, providing a displayed cache memory read-write instruction, and providing a memory read-write instruction with the maximum preset bit number for the offloaded eBPF program by the intelligent network card so as to realize model mapping of the to-be-offloaded eBPF program on the intelligent network card;
Translating instructions in the program instruction set to be offloaded eBPF into stream processing engine instructions supported by the offloaded eBPF program based on a model mapping of the program to be offloaded eBPF;
The uninstall eBPF program is a eBPF program from the program to be uninstalled eBPF to the intelligent network card; wherein translating instructions in the program instruction set to be offloaded eBPF into stream processing engine instructions supported by the offloaded eBPF program based on a model mapping to the program to be offloaded eBPF comprises:
scanning the to-be-offloaded eBPF program instruction set, and translating the to-be-offloaded eBPF program instruction set into an original instruction set supported by the intelligent network card processor based on model mapping of the to-be-offloaded eBPF program;
Scanning the original instruction set to re-link the code segments in the original instruction set based on the code segment linking mode in the program instruction set to be uninstalled eBPF;
wherein, in the process of translating the instruction set instruction of the program to be offloaded eBPF into the original instruction set supported by the intelligent network card processor:
When a call instruction is scanned, all instructions corresponding to a called sub-process are required to be scanned so as to judge whether the R6 register-R9 register is modified by the called sub-process, if so, the R6 register-R9 register is written into a stack, the return address of the called sub-process is stored in a preset register, the called sub-process is executed, and after the called sub-process is finished, the instructions are inserted to transfer to the stored return address;
Wherein the R6 register-R9 register is eBPF call specifications that specify protection by callees.
2. The eBPF offload method of claim 1, wherein translating the instructions in the eBPF program instruction set to be offloaded to the original instruction set supported by the intelligent network card processor based on a model mapping to the eBPF program to be offloaded comprises:
the instruction bit width of the universal register to be offloaded eBPF programs is embodied based on the instruction bit width of the universal register of the intelligent network card, and the maximum memory read-write instruction of the eBPF programs to be offloaded is replaced by the maximum memory read-write instruction with preset digits of the intelligent network card;
when the type of the instruction sequence data identified by the eBPF checker in the uninstall eBPF program is a message type, the corresponding instruction sequence data is read into a transfer register corresponding to the uninstall eBPF program from a low-level memory, and then the corresponding instruction sequence data is loaded into a general register corresponding to the uninstall eBPF program.
3. The eBPF offload method of claim 1, wherein performing the model mapping of the program to be offloaded eBPF on the intelligent network card further comprises:
the intelligent network card adopts a content addressing memory to assist the unloading eBPF program to index eBPF map, and the type eBPF map is array or hash.
4. The eBPF offload method of claim 1, wherein performing the model mapping of the program to be offloaded eBPF on the intelligent network card further comprises:
The intelligent network card provides eBPF dedicated TLV message queues based on pcie engine and dma engine, eBPF dedicated TLV message queues are used as PERF EVENT ARRAY type eBPF map.
5. The method of claim eBPF as recited in any one of claims 1-4, wherein the intelligent network card is Corigine.
6. A programmable RSS method based on eBPF offloading, comprising:
Acquiring configured queue map and ctrl map, wherein the queue map and ctrl map are realized by adopting ebpf map structures, the queue map is used for storing queue information participating in hash, and the ctrl map is used for storing hash algorithm type and tunneling information;
Analyzing an input message through the type of a hash algorithm in the ctrl map based on tunneling information in the ctrl map to obtain a five-tuple hash value of the input message;
Acquiring a queue index of an input message hash queue based on the five-tuple hash value, and assigning the queue index to an rx_queue_ind in eBPF context;
Wherein the eBPF program is an offload eBPF program that is offloaded onto the intelligent network card by the eBPF offload method of the intelligent network card according to any one of claims 1-5.
7. The RSS method of claim 6, wherein obtaining a queue index for an input message hash queue based on the five-tuple hash value comprises:
and acquiring the queue index of the message hash queue based on a hash mode of a hash algorithm or a SYMMETRIC RSS mode.
8. A programmable RSS device based on eBPF unloading is characterized by comprising a configuration file acquisition module, a quintuple hash value acquisition module and a queue index assignment module;
The configuration file acquisition module is used for acquiring configured queue map and ctrl map, wherein the queue map and ctrl map are both realized by adopting ebpf map structures, the queue map is used for storing queue information participating in hash, and the ctrl map is used for storing hash algorithm type and tunneling information;
The five-tuple hash value acquisition module is used for analyzing the input message through the hash algorithm type in the ctrl map based on the tunneling information in the ctrl map to acquire the five-tuple hash value of the input message;
The queue index assignment module is configured to obtain a queue index of an input message hash queue based on the five-tuple hash value, and assign the queue index to an rx_queue_ind in eBPF context;
Wherein the eBPF program is an offload eBPF program that is offloaded onto the intelligent network card by the eBPF offload method of the intelligent network card according to any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410733319.9A CN118312243B (en) | 2024-06-07 | 2024-06-07 | EBPF unloading method of intelligent network card, programmable RSS (really simple syndication) method and device based on eBPF unloading |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410733319.9A CN118312243B (en) | 2024-06-07 | 2024-06-07 | EBPF unloading method of intelligent network card, programmable RSS (really simple syndication) method and device based on eBPF unloading |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118312243A CN118312243A (en) | 2024-07-09 |
CN118312243B true CN118312243B (en) | 2024-09-27 |
Family
ID=91728538
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410733319.9A Active CN118312243B (en) | 2024-06-07 | 2024-06-07 | EBPF unloading method of intelligent network card, programmable RSS (really simple syndication) method and device based on eBPF unloading |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118312243B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115473660A (en) * | 2021-06-11 | 2022-12-13 | 中兴通讯股份有限公司 | Network transmission layer data processing method, equipment and storage medium |
CN116170450A (en) * | 2022-12-08 | 2023-05-26 | 芯启源(南京)半导体科技有限公司 | Load balancing method based on intelligent network card eBPF unloading and electronic equipment |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115514508A (en) * | 2021-06-21 | 2022-12-23 | 中兴通讯股份有限公司 | Data packet filtering method and device, electronic equipment and computer readable storage medium |
CN114816761A (en) * | 2022-05-17 | 2022-07-29 | 昭通亮风台信息科技有限公司 | Cloud service grid resource optimization method, system and medium based on eBPF |
CN116055163A (en) * | 2023-01-10 | 2023-05-02 | 中电云数智科技有限公司 | A login information acquisition and blocking method based on eBPF XDP |
-
2024
- 2024-06-07 CN CN202410733319.9A patent/CN118312243B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115473660A (en) * | 2021-06-11 | 2022-12-13 | 中兴通讯股份有限公司 | Network transmission layer data processing method, equipment and storage medium |
CN116170450A (en) * | 2022-12-08 | 2023-05-26 | 芯启源(南京)半导体科技有限公司 | Load balancing method based on intelligent network card eBPF unloading and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN118312243A (en) | 2024-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7146613B2 (en) | JAVA DSP acceleration by byte-code optimization | |
US11449242B2 (en) | Shared storage space access method, device and system and storage medium | |
US9189271B2 (en) | Operation transfer from an origin virtual machine to a destination virtual machine while continue the execution of the operation on the origin virtual machine | |
US20090271172A1 (en) | Emulating A Computer Run Time Environment | |
CN114356223B (en) | Memory access method and device, chip and electronic equipment | |
WO2018040270A1 (en) | Method and device for loading linux-system elf file in windows system | |
US12210438B1 (en) | Breakpoints in neural network accelerator | |
US9772881B2 (en) | Hardware resource allocation for applications | |
CN116028455A (en) | A data processing method, device, storage medium and electronic equipment | |
CN109857553A (en) | EMS memory management process and device | |
Tianhua et al. | The design and implementation of zero-copy for linux | |
CN114826793B (en) | A kind of detection method, device and medium of ROP chain | |
US7650599B2 (en) | Method and system for accepting precompiled information | |
CN120255955A (en) | Binary translation method, device, electronic device and readable storage medium | |
EP4582960A1 (en) | Dpu-based remote procedure call method, device, and storage medium | |
WO2023016481A1 (en) | Data processing method and related apparatus | |
CN118312243B (en) | EBPF unloading method of intelligent network card, programmable RSS (really simple syndication) method and device based on eBPF unloading | |
CN111782274A (en) | Data processing device and related product | |
CN118672652A (en) | Instruction processing method, apparatus, electronic device and computer program product | |
WO2023030173A1 (en) | Method for managing dynamic library and corresponding apparatus | |
CN114780447A (en) | Memory data reading method, device, device and storage medium | |
CN114924794A (en) | Address storage and scheduling method and device for transmission queue of storage component | |
CN103235745A (en) | Address conflict detection method and device | |
CN1719416A (en) | Embedded type parallel computation system and embedded type parallel computing method | |
US12367021B1 (en) | Fast interference graph construction for a binary tree of interval nodes |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |