Method, computer device and medium for switch virtualization

By using an operating system that separates the main processor and the slave processor in the data processing unit to independently start and virtualize the switch controller and virtual devices, the problems of long server startup time and low resource utilization under virtualization technology are solved, achieving for fast startup and efficient resource utilization.

CN118433138BActive Publication Date: 2024-09-20ZHUHAI XINGYUN ZHILIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410873806.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-20
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

In the existing technology, with the application of virtualization technology and the increase in the scale of virtual devices, servers need to be customized and hot restarted, resulting in increased costs and system startup time, making it difficult to meet users' customized needs for input and output resources and quick startup. Require.

Method used

The main operating system is run through the main processor of the data processing unit, and the switch controller and virtual device controller are generated through simulation from the slave processor, which is started independently of the main operating system. The startup time of the slave operating system is shorter than the startup time of the main operating system. Complete virtualization of switches and virtual devices, and ensure virtualization is completed before BIOS scanning to avoid hot restarts.

Benefits of technology

It saves system startup time, improves the overall utilization efficiency of system resources, reduces the impact of exceptions, improves system reliability and performance processing capabilities, and meets users' customized needs for input and output resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118433138B
    Figure CN118433138B
Patent Text Reader

Abstract

The present application relates to the field of computer technology and provides a method, computer device and medium for switch virtualization. The method includes: running a main operating system through a main processor of a data processing unit, and simulating the generation of a switch controller and a virtual device controller and running a slave operating system through a slave processor of the data processing unit, wherein the startup of the slave operating system is independent of the startup of the main operating system, and the startup time of the slave operating system is less than the startup time of the main operating system; simulating the generation of a downlink port of a first switch and a mounted virtual device through a switch controller and a virtual device controller, executing control plane operations associated with input and output virtualization of the first switch using the slave operating system, and executing data plane operations associated with the first switch using the main operating system. In this way, system startup time is saved and system reliability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, computer device and medium for switch virtualization. Background Art

[0002] With the development of cloud computing and data centers, it is necessary to customize the input and output resources of various tenants, such as allocating input and output resources on demand through a data processing unit (DPU). The DPU implements the switch topology and uses hot plugging to dynamically issue and remove devices so that users can customize input and output resources. In order to correctly start the server, it is necessary to scan each port and allocate port resources through the server's Basic Input Output System (BIOS). In the prior art, with the application of virtualization technology and the increase in the scale of virtual devices, it is necessary to customize the server or hot restart the server after each cold restart, which increases costs and increases the system startup time.

[0003] To this end, the present application provides a method, a computer device and a medium for switch virtualization, which are used to address the technical difficulties in the prior art. Summary of the invention

[0004] In a first aspect, the present application provides a method for switch virtualization. The method includes: running a main operating system through a main processor of a data processing unit, and simulating and generating a switch controller and a virtual device controller and running a slave operating system through a slave processor of the data processing unit, wherein the startup of the slave operating system is independent of the startup of the main operating system, and the startup time of the slave operating system is less than the startup time of the main operating system; simulating and generating a downlink port of a first switch and a virtual device attached to the downlink port of the first switch through the switch controller and the virtual device controller, executing a control plane operation associated with input and output virtualization of the first switch using the slave operating system running on the slave processor, and executing a data plane operation associated with the first switch using the main operating system running on the main processor, wherein the startup of the slave operating system and the virtualization of the first switch and the virtual device attached to the downlink port of the first switch are completed at least before the port where the first switch is located is scanned by a basic input and output system.

[0005] Through the first aspect of the present application, the main operating system is run by the main processor, the switch controller and the virtual device controller are simulated and generated by the slave processor, and the slave operating system is run, the isolation between the slave processor and the main processor, the independence of the slave operating system relative to the main operating system, and the control plane operations associated with the input and output virtualization of the first switch and the data plane operations associated with the first switch are distinguished. On the basis of ensuring that the control plane operations and data plane operations of the first switch can run normally, the normal startup of the server and the correct allocation of port resources are ensured, and the server does not need to be hot-restarted again. There is no need to customize the server startup process in advance, which is conducive to saving system startup time; on the basis of meeting the user's demand for customization of input and output resources, while meeting the timely response requirements, high-performance processor cores are saved, and tasks requiring high-performance processing capabilities can be better executed, which is conducive to improving the overall utilization efficiency of system resources; the impact of abnormalities is reduced, which is conducive to improving the reliability of the system.

