Method and device for optimizing on-chip space of PCIe device
By dividing and managing configuration information in PCIe devices and sharing read-only fields and exclusive writable fields, the problem of on-chip space occupation of PCIe devices is solved, resource saving and performance improvement are achieved, and it is suitable for scenarios such as containers, Kubernetes and microservices. .
Patent Information
- Application Number
- CN202310672456.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-06-08
AI Technical Summary
Existing PCIe devices based on SR-IOV technology have resource constraints in terms of on-chip space occupation. Especially as the number of VFs increases, the demand for on-chip storage space continues to increase, which is difficult to effectively solve through traditional methods.
By dividing the configuration information of the PCIe device into shared first-type information and exclusive second-type information, and using the address mapping unit to store them in different storage units respectively, sharing read-only and reserved fields to reduce on-chip memory usage , exclusive writable fields to ensure the independence of each VF.
It significantly reduces the on-chip storage space occupied by virtual function modules, saves resources, supports more VF configurations, and meets the needs of emerging scenarios such as containers, Kubernetes, and microservices.
Smart Images

Figure CN116627883B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer equipment, and in particular, relates to a method and device for optimizing on-chip space of a PCIe device, in particular, a method and device for optimizing on-chip space of a PCIe device based on the SR-IOV standard. Background Art
[0002] SR-IOV (Single Root I / O Virtualization, also known as SRIOV) is an extension specification of the PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus) specification "Single Root I / O Virtualization and Sharing Specification" defined by the PCI-SIG organization. The purpose is to provide a standard specification to provide independent memory space, interrupts, and DMA (Direct Memory Access) data streams for VMs (virtual machines).
[0003] SR-IOV is implemented based on the PCIe specification. The SR-IOV protocol introduces the concept of two types of functions: physical function (PF) and virtual function (VF). Through the above PF and VF functions, a single physical PCIe device is supported to virtualize multiple virtual PCIe devices, and then the virtual PCIe devices are directly connected to each virtual machine, so as to realize the application scenario of a single physical PCIe device supporting multiple virtual machines.
[0004] However, with the rise of containers, Kubernetes (an open source container cluster management system from Google) and microservices, the scale of SRIOV VFs supported by PCIe devices including network cards and storage is getting larger and larger. PCIe devices need to fully implement the design of PCIe configuration space and BAR (Base Address Register) space in the chip. The continuous increase in the number of VFs has led to a continuous increase in the storage space required on the chip.
[0005] In the current PCIe devices based on SR-IOV technology, the following are several common scenarios that lead to new problems, as well as the corresponding solutions adopted to solve the new problems:
[0006] Scenario 1: SR-IOV technology scenario increases the requirements for on-chip storage space resources
[0007] In traditional PCIe, each PF usually supports 256 VFs, and each VF occupies 4KByte of storage space. Therefore, the on-chip configuration space required for VF is 1MByte. This order of magnitude of storage space can be directly implemented by the SRAM (Static Random-Access Memory) in the chip.
[0008] However, SR-IOV technology allows PCIe devices to be configured into multiple PFs (Physical Functions) and VFs (Virtual Functions). Existing network cards, DPUs and other devices support configuring PFs into more than 1024 VFs. According to the PCIe specification, the system needs to set up PCIe config space for each VF of the PCIe device. Each VF occupies 4KByte of storage space, and 1024 VFs need to occupy 4MByte of storage space. If there is still on-chip SRAM implementation, the on-chip space will be even more cramped, and 1024 VFs are not the end. As the number of VFs continues to grow, the required on-chip storage space is also increasing.
[0009] For example, with the rise of application scenarios such as containers, Kubernetes, and microservices, the scale of SR-IOV-based VFs supported by PCIe devices including network cards and storage is getting larger and larger. PCIe devices need to fully implement the design of PCIe configuration space and BAR space within the chip, and the continuously increasing number of VFs makes the space required on the chip continue to grow.
[0010] Therefore, with the further development of SR-IOV technology, the number of configurable VFs will increase, which will increase the demand for on-chip configspace resources. It can be foreseen that it will become increasingly difficult to implement PCIe config space in SRAM mode.
[0011] Scenario 2: Resolving resource issues through software on the ARM CPU
[0012] In some DPU implementations, the PCIe PF / VF config space is handled by software on the ARM CPU in the DPU. The hardware logic in the DPU forwards all PCIe CfgRd / CfgWr TLPs to the ARM. The PCIe configspace in this implementation does not occupy on-chip memory, but is entirely stored in the DDR memory on the ARM side.
[0013] Therefore, this method is actually handled by the software on the ARM CPU in the DPU, reducing the demand for on-chip storage space.
[0014] However, the disadvantage of this method is that it requires additional resource consumption.
[0015] Scenario 3: Saving resources by dynamically scheduling VFs
[0016] In order to solve the problems in the aforementioned scenarios, attempts have also been made in the art to dynamically adjust the VF and establish a new resource scheduling and architecture system.
[0017] For example, in Chinese patent CN106484492A, a method and system for configuring an interface are provided, the method comprising: determining a PCIe device with a single root node input / output virtualization SR-IOV capability from a peripheral device high-speed interconnect PCIe tree, the PCIe device comprising at least two physical functions PF, each PF being attached to at least one virtual function VF; according to the system service demand for the number of VFs, the allocation ratio of the VFs respectively attached to the at least two PFs is modified through the channel provided by the PCIe chip in the PCIe device. In the embodiment of the technical solution, the number of VFs attached to the PF is modified through the channel provided by the PCIe chip, so that the number of VFs meets the system service demand. In this way, the number of VFs of each PF meets the service demand, can reduce idle VFs, avoid resource waste, and improve system performance.
[0018] Therefore, this method is to modify the allocation ratio of the VFs respectively attached to the at least two PFs through the channel provided by the PCIe chip in the PCIe device according to the demand for the number of VFs by the system business; in this way, the idle VFs are reduced, thereby improving the function of the system.
[0019] For another example, CN113032103A discloses a VF resource dynamic scheduling method based on the SR-IOV function of a high-speed network card. The purpose is to solve the problem that the scalability of the high-speed network card VF with SR-IOV function is insufficient, and when the number of virtual machines is greater than the number of VFs, the I / O requirements of all virtual machines cannot be met. The technical solution is to first construct a resource scheduling system consisting of a resource configuration module and a dynamic scheduling module; run the resource scheduling system, the resource configuration module configures the VF hardware resources and VF software resources, and constructs VF hardware resource objects and VF software resource objects, and the number of VF software resource objects is greater than the number of VF hardware resources; the dynamic scheduling module dynamically schedules the VF hardware resource objects: the use of this technical solution not only increases the number of VFs, but also solves the problem of mismatch between the VFs allocated to the virtual machines and the bandwidth requirements of the high-speed network card with SR-IOV function, thereby improving the utilization rate of the high-speed network card.
[0020] Therefore, this method is to improve the utilization rate by building a resource scheduling system to configure VF hardware resources and VF software resources.
[0021] In summary, when faced with the dilemma of increasing demand for space resources, technical personnel in this field usually adopt a resource scheduling method of building dynamic scheduling of VFs to solve the problem.
[0022] Therefore, there is an urgent need in the art for a technical solution that can effectively solve the on-chip space occupation problem of PCIe devices, especially a technical solution that can effectively solve the on-chip space occupation problem of PCIe device configuration space (config space). Summary of the invention
[0023] In view of the problem that VF occupies a large amount of on-chip space of PCIe devices in the prior art, a method for optimizing the on-chip space of PCIe devices is provided. The specific technical solution includes:
[0024] Providing at least one physical functional module;
[0025] Providing at least one virtual function module created based on at least one of the physical function modules, each of the virtual function modules comprising configuration information, the configuration information comprising shared first-category information and exclusive second-category information;
[0026] Providing first storage units whose number corresponds to the number of the physical function modules, for storing the first type of information;
[0027] Provide second storage units whose number corresponds to the number of the virtual function modules, for storing the second type of information.
[0028] In a specific embodiment of the present invention, an address mapping unit is provided to map the first type of information storage location and the second type of information storage location of each of the virtual function modules.
[0029] In a specific implementation of the present invention, the first type of information includes a read-only field and a reserved field.
[0030] In a specific implementation of the present invention, the second type of information includes a writable field.
[0031] In a specific embodiment of the present invention, the first type of information includes a read-only field and a reserved field, and the second type of information includes a writable field.
[0032] In a specific embodiment of the present invention, the first storage unit is formed on a first static random access memory.
[0033] In a specific embodiment of the present invention, the second storage unit is formed on a second static random access memory.
[0034] In a specific embodiment of the present invention, the first storage unit is formed on a first static random access memory, and the second storage unit is formed on a second static random access memory.
[0035] In a specific embodiment of the present invention, the first storage unit and the second storage unit are formed on a static random access memory group.
[0036] A PCIe device is also provided, comprising:
[0037] at least one physical functional module;
[0038] at least one virtual function module created based on at least one of the physical function modules, each of the virtual function modules including configuration information, the configuration information including shared first-category information and exclusive second-category information;
[0039] First storage units, the number of which corresponds to the number of the physical function modules, are used to store the first type of information;
[0040] The second storage units, the number of which corresponds to the number of the virtual function modules, are used to store the second type of information.
[0041] In a specific embodiment of the present invention, it also includes:
[0042] a processor configured to generate configuration information read and write instructions;
[0043] An address mapping unit is configured to be connected to the processor, the first storage unit and the second storage unit respectively, and is used to map the first information storage location and the second information storage location of the corresponding virtual function module to the configuration information read and write instructions.
[0044] In a specific embodiment of the present invention, it also includes:
[0045] a processor configured to generate configuration information read and write instructions;
[0046] An address mapping unit is configured to be connected to the processor, the first storage unit and the second storage unit respectively, so as to map the first type of information storage location and the second type of information storage location of the corresponding virtual function module to the configuration information read and write instructions, and the address mapping unit is connected to an optional first status register for outputting or setting the read and write status of the address mapping unit.
[0047] Specifically, the address mapping unit is configured to be connected to the processor, the first storage unit and the second storage unit respectively, so as to map the first information storage location and the second information storage location of the corresponding virtual function module to the configuration information read and write instructions.
[0048] Optionally, the address mapping unit is configured to be respectively connected to the processor, the first storage unit and the second storage unit, so as to map the first type of information storage location and the second type of information storage location of the virtual function module corresponding to the configuration information read and write instructions. The address mapping unit is connected to a first status register for outputting or setting the read and write status of the address mapping unit.
[0049] In a specific implementation of the present invention, the first type of information includes a read-only field and a reserved field.
[0050] In a specific implementation of the present invention, the second type of information includes a writable field.
[0051] In a specific embodiment of the present invention, the first type of information includes a read-only field and a reserved field, and the second type of information includes a writable field.
[0052] In a specific embodiment of the present invention, the first type of information consists of a read-only field and a reserved field, and the second type of information includes a writable field.
[0053] In a specific embodiment of the present invention, the first storage unit is formed on a first static random access memory.
[0054] In a specific embodiment of the present invention, the second storage unit is formed on a second static random access memory.
[0055] In a specific embodiment of the present invention, the first storage unit is formed on a first static random access memory, and the second storage unit is formed on a second static random access memory.
[0056] In a specific embodiment of the present invention, the first static random access memory is connected to a second status register for outputting or setting the read / write status of the first static random access memory.
[0057] In a specific embodiment of the present invention, the second static random access memory is connected to a third status register for outputting or setting the read / write status of the second static random access memory.
[0058] In a specific embodiment of the present invention, the first static random access memory is connected to a second status register for outputting or setting the read / write status of the first static random access memory, and the second static random access memory is connected to a third status register for outputting or setting the read / write status of the second static random access memory.
[0059] The present invention can bring the following beneficial effects: it can reduce the on-chip storage space occupied by the virtual function module. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and their implementation methods.
[0061] Figure 1 The PCIe device VF configuration space (PCIe VirtualFunction Config Space ) according to one embodiment of the present invention is shown.
[0062] Figure 2 The implementation of the PCIe config space according to one embodiment of the present invention is shown. DETAILED DESCRIPTION
[0063] Various aspects of the present invention are described in further detail below.
[0064] Unless otherwise defined or indicated, all professional and scientific terms used herein have the same meanings as those familiar to those skilled in the art. In addition, any methods and materials similar or equivalent to those described herein can be applied to the method of the present invention.
[0065] The following is an explanation of the terms.
[0066] Unless otherwise clearly specified and limited, the "or" mentioned in the present invention includes the relationship of "and". The "and" is equivalent to the Boolean logic operator "AND", the "or" is equivalent to the Boolean logic operator "OR", and "AND" is a subset of "OR".
[0067] It is to be understood that although the terms "first", "second", etc. may be used herein to describe different elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. Therefore, the first element may be referred to as the second element without departing from the teachings of the present invention.
[0068] In the present invention, the terms "comprising", "including" or "comprising" indicate that various components can be applied together in the mixture or composition of the present invention. Therefore, the term "consisting mainly of..." is included in the terms "comprising", "including" or "comprising".
[0069] Unless otherwise clearly specified and limited, the terms "connected", "connected" and "connection" in the present invention should be understood in a broad sense, for example, it can be a fixed connection, or it can be connected through an intermediary medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0070] For example, if an element (or component) is referred to as being on, coupled to, or connected to another element, the element may be directly formed on, coupled to, or connected to the other element, or there may be one or more intervening elements between them. In contrast, if the expressions "directly on," "directly coupled to," and "directly connected to" are used herein, then no intervening elements are indicated. Other words used to describe the relationship between elements should be similarly interpreted, such as "between" and "directly between," "attached" and "directly attached," "adjacent" and "directly adjacent," etc.
[0071] It should also be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the drawings. The words "inner" and "outer" used refer to directions toward or away from the geometric center of a particular component, respectively. It can be understood that these terms are used here to describe the relationship of one element, layer or region relative to another element, layer or region as shown in the drawings. In addition to the orientations described in the drawings, these terms should also include other orientations of the device.
[0072] Other aspects of the present invention will be apparent to those skilled in the art in view of the disclosure herein.
[0073] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0074] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The drawings only show the components related to the present application and are not drawn according to the number, shape and size of the components in actual implementation. The type, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the component layout may also be more complicated. For example, the thickness of the components in the drawings may be exaggerated for the sake of clarity.
[0075] Example
[0076] After extensive and in-depth research, the inventors found that all fields in the PCIe config space can be analyzed and divided into categories (preferably divided into 3 categories), and each category can be designed separately. Some fields can be shared among VFs of the same category, which can greatly reduce the on-chip memory usage. Therefore, the purpose of the present invention is to provide a new resource scheduling and architecture method and system that is different from the existing dynamic scheduling route, so as to greatly reduce the on-chip storage space usage and greatly reduce or even eliminate the performance degradation of the system in the above situation.
[0077] A first aspect of the present invention provides a method for optimizing the on-chip space of a PCIe device, comprising: providing at least one physical function module; providing at least one virtual function module created based on the at least one physical function module, each virtual function module including configuration information, the configuration information including shared first-category information, and exclusive second-category information; providing first storage units whose number corresponds to the number of physical function modules, for storing the first-category information; providing second storage units whose number corresponds to the number of virtual function modules, for storing the second-category information.
[0078] Specifically, the architecture adopted by the PCIe device includes a physical function (PF) module that provides management of physical functions and a virtual function (VF) module that applies multiple virtual functions. Each virtual function module is created based on a physical function module. As described above, multiple virtual function modules can be configured based on one physical function module, that is, multiple virtual function modules correspond to one physical function module.
[0079] Specifically, the division of the first category of information and the second category of information is obtained in the following way:
[0080] Based on the category of the virtual function module, the information of its configuration space is analyzed in units of fields and then divided into categories to obtain fields of different categories; at least including first category fields that can be shared and second category fields that cannot be shared. According to the inventor's research, the first category information of the virtual function modules configured based on the same physical function module is exactly the same. Therefore, the main purpose of the present invention is to make these virtual function modules configured based on the same physical function module share exactly the same first category information, without the need to set up independent storage space for these same information of each virtual function module as in the prior art, thereby reducing the on-chip storage space occupancy. It should be noted that the discovery that the first category information of the virtual function modules configured based on the same physical function module is exactly the same is not obvious. Those skilled in the art fully understand that it is very difficult to track and monitor a large amount of data in the system and confirm that the large amount of data is the same at every moment. The inventor has made a lot of creative work to confirm this discovery.
[0081] For example, the information in the configuration space can be divided into: read-only fields and reserved fields; writable fields and unused fields at the field level. More specifically, read-only fields and reserved fields can be used as the first category of fields that can be shared. It should be noted that the read-only and reserved characteristics of read-only and reserved fields are only for operations with specific permissions, and it cannot be judged that they are unchanged at every moment because of their read-only and reserved characteristics.
[0082] In the new resource scheduling and architecture configuration system of the present invention, the first category fields are used as shared first category information; and the second category fields are used as exclusive second category information.
[0083] The virtual functions are applied through the above-mentioned sharing mechanism, thereby saving storage resources.
[0084] More specifically, the object of the sharing mechanism is: the on-chip storage space of the PCIe device based on the SR-IOV standard.
[0085] It is satisfying that, based on SR-IOV technology, each SR-IOV device can have a PF, and each PF can theoretically have up to 64,000 VFs associated with it. PF can create and manage these VFs through registers, for example. Therefore, the sharing mechanism can greatly save the logic resources of the on-chip space based on SR-IOV technology.
[0086] What is more satisfying is that the resource saving allows PF to configure more VFs, thereby meeting the calling needs of more users.
[0087] In a specific embodiment of the present invention, an address mapping unit is provided to map the storage location of the first type of information and the storage location of the second type of information of each virtual function module. According to the inventor's research, the offset value of the first type of information in the field and the offset value of the second type of information in the field recorded above are mutually nested or fragmented. Therefore, in this embodiment, the mutually nested fragmented addresses can be combined by the address mapping unit. In a specific example, the same first type of information in the configuration information of multiple virtual function modules configured based on the same physical function module can be extracted and only one copy can be saved in the first storage unit. Further preferably, the second type of information of each virtual function module can be added with an identification mark and saved in the second storage unit. As a further preferred embodiment, the second type of information corresponding to each virtual function module in the second storage unit can be sequentially saved in the form of a queue, or in the form of a pointer linked list.
[0088] In a specific implementation of the present invention, the first type of information includes a read-only field and a reserved field.
[0089] Further preferably, the second type of information includes a writable field.
[0090] In a specific embodiment of the present invention, the first storage unit can be formed on a first static random access memory, and further optionally, the second storage unit can also be formed on a second static random access memory. It should be noted that the first static random access memory and the second static random access memory here are not absolutely physically divided, and the two can be formed on the same physical structure, or can be formed on one or more physical structures respectively, or can be formed together on multiple physical structures.
[0091] In one embodiment of the present invention, the first storage unit and the second storage unit are formed on a static random access memory group.
[0092] The following is a detailed description of various specific embodiments of the present invention in conjunction with the accompanying drawings. It should be understood that the specific embodiments obtained by combining the technical features of various specific embodiments of the present invention are also within the protection scope of the present invention.
[0093] Figure 1 The figure shows the used field structure of the PCIe device VF configuration space (PCIe VirtualFunction Config Space) according to an embodiment of the present invention, where the field marked with * corresponds to the exclusive part of the second type of information, and the rest corresponds to the sharable part of the first type of information. In addition, there is an unused part in the configuration space that is not Figure 1 Shown in.
[0094] See also Figure 1As shown, the VF config space includes a fixed PCI header part and an extended header part connected by a pointer nextcapability pointer. The pointer Capability pointer provided in the PCI header part points to the first address of the extended header part.
[0095] According to the inventor's research, for VF, many contents of the PCI Header part are fixed, but two fields such as PCIStatus and PCI Command will change when the system is running, so these two fields can be set as the second type of information, and the storage location of these two fields can be found in Figure 1 , is embedded in the PCI Header. Therefore, as an optional implementation, when saving a single copy of the first type of information, the entire PCI Header can be compressed after extracting these two fields, and the decompression and assembly of the missing fields can be completed through the address mapping unit.
[0096] It should be understood that the above Figure 1 What is recorded is only an example, in which the used fields of the configuration space are not complete in every sense. Any addition or deletion in any form should be included in the gist of the present invention as long as it does not limit the purpose of the invention.
[0097] The extended header of each VF mainly includes:
[0098] •MSI-X capability
[0099] •PCI Express capability
[0100] •AER capability
[0101] •ARI capability
[0102] •TPH requester capability
[0103] •ACS capability
[0104] •ATS capability.
[0105] It should be understood that the above is only an example, and the extended header part includes but is not limited to Figure 1 Any addition or deletion of the parts shown should be included in the gist of the present invention as long as it does not limit the purpose of the present invention.
[0106] After analyzing the above fields, the inventors divided the fields containing different categories into at least the following three categories based on resource scheduling rules:
[0107] Read-only and reserved fields; writable fields; and unused fields.
[0108] Specifically, based on resource scheduling rules, the division of the first category of information and the second category of information is obtained in the following manner: based on the category of the virtual function module, the information of its configuration space is analyzed in units of fields and then divided into categories to obtain fields of different categories; at least including first category fields that can be shared and second category fields that cannot be shared.
[0109] For example, the information in the configuration space can be divided into the following fields at the field level: read-only fields and reserved fields; writable fields and unused fields. More specifically, read-only fields and reserved fields can be used as shared first-category fields corresponding to first-category information; writable fields can be used as exclusive second-category fields corresponding to second-category information; unused fields can be defined as third-category information for system function expansion. As a preferred implementation, the third-category information can be stored off-chip, thereby greatly reducing the on-chip storage space occupied.
[0110] In a specific embodiment, Figure 1 Taking the embodiment shown in as an example, in the VF config space, the read-only / shared field is 143Byte, and the writable / exclusive field is 42Byte. When configuring 4096 VFs based on the same PF, the required on-chip storage space size is 42Byte X 4K + 143Byte ≈ 168KByte. The on-chip storage resources required for the traditional implementation are 4KByte X 4K = 16MB. Therefore, the space saved by the solution proposed in this article is (16MB-168KB) / 16MB=98.97%. Of course, this is just an example, and the present invention can be combined with other features to obtain more solutions.
[0111] More importantly, in the solution of the present invention, when the object of the sharing mechanism is: the on-chip space of a PCIe device based on the SR-IOV standard, resources can be greatly saved.
[0112] What’s even more satisfying is that PCIe devices with a shared mechanism can be applied to a variety of emerging application scenarios, including containers, Kubernetes, or microservices.
[0113] Compared with the prior art, if the prior art is to be applied to emerging scenarios such as containers, Kubernetes and microservices, a large amount of storage resources are required. The sharing mechanism of the present invention can meet the application requirements of the above scenarios when combined with the SR-IOV standard.
[0114] The present invention further provides a preferred specific implementation mode. When implementing the present invention, the read-only field and the reserved field are configured to be shared among the VF modules of multiple application virtual functions. The writable field is configured to be exclusively used by the VF module of each application virtual function. The unused field is configured not to be stored in the on-chip space. Thus, the VF modules of multiple application virtual functions obtained include shared on-chip storage space and exclusive on-chip storage space.
[0115] In a specific embodiment of the present invention, the shared portion is implemented on-chip by a single shared SRAM.
[0116] In a specific implementation manner of the present invention, the SRAM is a single-port SRAM.
[0117] The inventors found that since the host side accesses the config space via the CPU Root Complex, there will not be multiple CfgRd TLPs in any chip clock cycle, so only a single-port SRAM is needed, thus reducing the requirements on system hardware resources.
[0118] In a specific implementation of the present invention, the storage addresses of the first type of information and the second type of information are managed and scheduled through a storage unit, a processor and an address mapping unit.
[0119] The scheduling process includes the following steps:
[0120] Providing first storage units whose number corresponds to the number of physical function modules for storing first-category information; providing second storage units whose number corresponds to the number of virtual function modules for storing second-category information;
[0121] Using a processor to generate configuration information read and write instructions;
[0122] An address mapping unit is used to map the first information storage location and the second information storage location of the corresponding virtual function module to the configuration information read and write instructions, wherein the address mapping unit is connected to the processor, the first storage unit and the second storage unit respectively.
[0123] Specifically, the address mapping unit may also be connected to a status register for outputting or setting the read / write status of the address mapping unit.
[0124] In a more preferred embodiment, the Address mapping logic of the address mapping unit is responsible for translating the original Config space read and write address into an access address for a first storage unit for storing shared first-class information or a second storage unit for storing second-class information exclusive to each VF through a mapping table. The Addressmapping logic, the first storage unit, and the second storage unit can all provide configuration register access, which can be written by hardware reset logic or by control plane CPU (such as ARM CPU in DPU) software to provide flexibility.
[0125] See also Figure 2 , Figure 2 The implementation of the PCIe config space according to one embodiment of the present invention is shown.
[0126] In a specific embodiment of the present invention, the optimization method is applied in scenarios including: containers, Kubernetes, microservices, or a combination thereof.
[0127] The present invention also provides an implementation of a PCIe device.
[0128] In a specific embodiment of the present invention, a PCIe device includes at least one physical function module; at least one virtual function module created based on at least one physical function module, each virtual function module includes configuration information, the configuration information includes shared first-category information, and exclusive second-category information; first storage units whose number corresponds to the number of physical function modules are used to store first-category information; second storage units whose number corresponds to the number of virtual function modules are used to store second-category information.
[0129] In a specific embodiment of the present invention, it also includes: a processor, which is configured to generate configuration information read and write instructions; an address mapping unit 100, which is configured to be connected to the processor, the first storage unit 200 and the second storage unit 300, respectively, to map the first type of information storage location and the second type of information storage location of the corresponding virtual function module to the configuration information read and write instructions.
[0130] Optionally, the address mapping unit is connected to an optional first status register for outputting or setting the read and write status of the address mapping unit.
[0131] Specifically, the address mapping unit 100 is configured to be connected to the processor, the first storage unit 200 and the second storage unit 300 respectively, and is used to map the first information storage location and the second information storage location of the corresponding virtual function module to the configuration information read and write instructions.
[0132] Optionally, the address mapping unit 100 is configured to be connected to the processor, the first storage unit 200 and the second storage unit 300 respectively, so as to map the first type of information storage location and the second type of information storage location of the corresponding virtual function module to the configuration information read and write instructions. The address mapping unit 100 is connected to a first status register for outputting or setting the read and write status of the address mapping unit.
[0133] In a specific embodiment of the present invention, the first storage unit 200 is formed on a first static random access memory; and / or the second storage unit 300 is formed on a second static random access memory.
[0134] More specifically, the storage unit may be a static random access memory (SRAM).
[0135] In a specific embodiment of the present invention, the first static random access memory is connected to a second status register for outputting or setting the read / write status of the first static random access memory; and / or the second static random access memory is connected to a third status register for outputting or setting the read / write status of the second static random access memory.
[0136] Preferably, the PCIe device is a PCIe device based on the SR-IOV standard.
[0137] In summary, if Figure 1 and 2 The specific embodiment of the present invention shown has the following effects:
[0138] 1. It can greatly save on-chip storage space resources. Analyze all fields in the PCIe config space, classify them into categories (preferably divided into 3 categories), and design each category separately. Some fields are shared in VFs of the same category, which can greatly reduce the on-chip memory usage. Therefore, the purpose of the present invention is to provide a new design method and system that is different from the existing dynamic scheduling route, so as to greatly reduce the on-chip memory usage and greatly reduce or even eliminate the performance degradation of the system in the above situation.
[0139] 2. Support a variety of emerging application scenarios, including containers, Kubernetes, and microservices.
[0140] In summary, combined with the requirements for saving system hardware resources, and the aforementioned sharing mechanism to save on-chip storage resources, it can very well meet the needs of a variety of emerging application scenarios, including containers, Kubernetes or microservices.
[0141] Based on this application, it should be understood by those skilled in the art that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspect described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.
[0142] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0143] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.
[0144] All documents mentioned in the present invention are cited as references in this application, just as each document is cited as reference separately. In addition, it should be understood that after reading the above content of the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the claims attached to this application.
Claims
1. A method for optimizing on-chip space of a PCIe device, It is characterized in that Providing at least one physical functional module; Providing at least one virtual function module created based on at least one of the physical function modules, each of the virtual function modules comprising configuration information, the configuration information comprising shared first-category information and exclusive second-category information; Providing first storage units whose number corresponds to the number of the physical function modules, for storing the first type of information; Providing second storage units whose number corresponds to the number of the virtual function modules, for storing the second type of information; The first type of information includes read-only fields and reserved fields, and / or The second type of information includes writable fields.
2. The method for optimizing the on-chip space of a PCIe device as claimed in claim 1, It is characterized in that An address mapping unit is provided to map the first type of information storage location and the second type of information storage location of each virtual function module.
3. The method for optimizing the on-chip space of a PCIe device as claimed in claim 1, It is characterized in that The first storage unit is formed on a first static random access memory, and / or The second storage unit is formed on a second static random access memory.
4. The method for optimizing the on-chip space of a PCIe device as claimed in claim 3, It is characterized in that The first storage unit and the second storage unit are formed on a static random access memory group.
5. A PCIe device, It is characterized in that include; at least one physical functional module; at least one virtual function module created based on at least one of the physical function modules, each of the virtual function modules including configuration information, the configuration information including shared first-category information and exclusive second-category information; First storage units, the number of which corresponds to the number of the physical function modules, are used to store the first type of information; Second storage units, the number of which corresponds to the number of the virtual function modules, are used to store the second type of information; The first type of information includes read-only fields and reserved fields, and / or The second type of information includes writable fields.
6. The PCIe device according to claim 5, It is characterized in that Also includes: a processor configured to generate configuration information read and write instructions; an address mapping unit, which is configured to be connected to the processor, the first storage unit and the second storage unit respectively, and is used to map the first information storage location and the second information storage location of the corresponding virtual function module to the configuration information read and write instruction, The address mapping unit is connected to an optional first status register for outputting or setting the read and write status of the address mapping unit.
7. The PCIe device according to claim 6, It is characterized in that The first storage unit is formed on a first static random access memory; and / or The second storage unit is formed on a second static random access memory.
8. The PCIe device according to claim 7, It is characterized in that The first static random access memory is connected to a second status register for outputting or setting the read / write status of the first static random access memory; and / or The second static random access memory is connected to a third status register for outputting or setting the read / write status of the second static random access memory.
