Identity information acquisition method, first device, chip and electronic equipment

By assigning identity information to devices after the host system is powered on and synchronizing the identity information during link training, the problem of delayed topology discovery and identity information synchronization of graphics processor devices is solved, and rapid device discovery and system initialization are achieved.

CN121980552APending Publication Date: 2026-05-05MOORE THREADS TECHNOLOGY (SHANGHAI) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MOORE THREADS TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2026-04-08
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technologies, the device topology discovery and identity information synchronization of graphics processors are delayed, resulting in slow system startup speed, especially in large-scale deployment scenarios where the initialization latency is too long.

Method used

After the host system is powered on, it assigns identity information to the device and synchronizes the device's identity information through information exchange during the link training process. After the driver is loaded, it directly queries the device's identity information.

Benefits of technology

It significantly shortens system initialization time, improves device topology discovery efficiency and driver detection speed, and reduces device connection latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121980552A_ABST
    Figure CN121980552A_ABST
Patent Text Reader

Abstract

The invention discloses an identity information acquisition method, a first device, a chip and electronic equipment, and belongs to the field of processors. The method is executed by a first device, the first device is an internal device of a host system or an external device connected with the host system, and the method comprises the following steps: in a link training process of the first device and a second device, performing information exchange with the second device based on first identity information to obtain second identity information of the second device; and after the drive program of the first device is loaded, responding to a query operation of the drive program, and feeding back second identity information of the second device to the drive program. According to the method, information exchange is carried out on the identity information distributed for the equipment after the host system is powered on in the link training process, so that the identity information of the second device can be quickly inquired after the driver is loaded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of processors, and in particular to a method for obtaining identity information, a first device, a chip, and an electronic device. Background Technology

[0002] A graphics processor is an external physical device that is connected to a host system.

[0003] In related technologies, after the host system is powered on, a first driver for the first graphics processor will be loaded. With the participation of the first driver, the first graphics processor will establish a connection with the second graphics processor. After the connection is established, the first driver can obtain the identity information of the second graphics processor connected to the first graphics processor.

[0004] The relevant technologies were severely delayed in obtaining the identity information of the second graphics processor. Summary of the Invention

[0005] This application provides a method for obtaining identity information, a first device, a chip, and an electronic device. This application will exchange information during the link training process based on the identity information assigned to the device after the host system is powered on, so that the identity information of the second device can be quickly queried after the driver is loaded.

[0006] According to one aspect of this application, a method for obtaining identity information is provided, executed by a first device, the first device being an internal device of a host system or an external device connected to the host system, the method comprising the following steps.

[0007] During the link training process between the first device and the second device, information is exchanged between the first identity information and the second device to obtain the second identity information of the second device. After the driver for the first device is loaded, in response to the query operation of the driver, the second identity information of the second device is fed back to the driver; The first identity information and the second identity information are the identity information assigned to the first device and the second device respectively after the host system is powered on.

[0008] According to one aspect of this application, a first device is provided, the first device including a device discovery unit; the device discovery unit is configured to perform the method described above.

[0009] According to one aspect of this application, a chip is provided, the chip comprising the first device as described above.

[0010] According to one aspect of this application, an electronic device is provided, the electronic device comprising the first device as described above.

[0011] The beneficial effects of the technical solutions provided in this application include at least the following:

[0012] In this embodiment of the application, by using the first identity information assigned to the first device after the host system is powered on, the first device will exchange information with the second device based on the first identity information during the link training process to obtain the second identity information of the second device. Then, after the driver of the first device is loaded, the driver can quickly query the second identity information of the second device.

[0013] Compared to related technologies, which require a complete connection establishment process after the driver is loaded to obtain the second identity information of the second device, this application advances the device discovery process at the driver level to the device discovery process at the host system power-on level. After the driver is loaded, the second device electrically connected to the first device can be discovered more quickly, and the identity information of the second device can be queried more quickly. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0015] Figure 1 This is a flowchart of a method for obtaining identity information provided in one embodiment of this application.

[0016] Figure 2 This is a flowchart of a method for obtaining identity information provided in another embodiment of this application.

[0017] Figure 3 This is a schematic diagram of an identity information acquisition system provided in one embodiment of this application.

[0018] Figure 4 This is a schematic diagram of an identity information acquisition system provided in another embodiment of this application.

[0019] Figure 5 This is a structural block diagram of an electronic device provided in one embodiment of this application.

[0020] Figure 6 This is a schematic diagram of the structure of a server provided in one embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0022] First, some terms used in the embodiments of this application will be introduced.

[0023] The host system is the core hardware assembly in a computer device that plays a crucial role in instruction processing and operational control. It can independently handle data processing and instruction execution. Optionally, the host system includes a Central Processing Unit (CPU), memory, motherboard, storage devices, and a power supply. The CPU is responsible for executing instructions and making logical judgments, and is the core of the entire host system's computation. Memory, or Random Access Memory, is the host system's temporary storage space, used to temporarily store running programs and data being processed; data in memory is lost when power is off. The motherboard is the connecting component of the host system, used to connect the CPU, memory, storage devices, and power supply, providing data transmission channels and power delivery. Storage devices, including hard drives (HDDs, SSDs, etc.), are the host system's permanent storage space, used to permanently store the operating system, software, files, and other data; data in storage devices is not lost when power is off. The power supply is the host system's energy source, used to convert AC power into a stable DC power required by the various components, ensuring the normal operation of the host system.