[0006] In a possible implementation of the first aspect of the present application, the main processor is also used to support a remote procedure call protocol configuration management interface and a storage backend data plane application.

[0007] In a possible implementation of the first aspect of the present application, the control plane operations associated with the input and output virtualization of the first switch include assisting the basic input and output system in port scanning, generating or removing virtual devices, hot-plugging physical devices, and configuring device virtualization features.

[0008] In a possible implementation manner of the first aspect of the present application, the data plane operation associated with the first switch includes data writing and data reading through the first switch.

[0009] In a possible implementation manner of the first aspect of the present application, the method further includes: simulating and generating an uplink port of the first switch through the switch controller and the virtual device controller.

[0010] In a possible implementation of the first aspect of the present application, the method further includes: simulating and generating, by means of the switch controller and the virtual device controller, an uplink port of the second switch, a downlink port of the second switch, and a virtual device connected to the downlink port of the second switch, and executing control plane operations associated with input and output virtualization of the second switch using the slave operating system running on the slave processor, and executing data plane operations associated with the second switch using the master operating system running on the master processor.

[0011] In a possible implementation manner of the first aspect of the present application, the slave processor supports simultaneous virtualization of the first switch and the second switch through a multi-function feature.

[0012] In a possible implementation manner of the first aspect of the present application, the master processor includes a high-performance processor core, and the slave processor is a low-performance processor core relative to the high-performance processor core.

[0013] In a possible implementation manner of the first aspect of the present application, the master processor is an embedded central processing unit, and the slave processor is a micro control unit or a micro processing unit.

[0014] In a possible implementation of the first aspect of the present application, the slave operating system is a lightweight real-time operating system relative to the master operating system, the boot time of the slave operating system is in milliseconds, and the boot time of the master operating system is in seconds.

[0015] In a possible implementation manner of the first aspect of the present application, after the port where the first switch is located is scanned by the basic input and output system, the main operating system is started.

[0016] In a possible implementation manner of the first aspect of the present application, a startup process of the server where the data processing unit is located includes scanning, through the basic input and output system, a port where the first switch is located.

[0017] In a possible implementation manner of the first aspect of the present application, the first switch is a Peripheral Component Interconnect Express switch, and the switch controller is a Peripheral Component Interconnect Express switch controller.

[0018] In a possible implementation manner of the first aspect of the present application, the data processing unit utilizes the slave processor to meet the reply time limit of the processing layer protocol message specified by the Peripheral Component Interconnect Express protocol to avoid high-level error reporting.

[0019] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.

[0020] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.

[0021] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1 A flowchart of a method for switch virtualization provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of a fast peripheral component interconnect switch provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0027] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0028] Figure 1 A flow chart of a method for switch virtualization provided in an embodiment of the present application. Figure 1 As shown, the method includes the following steps.

[0029] Step S110: Run a main operating system through a main processor of a data processing unit, and simulate and generate a switch controller and a virtual device controller and run a slave operating system through a slave processor of the data processing unit, wherein the startup of the slave operating system is independent of the startup of the main operating system, and the startup time of the slave operating system is less than the startup time of the main operating system.

[0030] Step S120: Simulate and generate the downstream port of the first switch and the virtual device connected to the downstream port of the first switch through the switch controller and the virtual device controller, and use the slave operating system running on the slave processor to execute the control plane operations associated with the input and output virtualization of the first switch, and use the master operating system running on the master processor to execute the data plane operations associated with the first switch.

[0031] See also Figure 1 , at least before the port where the first switch is located is scanned by the basic input and output system, the startup of the slave operating system and the virtualization of the first switch and the virtual device attached to the downstream port of the first switch are completed.

