A method, system, device and medium for automatically acquiring register data of a PCIE card
By obtaining PCIE card device information and classification, and automatically obtaining the register data of PCIE card using BMC, the inefficiency problem caused by manual pairing in the prior art is solved, and efficient PCIE card debugging is achieved.
Patent Information
- Application Number
- CN202211193028.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-09-28
AI Technical Summary
In the prior art, during the debugging process of multiple PCIE cards, register data pairing operations need to be performed manually, resulting in low debugging efficiency and unable to achieve automated acquisition.
By obtaining the device information of the PCIE card, the corresponding CPU core is determined, the class code in the PCIE configuration menu is used for classification, and parsed data is generated, stored in memory. Finally, the BMC obtains the register data according to the classification items.
It realizes automatic classification and acquisition of PCIE card register data, improves debugging efficiency, and can quickly analyze problems. It is suitable for PCIE card debugging in factories and clients.
Smart Images

Figure CN115525489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more particularly to a method, system, device and medium for automatically acquiring register data of a PCIE card. Background Art
[0002] The BMC in a server monitors system health and controls fan cooling. It can also debug system issues, obtaining management engine and CPU data through IPMB interface commands and querying CPU and PCIe card data through the PECI interface.
[0003] Currently, when a PCIe card experiences bandwidth loss or other issues, access to the corresponding PCI configuration registers is required, typically using a BMC debug tool. Specifically, the peciapp tool can be used to send read and write commands over the PECI interface to retrieve data. However, before retrieving data, it is necessary to know the CPU core to which the PCIe card is connected and the card's BDF identifier to query the corresponding PCIe card register data. After issuing a query request, the required data must be retrieved from the current operating system or BIOS setup menu.
[0004] However, if multiple PCIE cards are installed in the current system, once the PCIE cards need to be debugged, the above method is used to obtain data, and register data pairing operations need to be performed for each PCIE card in advance. Automatic acquisition of PCIE card register data cannot be achieved, resulting in low debugging efficiency. Summary of the Invention
[0005] In view of the above problems, the purpose of the present invention is to provide a method, system, device and medium for automatically acquiring register data of a PCIE card, which realizes automatic classification acquisition of register data of a PCIE card and effectively improves the debugging efficiency of the PCIE card.
[0006] To achieve the above object, the present invention is implemented through the following technical solutions: A method for automatically acquiring register data of a PCIE card, comprising:
[0007] Get the device information of the PCIE card in the current system;
[0008] Determine the corresponding CPU core based on the device information of the PCIE card;
[0009] Use the class code in the PCIE configuration menu to classify PCIE cards;
[0010] Map device information and PCIE cards based on the classification results to generate parsed data;
[0011] Store parsed data in memory;
[0012] Enter the corresponding PCIE card classification items according to data requirements;
[0013] The BMC determines the CPU core and BDF identifier information of the PCIE card based on the classification item, and executes the Read PCIConfig command to obtain the register data of the PCIE card.
[0014] Furthermore, obtaining the device information of the PCIE card in the current system includes:
[0015] By sending the set PCIE device information command in the BIOS process, the device information of all PCIE cards can be obtained.
[0016] Furthermore, the device information of the PCIE card includes:
[0017] Vendor ID, device ID, and BDF identifier information of the PCIE card.
[0018] Further, determining the corresponding CPU core according to the device information of the PCIE card includes:
[0019] Determine the corresponding CPU core based on the bus number in the BDF identifier information of the PCIE card.
[0020] Furthermore, the classification of the PCIE cards using the class codes in the PCIE configuration menu includes:
[0021] Get the class code in the PCIE configuration menu;
[0022] Execute the PCIE configuration read command through the PECI interface to obtain the information stored in the address 0x08 of the corresponding register, and determine the classification of the PCIE card according to the class code and the obtained information.
[0023] Furthermore, the classification result includes: the type of PCIE card, the card slot ID and the corresponding register number.
[0024] Furthermore, before obtaining the device information of the PCIE card in the current system, the method further includes:
[0025] Make sure the system is powered on.
[0026] Accordingly, the present invention also discloses a system for automatically acquiring register data of a PCIE card, comprising:
[0027] A signal acquisition unit is used to obtain device information of the PCIE card in the current system;
[0028] A core identification unit is used to determine the corresponding CPU core based on the device information of the PCIE card;
[0029] A classification unit, for classifying PCIE cards using class codes in a PCIE configuration menu;
[0030] A mapping unit, used to map device information and PCIE cards according to the classification results to generate parsed data;
[0031] A storage unit for storing parsed data in memory;
[0032] An input unit, used to input the classification items of the corresponding PCIE cards according to data requirements;
[0033] The execution unit is used for the BMC to determine the CPU core and BDF identifier information of the PCIE card according to the classification item, and execute the Read PCIConfig command to obtain the register data of the PCIE card.
[0034] Accordingly, the present invention discloses a device for automatically acquiring register data of a PCIE card, comprising:
[0035] A memory, used for storing a program for automatically acquiring register data of a PCIE card;
[0036] The processor is configured to implement the steps of the method for automatically acquiring register data of a PCIE card as described in any one of the above items when executing the program for automatically acquiring register data of the PCIE card.
[0037] Accordingly, the present invention discloses a readable storage medium, on which a program for automatically acquiring register data of a PCIE card is stored. When the program for automatically acquiring register data of a PCIE card is executed by a processor, the steps of the method for automatically acquiring register data of a PCIE card as described in any one of the above items are implemented.
[0038] Compared with the prior art, the beneficial effect of the present invention is that: the present invention discloses a method, system, device and medium for automatically obtaining register data of a PCIE card, which enables rapid acquisition of data for problem analysis when debug information analysis of the PCIE card is required. Whether at the factory or at the client end, when a problem analysis is required, the register data of the PCIE card can be automatically classified and obtained, effectively improving the debugging efficiency of the PCIE card.
[0039] It can be seen that compared with the prior art, the present invention has outstanding substantial features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0041] Figure 1 It is a method flow chart of a specific embodiment of the present invention.
[0042] Figure 2 It is a system structure diagram of a specific implementation method of the present invention.
[0043] In the figure, 1. Signal acquisition unit; 2. Core recognition unit; 3. Classification unit; 4. Mapping unit; 5. Storage unit; 6. Input unit; 7. Execution unit. DETAILED DESCRIPTION
[0044] The core of the present invention is to provide a method for automatically acquiring register data of a PCIE card. In the prior art, when a PCIE card loses bandwidth or encounters other problems, it is necessary to access the corresponding PCI configuration registers, and the BMC debug tool is usually used to obtain the register data. Specifically, the peciapp tool can be used to send read and write commands through the PECI interface to obtain data. However, before obtaining the data, it is necessary to know which CPU core the PCIE card is connected to and the BDF identifier information of the PCIE card in order to query the register data of the corresponding PCIE card. After issuing a query request, it is also necessary to obtain the required data under the current operating system or BIOS setup menu.
[0045] The method for automatically acquiring the register data of a PCIE card provided by the present invention first acquires the device information of the PCIE card in the current system. Then, the corresponding CPU core is determined based on the device information of the PCIE card, and the class code in the PCIE configuration menu is used to classify the PCIE card. At this time, the device information and the PCIE card are mapped according to the classification result, parsed data is generated, and the parsed data is stored in the memory. When in use, the classification items of the corresponding PCIE card are input according to the data requirements, and finally the BMC determines the CPU core and BDF identifier information of the PCIE card based on the classification items, and executes the Read PCIConfig command to obtain the register data of the PCIE card. It can be seen that the present invention realizes the automatic classification acquisition of the register data of the PCIE card, effectively improving the debugging efficiency of the PCIE card.
[0046] In order to enable those skilled in the art to better understand the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0047] Example 1:
[0048] like Figure 1 As shown, this embodiment provides a method for automatically obtaining register data of a PCIE card, comprising the following steps:
[0049] S1: Make sure the system is powered on.
[0050] Since the PCIE card device mapping program cannot be run when the system is powered off, you need to ensure that the system is powered on.
[0051] S2: Get the device information of the PCIE card in the current system.
[0052] Specifically, the BIOS process sends a "Set PCIE Device Information" command to obtain the device information of all PCIE cards. The PCIE card device information includes the vendor ID, device ID, and the card's BDF identifier. The BDF identifier includes the Bus, Device, and Function fields, representing the bus number, device number, and function number.
[0053] S3: Determine the corresponding CPU core according to the device information of the PCIE card.
[0054] Specifically, the corresponding CPU core is determined according to the bus number in the BDF identifier information of the PCIE card.
[0055] Taking a dual-core CPU as an example, each Slim Line Cable bus number will be within a range, and the following table explains the range.
[0056] CPU 0 0x16~0x59(J38 / J76) 0x60~0x69(J70 / J34) 0x6A~0x73(J39 / J40) 0x74~0x96(J33 / J53) CPU 1 0x97~0xAF(J77 / J46) 0xB0~0xC8(J42 / J41) 0xC9~0xE1(J44 / J43) 0xE2~0xFE(J79 / J78)
[0057] Table 1
[0058] The BDF identifier is a 3-byte number. The first byte represents the bus, the second byte represents the device, and the third byte represents the function. The size of the first byte can be used to determine the CPU core and connection path corresponding to the current PCIE card.
[0059] S4: Classify the PCIE cards using the class codes in the PCIE configuration menu.
[0060] First, obtain the class code in the PCIE configuration menu; then, execute the PCIE configuration read command through the PECI interface to obtain the information stored in the address 0x08 of the corresponding register, and determine the classification of the PCIE card based on the class code and the obtained information.
[0061] For example, to determine which PCIe card type the BDF value belongs to, we use the Class code in PCIEConfiguration to classify it. We execute the Read PCIConfigCommand command through the PECI interface to read register 0x08 and classify it based on the data read. For example, if Data 0x03 indicates a GPU card, Data 0x07 indicates an FPGA card, Data 0x05 indicates an MOC card, Data 0x01 indicates an NVME card, and Data 0x06 indicates an FIC card. If there are duplicate classifications, the corresponding Slot ID is incremented by 1.
[0062] S5: Map the device information and the PCIE card according to the classification result to generate parsed data.
[0063] The classification result includes: PCIE card type, card slot ID and corresponding register number.
[0064] S6: Store the parsed data in memory.
[0065] S7: Enter the corresponding PCIE card classification item according to data requirements.
[0066] S8: The BMC determines the CPU core and BDF identifier information of the PCIE card according to the classification item, and executes the ReadPCIConfig command to obtain the register data of the PCIE card.
[0067] For example, when a user inputs the need to read the PCI Configuration Register for a GPU card, they only need to enter the PCIe Card Type / Slot Id / Register. The BMC will automatically find the corresponding BDF value and the CPU to be targeted, execute the Read PCIConfig Command, and return the value of its Register.
[0068] This embodiment provides a method for automatically acquiring register data of a PCIE card, which enables rapid acquisition of data for problem analysis when debug information analysis of the PCIE card is required. Regardless of whether a problem analysis is required at the factory or at the client, the register data of the PCIE card can be automatically classified and acquired, effectively improving the debugging efficiency of the PCIE card.
[0069] Example 2:
[0070] Based on Example 1, Figure 2 As shown, the present invention also discloses a system for automatically acquiring register data of a PCIE card, comprising: a signal acquisition unit 1, a core identification unit 2, a classification unit 3, a mapping unit 4, a storage unit 5, an input unit 6 and an execution unit 7.
[0071] The signal acquisition unit 1 is used to obtain the device information of the PCIE card in the current system.
[0072] The signal acquisition unit 1 is specifically used to acquire the device information of all PCIE cards by sending a set PCIE device information command under the BIOS process.
[0073] The core identification unit 2 is used to determine the corresponding CPU core according to the device information of the PCIE card.
[0074] The core identification unit 2 is specifically configured to determine the corresponding CPU core according to the bus number in the BDF identifier information of the PCIE card.
[0075] The classification unit 3 is used to classify the PCIE cards using the class codes in the PCIE configuration menu.
[0076] The classification unit 3 is specifically used to: obtain the class code in the PCIE configuration menu; execute the PCIE configuration read command through the PECI interface to obtain the information stored in the address 0x08 of the corresponding register, and determine the classification of the PCIE card according to the class code and the obtained information.
[0077] The mapping unit 4 is used to map the device information and the PCIE card according to the classification result to generate parsing data.
[0078] The storage unit 5 is used to store the parsed data in the memory.
[0079] The input unit 6 is used to input the corresponding classification items of the PCIE card according to data requirements.
[0080] The execution unit 7 is configured to enable the BMC to determine the CPU core and BDF identifier information of the PCIE card according to the classification items, and execute a Read PCIConfig command to obtain register data of the PCIE card.
[0081] This embodiment provides a system for automatically acquiring register data of a PCIE card, which enables rapid acquisition of data for problem analysis when debug information analysis of the PCIE card is required. Whether at the factory or at the client end, when a problem analysis is required, the register data of the PCIE card can be automatically classified and acquired, effectively improving the debugging efficiency of the PCIE card.
[0082] Example 3:
[0083] This embodiment discloses a device for automatically acquiring register data of a PCIE card, comprising a processor and a memory. The device implements the following steps when the processor executes a program for automatically acquiring register data of a PCIE card stored in the memory:
[0084] 1. Make sure the current system is powered on.
[0085] 2. Get the device information of the PCIE card in the current system.
[0086] 3. Determine the corresponding CPU core based on the device information of the PCIE card.
[0087] 4. Use the class code in the PCIE configuration menu to classify the PCIE card.
[0088] 5. Map the device information and PCIE card based on the classification results to generate parsed data.
[0089] 6. Store the parsed data in memory.
[0090] 7. Enter the corresponding PCIE card classification items according to data requirements.
[0091] 8. The BMC determines the CPU core and BDF identifier information of the PCIE card based on the classification item, and executes the ReadPCIConfig command to obtain the register data of the PCIE card.
[0092] Furthermore, the device for automatically acquiring register data of a PCIE card in this embodiment may further include:
[0093] The input interface is used to obtain the automatic acquisition program for register data of the PCIE card imported from the outside and save the obtained automatic acquisition program for register data of the PCIE card to the memory. It can also be used to obtain various instructions and parameters transmitted by the external terminal device and transmit them to the processor so that the processor can use these various instructions and parameters to carry out corresponding processing. In this embodiment, the input interface can specifically include but is not limited to a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk read interface, etc.
[0094] The output interface is used to output various data generated by the processor to the terminal device connected to it, so that other terminal devices connected to the output interface can obtain various data generated by the processor. In this embodiment, the output interface can specifically include but is not limited to a USB interface, a serial interface, etc.
[0095] A communication unit is configured to establish a remote communication connection between the device for automatically acquiring register data of a PCIE card and an external server, so that the device for automatically acquiring register data of a PCIE card can mount the image file to the external server. In this embodiment, the communication unit may specifically include, but is not limited to, a remote communication unit based on wireless communication technology or wired communication technology.
[0096] The keyboard is used to obtain various parameter data or instructions input by the user by tapping the keycaps in real time.
[0097] The display is used to display relevant information of the server power supply line short circuit locating process in real time.
[0098] The mouse can be used to assist users in inputting data and simplify user operations.
[0099] Example 4:
[0100] This embodiment also discloses a readable storage medium, which includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art. The readable storage medium stores a program for automatically acquiring register data of a PCIE card. When executed by a processor, the program automatically acquires register data of a PCIE card to implement the following steps:
[0101] 1. Make sure the current system is powered on.
[0102] 2. Get the device information of the PCIE card in the current system.
[0103] 3. Determine the corresponding CPU core based on the device information of the PCIE card.
[0104] 4. Use the class code in the PCIE configuration menu to classify the PCIE card.
[0105] 5. Map the device information and PCIE card based on the classification results to generate parsed data.
[0106] 6. Store the parsed data in memory.
[0107] 7. Enter the corresponding PCIE card classification items according to data requirements.
[0108] 8. The BMC determines the CPU core and BDF identifier information of the PCIE card based on the classification item, and executes the ReadPCIConfig command to obtain the register data of the PCIE card.
[0109] In summary, the present invention realizes the automatic classification and acquisition of register data of the PCIE card, and effectively improves the debugging efficiency of the PCIE card.
[0110] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. References to the same or similar parts between the various embodiments are sufficient. The methods disclosed in the embodiments are described briefly because they correspond to the systems disclosed in the embodiments. For relevant details, refer to the method description.
[0111] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0112] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0114] In addition, the functional modules in the various embodiments of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit.
[0115] Similarly, each processing unit in each embodiment of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units may be integrated into one functional module.
[0116] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0117] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0118] The above describes in detail the method, system, device, and readable storage medium for automatically acquiring register data for a PCIE card provided by the present invention. This document uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is intended only to facilitate understanding of the method and core concepts of the present invention. It should be noted that those skilled in the art may make various improvements and modifications to the present invention without departing from the principles of the present invention, and such improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for automatically acquiring register data of a PCIE card, characterized in that: include: Get the device information of the PCIE card in the current system; Determine the corresponding CPU core based on the device information of the PCIE card; Use the class code in the PCIE configuration menu to classify PCIE cards; Map device information and PCIE cards based on the classification results to generate parsed data; Store parsed data in memory; Enter the corresponding PCIE card classification items according to data requirements; The BMC determines the CPU core and BDF identifier information of the PCIE card based on the classification items, and executes the Read PCIConfig command to obtain the register data of the PCIE card; The classification result includes: PCIE card type, card slot ID and corresponding register number; The device information of the PCIE card includes: Vendor ID, device ID, and BDF identifier information of the PCIE card; Determining the corresponding CPU core according to the device information of the PCIE card includes: Determine the corresponding CPU core based on the bus number in the BDF identifier information of the PCIE card.
2. The method for automatically acquiring register data of a PCIE card according to claim 1, wherein: The acquisition of the device information of the PCIE card in the current system includes: By sending the set PCIE device information command in the BIOS process, the device information of all PCIE cards can be obtained.
3. The method for automatically acquiring register data of a PCIE card according to claim 1, wherein: The classification of the PCIE cards using the class codes in the PCIE configuration menu includes: Get the class code in the PCIE configuration menu; Execute the PCIE configuration read command through the PECI interface to obtain the information stored in the address 0x08 of the corresponding register, and determine the classification of the PCIE card according to the class code and the obtained information.
4. The method for automatically acquiring register data of a PCIE card according to claim 1, wherein: Before obtaining the device information of the PCIE card in the current system, the following steps are further included: Make sure the system is powered on.
5. A system for automatically acquiring register data of a PCIE card, characterized in that: include: A signal acquisition unit is used to obtain device information of the PCIE card in the current system; A core identification unit is used to determine the corresponding CPU core based on the device information of the PCIE card; A classification unit, for classifying PCIE cards using class codes in a PCIE configuration menu; A mapping unit, used to map device information and PCIE cards according to the classification results to generate parsed data; A storage unit for storing parsed data in memory; An input unit, used to input the classification items of the corresponding PCIE cards according to data requirements; An execution unit, configured for the BMC to determine the CPU core and BDF identifier information of the PCIE card based on the classification item, and execute a ReadPCIConfig command to obtain register data of the PCIE card; The classification result includes: PCIE card type, card slot ID and corresponding register number; The device information of the PCIE card includes: Vendor ID, device ID, and BDF identifier information of the PCIE card; Determining the corresponding CPU core according to the device information of the PCIE card includes: Determine the corresponding CPU core based on the bus number in the BDF identifier information of the PCIE card.
6. A device for automatically acquiring register data of a PCIE card, characterized in that: include: A memory, used for storing a program for automatically acquiring register data of a PCIE card; A processor, configured to implement the steps of the method for automatically acquiring register data of a PCIE card as claimed in any one of claims 1 to 4 when executing the program for automatically acquiring register data of a PCIE card.
7. A readable storage medium, characterized in that: The readable storage medium stores a program for automatically acquiring register data of a PCIE card. When the program is executed by a processor, the steps of the method for automatically acquiring register data of a PCIE card are implemented as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
PCIE fault positioning method and device for Purley platform server, equipment and medium
CN110362435A
PCIE bandwidth automatic configuration method, server mainboard and server
CN111159085A