[0024] Link control unit: This device manages the physical link between the local device and the peer device. The link control unit encapsulates or decapsulates communication data between the local and peer devices according to protocol layer formats, ensuring reliable, orderly, and error-free data transmission. The link control unit is responsible for link establishment, maintenance, and release, such as point-to-point link connection negotiation and link status monitoring.

[0025] In related technologies, in a scenario where eight graphics processing units (GPUs) are interconnected on a single machine, the link establishment between two GPUs occurs after the GPU drivers have finished loading and completing their probe operations. The driver uses the first GPU's Bus / Device / Function (BDF) information and link port ID as identity tokens to identify each physical port of the first GPU. After the first GPU and the second GPU have synchronized their physical layer link establishment, the driver reconfigures the first GPU's identity information (link port identity information). Then, the first link control unit of the first GPU initiates link layer link establishment with the second GPU, exchanging their identity information. Once the first GPU has established links with all other GPUs, a topology information for the GPUs on that node is generated, allowing the driver to obtain the identity information of all other GPUs electrically connected to the first GPU. The entire process, from computer startup to the construction of the GPU topology information, takes at least several minutes.

[0026] The relevant technologies have the following problems: 1. Device topology discovery is severely delayed: Drivers are usually loaded in the late stage of host system startup or even in user space. Before that, it is impossible to know which devices have been physically connected to the local link port. It is necessary to rely on subsequent user data interaction or long-term polling to discover them, which makes device discovery and topology information construction take too long (may reach several minutes). 2. Untimely synchronization of identity information: During the link training phase, although the physical connection between the two graphics processors has been established, the identity information between the devices (such as BDF information, Link ID, etc.) has not been synchronized to the other end in a timely manner. As a result, the driver cannot immediately perceive the identity information of the other device during the detection phase and must wait until the subsequent link establishment process is completed before it can obtain it. 3. Low efficiency, affecting system startup speed: Especially in large-scale deployment scenarios (such as data centers and multi-card training clusters), the process of probing and establishing links for a large number of devices waiting to be linked further amplifies the overall initialization latency, which is not conducive to the rapid readiness of services. Therefore, there is an urgent need for a technical solution that can synchronize device identity information in the early stages of host system power-on and link training, and enable the driver to quickly perceive the remote connected device and its corresponding link port information during the detection phase, thereby skipping the lengthy waiting and interaction process in related technologies and accelerating link establishment.

[0027] Figure 1A flowchart of an exemplary embodiment of the present application for obtaining identity information is shown, illustrated by way of example, with the method being performed by a first device. The method includes the following steps.

[0028] Step 120: During the link training process between the first device and the second device, information is exchanged between the first identity information and the second device to obtain the second identity information of the second device.

[0029] For example, the first device is an internal device of the host system or an external device connected to the host system. For instance, the first device is a central processing unit (CPU) in the host system; or, for example, an external device connected to the host system such as a graphics processing unit (GPU), neural network processing unit (NPU), or tensor processing unit (TPU). Optionally, the first device can be a CPU, chipset, link master control device, link endpoint device, etc.

[0030] After the host system powers on, it enumerates the hardware devices and assigns them identity information. Optionally, the hardware devices can be PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) devices, etc. Optionally, the first identity information is the identity information assigned to the first device after the host system powers on; this first identity information is the initial identity information of the first device.

[0031] Optionally, the first identity information is BDF information. After the host system powers on, the first device receives the BDF information configured by the BIOS (Basic Input / Output System) / UEFI (Unified Extensible Firmware Interface) program. During the initialization and configuration of hardware devices after the host system powers on, the BIOS / UEFI program enumerates devices and configures the BDF information into the first device to inform it of its assigned initial identity information.

[0032] The BIOS program is pre-installed on the motherboard. After the host system boots up, it performs power-on tests and initialization of the hardware, loads the boot program from storage devices (such as hard drives, USB flash drives, optical discs, etc.), and then the boot program starts the operating system. The BIOS program can be said to be the first software loaded after the host system boots up.

[0033] BDF information is used to uniquely identify each device. BDF information contains the following components: Bus information: an 8-bit field indicating the bus number the device belongs to. Because it's 8 bits, it can support 256 buses. Device information: a 5-bit field indicating the device number on a specific bus. Each bus can have 32 devices, numbered from 0 to 31. Function information: a 3-bit field indicating the function number of a specific device. Because it's 3 bits, a device can have a maximum of 8 functions. The structure of BDF information allows the entire system to support up to 256 buses × 32 devices / bus × 8 functions / device = 65,536 unique functions, which is sufficient to meet the needs of modern computer systems.

[0034] For example, after receiving the first identity information configured after the host system powers on, the first device will initiate link training for the second device. Similarly, after receiving the second identity information configured after the host system powers on, the second device will initiate link training for the first device. The second identity information is the identity information assigned to the second device after the host system powers on, and it is the initial identity information of the second device. Optionally, similar to the first identity information, the second identity information is BDF information, which the second device receives from the BIOS / UEFI program after the host system powers on. In this application, the description will mainly focus on the perspective of the first device, while the second device, as the peer device of the first device, performs similar actions.