[0032] Continue reading Figure 1 , Figure 1The method for switch virtualization shown can be applied in scenarios such as cloud computing, data centers, and high-performance servers. In order to meet the user's requirements for customized input and output resources, and to make full use of physical memory resources and computing power resources, various virtual devices are simulated and generated through various virtualization technologies, and the switch topology is virtualized, so that hot plugging can be used to achieve dynamic distribution and removal of devices, so that users can customize input and output resources. Here, the server startup process includes scanning each port and allocating port resources through the server's Basic Input Output System (BIOS), and in order to correctly allocate port resources, the BIOS needs to scan the switch topology and scan the various virtual devices attached to the switch. With the development of virtualization technology and the increase in the scale of virtual devices, it is necessary to provide users with customizable switch topologies such as customizable downstream ports, and provide various types of virtual devices and virtualization features through software and hardware collaboration. Taking a PCIe switch that complies with the PCIe standard as an example, the upstream part of the PCIe switch is generally fixed in the hardware engine, and the downstream part of the PCIe switch and various virtual devices attached to the downstream part are implemented by the embedded CPU (ECPU) of the data processing unit (DPU). When the server starts, the BIOS scans each port. It is necessary to ensure that the BIOS correctly scans the upstream and downstream parts in the topology of the PCIe switch so as to correctly allocate port resources. If the server is customized to ensure that the ECPU is started before starting the server, the system startup time will be extended and it will be easily affected by abnormalities, such as abnormal applications requesting too much memory and causing abnormal exit. In addition, if the BIOS is started first and the server is hot-restarted after the ECPU is ready, the server needs to be hot-restarted once after each cold restart. The operating system running on the server may take tens of seconds to complete the startup, which increases the cost and the system startup time. In addition, the PCIe protocol specifies a timeout mechanism for Completion with Data (CPLD). If the DPU does not respond to the Transaction Layer Packet (TLP) in a timely manner, for example, if there is no response for more than 100 milliseconds, an Advanced Error Reporting (AER) will appear on the server. Figure 1 The method for switch virtualization provided by the specific embodiments of the present application is described in detail to overcome these challenges.

[0033] Continue reading Figure 1In step S110, the main operating system is run through the main processor of the data processing unit, and the switch controller and the virtual device controller are simulated and generated and the slave operating system is run through the slave processor of the data processing unit, wherein the startup of the slave operating system is independent of the startup of the main operating system, and the startup time of the slave operating system is less than the startup time of the main operating system. Here, the main processor can be a high-performance processor core such as an ECPU, and the slave processor can be a relatively low-performance processor core such as a microcontroller unit (MCU) or a microprocessor unit (MPU). Considering that the exclusive processor core is conducive to ensuring the timeliness of the reply, for example, the DPU can reply to the TLP in time, the switch controller and the virtual device controller are simulated and generated by the slave processor and the slave operating system is run, which can save the processing power of the high-performance processor core. In addition, the startup of the slave operating system is independent of the startup of the main operating system, which means that the virtualization of the switch controller and the virtual device controller can be completed by starting the slave operating system without waiting for the startup of the main operating system to be completed. Furthermore, the slave operating system runs on the slave processor and is a lightweight operating system relative to the master operating system. The boot time of the slave operating system is less than the boot time of the master operating system. In this way, the slave operating system can cooperate with the port scanning of the BIOS and the server boot process, thereby saving the system boot time. In step S120, the downlink port of the first switch and the virtual device attached to the downlink port of the first switch are simulated and generated by the switch controller and the virtual device controller, and the control plane operation associated with the input and output virtualization of the first switch is performed by using the slave operating system running on the slave processor, and the data plane operation associated with the first switch is performed by using the master operating system running on the master processor. In this way, by distinguishing the control plane operation associated with the input and output virtualization of the first switch and the data plane operation associated with the first switch, combined with the above, the switch controller and the virtual device controller are simulated and generated by the slave processor and the slave operating system is run, and the master operating system is run by the master processor, so that the system boot time can be saved by the relatively lightweight operating system, that is, the slave operating system. This is because the port scanning of the BIOS requires the correct scanning of the upstream and downstream parts of the topology of the virtualized switch and the various virtual devices attached to the downstream part in order to correctly allocate port resources. The port scanning of the BIOS can be coordinated by the slave processor and the switch controller and virtual device controller simulated and generated by the slave processor, as well as the control plane operations associated with the input and output virtualization of the first switch executed by the slave operating system running on the slave processor.In addition, at least before the port where the first switch is located is scanned by the basic input and output system, the startup of the slave operating system and the virtualization of the first switch and the virtual device attached to the downstream port of the first switch are completed. In this way, it can be ensured that the startup of the slave operating system and the necessary virtualization work have been completed before the BIOS starts scanning, so that the BIOS scans the switch topology and scans the various virtual devices attached to the first switch. Further, the virtualization of the first switch is realized on the basis of the virtualization of the switch controller and the virtual device controller by using the slave processor and the slave operating system, so that the physical memory resources and computing power resources can be fully utilized, various virtual devices can be simulated and generated by various virtualization technologies, and the switch topology can be virtualized, so that the hot plug can be used to realize the dynamic issuance and removal of the device, so that the user can customize the input and output resources.

