Method and device for collecting device information on pcie board card, terminal and medium
Patent Information
- Application Number
- CN202211705042.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-12-29
AI Technical Summary
[0004]由于BIOS收集所有PCIE设备的相关信息,用于实现资产信息功能和SMBIOS的type9功能,在遇到上述一个PCIE板卡上存在多个逻辑或者物理设备的时候,会把这个板卡上的所有设备信息的都收集和展示,这就导致了BMC web界面上会出现多个设备,比如有的虚拟网卡会虚拟出几十个虚拟设备,那么在BMC web就会为这个板卡展示所有的几十个设备的信息,会让用户直观地认为机器上有几十个设备,而实际只有一张卡,插槽的丝印信息也只有一个,这么多设备怎么对应到这唯一的一个插槽丝印信息也是个困难,往往会因为physical slot number信息的差异定位到不准确的丝印信息,或者匹配不到这个信息
[0016]本发明提供的一种PCIE板卡上设备信息收集方法、装置、终端及介质,相对于现有技术,具有以下有益效果:根据PCIE设备的拓扑信息分析出板卡的多设备衍生情况,再根据衍生情况进行针对性收集,最终实现每个板卡仅收集一个设备信息,进行实现卡与设备数量的统一,不会造成误解,或收集多个设备信息,同时多个设备信息共享一个位置信息,使一个板卡对应一个丝印信息,避免引起板卡与插槽的物理位置对应错误的情况,也不会影响设备报错定位功能,便于设备维护人员定位到报错设备进行维护,节省维护成本。
Smart Images