[0035] Optionally, the first device and the second device are of the same type, such as both being graphics processors; or, optionally, the first device and the second device are of different types, such as the first device being a central processing unit and the second device being a graphics processor. Optionally, both the first device and the second device are devices within the host system, or both are external devices connected to the host system, or one of the first device and the second device is an internal device of the host system, and the other is an external device of the host system.

[0036] For example, before the host system is powered on, the first device is physically connected to the second device. At this time, there is no power between the first and second devices. This connection can be direct or indirect through an intermediate medium, such as a Regslice. After the host system is powered on, the first device is also electrically connected to the second device, and at this time, there is successful power between the first and second devices.

[0037] During link training, the first device synchronizes its first identity information to the second device, and the second device also synchronizes its second identity information to the first device. Through a handshake exchange, the first device obtains the second identity information from the second device. Optionally, the first device stores the obtained second identity information.

[0038] Optionally, the first device stores the second identity information of the second device in the link status register, training status bit or target field corresponding to the first link control unit on the first device, and waits for the driver to query it. The first link control unit is the link control unit on the first device.

[0039] Step 140: After the driver for the first device is loaded, in response to the query operation of the driver, the second identity information of the second device is fed back to the driver.

[0040] For example, after the driver is loaded, it retrieves the second identity information of the second device from the link status register, training status bit or target field corresponding to the first link control unit on the first device.

[0041] For example, in one possible scenario, the link training process between the first device and the second device may be completed before the driver of the first device is successfully loaded. In this case, after the driver of the first device is loaded, it can directly query the second identity information of the second device without waiting for the link establishment process.

[0042] For example, in another possible scenario, the link training process between the first and second devices may be completed only after the driver for the first device is loaded. In this case, the driver for the first device needs to wait a certain amount of time before it can query the second identity information of the second device. However, although a certain amount of time is required, compared to related technologies where the link establishment process is executed after the driver is loaded and the second identity information of the second device can only be obtained after the link establishment is completed, this application will execute the identity information discovery process of the second device earlier, thus obtaining the second identity information of the second device earlier than related technologies.

[0043] In one embodiment, in response to the driver polling the port status of the first device during device probe, the second identity information of the second device is fed back to the driver.

[0044] The device detection operation performed by the driver is a driver initialization function automatically called by the kernel after the driver and device are successfully matched. It performs operations such as device authentication, resource management, hardware initialization, software interface creation, framework integration, and interconnection preparation, and initializes the device to a state that can be managed by the operating system.

[0045] By polling the port status of the first device, the status of all ports of the first device will be queried. The driver can then learn the identity information of all devices connected to the first device and obtain the topology of the devices connected to the first device, centered on the first device.

[0046] In one embodiment, in response to the driver polling the port status of the first device during device detection, the driver is fed back a first device connection indication message; the connection indication message is used to indicate that a remote device has been connected, and the connected remote device includes a second device with identity information of the second identity information.

[0047] After the driver for the first device is loaded, the driver will poll the port status of the first device during device detection to determine whether each port is connected to a device. When a port is found to be connected to a device, the driver will query the information about the connected device and further query the identity information of the connected device. When a port is found to be unconnected, the driver will query the information about the unconnected device.

[0048] In one embodiment, the second identity information is used to trigger the driver to determine whether the electrical connection between the first device and the second device is a valid connection based on the link state machine state, and to determine that the second identity information is valid if the electrical connection between the first device and the second device is a valid connection. Optionally, the link state machine state includes at least one of the training completed state and the normal operation state.

[0049] If the link state machine indicates that the first device and the second device have completed link training, or the link between the first device and the second device is in normal working condition, further confirming that the electrical connection between the first device and the second device is valid, then the driver can confirm that the second identity information of the second device is valid. At this time, the second identity information of the second device will be more reliable. If the link state machine indicates that the first device and the second device have not completed link training, or that the link between the first device and the second device is not in normal working condition, further confirming that the electrical connection between the first device and the second device is invalid, then the driver can confirm that the second identity information of the second device queried is invalid. The driver does not trust the second identity information of the second device and will query again.

[0050] By comprehensively judging the link state machine state, the driver can query more reliable identity information of the second device, thereby improving the confidence level of the queried identity information of the second device.

[0051] In this embodiment of the application, by reusing the first identity information assigned to the first device after the host system is powered on, the first device will exchange information with the second device based on the first identity information during the link training process to obtain the second identity information of the second device. Then, after the driver of the first device is loaded, the second identity information of the second device can be quickly queried.

[0052] Compared to related technologies, which require a complete connection establishment process after the driver is loaded to obtain the second identity information of the second device, this application advances the device discovery process at the driver level to the device discovery process at the host system power-on process level. After the driver is loaded, the second device electrically connected to the first device can be discovered more quickly, and the identity information of the second device can be queried more quickly.

[0053] In one embodiment, during the link training process, the first device also exchanges information with the second device to obtain the second link identification information of the second device; After the driver for the first device is loaded, in response to the driver's query operation, the second link identification information of the second device is fed back to the driver.

[0054] The first link identification information is the link identification information of the link to be established between the first device and the second device, used to distinguish multiple parallel links. Optionally, the first link identification information is the number of the link established by the first device with other devices, with the first device as the central node. For example, the link established by the first device with the second device (device A) is numbered 1, the link established with device B is numbered 2, and so on.