[0034] Continue reading Figure 1, taking the master processor as ECPU and the slave processor as MCU as an example, the above-mentioned TLP reply timeliness problem and the correct scanning of PCIe switch topology problem are solved by providing heterogeneous computing results in DPU, that is, by providing an MCU independent of ECPU. A lightweight real-time operating system can be run on the MCU, and the startup time is in milliseconds. In contrast, a more complex operating system can be run on the ECPU to provide services that require high-performance processing capabilities, such as storage data plane operations and remote procedure call configuration management operations. The MCU or a similar slave processor is responsible for the control plane operations associated with the input and output virtualization of the PCIe switch, such as PCIe scanning in conjunction with BIOS, device hot plugging, generating and removing virtualized devices, and providing device virtualization features such as single-root input and output virtualization. On the other hand, the data plane operations associated with the switch are still performed through the ECPU, such as writing and reading data. Therefore, the MCU is used to meet the PCIe scanning requirements of the BIOS in the aspect of PCIe switch virtualization. In this way, by starting the MCU and running the operating system, the server startup and correct allocation of port resources can be realized under the coordination of software and hardware, and the server startup and correct allocation of port resources can be realized. It avoids the need to hot-restart the server again and does not need to customize the server startup process in advance. It can flexibly adapt to various virtualization architectures, operating systems, server startup processes, etc., reducing costs and system startup time. In addition, compared with the high-performance processor core in the ECPU to meet the timely TLP response requirements, the control plane operations associated with the input and output virtualization of the first switch are executed by monopolizing the low-performance processor core in the MCU. In this way, while meeting the timely TLP response requirements, the high-performance processor core in the ECPU is also saved. In this way, the ECPU can focus on tasks that require high-performance processing capabilities, such as storage data plane operations and remote procedure call configuration management operations, which is conducive to improving the overall utilization efficiency of system resources. Furthermore, the deployment of switch virtualization is provided by the slave operating system running on the slave processor, and the downlink port of the first switch and the virtual device connected to the downlink port of the first switch are simulated and generated by the switch controller and the virtual device controller. In this way, the isolation between the slave processor and the main processor and the independence of the slave operating system from the main operating system are utilized to reduce the impact of abnormalities. For example, an abnormal application running on the ECPU may apply for too much memory, which is conducive to improving the reliability of the system.