Figure CN115905097B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of PCIe device information collection, and specifically to a method, apparatus, terminal, and medium for collecting device information on a PCIe board. Background Technology
[0002] There is a type of PCIe card that appears as a single card, but in the operating system it manifests as multiple logical devices, or a combination of logical and physical devices. For example, a GPU card may also have a network card, and a physical card that supports virtualization may also generate multiple virtual devices through virtualization technology. The difference between these devices is often not in the function number of the PCIe device, but in attributes such as the bus number.
[0003] The BIOS implements asset information functionality for PCIe devices. This is achieved by the BIOS enumerating all PCIe devices during computer platform initialization, allocating necessary resources, and loading drivers (if applicable) to support normal device operation. Simultaneously, it collects relevant attribute information from the PCIe devices and sends it to the BMC (Browser Management Center), which displays it on the web interface for the user. Additionally, the BIOS needs to implement the Type 9 information functionality in SMBIOS (Smart Module System). This function collects and presents attribute information of devices connected to the PCIe slots, such as the device's Bus / Device / Function number and slot / device silkscreen information.
[0004] Because the BIOS collects information about all PCIe devices to implement asset information functions and SMBIOS type 9 functions, when encountering multiple logical or physical devices on a single PCIe card, it collects and displays information about all devices on that card. This results in multiple devices appearing on the BMC web interface. For example, some virtual network cards may virtualize dozens of virtual devices, and the BMC web interface will display information about all dozens of devices for that card, making the user intuitively believe that there are dozens of devices on the machine, when in reality there is only one card and only one slot silkscreen information. It is difficult to match so many devices to this single slot silkscreen information. Often, due to differences in physical slot number information, inaccurate silkscreen information is located, or the information cannot be matched at all. This silkscreen information is also the device's location information, used to uniquely associate a board with a slot on the machine for positioning. When a board is added or removed, or when an error occurs during operation, the error analysis and positioning function jointly implemented by the BIOS and BMC uses this silkscreen information. This means that when a board is added, removed, or an error occurs, the silkscreen information cannot be accurately matched, and therefore the accurate physical location cannot be matched. This renders the crucial device error positioning function for servers and other machines ineffective, increasing the maintenance cost after a device error occurs. At the same time, the Type 9 function will also present incorrect device information, causing the function to become ineffective. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a method, apparatus, terminal, and medium for collecting device information on PCIe boards. Each board collects only one device information, ensuring consistency between the number of boards and devices and preventing misunderstandings. Alternatively, multiple device information can be collected, and all device information can share a single location information, allowing one board to correspond to one silkscreen information. This avoids errors in the physical location of the board and slot and does not affect the device error reporting and location function.
[0006] In a first aspect, the technical solution of the present invention provides a method for collecting device information on a PCIe board, comprising the following steps: Get information on all PCIe devices on the machine; Obtain the tree topology information of the PCIe devices based on all PCIe device information; Based on the PCIe device information, obtain all board information and determine the board manufacturer and model; Based on the tree topology information of PCIe devices, the multi-device derivative situation of each board is analyzed; In the loop function for collecting PCIe device information, for each board, the device information on the board is collected according to its multi-device derivative situation, so that each board collects the information of one device or the information of multiple devices, while multiple devices share the same location information.
[0007] Furthermore, the multi-device derivative scenario includes: the number of virtual devices corresponding to each physical device, the number of logical devices corresponding to each physical device, the number of functions integrated and implemented on each physical device, and the number of logical devices corresponding to each function.
[0008] Furthermore, based on the tree-like topology information of the PCIe devices, the multi-device derivation situation of each board is analyzed, including: Enable and disable the virtual device function of the device, compare the topology information of the PCIe device in the two states, and analyze the multi-device derivative situation of the number of virtual devices corresponding to the physical devices of the board.
[0009] Furthermore, based on its multi-device derivative situation, device information is collected on the board, so that each board collects information of one device or multiple devices, while multiple devices share a location information, including: For a single physical device that generates multiple virtual devices, collect information about the physical device and skip the collection actions for the corresponding multiple virtual devices in the loop; For a physical device that includes multiple logical devices, collect information for one logical device and skip the collection actions for the corresponding other logical devices in the loop; For a single board that integrates multiple functions, information on a single device for a single function can be collected, or information on a single device for a single function across all functions can be collected, with all collected devices sharing the same location information. For a single board that integrates multiple functions, where each function is divided into multiple logical devices, the device information of a specific function is collected from all functions, while the collection of information from other logical devices is skipped.
[0010] Furthermore, the method specifically includes: For a physical device that includes multiple logical devices, collect the information of the first logical device and skip the collection actions for the corresponding other logical devices in the loop; For a single board that integrates multiple functions, only the information of the first device for the first function is collected, or the device information of the first function for all functions is collected, and all collected devices share a single location information. For a single board that integrates multiple functions, where each function is divided into multiple logical devices, the device information of the first function of all functions is collected, and the collection of information for other logical devices is skipped.
[0011] Furthermore, based on the PCIe device information, all board information is obtained, and the manufacturer and model of the board are determined, specifically including: Based on the information in all PCIe device configuration spaces, the board's identification information is obtained, and the board manufacturer and model are determined based on the board's identification information.
[0012] Furthermore, the board's identification information includes: manufacturer identification, device identification, system manufacturer identification, and subsystem identification.
[0013] Secondly, the technical solution of the present invention provides a device for collecting device information on a PCIe board, comprising, Information Acquisition Module: Acquires information about all PCIe devices on the machine; Topology Analysis Module: Obtains the tree-like topology information of PCIe devices based on all PCIe device information; Board identification module: Obtains information about all boards based on PCIe device information, and determines the manufacturer and model of the board; Derivative Analysis Module: Analyzes the multi-device derivation situation of each board based on the tree topology information of PCIe devices; Device Information Collection Module: In the loop function of collecting PCIe device information, for each board, the device information on the board is collected according to its multiple device derivatives, so that each board collects the information of one device.
[0014] Thirdly, the technical solution of the present invention provides a terminal, including: The memory is used to store the device information collection program on the PCIe card; A processor is configured to implement the steps of the PCIe card on-board device information collection method as described above when executing the PCIe card on-board device information collection program.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a PCIe card device information collection program, wherein the PCIe card device information collection program, when executed by a processor, implements the steps of the PCIe card device information collection method as described in any of the above claims.
[0016] The present invention provides a method, apparatus, terminal, and medium for collecting device information on PCIe boards. Compared with the prior art, it has the following advantages: It analyzes the multi-device derivation of the board based on the topology information of the PCIe devices, and then collects information specifically based on the derivation, ultimately achieving the goal of collecting only one device information per board. This ensures consistency between the number of boards and devices, preventing misunderstandings or the collection of multiple device information. Furthermore, multiple device information shares a single location information, ensuring that one board corresponds to one silkscreen information. This avoids errors in the physical location correspondence between the board and the slot, and does not affect the device error location function. It facilitates equipment maintenance personnel in locating the malfunctioning device for maintenance, saving maintenance costs. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of a method for collecting device information on a PCIe board according to an embodiment of the present invention.
[0019] Figure 2 This is a schematic block diagram of a device information collection device on a PCIe board provided in an embodiment of the present invention.
[0020] Figure 3 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation
[0021] The following explains some of the English terms involved in this invention.
[0022] BIOS: Base Input / Output System.
[0023] BMC: Baseboard Management Controller.
[0024] SEL: System Event Log.
[0025] WebUI: Web User Interface.
[0026] PCIE: Peripheral Component Interconnect Express, bus.
[0027] PCIE Device: PCIE device.
[0028] PCIE Bridge: PCIE bridge.
[0029] PCIe Switch: A PCIe converter that allows other PCIe devices to be connected to it.
[0030] Physical Slot Number: The physical slot number.
[0031] Bus / Device / Function: The bus, device, and function values of PCIe devices.
[0032] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0033] Figure 1 This is a schematic flowchart of a method for collecting device information on a PCIe board according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes the following steps.
[0034] S1: Obtain information on all PCIe devices on the machine.
[0035] S2, obtain the tree topology information of the PCIe devices based on all PCIe device information.
[0036] PCIe device information includes the upstream and downstream device link relationships of the PCIe device, and the tree topology information of the PCIe device can be analyzed based on this information.
[0037] S3 retrieves all board information based on PCIe device information and determines the board manufacturer and model.
[0038] This step is mainly used to obtain the actual number of boards on the machine, with one board corresponding to one model.
[0039] S4 analyzes the multi-device derivative situation of each board based on the tree topology information of PCIe devices.
[0040] A PCIe card may contain multiple logical or physical devices, or may virtualize multiple devices, which is the multi-device derivative situation of the card.
[0041] In S5, the loop function for collecting PCIe device information collects device information on each board according to its multi-device derivative situation, so that each board collects information of one device or multiple devices, while multiple devices share a location information.
[0042] This embodiment effectively solves the problems of confusing display and ineffective location functions of PCIe device asset information and error reporting functions implemented by the BIOS and BMC when a machine has multiple PCIe cards connected due to various functional designs. It also addresses the issue of inaccurate SMBIOS type 9 function information implemented by the BIOS. Specifically, it analyzes the multi-device derivation situation of the cards based on the PCIe device topology information, and then collects information specifically based on this derivation situation. Ultimately, it ensures that only one device information is collected for each card, unifying the number of cards and devices to avoid misunderstandings or the collection of multiple device information. Simultaneously, multiple device information shares a single location information, ensuring that one card corresponds to one silkscreen information, avoiding errors in the physical location correspondence between the card and the slot. This also does not affect the device error reporting and location function, making it easier for maintenance personnel to locate the faulty device for maintenance, saving maintenance costs, improving customer satisfaction, enhancing enterprise competitiveness, and indirectly increasing enterprise benefits.
[0043] To further understand the present invention, the following detailed description is provided based on the principles of the present invention and in conjunction with the above embodiments, using a specific embodiment that includes the following steps.
[0044] Step 1: Obtain information on all PCIe devices on the machine, and then obtain the tree topology information of the PCIe devices based on the information on all PCIe devices.
[0045] Before implementing the functions for PCIe device asset information and SMBIOS type9 information, we first studied the board's technical documentation and collected information on all PCIe devices on the machine through functions such as lspci under the operating system or UEFI shell. Based on the PCIe device information, we analyzed and viewed the tree-like topology architecture.
[0046] Step 2: Obtain all board information based on PCIe device information, and determine the board manufacturer and model.
[0047] PCIe device information includes information from the PCIe device configuration space. The board information is obtained from the information in the PCIe device configuration space, and then the manufacturer and model of the board are determined.
[0048] The board information obtained from the PCIe device configuration space includes four IDs: vendor ID, device ID, subsystem ID, and subsystem vendor ID.
[0049] It should be noted that in this specific embodiment, the above four ID information are used to determine the manufacturer and model, instead of just the vendor ID and device ID, which can prevent misjudgment.
[0050] Step 3: Analyze the multi-device derivative situation of each board based on the tree topology information of the PCIe devices.
[0051] Step two above has analyzed the circuit boards. The device-related information of each circuit board will be analyzed in turn.
[0052] Multi-device derivation scenarios include: the number of virtual devices corresponding to each physical device, the number of logical devices corresponding to each physical device, the number of functions integrated and implemented on each physical device, and the number of logical devices corresponding to each function. In other words: how many virtual devices a physical device can virtualize (a physical device can derive multiple parallel devices through virtual functions), how many logical devices a physical device can implement (a physical device can have multiple parallel devices even without enabling virtual functions), how many functions a physical device can integrate and implement (a physical device can have multiple parallel devices even without enabling virtual functions, and the functions of each parallel device can be determined by the class code information in the device configuration space), and how many logical devices each function has (each function's devices may also have parallel devices or parallel functions).
[0053] For analyzing multi-device scenarios, the topology information of the PCIe devices can first be obtained / viewed using commands such as `lspci -vt` or related tools. Then, using this structure information, we can analyze the topology from each PCIe root port of each CPU, to each level of PCIe bridge below it and the cascading relationships (if any, since a PCIe end device can be directly connected to the root bridge without an intermediate bridge), all the way to the last level of PCIe end device. We can also see how many parallel devices each device has (if any), and how many functions each device has (for devices with multiple functions). By enabling and disabling the virtual device function of the devices, comparing the PCIe device topology information in these two scenarios, we can see which devices are virtualized, how many of them there are, etc., thus analyzing the multi-device scenario where the physical devices of the board correspond to the number of virtual devices.
[0054] Step 3, in the loop function of collecting PCIe device information, for each board, the device information on the board is collected according to its multi-device derivative situation, so that each board collects the information of one device or the information of multiple devices, and multiple devices share the same location information.
[0055] When implementing the asset information function and SMBIOS type9 function, the BIOS collects device information through a loop. First, it determines which types of boards are available based on step two, and then collects device information for each board. To avoid problems such as inconsistencies between the number of boards and devices, each board collects information for one device or multiple devices, while multiple devices share the same location information.
[0056] Specifically, depending on the multi-device scenario, the following processing is performed in the loop function for collecting PCIe device information, including but not limited to: 1) For a physical device that generates multiple virtual devices, collect the information of the physical device and skip the collection action for the corresponding multiple virtual devices in the loop.
[0057] This way, only information about physical devices is collected, not information about virtual devices.
[0058] 2) For a physical device that includes multiple logical devices, collect information from one logical device and skip the collection actions for the corresponding other logical devices in the loop.
[0059] For example, if a physical device includes N logical devices, only the information of the first device is collected, and then the collection action of the N-1 devices in the loop is skipped, that is, the information of the other logical devices is not collected.
[0060] 3) For a single board that integrates multiple functions, information on a single device for a single function can be collected, or information on a single device for a single function of all functions can be collected, and all collected devices share the same location information.
[0061] You can collect information from only the first device of the first function, or you can collect information from the first device of all functions, with the collected devices sharing a single location information, i.e., silkscreen information, since they are all on the same card. For the latter collection method, because of the agreed-upon processing strategy, it is clear that the collected devices are on the same board and have the same silkscreen, thus avoiding misunderstandings.
[0062] 4) For a single board that integrates multiple functions, where each function is divided into multiple logical devices, collect the device information of one function from all functions and skip the collection of information from other logical devices.
[0063] For example, collect device information for the first function of all functions, and ignore (skip) the processing of other logical devices.
[0064] In this way, the device information collected and sent by the BIOS to the BMC is displayed only on the BMC's web UI, ensuring that the number of cards is consistent with the actual number of cards and will not cause misunderstanding for customers. At the same time, it will not result in multiple cards corresponding to the same silkscreen information or incorrect information, thus preventing errors in the physical location of the cards and slots and not affecting the device error location function.
[0065] The filtering actions described above in the loop function can also be implemented through the BMC. After the BIOS sends all PCIe devices to the BMC, the BMC adopts the above filtering strategy to determine which devices should be displayed on the web interface and how to achieve the correspondence between devices and silkscreen information.
[0066] The foregoing has described in detail an embodiment of a method for collecting device information on a PCIe board. Based on the PCIe board device information collection method described in the above embodiment, this invention also provides a PCIe board device information collection device corresponding to the method.
[0067] Figure 2 This is a schematic block diagram of a device information collection device on a PCIe board provided in an embodiment of the present invention, such as... Figure 2 As shown, the device includes: an information acquisition module, a topology analysis module, a board identification module, and a derivative analysis module.
[0068] Information Acquisition Module: Acquires information about all PCIe devices on the machine.
[0069] Topology Analysis Module: Obtains the tree-like topology information of PCIe devices based on all PCIe device information.
[0070] Board identification module: Obtains information about all boards based on PCIe device information, and determines the manufacturer and model of the board.
[0071] Derivative Analysis Module: Analyzes the multi-device derivative situation of each board based on the tree topology information of PCIe devices.
[0072] Device Information Collection Module: In the loop function of collecting PCIe device information, for each board, the device information on the board is collected according to its multiple device derivatives, so that each board collects the information of one device.
[0073] The board identification module obtains information about all boards based on the PCIe device information, and determines the manufacturer and model of the board. Specifically, this includes: obtaining the board's identification information based on the information in the configuration space of all PCIe devices, and determining the board's manufacturer and model based on the board's identification information. The board's identification information includes: manufacturer identification, device identification, system manufacturer identification, and subsystem identification.
[0074] Multi-device derivative scenarios include: the number of virtual devices corresponding to each physical device, the number of logical devices corresponding to each physical device, the number of functions integrated and implemented on each physical device, and the number of logical devices corresponding to each function.
[0075] The derivative analysis module analyzes the multi-device derivative situation of each board based on the tree topology information of the PCIe devices, including: enabling and disabling the virtual device function of the device, comparing the topology information of the PCIe devices in the two states, and analyzing the multi-device derivative situation of the number of virtual devices corresponding to the physical devices of the board.
[0076] The device information collection module is specifically used for: collecting information of the physical device when one physical device is used to emulate multiple virtual devices, skipping the collection actions corresponding to multiple virtual devices in the loop; collecting information of one logical device when one physical device includes multiple logical devices, skipping the collection actions corresponding to other logical devices in the loop; collecting information of one device for one function when one board integrates multiple functions, or collecting device information of one function of all functions, with all collected devices sharing a single location information; and collecting device information of one function of all functions when one board integrates multiple functions, with each function divided into multiple logical devices, skipping the collection actions of other logical devices.
[0077] The PCIe card device information collection device of this embodiment is used to implement the aforementioned PCIe card device information collection method. Therefore, the specific implementation of this device can be found in the embodiment section of the PCIe card device information collection method above. So, the specific implementation can be referred to the description of the corresponding embodiments, and will not be described in detail here.
[0078] Furthermore, since the PCIE card device information collection device in this embodiment is used to implement the aforementioned PCIE card device information collection method, its function corresponds to the function of the above method, and will not be described again here.
[0079] Figure 3 A schematic diagram of a terminal device 300 provided in an embodiment of the present invention includes: a processor 310, a memory 320, and a communication unit 330. The processor 310 is used to implement the following steps when setting an information collection program on a PCIe board stored in the memory 320: S1, retrieve information on all PCIe devices on the machine; S2, obtain the tree topology information of the PCIe devices based on all PCIe device information; S3: Based on the PCIe device information, obtain all board information and determine the board manufacturer and model. S4, analyze the multi-device derivative situation of each board based on the tree topology information of PCIe devices; In S5, the loop function for collecting PCIe device information collects device information on each board according to its multi-device derivative situation, so that each board collects information of one device or multiple devices, while multiple devices share a location information.
[0080] This invention analyzes the topology information of PCIe devices to determine the multi-device derivation of boards, and then collects information specifically based on the derivation. Ultimately, it achieves the goal of collecting only one device information for each board, ensuring consistency between the number of boards and devices and preventing misunderstandings or the collection of multiple device information. At the same time, multiple device information shares a single location information, so that one board corresponds to one silkscreen information, avoiding errors in the physical location correspondence between the board and the slot, and not affecting the device error location function. This makes it easier for equipment maintenance personnel to locate the faulty device for maintenance, saving maintenance costs.
[0081] The terminal device 300 includes a processor 310, a memory 320, and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It can be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0082] The memory 320 can be used to store the execution instructions of the processor 310. The memory 320 can be implemented by any type of volatile or non-volatile memory terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 is able to perform some or all of the steps in the above method embodiments.
[0083] The processor 310 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 310 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.
[0084] The communication unit 330 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It can receive user data sent by other terminals or send user data to other terminals.
[0085] The present invention also provides a computer storage medium, which may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0086] The computer storage medium stores a program for collecting information on a PCIe card. When the processor executes this program, the program performs the following steps: S1, retrieve information on all PCIe devices on the machine; S2, obtain the tree topology information of the PCIe devices based on all PCIe device information; S3: Based on the PCIe device information, obtain all board information and determine the board manufacturer and model. S4, analyze the multi-device derivative situation of each board based on the tree topology information of PCIe devices; In S5, the loop function for collecting PCIe device information collects device information on each board according to its multi-device derivative situation, so that each board collects information of one device or multiple devices, while multiple devices share a location information.
[0087] This invention analyzes the topology information of PCIe devices to determine the multi-device derivation of boards, and then collects information specifically based on the derivation. Ultimately, it achieves the goal of collecting only one device information for each board, ensuring consistency between the number of boards and devices and preventing misunderstandings or the collection of multiple device information. At the same time, multiple device information shares a single location information, so that one board corresponds to one silkscreen information, avoiding errors in the physical location correspondence between the board and the slot, and not affecting the device error location function. This makes it easier for equipment maintenance personnel to locate the faulty device for maintenance, saving maintenance costs.
[0088] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or other media capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, server, or a second terminal, network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0089] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0090] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0091] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0092] The above-disclosed embodiments are merely preferred embodiments of the present invention, but the present invention is not limited thereto. Any non-creative variations that can be conceived by those skilled in the art, as well as any improvements and modifications made without departing from the principles of the present invention, should fall within the protection scope of the present invention.
Claims
1. A method for collecting device information on a PCIe board, characterized in that, This method, applied during the BIOS initialization phase, provides PCIe board asset information to the Baseboard Management Controller (BMC) and supports device error localization. The method includes the following steps: Get information on all PCIe devices on the machine; Obtain the tree topology information of the PCIe devices based on all PCIe device information; Based on the board manufacturer identifier, device identifier, system manufacturer identifier, and subsystem identifier in the PCIe device's configuration space information, the board manufacturer and model can be determined. Based on the tree-like topology information of the PCIe devices, the multi-device derivation of each board is analyzed, including: turning the virtual device function of the device on and off, comparing the topology information of the PCIe devices in the two states, and analyzing the multi-device derivation of the number of virtual devices corresponding to the physical devices of the board; the multi-device derivation includes: the number of virtual devices corresponding to each physical device, the number of logical devices corresponding to each physical device, the number of functions integrated on each physical device, and the number of logical devices corresponding to each function; In the loop function for collecting PCIe device information, for each board, device information on the board is collected according to its multi-device derivative situation. This allows each board to collect information on one device or multiple devices, while multiple devices share a single location information. This achieves a 1:1 physical location correspondence between the board and the slot on the machine, avoiding errors in the physical location correspondence between the board and the slot, and ensuring that the device error location function is effective. This includes: for one physical device that virtualizes multiple virtual devices, only the information of the physical device is collected, skipping the collection actions for the corresponding multiple virtual devices in the loop; for one physical device that includes multiple logical devices or integrates multiple functions, only the device information of one logical device or one function is collected, skipping the collection actions for the corresponding other logical devices or functions in the loop.
2. The method for collecting device information on a PCIe board according to claim 1, characterized in that, For a physical device that includes multiple logical devices or integrates multiple functions, only the device information of a specific logical device or function is collected, skipping the collection actions for other logical devices or functions in the loop, including: For a physical device that includes multiple logical devices, collect information for one logical device and skip the collection actions for the corresponding other logical devices in the loop; For a single board that integrates multiple functions, information on a single device for a single function can be collected, or information on a single device for a single function across all functions can be collected, with all collected devices sharing the same location information. For a single board that integrates multiple functions, where each function is divided into multiple logical devices, the device information of a specific function is collected from all functions, while the collection of information from other logical devices is skipped.
3. The method for collecting device information on a PCIe board according to claim 1, characterized in that, The method specifically includes: For a physical device that includes multiple logical devices, collect the information of the first logical device and skip the collection actions for the corresponding other logical devices in the loop; For a single board that integrates multiple functions, only the information of the first device for the first function is collected, or the device information of the first function for all functions is collected, and all collected devices share a single location information. For a single board that integrates multiple functions, where each function is divided into multiple logical devices, the device information of the first function of all functions is collected, and the collection of information for other logical devices is skipped.
4. A device for collecting device information on a PCIe board, characterized in that, This device, used during the BIOS initialization phase, provides PCIe board asset information to the Baseboard Management Controller (BMC) and supports device error localization. It includes... Information Acquisition Module: Acquires information about all PCIe devices on the machine; Topology Analysis Module: Obtains the tree-like topology information of PCIe devices based on all PCIe device information; Board identification module: Based on the board manufacturer identifier, device identifier, system manufacturer identifier, and subsystem identifier in the PCIe device's configuration space information, it determines the board manufacturer and model. Derivative Analysis Module: Based on the tree-like topology information of the PCIe devices, this module analyzes the multi-device derivation of each board, including: enabling and disabling the virtual device function of the device, comparing the topology information of the PCIe devices in the two states, and analyzing the multi-device derivation of the number of virtual devices corresponding to the physical devices of the board; the multi-device derivation includes: the number of virtual devices corresponding to each physical device, the number of logical devices corresponding to each physical device, the number of functions integrated on each physical device, and the number of logical devices corresponding to each function; Device Information Collection Module: In the loop function for collecting PCIe device information, for each board, device information on the board is collected according to its multi-device derivative situation, so that each board collects the information of one device. This achieves a 1:1 physical location correspondence between the board and the slot on the machine, avoids errors in the physical location correspondence between the board and the slot, and ensures that the device error location function is effective. This includes: if one physical device emulates multiple virtual devices, only the information of the physical device is collected, and the collection actions corresponding to multiple virtual devices in the loop are skipped; if one physical device includes multiple logical devices or integrates multiple functions, only the device information of one logical device or one function is collected, and the collection actions corresponding to other logical devices or functions in the loop are skipped.
5. A terminal, characterized in that, include: The memory is used to store the device information collection program on the PCIe card; The processor is configured to implement the steps of the PCIe card device information collection method as described in any one of claims 1-3 when executing the PCIe card device information collection program.
6. A computer-readable storage medium, characterized in that, The readable storage medium stores a device information collection program on a PCIe card, which, when executed by a processor, implements the steps of the device information collection method on a PCIe card as described in any one of claims 1-3.
Citation Information
Patent Citations
Processing method and device of equipment hierarchical structure, electronic equipment and storage medium
CN113127397A