[0055] Similarly, the second link identification information is the link identification information of the link to be established between the second device and the first device, used to distinguish multiple parallel links. The second link identification information is the number of the link established between the second device and other devices with the second device as the central node. For example, the link established between the second device and device D is numbered 1, the link established between the second device and the first device (device E) is numbered 2, and so on.

[0056] Optionally, the first link identification information and the first identity information are stored in the same field on the first device, so that the first link identification information and the first identity information can be read together during the link training process.

[0057] Optionally, the second link identification information and the second identity information obtained from the exchange with the second device are stored in the same field on the first device, so that the driver can query and obtain them together.

[0058] By exchanging link identification information during link training, the driver can quickly query the link identification between the first and second devices after loading, thereby obtaining more comprehensive information.

[0059] based on Figure 1 The optional embodiments shown, Figure 2 A flowchart of an exemplary embodiment of the present application for obtaining identity information is shown. The method is illustrated by way of example, with the method being performed by a first device. Step 120 is preceded by step 220. Step 120 includes steps 240 and 260. The method includes the following.

[0060] Step 220: Store the first identity information in the target field corresponding to the first link control unit, where the first link control unit is the link control unit on the first device; For example, during the initialization and configuration of the first device, the BIOS / UEFI program writes BDF information into the configuration space corresponding to the first device (if the first device is a PCIe device, then this configuration space is a PCIe configuration space). The first device also synchronously writes the BDF information into the target field corresponding to the first link control unit on the first device. Optionally, the target field is a dedicated field of the first link control unit, and only the first link control unit can use the field content carried in the target field.

[0061] In one embodiment, after the host system is powered on, in response to configuration operations by the BIOS program or UEFI program, a target field is configured in a dedicated register or internal cache of the first link control unit.

[0062] For example, after the host system is powered on, the BIOS program or UEFI program configures the BDF information and target field together with the first device. The first device synchronizes the BDF information to the target field and waits for the subsequent link training to read the BDF information from the target field as the first identity information for information exchange.

[0063] Optionally, the target field is the device identifier field (Decice_id). The first device stores its first identity information in the device identifier field corresponding to the first link control unit. The device identifier field is used to contain the identity information of the first device. The identity information of the first device includes identity information related to the first device used for link training. Optionally, the device identifier field can be a reusable or extensible field.

[0064] By configuring a device identification field for the first link control unit, the first link control unit can then read complete identification information of the first device used for link establishment from the device identification field.

[0065] Step 240: During the link training process between the first device and the second device, the first identity information is read from the target field through the first link control unit. During the link training process between the first device and the second device, the first device can read the first identity information from the target field through its first link control unit for link training.

[0066] In this embodiment, the first device moves the first identity information to the target field corresponding to the first link control unit, granting the first link control unit the right to read the first identity information, thus ensuring that the first link control unit can perform link training based on the first identity information before the driver is loaded.

[0067] Step 260: The first link control unit exchanges information with the second device based on the first identity information to obtain the second identity information of the second device.

[0068] The first device can exchange information with the second device by transmitting link training frames on the physical layer (PHY layer) through its first link control unit, and obtain the second identity information of the second device.

[0069] In one embodiment, link training is initiated through a first link control unit to transmit a first link training frame to a second link control unit on a second device; the first link training frame includes first identity information. Optionally, link training is initiated through a first physical layer module on the first link control unit to transmit the first link training frame to a second physical layer module on the second link control unit of the second device; for example, the first physical layer module is a hardware module on the first link control unit that processes data according to a physical layer format, and the second physical layer module is a hardware module on the second link control unit that processes data according to a physical layer format. During the link training phase, the first physical layer module acquires the first identity information, encapsulates the first link training frame based on the first identity information, and transmits the first link training frame to the second physical layer module on the second link control unit of the second device.

[0070] The second identity information of the second device is obtained by parsing the received second link training frame through the first link control unit; the second link training frame is sent by the second link control unit. Optionally, the second identity information of the second device is obtained by parsing the received second link training frame through the first physical layer module on the first link control unit; the second link training frame is sent by the second physical layer module of the second link control unit on the second device. For example, the first physical layer module on the first link control unit will also obtain the second link training frame constructed by the second physical layer module on the second link control unit, and parse the second identity information of the second device from the second link training frame.

[0071] Optionally, the first link training frame also includes at least one of the following: type information of the first device, manufacturer identification information of the first device, and rate capability of the first device, so that the second device can also learn about the type of the first device, the manufacturer of the first device, and the rate capability of the first device by parsing the first link training frame. The type information of the first device includes information indicating whether the first device is a graphics processor, a central processing unit, or a network card; the manufacturer identification of the first device is a unique identifier of the manufacturer of the first device; the rate capability of the first device indicates the maximum transmission speed that the first device can support when transmitting data.

[0072] In one embodiment, a first link training frame is constructed based on a link training protocol through a first physical layer module on a first link control unit. The link training protocol refers to a standard protocol (such as the PCIe protocol) in which the training process and frame format are defined, such as training sequences TS1 / TS2 or similar training phase frames.

[0073] This embodiment adds custom information to the standard training frame without breaking the original protocol, based on the training process and frame format already defined in the link training protocol, to transmit information using the existing training channel. The custom information includes at least the aforementioned first identity information, and optionally at least one of the following: first link identification information, first device type information, first device manufacturer identification information, and first device rate capability.

