Resource sharing system, method, electronic device, storage medium and program product
Through the shared devices, management devices and resource mapping devices in the resource sharing system, the PCIe specifications are used for connection and mapping, the problem of the B host cannot be accessed without modifying the driver in the prior art, and efficient resource sharing, interruption and DMA operations are achieved.
Patent Information
- Application Number
- CN202210651994.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-09
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-06-09
AI Technical Summary
In existing systems that use transparent bridges to connect to host B cannot access without modifying host A, and cannot handle interruptions and direct memory access (DMA) issues of shared devices.
Through the resource sharing system, including shared devices, management devices and resource mapping devices, the endpoints and root complexes in the PCIe specification are connected and mapped to realize access and management of virtual or physical functional units of shared devices, and support interrupts and DMA operations.
It realizes efficient access and management of shared devices without modifying access device drivers, improving the flexibility of interrupt response processing and the efficiency of direct memory access.
Smart Images

Figure CN114968591B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and in particular to a resource sharing system, method, electronic device, storage medium, and program product. Background Art
[0002] Large cloud computing resource pools often require device pooling and sharing. This means that computing, storage, and network resources within cloud computing infrastructure are often centrally redistributed. Existing systems that connect multiple hosts via transparent bridges use direct address translation or table-based address translation for address translation. However, these systems cannot access host B without modifying the driver on host A, nor can they handle interrupts or direct memory access (DMA) from shared devices. Summary of the Invention
[0003] In order to solve the problems in the related art, embodiments of the present disclosure provide a resource sharing system, method, electronic device, storage medium, and program product.
[0004] In a first aspect, an embodiment of the present disclosure provides a resource sharing system, characterized by comprising:
[0005] A shared device, wherein the shared device includes a virtual functional unit or a physical functional unit and is used for resource sharing;
[0006] Management equipment, managing resource sharing of the shared equipment;
[0007] A resource mapping device comprising at least a first endpoint and a second endpoint,
[0008] The second endpoint is connected to the management device, and the first endpoint is connected to the virtual function unit or the physical function unit in the shared device;
[0009] An access device accesses the virtual functional unit or the physical functional unit in the shared device through the first endpoint in the resource mapping device.
[0010] In the embodiments of the present disclosure,
[0011] The access device includes a first root complex, the first root complex is connected to the first endpoint of the resource mapping device via a first switch or a first root complex root port; and / or
[0012] The management device includes a second root complex, and the second root complex is connected to the shared device and the second endpoint of the resource mapping device through a second switch or a second root complex root port.
[0013] In the embodiments of the present disclosure,
[0014] The first endpoint and the second endpoint are endpoints in the Peripheral Component Interconnect Express specification; and / or
[0015] The first root complex and the second root complex are complexes in the Peripheral Component Interconnect Express specification.
[0016] In a second aspect, an embodiment of the present disclosure provides a method for configuring a resource sharing system, characterized by comprising:
[0017] The access device sends a configuration message to the resource mapping device;
[0018] The resource mapping device sends a configuration interrupt to the management device based on the configuration message, or the management device polls the configuration message;
[0019] The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt or the configuration message polled;
[0020] The shared device sends a configuration return message to the management device;
[0021] The management device configures the resource mapping device based on the configuration return message;
[0022] The resource mapping device sends the configuration return message to the access device.
[0023] In the embodiments of the present disclosure,
[0024] The access device sending a configuration message to the resource mapping device includes:
[0025] The access device sends a configuration message to the resource mapping device via the first root complex; and / or
[0026] The management device sending the configuration space of the resource mapping device to the shared device based on the configuration interrupt or the configuration message polled includes:
[0027] The management device sends the configuration space of the resource mapping device to the shared device through the second root complex based on the configuration interrupt or the configuration message polled; and / or
[0028] The resource mapping device sending the configuration return message to the access device includes:
[0029] The resource mapping device sends the configuration return message to the first root complex of the access device.
[0030] In a third aspect, an embodiment of the present disclosure provides a space access method for a resource sharing system, characterized by comprising:
[0031] The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device;
[0032] The access device accesses the first address space;
[0033] The resource mapping device generates a space access transaction based on the access device accessing the first address space;
[0034] The resource mapping device accesses the second address space according to the type of the space access transaction.
[0035] In the embodiments of the present disclosure,
[0036] The resource mapping device accessing the second address space according to the type of the space access transaction includes:
[0037] Under the condition that the type of the space access transaction is a return message type,
[0038] The resource mapping device records the identifier of the access device accessing the first address space, and sends an access request to the second address space to the shared device;
[0039] The shared device sends an access request response message to the resource mapping device, where the access request response message includes an access response identifier;
[0040] The resource mapping device sends the access response identifier to the access device, and / or
[0041] Under the condition that the type of the space access transaction is a no-return message type,
[0042] The resource mapping device accesses the second address space.
[0043] In a fourth aspect, an embodiment of the present disclosure provides an interrupt access method for a resource sharing system, characterized by comprising:
[0044] Under the control of the management device, the shared device sends a first interrupt message to the resource mapping device, where the first interrupt message includes a first interrupt address pointing to the second endpoint;
[0045] The resource mapping device generates a second interrupt message according to the first interrupt message, wherein the second interrupt message includes a second interrupt address pointing to the first endpoint;
[0046] The resource mapping device sends a second interrupt message to the access device;
[0047] The access device executes the terminal service program corresponding to the second interrupt message.
[0048] In a fifth aspect, an embodiment of the present disclosure provides a direct memory access method for a resource sharing system, characterized by comprising:
[0049] The access device applies for a first direct memory access address from a first endpoint of the resource mapping device;
[0050] The resource mapping device maps the first direct memory access address to a second direct memory access address in the second endpoint;
[0051] The shared device sends direct memory access data to the second direct memory access address of the resource mapping device;
[0052] The resource mapping device sends the direct memory access data to an access device via the first direct memory access address.
[0053] In a sixth aspect, an embodiment of the present disclosure provides a configuration method for a resource sharing system, characterized by comprising:
[0054] The resource mapping device sends a configuration interrupt to the management device based on the configuration message sent by the access device;
[0055] The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt;
[0056] The shared device sends a configuration return message to the management device;
[0057] The management device configures the resource mapping device based on the configuration return message;
[0058] The resource mapping device sends the configuration return message to the access device.
[0059] In a seventh aspect, an embodiment of the present disclosure provides a space access method of a resource sharing system, characterized by comprising:
[0060] The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device;
[0061] The resource mapping device generates a space access transaction based on the access device accessing the first address space;
[0062] The resource mapping device accesses the second address space according to the type of the space access transaction.
[0063] In an eighth aspect, an embodiment of the present disclosure provides an electronic device comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the processor to implement a method as described in any one of aspects 2 to 7.
[0064] In the ninth aspect, an embodiment of the present disclosure provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the method described in any one of the second to seventh aspects is implemented.
[0065] In a tenth aspect, an embodiment of the present disclosure provides a computer program, which includes computer instructions, and when the computer instructions are executed by a processor, implements the method as described in any one of the second to seventh aspects.
[0066] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:
[0067] According to the technical solution provided by the embodiment of the present disclosure, a resource sharing system is provided, characterized in that it includes: a shared device, the shared device including a virtual function unit or a physical function unit for resource sharing; a management device, managing the resource sharing of the shared device; a resource mapping device, including at least one first endpoint and a second endpoint, the second endpoint being connected to the management device, and the first endpoint being connected to the virtual function unit or the physical function unit in the sharing device; an access device, accessing the virtual function unit or the physical function unit in the shared device through the first endpoint in the resource mapping device, thereby managing the sharing of the virtual function unit or the physical function unit in the shared device through the management device, and the access device can access the virtual function unit or the physical function unit in the shared device without modifying the driver.
[0068] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:
[0070] Figure 1 An exemplary schematic diagram illustrating an implementation scenario of a resource sharing system according to an embodiment of the present disclosure is shown.
[0071] Figure 2 An exemplary schematic diagram illustrating a configuration process of a resource sharing system according to an embodiment of the present disclosure is shown.
[0072] Figure 3a An exemplary schematic diagram illustrating a spatial access address of a resource sharing system according to an embodiment of the present disclosure.
[0073] Figure 3b An exemplary schematic diagram illustrating a space access process of a resource sharing system according to an embodiment of the present disclosure is shown.
[0074] Figure 4 An exemplary schematic diagram illustrating interrupt access processing in a resource sharing system according to an embodiment of the present disclosure is shown.
[0075] Figure 5 An exemplary schematic diagram illustrating direct memory access processing of a resource sharing system according to an embodiment of the present disclosure is shown.
[0076] Figure 6 An exemplary schematic diagram illustrating a configuration method of a resource sharing system according to an embodiment of the present disclosure is shown.
[0077] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0078] Figure 8 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0079] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0080] In the present disclosure, it should be understood that terms such as "including" or "having" are intended to indicate the presence of labels, numbers, steps, actions, components, parts, or combinations thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other labels, numbers, steps, actions, components, parts, or combinations thereof exist or are added.
[0081] It should also be noted that, in the absence of conflict, the embodiments and labels in the embodiments of the present disclosure can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0082] Large cloud computing resource pools often require device pooling and sharing. This means that computing, storage, and network resources within cloud computing infrastructure are often centrally redistributed. Existing systems that connect multiple hosts via transparent bridges use direct address translation or table-based address translation for address translation. However, these systems cannot access host B without modifying the driver on host A, nor can they handle interrupts or direct memory access (DMA) from shared devices.
[0083] To solve this problem, the present disclosure proposes a resource sharing system, method, electronic device, storage medium, and program product.
[0084] Figure 1 An exemplary schematic diagram illustrating an implementation scenario of a resource sharing system according to an embodiment of the present disclosure is shown.
[0085] It can be understood by those skilled in the art that Figure 1 The implementation scenarios of the resource sharing system are illustrated by way of example only and do not constitute a limitation to the present disclosure.
[0086] like Figure 1 As shown, the resource sharing system 100 includes: a shared device, a management device, a resource mapping device, and access devices such as access device-1 and access device-2.
[0087] The shared devices include virtual function units (VFs) such as virtual function unit-1 and virtual function unit-2, which are used to virtualize resources such as hard disks and memories for resource sharing.
[0088] Those skilled in the art will appreciate that the shared device also includes a physical functional unit (PF), which is not limited in the present disclosure.
[0089] The management device manages resource sharing in the shared device, such as resource sharing of virtual functional units or physical functional units.
[0090] In an embodiment of the present disclosure, the access device includes a first root complex (RC), which is connected to the first endpoint of the resource mapping device through a first switch. The first root complex can also be directly connected to the first endpoint of the resource mapping device through the first root complex port. For example, access device-1 includes the first root complex-1, and access device-2 includes the first root complex-2. The first root complex-1 is connected to the first endpoint-1 through the first switch-1; the first root complex-2 is connected to the first endpoint-2 through the first switch-2. The management device includes a second root complex, which is connected to the second endpoints of the shared device and the resource mapping device through the second switch. The second root complex can also be directly connected to the second endpoints of the shared device and the resource mapping device through the second root complex port. In this way, the second endpoint and the management device are connected.
[0091] The resource mapping device includes, for example, a first endpoint-1 and a first endpoint-2. The first endpoint-1 is connected to the virtual functional unit-1, and the first endpoint-2 is connected to the virtual functional unit-2. The first endpoint may also be connected to a physical functional unit in a shared device. The second endpoint is connected to the management device via a second switch.
[0092] An access device accesses a virtual function unit or a physical function unit in a shared device through a first endpoint. For example, first endpoint-1 is connected to virtual function unit-1 in the shared device through a second switch, and first endpoint-2 is connected to virtual function unit-2 in the shared device through a second switch. Access device-1 accesses virtual function unit-1 through first endpoint-1, and access device-2 accesses virtual function unit-2 through first endpoint-2.
[0093] Those skilled in the art will appreciate that the first endpoint-1 and the first endpoint-2 may also be connected to the physical functional unit in the shared device via the second switch ( Figure 1 (not shown), so that the access device-1 accesses the physical functional unit in the shared device through the first endpoint-1 and the access device-2 accesses the physical functional unit in the shared device through the first endpoint-2.
[0094] In the embodiment of the present disclosure, the first switch-1 and the first switch-2 may also adopt a multi-stage switch structure, and the second switch may also adopt a multi-stage switch structure.
[0095] Those skilled in the art will appreciate that the first endpoint-1 and the first endpoint-2 may be connected to the virtual functional unit or physical functional unit in the shared device using other means rather than the second switch. The second endpoint may also be connected to the management device using other means rather than the second switch, and this disclosure is not limited thereto.
[0096] In the embodiment of the present disclosure, the first endpoint and the second endpoint are endpoints in the Peripheral Component Interconnect Express (PCIe) specification, i.e., end nodes of a PCIe tree, and the first root complex and the second root complex are root complexes in the PCIe specification. According to the embodiment of the present disclosure, one or more of the following connections are achieved through one or more hops in the PCIe tree topology: a connection between an endpoint and a virtual or physical functional unit, a connection between an endpoint and a root complex, a connection between an endpoint and a switch, and a connection between an endpoint and any device or any object.
[0097] With the above structure, the sharing of virtual functional units or physical functional units in the shared device can be managed by the management device. In the resource mapping device, the mapping relationship of the shared resource is converted through the first endpoint and the second endpoint, and the access device can access the virtual functional units or physical functional units in the shared device without modifying the driver.
[0098] Figure 2 An exemplary schematic diagram illustrating a configuration process of a resource sharing system according to an embodiment of the present disclosure is shown.
[0099] It can be understood by those skilled in the art that Figure 2 The configuration process of the resource sharing system is exemplified and does not constitute a limitation to the present disclosure.
[0100] like Figure 2 As shown, in step S201, the access device sends a configuration message to the resource mapping device.
[0101] In step S202, the resource mapping device sends a configuration interrupt to the management device based on the configuration message, or the management device polls the configuration message.
[0102] In step S203, the management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt or the configuration message polled.
[0103] In step S204, the shared device sends a configuration return message to the management device.
[0104] In step S205 , the management device configures the resource mapping device based on the configuration return message.
[0105] In step S206, the resource mapping device sends a configuration return message to the access device.
[0106] Through the above steps, you can configure the resource mapping device and the shared device, thereby facilitating subsequent access to shared resources.
[0107] In the disclosed embodiment, resource sharing can be controlled based on the PCIe specification. Therefore, the root complex in the access device and the management device can serve as the sender and receiver of the configuration message.
[0108] Specifically, the access device sends a configuration message to the resource mapping device via the first root complex. Based on configuration interrupts or polled configuration messages, the management device sends the resource mapping device's configuration space to the shared device via the second root complex. The resource mapping device then sends a configuration return message to the access device's first root complex. Using root complexes allows for efficient transmission and reception of configuration messages.
[0109] Figure 3a An exemplary schematic diagram illustrating a spatial access address of a resource sharing system according to an embodiment of the present disclosure.
[0110] It can be understood by those skilled in the art that Figure 3a The spatial access address of the resource sharing system is shown as an example and does not constitute a limitation to the present disclosure.
[0111] In the disclosed embodiment, the configuration space on the management device side may include up to six entries for the resource sharing system's spatial access address, according to the PCIe specification, such as PF BAR0, VF1 BAR0, VF2 BAR0, etc., where BAR stands for Base Address Register. In the PCIe memory space, each entry corresponds to a storage space on the access device side.
[0112] Figure 3b An exemplary schematic diagram illustrating a space access process of a resource sharing system according to an embodiment of the present disclosure is shown.
[0113] It can be understood by those skilled in the art that Figure 3b The spatial access processing of the resource sharing system is exemplified and does not constitute a limitation to the present disclosure.
[0114] like Figure 3b As shown, the resource mapping device generates a specific number of entries, for example, a maximum of 6 entries, each of which contains a first address space for an access device and a second address space for a shared device.
[0115] In step S301, an access device accesses a first address space.
[0116] The resource mapping device generates a space access transaction based on the access device accessing the first address space.
[0117] In step S302, the resource mapping device accesses the second address space according to the type of the space access transaction.
[0118] In the embodiment of the present disclosure, the address space conversion is realized in the above manner. Without modifying the driver of the access device, the access device can conveniently access the address space of the shared device, thereby conveniently accessing the virtual functional unit or physical functional unit in the shared device.
[0119] In the embodiment of the present disclosure, the types of space access transactions can be divided into: a type with a return message and a type without a return message.
[0120] In the disclosed embodiment, if the space access transaction type is a return message type, the specific implementation process of step S302 is as follows: the resource mapping device records the identifier (RequestID) of the access device accessing the first address space and sends an access request for the second address space to the shared device; the shared device sends an access request response message to the resource mapping device, the access request response message including the access response identifier; the resource mapping device sends the access response identifier to the access device. In this way, the process of sending an access request from the resource mapping device to the shared device and returning a corresponding request message from the shared device is completed, increasing reliability through the request and response process, and completing the access of the access device to the shared device.
[0121] In an embodiment of the present disclosure, under the condition that the type of space access transaction is a non-return message type, the specific implementation process of step S302 is as follows: after the resource mapping device obtains the second address space from the first address space, it directly accesses the second address space without the need for a message response, thereby improving the access efficiency to the second address space.
[0122] Figure 4 An exemplary schematic diagram illustrating interrupt access processing in a resource sharing system according to an embodiment of the present disclosure is shown.
[0123] It can be understood by those skilled in the art that Figure 4 The interrupt access processing of the resource sharing system is exemplified and does not constitute a limitation to the present disclosure.
[0124] like Figure 4 As shown, in step S401, under the control of the management device, the shared device sends a first interrupt message to the resource mapping device, where the first interrupt message includes a first interrupt address pointing to the second endpoint.
[0125] In step S402, the resource mapping device generates a second interrupt message according to the first interrupt message, where the second interrupt message includes a second interrupt address pointing to the first endpoint.
[0126] In step S403, the resource mapping device sends a second interrupt message to the access device.
[0127] The access device executes the terminal service program corresponding to the second interrupt message.
[0128] In the embodiment of the present disclosure, through the conversion of the first interrupt message to the second interrupt message, and the conversion of the first interrupt address to the second interrupt address, the response and processing of the interrupt of the shared device by the access device are completed without modifying the driver of the access device, thereby improving the flexibility and portability of the interrupt response processing.
[0129] Figure 5 An exemplary schematic diagram illustrating direct memory access processing of a resource sharing system according to an embodiment of the present disclosure is shown.
[0130] It can be understood by those skilled in the art that Figure 5 The direct memory access process of the resource sharing system is exemplified and does not constitute a limitation to the present disclosure.
[0131] like Figure 5 As shown, in step S501, the access device applies for a first direct memory access address, ie, a first DMA address, from a first endpoint of the resource mapping device.
[0132] In step S502 , the resource mapping device maps the first direct memory access address to a second direct memory access address in the second endpoint.
[0133] In step S503 , the shared device sends direct memory access data to the second direct memory access address of the resource mapping device.
[0134] In step S504, the resource mapping device sends direct memory access data to the access device via the first direct memory access address.
[0135] According to an embodiment of the present disclosure, the resource mapping device maps the first direct memory access address to the second direct memory access address in the second endpoint, which means that the resource mapping device establishes a correspondence between the first direct memory access address and the second direct memory access address.
[0136] The above steps complete the process of writing data directly from the shared device to the access device. For the process of reading data directly from the shared device to the access device, the shared device initiates a read request via the resource mapping device and the access device, and then the access device, resource sharing device, and shared device read the data.
[0137] In the embodiment of the present disclosure, through the above steps, direct memory access between the access device and the shared device can be efficiently completed without modifying the driver of the access device.
[0138] In the embodiment of the present disclosure, Figure 1 In the resource sharing system, the access device, resource mapping device, management device, and shared device can all be located in the public cloud of the cloud service provider.
[0139] In the disclosed embodiment, the access device may also be located not in the public cloud of the cloud service provider, but in the customer's private cloud, or in the customer's own host outside the cloud platform, while the resource mapping device, management device, and shared device are located in the public cloud of the cloud service provider.
[0140] In an embodiment of the present disclosure, a configuration method of a resource sharing system may be constructed for a resource mapping device, a management device, and a shared device in a public cloud of a cloud service provider, as follows.
[0141] The resource mapping device sends a configuration interrupt to the management device based on the configuration message sent by the access device;
[0142] The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt;
[0143] The shared device sends a configuration return message to the management device;
[0144] The management device configures the resource mapping device based on the configuration return message;
[0145] The resource mapping device sends a configuration return message to the access device.
[0146] In the embodiment of the present disclosure, through the above-mentioned method, the configuration of resource mapping devices, management devices, and shared devices in the public cloud of the cloud service provider is efficiently completed, facilitating subsequent space access, etc.
[0147] In the embodiment of the present disclosure, a spatial access method of a resource sharing system may also be constructed for resource mapping devices, management devices, and shared devices in a public cloud of a cloud service provider, as follows.
[0148] The resource mapping device generates a specific number of entries, each entry including a first address space for an access device and a second address space for a shared device;
[0149] The resource mapping device generates a space access transaction based on the access device accessing the first address space;
[0150] The resource mapping device accesses the second address space according to the type of the space access transaction.
[0151] In the embodiment of the present disclosure, access to the address space of the shared device is efficiently completed through the above-mentioned method.
[0152] In the embodiment of the present disclosure, as previously described, Figure 1 As stated above, the resource sharing system 100 includes: a shared device, a management device, a resource mapping device, and access devices such as access device-1 and access device-2.
[0153] The shared devices include virtual function units (VFs) such as virtual function unit-1 and virtual function unit-2, which are used to virtualize resources such as hard disks and memories for resource sharing.
[0154] Those skilled in the art will appreciate that the shared device also includes a physical functional unit (PF), which is not limited in the present disclosure.
[0155] The management device manages resource sharing in the shared device, such as resource sharing of virtual functional units or physical functional units.
[0156] The resource mapping device includes a first endpoint and a second endpoint, such as a first endpoint-1 and a first endpoint-2. The first endpoint-1 corresponds to the virtual function unit-1, and the first endpoint-2 corresponds to the virtual function unit-2. The first endpoint may also correspond to a physical function unit in the shared device. The second endpoint corresponds to the management device.
[0157] The access device accesses the virtual functional unit or physical functional unit in the shared device through the first endpoint. For example, access device-1 accesses virtual functional unit-1 through the first endpoint-1, and access device-2 accesses virtual functional unit-2 through the first endpoint-2.
[0158] According to an embodiment of the present disclosure, a resource sharing system is characterized in that it includes: a shared device, the shared device including a virtual function unit or a physical function unit for resource sharing; a management device, managing the resource sharing of the shared device; a resource mapping device, including at least one first endpoint and a second endpoint, the second endpoint being connected to the management device, and the first endpoint being connected to the virtual function unit or the physical function unit in the sharing device; an access device, accessing the virtual function unit or the physical function unit in the shared device through the first endpoint in the resource mapping device, thereby managing the sharing of the virtual function unit or the physical function unit in the shared device through the management device, and the access device can access the virtual function unit or the physical function unit in the shared device without modifying the driver.
[0159] In the disclosed embodiment, the access device includes a first root complex (RC), which is connected to the first endpoint of the resource mapping device via a first switch. For example, access device-1 includes the first root complex-1, and access device-2 includes the first root complex-2. The first root complex-1 is connected to the first endpoint-1 via the first switch-1; the first root complex-2 is connected to the first endpoint-2 via the first switch-2. The management device includes a second root complex, which is connected to the second endpoints of the shared device and the resource mapping device via a second switch.
[0160] According to an embodiment of the present disclosure, the access device includes a first root complex, and the first root complex is connected to the first endpoint of the resource mapping device through a first switch; and / or the management device includes a second root complex, and the second root complex is connected to the shared device and the second endpoint of the resource mapping device through a second switch, so that the mapping relationship of the shared resource is converted through the first endpoint and the second endpoint, and efficient access to the shared resource is achieved through the root complex.
[0161] In the embodiment of the present disclosure, the first endpoint and the second endpoint are endpoints in the Peripheral Component Interconnect express (PCIe) specification, and the first root complex and the second root complex are root complexes in the PCIe specification.
[0162] According to an embodiment of the present disclosure, the first endpoint and the second endpoint are endpoints in the Peripheral Component Interconnect Express specification; and / or the first root complex and the second root complex are complexes in the Peripheral Component Interconnect Express specification, thereby efficiently completing access to shared resources using the PCIe specification.
[0163] Figure 6 An exemplary schematic diagram illustrating a configuration method of a resource sharing system according to an embodiment of the present disclosure is shown.
[0164] like Figure 6 As shown, the configuration method of the resource sharing system includes: steps S601, S602, S603, S604, S605, and S606.
[0165] In step S601, the access device sends a configuration message to the resource mapping device;
[0166] In step S602, the resource mapping device sends a configuration interrupt to the management device based on the configuration message, or the management device polls the configuration message;
[0167] In step S603, the management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt or the configuration message polled;
[0168] In step S604, the shared device sends a configuration return message to the management device;
[0169] In step S605, the management device configures the resource mapping device based on the configuration return message;
[0170] In step S606, the resource mapping device sends the configuration return message to the access device.
[0171] According to an embodiment of the present disclosure, a configuration message is sent to a resource mapping device through an access device; the resource mapping device sends a configuration interrupt to a management device based on the configuration message; the management device sends the configuration space of the resource mapping device to a shared device based on the configuration interrupt; the shared device sends a configuration return message to the management device; the management device configures the resource mapping device based on the configuration return message; the resource mapping device sends the configuration return message to the access device, thereby efficiently completing the configuration of the resource sharing system without modifying the access device driver, facilitating subsequent use.
[0172] According to an embodiment of the present disclosure, sending a configuration message to a resource mapping device through the access device includes: the access device sending a configuration message to the resource mapping device through the first root complex; and / or the management device sending the configuration space of the resource mapping device to the shared device based on the configuration interrupt or the configuration message polled includes: the management device sending the configuration space of the resource mapping device to the shared device through the second root complex based on the configuration interrupt or the configuration message polled; and / or the resource mapping device sending the configuration return message to the access device includes: the resource mapping device sending the configuration return message to the first root complex of the access device, thereby efficiently completing the configuration of the resource sharing system using the root complex in the PCIe specification.
[0173] In the embodiment of the present disclosure, for the aforementioned Figure 3a 、 Figure 3b The spatial access method of the resource sharing system includes:
[0174] The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device;
[0175] The access device accesses the first address space;
[0176] The resource mapping device generates a space access transaction based on the access device accessing the first address space;
[0177] The resource mapping device accesses the second address space according to the type of the space access transaction.
[0178] According to an embodiment of the present disclosure, a specific number of entries are generated by a resource mapping device, each of which contains a first address space for an access device and a second address space for a shared device; the access device accesses the first address space; the resource mapping device generates a space access transaction based on the access device accessing the first address space; the resource mapping device accesses the second address space according to the type of the space access transaction, thereby realizing address space conversion. Without modifying the driver of the access device, the access device can conveniently access the address space of the shared device, thereby conveniently accessing the virtual functional unit or physical functional unit in the shared device.
[0179] According to an embodiment of the present disclosure, accessing the second address space through the resource mapping device according to the type of the space access transaction includes: under the condition that the type of the space access transaction is a return message type, the resource mapping device records the identifier of the access device accessing the first address space, and sends an access request for the second address space to the shared device; the shared device sends an access request response message to the resource mapping device, and the access request response message includes an access response identifier; the resource mapping device sends the access response identifier to the access device, and / or under the condition that the type of the space access transaction is a non-return message type, the resource mapping device accesses the second address space, thereby increasing reliability through the request and response process, or without the need for a message response, thereby improving access efficiency to the second address space.
[0180] In the embodiment of the present disclosure, for the aforementioned Figure 4 The statement, the interrupt access method of the resource sharing system, comprises:
[0181] Under the control of the management device, the shared device sends a first interrupt message to the resource mapping device, where the first interrupt message includes a first interrupt address pointing to the second endpoint;
[0182] The resource mapping device generates a second interrupt message according to the first interrupt message, wherein the second interrupt message includes a second interrupt address pointing to the first endpoint;
[0183] The resource mapping device sends a second interrupt message to the access device;
[0184] The access device executes the terminal service program corresponding to the second interrupt message.
[0185] According to an embodiment of the present disclosure, under the control of a management device, a shared device sends a first interrupt message to a resource mapping device, wherein the first interrupt message includes a first interrupt address pointing to a second endpoint; the resource mapping device generates a second interrupt message based on the first interrupt message, wherein the second interrupt message includes a second interrupt address pointing to the first endpoint; the resource mapping device sends the second interrupt message to an access device; and the access device executes a terminal service program corresponding to the second interrupt message, thereby completing the access device's response and processing of the interruption of the shared device without modifying the driver of the access device, thereby improving the flexibility and portability of interrupt response processing.
[0186] In the embodiment of the present disclosure, for the aforementioned Figure 5 The direct memory access method of a resource sharing system includes:
[0187] The access device applies for a first direct memory access address from a first endpoint of the resource mapping device;
[0188] The resource mapping device maps the first direct memory access address to a second direct memory access address in the second endpoint;
[0189] The shared device sends direct memory access data to the second direct memory access address of the resource mapping device;
[0190] The resource mapping device sends the direct memory access data to an access device via the first direct memory access address.
[0191] According to an embodiment of the present disclosure, an access device applies for a first direct memory access address from a first endpoint of a resource mapping device; the resource mapping device maps the first direct memory access address to a second direct memory access address in a second endpoint; the shared device sends direct memory access data to the second direct memory access address of the resource mapping device; and the resource mapping device sends the direct memory access data to the access device via the first direct memory access address, thereby efficiently completing direct memory access between the access device and the shared device without modifying a driver of the access device.
[0192] In the embodiment of the present disclosure, as described above, a configuration method of a resource sharing system can be constructed for a resource mapping device, a management device, and a shared device in a public cloud of a cloud service provider, including:
[0193] The resource mapping device sends a configuration interrupt to the management device based on the configuration message sent by the access device;
[0194] The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt;
[0195] The shared device sends a configuration return message to the management device;
[0196] The management device configures the resource mapping device based on the configuration return message;
[0197] The resource mapping device sends the configuration return message to the access device.
[0198] According to an embodiment of the present disclosure, a resource mapping device sends a configuration interrupt to a management device based on a configuration message sent by an access device; the management device sends the configuration space of the resource mapping device to a shared device based on the configuration interrupt; the shared device sends a configuration return message to the management device; the management device configures the resource mapping device based on the configuration return message; the resource mapping device sends the configuration return message to the access device, thereby efficiently completing the configuration of the resource mapping device, management device, and shared device in the public cloud of the cloud service provider, facilitating subsequent space access, etc.
[0199] In the embodiment of the present disclosure, as described above, a spatial access method of a resource sharing system may be constructed for resource mapping devices, management devices, and shared devices in a public cloud of a cloud service provider, including:
[0200] The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device;
[0201] The resource mapping device generates a space access transaction based on the access device accessing the first address space;
[0202] The resource mapping device accesses the second address space according to the type of the space access transaction.
[0203] According to an embodiment of the present disclosure, a specific number of entries are generated by a resource mapping device, each of which contains a first address space for an accessing device and a second address space for a shared device; the resource mapping device generates a space access transaction based on the accessing device accessing the first address space; the resource mapping device accesses the second address space according to the type of the space access transaction, thereby efficiently completing the access to the address space of the shared device.
[0204] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0205] like Figure 7As shown, the electronic device 700 includes a memory 701 and a processor 702, wherein the memory 701 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 702 to implement the following steps:
[0206] The access device sends a configuration message to the resource mapping device;
[0207] The resource mapping device sends a configuration interrupt to the management device based on the configuration message;
[0208] The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt;
[0209] The shared device sends a configuration return message to the management device;
[0210] The management device configures the resource mapping device based on the configuration return message;
[0211] The resource mapping device sends the configuration return message to the access device.
[0212] In the embodiments of the present disclosure,
[0213] The access device sending a configuration message to the resource mapping device includes:
[0214] The access device sends a configuration message to the resource mapping device via the first root complex; and / or
[0215] The management device sending the configuration space of the resource mapping device to the shared device based on the configuration interrupt includes:
[0216] The management device sends the configuration space of the resource mapping device to the shared device through the second root complex based on the configuration interrupt; and / or
[0217] The resource mapping device sending the configuration return message to the access device includes:
[0218] The resource mapping device sends the configuration return message to the first root complex of the access device.
[0219] The one or more computer instructions are further executed by the processor 702 to implement the following steps:
[0220] The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device;
[0221] The access device accesses the first address space;
[0222] The resource mapping device generates a space access transaction based on the access device accessing the first address space;
[0223] The resource mapping device accesses the second address space according to the type of the space access transaction.
[0224] In the embodiments of the present disclosure,
[0225] The resource mapping device accessing the second address space according to the type of the space access transaction includes:
[0226] Under the condition that the type of the space access transaction is a return message type,
[0227] The resource mapping device records the identifier of the access device accessing the first address space, and sends an access request to the second address space to the shared device;
[0228] The shared device sends an access request response message to the resource mapping device, where the access request response message includes an access response identifier;
[0229] The resource mapping device sends the access response identifier to the access device, and / or
[0230] Under the condition that the type of the space access transaction is a no-return message type,
[0231] The resource mapping device accesses the second address space.
[0232] The one or more computer instructions are further executed by the processor 702 to implement the following steps:
[0233] Under the control of the management device, the shared device sends a first interrupt message to the resource mapping device, where the first interrupt message includes a first interrupt address pointing to the second endpoint;
[0234] The resource mapping device generates a second interrupt message according to the first interrupt message, wherein the second interrupt message includes a second interrupt address pointing to the first endpoint;
[0235] The resource mapping device sends a second interrupt message to the access device;
[0236] The access device executes the terminal service program corresponding to the second interrupt message.
[0237] The one or more computer instructions are further executed by the processor 702 to implement the following steps:
[0238] The access device applies for a first direct memory access address from a first endpoint of the resource mapping device;
[0239] The resource mapping device maps the first direct memory access address to a second direct memory access address in the second endpoint;
[0240] The shared device sends direct memory access data to the second direct memory access address of the resource mapping device;
[0241] The resource mapping device sends the direct memory access data to an access device via the first direct memory access address.
[0242] The one or more computer instructions are further executed by the processor 702 to implement the following steps:
[0243] The resource mapping device sends a configuration interrupt to the management device based on the configuration message sent by the access device;
[0244] The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt;
[0245] The shared device sends a configuration return message to the management device;
[0246] The management device configures the resource mapping device based on the configuration return message;
[0247] The resource mapping device sends the configuration return message to the access device.
[0248] The one or more computer instructions are further executed by the processor 702 to implement the following steps:
[0249] The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device;
[0250] The resource mapping device generates a space access transaction based on the access device accessing the first address space;
[0251] The resource mapping device accesses the second address space according to the type of the space access transaction.
[0252] Figure 8 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown.
[0253] like Figure 8As shown, the computer system 800 includes a processing unit 801, which can execute various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the computer system 800 are also stored in the RAM 803. The processing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0254] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom can be installed into the storage section 808 as needed. Among them, the processing unit 801 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.
[0255] In particular, according to embodiments of the present disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising computer instructions that, when executed by a processor, implement the method steps described above. In such embodiments, the computer program product can be downloaded and installed from a network via the communication portion 809 and / or installed from removable media 811.
[0256] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0257] The units or modules involved in the embodiments described in this disclosure may be implemented by software or programmable hardware. The units or modules described may also be provided in a processor, and the names of these units or modules do not, in certain circumstances, constitute limitations on the units or modules themselves.
[0258] As another aspect, the present disclosure further provides a computer-readable storage medium. This computer-readable storage medium may be included in the electronic device or computer system described in the above embodiments, or may be a standalone computer-readable storage medium not incorporated into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the methods described in the present disclosure.
[0259] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
Claims
1. A resource sharing system, characterized in that: include: A shared device, wherein the shared device includes a virtual functional unit or a physical functional unit and is used for resource sharing; Management equipment, managing resource sharing of the shared equipment; A resource mapping device comprising at least a first endpoint and a second endpoint, The second endpoint is connected to the management device, and the first endpoint is connected to the virtual function unit or the physical function unit in the shared device; An access device accesses the virtual functional unit or the physical functional unit in the shared device through the first endpoint in the resource mapping device.
2. The system according to claim 1, wherein: The access device includes a first root complex, the first root complex is connected to the first endpoint of the resource mapping device via a first switch or a first root complex root port; and / or The management device includes a second root complex, and the second root complex is connected to the shared device and the second endpoint of the resource mapping device through a second switch or a second root complex root port.
3. The system according to claim 2, characterized in that The first endpoint and the second endpoint are endpoints in the Peripheral Component Interconnect Express specification; and / or The first root complex and the second root complex are complexes in the Peripheral Component Interconnect Express specification.
4. A configuration method for the resource sharing system according to any one of claims 1 to 3, characterized in that: include: The access device sends a configuration message to the resource mapping device; The resource mapping device sends a configuration interrupt to the management device based on the configuration message, or the management device polls the configuration message; The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt or the configuration message polled; The shared device sends a configuration return message to the management device; The management device configures the resource mapping device based on the configuration return message; The resource mapping device sends the configuration return message to the access device.
5. The method according to claim 4, characterized in that The access device sending a configuration message to the resource mapping device includes: The access device sends a configuration message to the resource mapping device via the first root complex; and / or The management device sending the configuration space of the resource mapping device to the shared device based on the configuration interrupt or the configuration message polled includes: The management device sends the configuration space of the resource mapping device to the shared device through the second root complex based on the configuration interrupt or the configuration message polled; and / or The resource mapping device sending the configuration return message to the access device includes: The resource mapping device sends the configuration return message to the first root complex of the access device.
6. A method for accessing a space of a resource sharing system according to any one of claims 1 to 3, characterized in that: include: The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device; The access device accesses the first address space; The resource mapping device generates a space access transaction based on the access device accessing the first address space; The resource mapping device accesses the second address space according to the type of the space access transaction.
7. The method according to claim 6, characterized in that The resource mapping device accessing the second address space according to the type of the space access transaction includes: Under the condition that the type of the space access transaction is a return message type, The resource mapping device records the identifier of the access device accessing the first address space, and sends an access request to the second address space to the shared device; The shared device sends an access request response message to the resource mapping device, where the access request response message includes an access response identifier; The resource mapping device sends the access response identifier to the access device, and / or Under the condition that the type of the space access transaction is a non-return message type, The resource mapping device accesses the second address space.
8. A method for interrupting access to the resource sharing system according to any one of claims 1 to 3, characterized in that: include: Under the control of the management device, the shared device sends a first interrupt message to the resource mapping device, where the first interrupt message includes a first interrupt address pointing to the second endpoint; The resource mapping device generates a second interrupt message according to the first interrupt message, wherein the second interrupt message includes a second interrupt address pointing to the first endpoint; The resource mapping device sends a second interrupt message to the access device; The access device executes the terminal service program corresponding to the second interrupt message.
9. A method for direct memory access to the resource sharing system according to any one of claims 1 to 3, characterized in that: include: The access device applies for a first direct memory access address from a first endpoint of the resource mapping device; The resource mapping device maps the first direct memory access address to a second direct memory access address in the second endpoint; The shared device sends direct memory access data to the second direct memory access address of the resource mapping device; The resource mapping device sends the direct memory access data to an access device via the first direct memory access address.
10. A configuration method for the resource sharing system according to any one of claims 1 to 3, characterized in that: include: The resource mapping device sends a configuration interrupt to the management device based on the configuration message sent by the access device; The management device sends the configuration space of the resource mapping device to the shared device based on the configuration interrupt; The shared device sends a configuration return message to the management device; The management device configures the resource mapping device based on the configuration return message; The resource mapping device sends the configuration return message to the access device.
11. A method for accessing a space of a resource sharing system according to any one of claims 1 to 3, characterized in that: include: The resource mapping device generates a specific number of entries, each of which includes a first address space for an access device and a second address space for a shared device; The resource mapping device generates a space access transaction based on the access device accessing the first address space; The resource mapping device accesses the second address space according to the type of the space access transaction.
12. An electronic device comprising a memory and a processor; wherein: The memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps described in any one of claims 4 to 11.
13. A readable storage medium having computer instructions stored thereon, wherein when the computer instructions are executed by a processor, the method steps according to any one of claims 4 to 11 are implemented.
14. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method according to any one of claims 4 to 11 is implemented.
Citation Information
Patent Citations
Flexible memory mapped input / output (I / O) space definition for a virtual device in scalable I / O virtualization (S-IOV) architecture
CN110858185A
Method and system for a guest physical address virtualization in a virtual machine environment
CN1831790A