[0035] In conclusion, Figure 1The method for switch virtualization shown in the figure runs the main operating system through the main processor, generates the switch controller and the virtual device controller through the slave processor simulation and runs the slave operating system, utilizes the isolation between the slave processor and the main processor, the independence of the slave operating system relative to the main operating system, and distinguishes the control plane operation associated with the input and output virtualization of the first switch and the data plane operation associated with the first switch. On the basis of ensuring that the control plane operation and the data plane operation of the first switch can run normally, it ensures that the server is started normally and the port resources are correctly allocated, avoids hot restarting the server again, and does not need to customize the server startup process in advance, which is conducive to saving system startup time; on the basis of meeting the user's demand for customization of input and output resources, while meeting the requirement of timely response, it also saves high-performance processor cores, can better execute tasks requiring high-performance processing capabilities, and is conducive to improving the overall utilization efficiency of system resources; reduces the impact of abnormalities, and is conducive to improving the reliability of the system.

[0036] Figure 2 A schematic diagram of a fast peripheral component interconnect switch provided in an embodiment of the present application. Figure 2As shown, the data processing unit 200 includes a hardware engine 220, a main processor 230, and a slave processor 240. Among them, the peripheral component interconnect express switch 210 is deployed on the hardware engine 220, and the topology structure of the peripheral component interconnect express switch 210 includes an uplink port 212, a downlink port A214, and a downlink port B216. The network interface A224 in the hardware engine 220 corresponds to the downlink port A214, and the network interface B226 corresponds to the downlink port B216. The main processor 230 includes a remote procedure call protocol configuration management interface 232 and a storage backend data plane application 234. Here, the remote procedure call protocol configuration management interface 232 is used to meet the complex configuration management needs of the remote procedure call protocol (Remote Procedure Call Protocol, RPC), such as the relevant parsing and processing of the transmission control protocol / Internet protocol (Transmission Control Protocol / Internet Protocol, TCP / IP). The storage backend data plane application 234 is used to meet the application requirements of the storage data plane. For example, the storage backend data plane application 234 may need to access the remote hard disk through the TCP network or the Remote Direct Memory Access (RDMA) network. Considering that the remote procedure call protocol configuration management interface 232 and the storage backend data plane application 234 are not necessary for cooperating with the PCIe scan of the BIOS, and both require high-performance processing capabilities to have better performance, the main processor 230, such as the ECPU, can retain the remote procedure call protocol configuration management interface 232 and the storage backend data plane application 234. The slave processor 240 includes a peripheral component interconnection express switch controller 242 and a virtual device controller 244.

[0037] Continue reading Figure 2 ,refer to Figure 1 The method for switch virtualization is shown for Figure 2The driving method of the PCI Express switch 210 shown in the figure includes: running a main operating system through a main processor 230 of a data processing unit 200, and simulating and generating a switch controller (PCI Express switch controller 242) and a virtual device controller 244 and running a slave operating system through a slave processor 240 of the data processing unit 200, wherein the startup of the slave operating system is independent of the startup of the main operating system, and the startup time of the slave operating system is less than the startup time of the main operating system; The controller 244 simulates and generates virtual devices of the downstream ports (downstream port A 214 and downstream port B 216) of the first switch (PCI Express switch 210) and the downstream ports attached to the first switch (PCI Express switch 210), and uses the slave operating system running on the slave processor 240 to perform control plane operations associated with input / output virtualization of the first switch (PCI Express switch 210), and uses the master operating system running on the master processor 230 to perform data plane operations associated with the first switch (PCI Express switch 210). At least before the port where the first switch (PCI Express switch 210) is located is scanned by the basic input / output system, the slave operating system is started and the virtual devices of the first switch (PCI Express switch 210) and the downstream ports (downstream port A 214 and downstream port B 216) attached to the first switch (PCI Express switch 210) are virtualized.

[0038] Continue reading Figure 2, the main processor 230 also runs a mailbox A236, which includes a sending queue A237 and a receiving queue A238. The slave processor 240 also runs a mailbox B246, which includes a sending queue B247 and a receiving queue B248. The hardware engine 220 can use the mailbox A236 and the mailbox B246 to provide an interaction mechanism for the interaction between the main processor 230 and the slave processor 240. For example, the user can configure the remote procedure call protocol configuration management interface 232 in advance, so that the respective sending and receiving queues of the mailbox A236 and the mailbox B246 can be used for message interaction, for example, the sending queue A237 of the mailbox A236 can send a message to the receiving queue B248 of the mailbox B246, and for another example, the sending queue B247 of the mailbox B246 can send a message to the receiving queue A238 of the mailbox A236. It should be understood that the data processing unit 200 can implement interaction between the master processor 230 and the slave processor 240 through any appropriate interaction mechanism, thereby ensuring that the control plane operation and data plane operation of the first switch (PCI Express switch 210) can operate normally.