[0074] At this point, the existing link training protocol will be used to transmit the first identity information. Only minor adaptation modifications to the existing protocol are needed to meet the requirement that the driver can quickly obtain the second identity information after loading.

[0075] In another embodiment, a first link training frame is constructed and transmitted during non-data transmission periods via a first physical layer module on a first link control unit.

[0076] During link training or normal operation intervals, there are idle periods with no effective data transmission. Standard protocols may specify sending specific idle symbols during these periods to maintain link activity and synchronization. This embodiment will not send standard idle symbols during these idle periods; instead, it will construct and transmit a custom first link training frame. In this case, the first link training frame can be constructed and transmitted without interfering with normal data transmission. The frame format of the first link training frame is a custom format.

[0077] In summary, in the above embodiments, after the host system powers on, it will assign first identity information to the first device. The first device will synchronously write the first identity information into the target field corresponding to the first link control unit. During the link training phase, the first link control unit will read the first identity information and construct the first link training frame. The training frame will be used to synchronize the identity information of the first device and the second device, so that the driver of the first device can quickly perceive the second device after loading, without waiting for the subsequent link establishment process, which significantly improves the system initialization speed and device topology discovery efficiency.

[0078] based on Figure 2 In the optional embodiment shown, during the link training process between the first device and the second device, the first device and the second device also synchronize link identification information. Optionally, the methods for synchronizing link identification information between the first device and the second device include the following two.

[0079] First, the first device reads the first link identification information from the target field through the first link control unit; The first link identification information is encapsulated in the first link training frame by the first link control unit; and... The second link identification information of the second device is obtained by parsing the received second link training frame by the first link control unit.

[0080] Optionally, the first link identification information can be encapsulated in the first link training frame through the first physical layer module on the first link control unit; Furthermore, the second link identification information of the second device is obtained by parsing the received second link training frame through the first physical layer module on the first link control unit.

[0081] At this time, the first identity information and the first link identification information are encapsulated in the first link training frame, and the second identity information and the second link identification information are encapsulated in the second link training frame. The first physical layer module can read the second identity information and the second link identification information by decapsulation once, saving decapsulation resources.

[0082] Optionally, in the first link training frame, the first identity information is placed before the first link identification information to ensure that the more important first identity information can be parsed by the second physical layer module as soon as possible, and that the first link identification information can be mapped to the first device as soon as possible after parsing.

[0083] Optionally, the first link training frame may contain repeated information combinations, each combination including a first identity information and a first link identifier. Placing repeated information combinations in the first link training frame can, to some extent, avoid information loss and facilitate comparison and analysis by the second device.

[0084] 2. The first device reads the first link identification information from the target field through the first link control unit; The third link training frame is transmitted to the second link control unit on the second device via the first link control unit; the third link training frame includes the first link identification information; and... The second link identification information of the second device is obtained by parsing the received fourth link training frame by the first link control unit; the fourth link training frame is sent by the second link control unit on the second device.

[0085] Optionally, the third link training frame is transmitted to the second physical layer module of the second link control unit on the second device through the first physical layer module on the first link control unit, and the third link training frame includes the first link identification information; Furthermore, the received fourth link training frame is parsed by the first physical layer module on the first link control unit to obtain the second link identification information of the second device. The fourth link training frame is sent by the second physical layer module of the second link control unit on the second device.

[0086] At this time, the first identity information and the first link identification information are transmitted by different link training frames, which improves the reliability of transmission. When the first identity information or the first link identification information is lost, it will not affect the transmission of the other information. Furthermore, framed transmission can reduce the transmission resources required for each transmission and reduce the requirements for hardware and software resources for data transmission.

[0087] In one embodiment, the method for obtaining identity information provided in this application includes the following process: I. BIOS Configuration Phase – BDF Information Pre-writing to Link Control Unit After the host system is powered on, the BIOS / UEFI program writes standard PCIe BDF information into the PCIe configuration space of the corresponding device during the initialization and configuration of hardware devices (including CPU, chipset, link master / endpoint devices, etc.). The local device also writes this BDF information into a dedicated field (e.g., the device_id field) of the link control unit associated with the local device. The link control unit of the local device is responsible for managing the physical link with the peer device. Its device_id field is reused or extended in this scheme to carry the identity information of the local device during the subsequent link training phase. This identity information may include PCIe BDF information and optional link identification information.

[0088] Optionally, the device_id field can be located in a dedicated register or internal cache of the link control unit, and the BIOS program configures it in the device along with the BDF information during initialization.

[0089] II. Link Training Phase – Synchronizing Device Information Using Custom Training Frames When the physical layer of the link control unit initiates link training, the local device (e.g., host or expansion card) will construct and send a custom training frame, which will contain at least the following fields: 1) Current device PCIe BDF information; 2) Link identification information of the current device (used to distinguish multiple parallel links); 3) Other optional device or link attributes (such as device type, vendor ID, rate capability, etc.); During the link training process, the custom training frame is transmitted to the peer device through the physical layer. After receiving the custom training frame, the peer device parses the BDF information, link identification information and other information carried in it to know the identity of the remote device with which it has established a connection. Similarly, the local device can also obtain the identity information of the peer device by receiving the corresponding custom frame sent by the peer.

[0090] Optionally, custom training frames can be obtained by extending the link training protocol (such as training sequence TS1 / TS2 or similar training phase frames); or, alternatively, custom training frames can be obtained by inserting custom control information during non-data transmission periods (such as training idle periods).

[0091] Optionally, BDF information and link identification information can be carried in a single custom frame or transmitted in multiple frame stages to ensure the reliability of the training process.

[0092] III. Driving Loading and Detection Phase – Rapidly Sensing Remote Devices After the host system boots into the operating system, the relevant drivers are loaded. When performing a device probe operation, the local device driver will directly poll the status of the current connection port (e.g., link status register, training status bits, current value of the device_id field, etc.). Since the local device's link control unit has synchronized the remote device's BDF information and other information through a custom training frame during the link training phase, and this information has been recorded or mapped to the internal status of the link control unit (e.g., in the device_id field or a dedicated cache), the local device driver can obtain the status information through a simple status query. 1) Is the current connection port already connected to a remote device? 2) If already connected, the remote device's BDF information, link identification information, and other key identity information; Based on the above information, the driver of the local device can quickly collect the device topology information of the current connection port of the local device during the detection phase, without having to wait for the subsequent additional connection establishment process initiated through user data and wait for a long time for topology discovery, thereby significantly shortening the system initialization time and device discovery latency.

[0093] Optionally, during the polling process, the driver can also combine the link state machine status (such as whether training has been completed, whether it is in the UP state, etc.) to comprehensively determine whether the remote device is effectively connected.

[0094] Optionally, this method is applicable to high-speed link interconnect technology and can also be extended to other private or standard high-speed bus systems that adopt a similar layered structure (physical layer-link layer-transaction layer).

[0095] Compared with related technologies, this application has the following significant advantages: 1) Significantly reduces the latency of topology discovery and device connection establishment; by pre-writing PCIe BDF information into the link control unit during the BIOS configuration stage and synchronizing remote device identity information using custom frames during the link training stage, the driver can quickly detect which devices are connected to the current connection port during the detection stage, without waiting for the long user data interaction or connection establishment process in related technologies, thereby greatly reducing the waiting time for device discovery during system startup.

[0096] 2) Achieve early device identity information synchronization and improve driver detection efficiency; This application achieves the synchronization of local and remote device identities (such as BDF information and link identification information) during the link training stage (rather than the running stage after driver loading). During the detection stage, the driver can obtain remote device information by simply polling the status of the connection port, avoiding the problem in related technologies where the driver needs to initiate an additional link establishment process or poll for a long time to obtain the device list, which significantly improves the driver detection efficiency and system initialization speed.

[0097] 3) Reduce system startup time and improve overall operating efficiency; Since device topology information is available quickly during the driver detection phase, the system does not need to go through the long process of "driver loading → initiating chain establishment → waiting for training to complete → collecting topology → initializing devices" in the traditional solution. Especially in multi-device, large-scale deployment scenarios (such as servers and data centers), it can significantly shorten the overall system startup time and speed up business launch and resource readiness.

[0098] 4) Enhance the awareness and manageability of device connectivity; by synchronizing device identity information such as BDF information in advance, the driver can know in the early stages which device (such as which accelerator card or which smart network card) is connected to the current device's connection port, providing accurate basic information for subsequent device management, resource allocation, fault location, etc., and enhancing the maintainability and observability of the system.

[0099] Figure 3 This illustration shows a schematic diagram of an identity information acquisition architecture provided by an exemplary embodiment of this application. Figure 3 The first device 320 and the second device 330 are illustrated as external devices of the host system 310. Optionally, at least one of the first device 320 and the second device 330 may be an internal device of the host system 310, such as the first device 320 being the central processing unit inside the host system, and the second device 330 being an accelerator card or other expansion card outside the host system.

[0100] For example, such as Figure 3 As shown, after the host system 310 is powered on, it assigns first identity information and second identity information to the first device 320 and the second device 330, respectively. For example, the host system assigns BDF information to the first device 320 and BDF information to the second device 330 by running a BIOS program. The BIOS program is stored as firmware in the storage device of the host system 310.