[0039] In conclusion, Figure 2 The illustrated PCI Express switch 210 runs a main operating system through a main processor 230, simulates and generates a switch controller (PCI Express switch controller 242) and a virtual device controller 244 and runs a slave operating system through a slave processor 240, utilizes the isolation between the slave processor 240 and the main processor 230, the independence of the slave operating system relative to the main operating system, and distinguishes the control plane operation associated with the input and output virtualization of the first switch (PCI Express switch 210) and the data plane operation associated with the first switch (PCI Express switch 210), ensures that the server is started normally and the port resources are allocated correctly on the basis of ensuring that the control plane operation and the data plane operation of the first switch (PCI Express switch 210) can run normally, avoids hot restarting the server again, and does not need to customize the server startup process in advance, which is conducive to saving system startup time; on the basis of meeting the user's demand for customization of input and output resources, while meeting the requirement of timely response, it also saves high-performance processor cores, can better execute tasks requiring high-performance processing capabilities, and is conducive to improving the overall utilization efficiency of system resources; reduces abnormal impact, and is conducive to improving system reliability.

[0040] See also Figure 1 and Figure 2In a possible implementation, the main processor is also used to support the remote procedure call protocol configuration management interface and storage backend data plane applications. In this way, on the basis of meeting the user's demand for customized input and output resources, while meeting the requirement of timely response, high-performance processor cores are also saved, and tasks requiring high-performance processing capabilities can be better executed, which is conducive to improving the overall utilization efficiency of system resources.

[0041] In a possible implementation, the control plane operations associated with the input and output virtualization of the first switch include assisting the port scanning of the basic input and output system, generating or removing virtual devices, hot-plugging physical devices, and configuring device virtualization features. In this way, the user's need to customize input and output resources is met.

[0042] In a possible implementation manner, the data plane operation associated with the first switch includes data writing and data reading through the first switch, so as to ensure that the control plane operation and the data plane operation of the first switch can run normally.

[0043] In a possible implementation, the method further includes: simulating and generating the uplink port of the first switch through the switch controller and the virtual device controller. Generally, the uplink port of the switch is difficult to adjust dynamically in hardware. The switch controller and the virtual device controller are simulated and generated through the above-mentioned slave processor independent of the main processor, and the uplink port of the first switch is simulated and generated through the switch controller and the virtual device controller, and then combined with the above-mentioned simulation and generation of the downlink port of the first switch and the virtual device connected to the downlink port of the first switch through the switch controller and the virtual device controller. In this way, the virtualization of the entire switch is realized through the switch controller and the virtual device controller. In addition, as mentioned above, the virtualization of the switch is realized by the slave processor and the startup of the slave processor is earlier than the BIOS, which means that before the BIOS performs port scanning, the virtualization of the switch including the uplink port has been completed. In this way, the virtualization of multiple uplink ports and corresponding multiple switches can be supported through multi-functional features. Each switch can have one or more uplink ports, which helps to flexibly adapt to the customer's customized requirements for input and output.

[0044] In some embodiments, the method further includes: simulating and generating the uplink port of the second switch, the downlink port of the second switch, and the virtual device connected to the downlink port of the second switch through the switch controller and the virtual device controller, executing the control plane operation associated with the input and output virtualization of the second switch using the slave operating system running on the slave processor, and executing the data plane operation associated with the second switch using the master operating system running on the master processor. In this way, by supporting the virtualization of the first switch and the second switch, and completing the startup of the slave operating system and the necessary virtualization work before the BIOS starts scanning, it helps to flexibly adapt to the customer's customized requirements for input and output.