[0101] During the link training process between the first device 320 and the second device 330, the first device 320 will exchange information with the second device 330 based on the first identity information to obtain the second identity information of the second device 330; similarly, the second device 330 will exchange information with the first device 320 based on the second identity information to obtain the first identity information of the first device 320. After the driver for the first device 320 is loaded ( Figure 3 (Not shown) In response to a query operation by the first driver of the first device 320, the first device 320 feeds back the second identity information of the second device 330 to the first driver; and, after the driver of the second device 330 is loaded, in response to a query operation by the second driver of the second device 330, the second device 330 feeds back the first identity information of the first device 320 to the second driver. The driver is run by the host system 310 and is stored in the storage device of the host system 310. Optionally, when probing a device, the driver of the first device 320 obtains the second identity information of the second device 330 connected to the port of the first device 320 by polling the port status of the first device 320; Optionally, when probing a device, the driver of the second device 330 can query the first identity information of the first device 320 connected to the port of the second device 330 by polling the port status of the second device 330.

[0102] In this embodiment of the application, by reusing the first identity information assigned to the first device 320 after the host system 310 is powered on, the first device 320 will exchange information with the second device 330 based on the first identity information during the link training process to obtain the second identity information of the second device 330. Then, after the driver of the first device 320 is loaded, the second identity information of the second device 330 can be quickly queried.

[0103] Compared to related technologies, which require a complete connection establishment process after the driver is loaded to obtain the second identity information of the second device 330, this application advances the device discovery process at the driver level to the device discovery process at the host system power-on process level. After the driver is loaded, the second device electrically connected to the first device can be discovered more quickly, and the identity information of the second device can be queried more quickly.

[0104] In one embodiment, such as Figure 4 As shown, the first device 320 stores the first identity information in the first target field corresponding to the first link control unit 321, where the first link control unit 321 is the link control unit on the first device 320. The second device 330 stores the second identity information in the second target field corresponding to the second link control unit 331, where the second link control unit 331 is the link control unit on the second device 330.

[0105] During the link training process between the first device 320 and the second device 330, the first device 320 reads the first identity information from the first target field through the first link control unit 321; and exchanges information with the second device 330 based on the first identity information through the first link control unit 321 to obtain the second identity information of the second device 330. Similarly, the second device 330 reads the second identity information from the second target field through the second link control unit 331, and exchanges information with the first device 320 based on the second identity information through the second link control unit 331 to obtain the first identity information of the first device 320.

[0106] In one embodiment, the first physical layer module in the first link control unit 321 initiates link training, constructs a first link training frame, the first link training frame including first identity information; and transmits the first link training frame to the second physical layer module of the second link control unit 331 on the second device 330. Furthermore, the second identity information of the second device 330 is obtained by parsing the received second link training frame through the first physical layer module on the first link control unit 321. The second link training frame is sent by the second physical layer module of the second link control unit 331 on the second device 320.

[0107] Similarly, the second physical layer module in the second link control unit 331 initiates link training, constructs a second link training frame, and the second link training frame includes second identity information; the second link training frame is then transmitted to the first physical layer module of the first link control unit 321 on the first device 320. Furthermore, the first identity information of the first device 320 is obtained by parsing the received first link training frame through the second physical layer module on the second link control unit 321. The first link training frame is sent by the first physical layer module of the first link control unit 321 on the first device 320.

[0108] In this embodiment, after the host system 310 is powered on, it will assign first identity information to the first device 320. The first device 320 will synchronously write the first identity information into the target field corresponding to the first link control unit 321. During the link training phase, the first link control unit 321 will read the first identity information and construct the first link training frame. The identity information of the first device and the second device will be synchronized using the training frame. This allows the driver of the first device 320 to quickly detect the second device after loading, without waiting for the subsequent link establishment process, which significantly improves the system initialization speed and device topology discovery efficiency.

[0109] For further details on the hardware architecture, please refer to the section on "Methods for Obtaining Identity Information" mentioned above. To save space, these details will not be repeated here.

[0110] This application also provides a first device, which includes a device discovery unit; the device discovery unit is used to perform the relevant content of the "method for obtaining identity information" as described above; In one embodiment, the device discovery unit includes a first link control unit; The device discovery unit is used to read first identity information from the target field during the link training process between the first device and the second device, via the first link control unit; and, The first link control unit exchanges information with the second device based on the first identity information to obtain the second identity information of the second device.

[0111] Optionally, the device discovery unit is configured to initiate link training via the first link control unit to transmit a first link training frame to the second link control unit on the second device; the first link training frame includes first identity information; and, The second link training frame received by the first link control unit is parsed to obtain the second identity information of the second device; the second link training frame is sent by the second link control unit.

[0112] Optionally, the first link control unit includes a first physical layer module. A device discovery unit is configured to initiate link training through the first physical layer module to transmit the first link training frame to the second physical layer module of the second link control unit on the second device; and, The second physical layer module parses the received second link training frame to obtain the second identity information of the second device; the second link training frame is sent by the second physical layer module.

[0113] For further information about the first device, please refer to the relevant content on "Methods for Obtaining Identity Information" introduced above. To save space, it will not be repeated here.

[0114] Figure 5 A structural block diagram of an electronic device provided in an exemplary embodiment of this application is shown. Optionally, the electronic device 500 includes the first device provided in this application.

[0115] Optionally, the electronic device can be a portable mobile terminal, such as a smartphone, tablet, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop, or desktop computer. The electronic device 500 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names. Typically, the electronic device 500 includes a processor 501 and a memory 502.

[0116] Processor 501 may include one or more processing cores, such as a quad-core processor, a penta-core processor, etc. Processor 501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 501 may integrate a graphics processing unit (GPU) responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor for handling computational operations related to machine learning.

[0117] Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices.

[0118] In some embodiments, the electronic device 500 may optionally include: a peripheral device interface 503 and at least one peripheral device. Those skilled in the art will understand that... Figure 5 The structure shown does not constitute a limitation on the electronic device 500, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0119] This application also provides a chip that includes the first device as described in the above embodiments.

[0120] This application also provides a server, which includes the first device as described in the above embodiments.

[0121] Figure 6 The diagram shows a schematic of the structure of a server provided in an exemplary embodiment of this application. The server 600 includes a plurality of first devices 601, and at least one of the first devices 601 is the first device described in the above embodiment of this application.

[0122] Optionally, if there are multiple first devices 601 in the server, any one of the multiple first devices 601 can be used as the first device described in the above embodiments of this application, and any of the remaining first devices 601 can be used as the second device.

[0123] This application also provides a computing cluster, which includes multiple servers, at least one of which includes the first device as described in the above embodiments.

[0124] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0125] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0126] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent switching, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for obtaining identity information, characterized in that, Performed by a first device, which is an internal device of the host system or an external device connected to the host system, the method includes: During the link training process between the first device and the second device, information is exchanged with the second device based on the first identity information to obtain the second identity information of the second device. After the driver for the first device is loaded, in response to the query operation of the driver, the second identity information of the second device is fed back to the driver; The first identity information and the second identity information are the identity information assigned to the first device and the second device respectively after the host system is powered on.

2. The method according to claim 1, characterized in that, The method further includes: The first identity information is stored in the target field corresponding to the first link control unit, where the first link control unit is the link control unit on the first device; During the link training process between the first device and the second device, information exchange is performed with the second device based on the first identity information to obtain the second identity information of the second device, including: During the link training process between the first device and the second device, the first identity information is read from the target field through the first link control unit; The first link control unit exchanges information with the second device based on the first identity information to obtain the second identity information of the second device.

3. The method according to claim 2, characterized in that, The target field includes a device identification field, which is used to store the identity information of the first device.

4. The method according to claim 2, characterized in that, The method further includes: After the host system is powered on, in response to the configuration operation of the BIOS program or the UEFI program, the target field is configured in the dedicated register or internal cache of the first link control unit.

5. The method according to claim 2, characterized in that, The step of exchanging information with the second device based on the first identity information through the first link control unit to obtain the second identity information of the second device includes: Link training is initiated through the first link control unit to transmit the first link training frame to the second link control unit on the second device; the first link training frame includes the first identity information; and, The second identity information of the second device is obtained by parsing the received second link training frame by the first link control unit; the second link training frame is sent by the second link control unit.

6. The method according to claim 5, characterized in that, The step of initiating link training through the first link control unit to transmit the first link training frame to the second link control unit on the second device includes: Link training is initiated through the first physical layer module on the first link control unit, so as to transmit the first link training frame to the second physical layer module of the second link control unit on the second device. The step of parsing the received second link training frame through the first link control unit to obtain the second identity information of the second device includes: The second physical layer module parses the received second link training frame to obtain the second identity information of the second device; the second link training frame is sent by the second physical layer module.

7. The method according to claim 5, characterized in that, The target field also stores the first link identifier information of the link to be established between the first device and the second device; the method further includes: The first link identification information is read from the target field by the first link control unit; The first link identification information is encapsulated in the first link training frame by the first link control unit; and... The second link identification information of the second device is obtained by parsing the received second link training frame by the first link control unit.

8. The method according to claim 5, characterized in that, The target field also stores the first link identifier information of the link to be established between the first device and the second device; the method further includes: The first link identification information is read from the target field by the first link control unit; The third link training frame is transmitted to the second link control unit on the second device via the first link control unit; the third link training frame includes the first link identification information; and... The second link identification information of the second device is obtained by parsing the received fourth link training frame by the first link control unit; the fourth link training frame is sent by the second link control unit on the second device.

9. The method according to claim 5, characterized in that, The first link training frame also includes at least one of the following: the type information of the first device, the manufacturer identification information of the first device, and the rate capability of the first device.

10. The method according to claim 5, characterized in that, The method further includes: The first link training frame is constructed based on the link training protocol using the first physical layer module on the first link control unit; or... The first physical layer module on the first link control unit constructs and transmits the first link training frame during non-data transmission periods.

11. The method according to any one of claims 1 to 10, characterized in that, The first identity information includes Bus Device Function (BDF) information; the method further includes: After the host system is powered on, it receives the BDF information configured by the BIOS or UEFI program.

12. The method according to any one of claims 1 to 10, characterized in that, The method further includes: The second identity information of the second device is stored in the link status register, training status bit or target field corresponding to the first link control unit on the first device; the first link control unit is the link control unit on the first device.

13. The method according to any one of claims 1 to 10, characterized in that, The step of responding to the query operation of the driver by feeding back the second identity information of the second device to the driver includes: In response to the driver's operation of polling the port status of the first device during device detection, the second identity information of the second device is fed back to the driver.

14. The method according to claim 13, characterized in that, The step of responding to the driver's operation of polling the port status of the first device during device detection, and feeding back the second identity information of the second device to the driver, includes: In response to the driver polling the port status of the first device during device detection, a connection indication is fed back to the driver; the connection indication is used to indicate that the first device has connected to a remote device, and the connected remote device includes the second device with the second identity information.

15. The method according to any one of claims 1 to 10, characterized in that, The second identity information is used to trigger the driver to determine whether the electrical connection between the first device and the second device is a valid connection based on the link state machine state, and to determine that the second identity information is valid if the electrical connection between the first device and the second device is a valid connection.

16. A first device, characterized in that, The first device includes a device discovery unit; the device discovery unit is configured to perform the method as described in any one of claims 1 to 15.

17. A chip, characterized in that, The chip includes the first device as described in claim 16.

18. An electronic device, characterized in that, The electronic device includes the first device as described in claim 16.

Citation Information

Patent Citations

  • RFID-chip-based fast networking method and special device

    CN104579870A

  • PCIE link stability test method and device, computer equipment and medium

    CN112416672A

  • PCIe link training method and device

    CN116955261A

  • Device initialization method, electronic equipment and readable storage medium

    CN117707628A

  • Virtual graphics device driver

    WO2010151385A1