[0045] In some embodiments, the slave processor supports virtualizing the first switch and the second switch simultaneously through multi-function characteristics, thereby flexibly adapting to the customized requirements of customers for input and output.

[0046] In a possible implementation, the main processor includes a high-performance processor core, and the slave processor is a low-performance processor core relative to the high-performance processor core. In this way, by providing a low-performance processor core independent of the high-performance processor core. A lightweight real-time operating system can be run on the low-performance processor core, and the startup time can be kept at the millisecond level. Relatively speaking, a more complex operating system can be run on the high-performance processor core to provide services that require high-performance processing capabilities such as storage data plane operations and remote procedure call configuration management operations. The low-performance processor core is responsible for control plane operations associated with the input and output virtualization of the PCIe switch, such as PCIe scanning in conjunction with BIOS, device hot plugging, generation and removal of virtualized devices, and providing virtualization features of the device such as single-root input and output virtualization. On the other hand, the data plane operations associated with the switch are still performed through the high-performance processor core, such as writing and reading data. Therefore, the low-performance processor core is used to meet the PCIe scan requirements of the BIOS in the PCIe switch virtualization aspect. In this way, by starting the low-performance processor core and running the operating system, the server startup and correct allocation of port resources can be achieved under the coordination of software and hardware, and the server can be restarted again without the need to customize the server startup process in advance. It can flexibly adapt to various virtualization architectures, operating systems, server startup processes, etc., reducing costs and reducing system startup time.

[0047] In a possible implementation, the main processor is an embedded central processing unit, and the slave processor is a microcontroller unit or a microprocessing unit. The main processor may be a high-performance processor core such as an ECPU, and the slave processor may be a relatively low-performance processor core such as an MCU or an MPU. In this way, a low-performance processor core independent of the high-performance processor core is provided. A lightweight real-time operating system can be run on the low-performance processor core, and the startup time can be kept at the millisecond level. Relatively speaking, a more complex operating system can be run on the high-performance processor core to provide services that require high-performance processing capabilities such as storage data plane operations and remote procedure call configuration management operations. The low-performance processor core is responsible for control plane operations associated with the input and output virtualization of the PCIe switch, such as PCIe scanning in cooperation with BIOS, hot plugging of devices, generation and removal of virtualized devices, and providing virtualization features of devices such as single-root input and output virtualization. On the other hand, the data plane operations associated with the switch are still performed through the high-performance processor core, such as writing and reading data. Therefore, the low-performance processor core is used to meet the PCIe scan requirements of the BIOS in the PCIe switch virtualization aspect. In this way, by starting the low-performance processor core and running the operating system, the server startup and correct allocation of port resources can be achieved under the coordination of software and hardware, and the server can be restarted again without the need to customize the server startup process in advance. It can flexibly adapt to various virtualization architectures, operating systems, server startup processes, etc., reducing costs and reducing system startup time.

[0048] In a possible implementation, the slave operating system is a lightweight real-time operating system relative to the master operating system, the boot time of the slave operating system is in milliseconds, and the boot time of the master operating system is in seconds. In this way, the normal startup of the server and the correct allocation of port resources are ensured, and the server does not need to be hot-restarted again, and the server startup process does not need to be customized in advance, which is conducive to saving system startup time.

[0049] In a possible implementation, after the port where the first switch is located is scanned by the basic input and output system, the main operating system is started. In this way, the normal startup of the server and the correct allocation of port resources are ensured, and the server is avoided from being hot-restarted again and the server startup process does not need to be customized in advance, which is conducive to saving system startup time.

[0050] In a possible implementation, the startup process of the server where the data processing unit is located includes scanning the port where the first switch is located through the basic input and output system. In this way, the normal startup of the server and the correct allocation of port resources are ensured, and the server does not need to be hot-restarted again, and the server startup process does not need to be customized in advance, which is conducive to saving system startup time.

[0051] In a possible implementation, the first switch is a Peripheral Component Interconnect Express switch, and the switch controller is a Peripheral Component Interconnect Express switch controller. This is beneficial to improving the overall utilization efficiency of system resources, reducing abnormal impacts, and improving system reliability.

[0052] In some embodiments, the data processing unit utilizes the slave processor to meet the reply time limit of the processing layer protocol message specified by the Express Peripheral Component Interconnection Protocol to avoid high-level error reporting. In this way, on the basis of meeting the user's demand for customized input and output resources, while meeting the requirement of timely reply, high-performance processor cores are also saved, and tasks requiring high-performance processing capabilities can be better executed, which is conducive to improving the overall utilization efficiency of system resources; reducing the impact of abnormalities, which is conducive to improving the reliability of the system.

[0053] Figure 3 3 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.

[0054] It should be understood that Figure 3The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.

[0055] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.

[0056] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.

[0057] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0058] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.

[0059] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.

[0060] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.

[0061] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0062] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A method for switch virtualization, characterized in that: The method comprises: Running a main operating system through a main processor of a data processing unit, and simulating and generating a switch controller and a virtual device controller and running a slave operating system through a slave processor of the data processing unit, wherein the startup of the slave operating system is independent of the startup of the main operating system, and the startup time of the slave operating system is less than the startup time of the main operating system; The switch controller and the virtual device controller are used to simulate and generate a downlink port of the first switch and a virtual device connected to the downlink port of the first switch, and the slave operating system running on the slave processor is used to perform a control plane operation associated with input and output virtualization of the first switch, and the master operating system running on the master processor is used to perform a data plane operation associated with the first switch. At least before the port where the first switch is located is scanned by the basic input and output system, the startup of the slave operating system and the virtualization of the first switch and the virtual device connected to the downstream port of the first switch are completed.

2. The method according to claim 1, characterized in that The main processor is also used to support remote procedure call protocol configuration management interface and storage backend data plane applications.

3. The method according to claim 1, characterized in that The control plane operations associated with the input and output virtualization of the first switch include assisting the basic input and output system in port scanning, generating or removing virtual devices, hot-plugging physical devices, and configuring device virtualization features.

4. The method according to claim 1, characterized in that: The data plane operations associated with the first switch include data writing and data reading through the first switch.

5. The method according to claim 1, characterized in that: The method further comprises: The uplink port of the first switch is simulated and generated through the switch controller and the virtual device controller.

6. The method according to claim 5, characterized in that The method further comprises: The switch controller and the virtual device controller are used to simulate and generate an uplink port of the second switch, a downlink port of the second switch, and a virtual device connected to the downlink port of the second switch. The slave operating system running on the slave processor is used to perform control plane operations associated with input and output virtualization of the second switch. In addition, the master operating system running on the master processor is used to perform data plane operations associated with the second switch.

7. The method according to claim 6, characterized in that The slave processor supports simultaneous virtualization of the first switch and the second switch through a multi-function feature.

8. The method according to claim 1, characterized in that The master processor includes a high-performance processor core, and the slave processor is a low-performance processor core relative to the high-performance processor core.

9. The method according to claim 1, characterized in that: The master processor is an embedded central processing unit, and the slave processor is a micro control unit or a micro processing unit.

10. The method according to claim 1, characterized in that The slave operating system is a lightweight real-time operating system relative to the master operating system. The boot time of the slave operating system is in milliseconds, while the boot time of the master operating system is in seconds.

11. The method according to claim 1, characterized in that: After the port where the first switch is located is scanned by the basic input and output system, the main operating system is started.

12. The method according to claim 1, characterized in that The startup process of the server where the data processing unit is located includes scanning the port where the first switch is located through the basic input and output system.

13. The method according to claim 1, characterized in that The first switch is a Peripheral Component Interconnect Express switch, and the switch controller is a Peripheral Component Interconnect Express switch controller.

14. The method according to claim 13, characterized in that The data processing unit utilizes the slave processor to meet the reply time limit of the transaction layer protocol message specified by the PCI Express protocol, thereby avoiding high-level error reporting.

15. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 14 when executing the computer program.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 14.