Search

EP-4738109-A1 - COMMUNICATION METHOD AND APPARATUS

EP4738109A1EP 4738109 A1EP4738109 A1EP 4738109A1EP-4738109-A1

Abstract

A communication method is applied to a bus network, and the method includes: A network management unit sends a request message to a bus device. The request message is used to request to access a first configuration space register of the bus device, the request message includes a network address, first indication information, and information about the first configuration space register of the bus device, the network address is an address allocated by the network management unit to the bus device, and the first indication information indicates a type of an operation performed on the first configuration space register. The network management unit receives a response message from the bus device in response to the request message. The configuration space register of the bus device is accessed based on the network address and the information about the configuration space register of the bus device, thereby avoiding stringent delay requirements associated with memory address access.

Inventors

  • GUO, JIAN
  • QIU, Zhenfa
  • ZHENG, Junlong
  • HUANG, Ruihua

Assignees

  • Huawei Technologies Co., Ltd.

Dates

Publication Date
20260506
Application Date
20240131

Claims (20)

  1. A communication method, wherein the method is applied to a bus network, and comprises: sending a request message to a bus device, wherein the request message is used to request to access a first configuration space register of the bus device, the request message comprises a network address, first indication information, and information about the first configuration space register of the bus device, the network address is an address allocated by a network management unit to the bus device, and the first indication information indicates a type of an operation performed on the first configuration space register; and receiving a response message from the bus device in response to the request message.
  2. The method according to claim 1, wherein the request message further comprises a task identifier, the response message comprises the task identifier, and the task identifier is used to determine that the response message is a message in response to the request message.
  3. The method according to claim 1 or 2, wherein the type of the operation performed on the first configuration space register comprises a read operation or a write operation.
  4. The method according to claim 3, wherein if the type of the operation performed on the first configuration space register is the write operation, the request message further comprises data to be written into the first configuration space register.
  5. The method according to claim 4, wherein the request message further comprises second indication information, and the second indication information indicates to write the data into at least one byte of the first configuration space register.
  6. The method according to any one of claims 1 to 5, wherein the information about the first configuration space register comprises at least one of the following: type information of the first configuration space register, an index of the first configuration space register, or an address of the first configuration space register.
  7. The method according to any one of claims 1 to 6, wherein the response message indicates whether the operation performed on the first configuration space register succeeds; or if the type of the operation performed on the first configuration space register is the read operation, the response message comprises information read from the first configuration space register.
  8. The method according to any one of claims 1 to 7, wherein the response message further comprises information indicating that the response message is in response to the read operation or the write operation.
  9. The method according to any one of claims 1 to 8, wherein the request message is further used to request to access a second configuration space register of the bus device, the request message further comprises third indication information and information about the second configuration space register, and the third indication information indicates a type of an operation performed on the second configuration space register.
  10. The method according to any one of claims 1 to 9, wherein the bus network comprises the network management unit and a plurality of bus devices, and the bus device is any one of the plurality of bus devices.
  11. A communication method, wherein the method is applied to a bus network, and comprises: receiving a request message from a network management unit, wherein the request message is used to request to access a first configuration space register of a bus device, the request message comprises a network address, first indication information, and information about the first configuration space register of the bus device, the network address is an address allocated by the network management unit to the bus device, and the first indication information indicates a type of an operation performed on the first configuration space register; and sending a response message to the network management unit in response to the request message.
  12. The method according to claim 11, wherein the request message further comprises a task identifier, the response message comprises the task identifier, and the task identifier is used to determine that the response message is a message in response to the request message.
  13. The method according to claim 11 or 12, wherein the type of the operation performed on the first configuration space register comprises a read operation or a write operation.
  14. The method according to claim 13, wherein if the type of the operation performed on the first configuration space register is the write operation, the request message further comprises data to be written into the first configuration space register.
  15. The method according to claim 14, wherein the request message further comprises second indication information, and the second indication information indicates to write the data into at least one byte of the first configuration space register.
  16. The method according to any one of claims 11 to 15, wherein the information about the first configuration space register comprises at least one of the following: type information of the first configuration space register, an index of the first configuration space register, or an address of the first configuration space register.
  17. The method according to any one of claims 11 to 16, wherein the response message indicates whether the operation performed on the first configuration space register succeeds; or if the type of the operation performed on the first configuration space register is the read operation, the response message comprises information read from the first configuration space register.
  18. The method according to any one of claims 11 to 17, wherein the response message further comprises information indicating that the response message is in response to the read operation or the write operation.
  19. The method according to any one of claims 11 to 18, wherein the request message is further used to request to access a second configuration space register of the bus device, the request message further comprises third indication information and information about the second configuration space register, and the third indication information indicates a type of an operation performed on the second configuration space register.
  20. The method according to any one of claims 11 to 19, wherein the bus network comprises the network management unit and a plurality of bus devices, and the bus device is any one of the plurality of bus devices.

Description

This application claims priority to Chinese Patent Application No. 202310996790.2, filed with the China National Intellectual Property Administration on August 8, 2023 and entitled "COMMUNICATION METHOD AND APPARATUS", which is incorporated herein by reference in its entirety. TECHNICAL FIELD Embodiments of this application relate to the field of information technologies, and in particular, to a communication method and apparatus. BACKGROUND Peripheral component interconnect express (peripheral component interconnect express, PCIe) is a high-speed serial computer expansion bus standard, and is used to connect a processor and external devices. These external devices are referred to as PCIe devices. Typically, in PCIe protocols, a 32-bit (bits) PCIe identifier (identifier, ID) is used to identify a PCIe device in a system. The 32-bit identifier includes a 16-bit domain (domain) identifier, an 8-bit bus (bus) identifier, a 5-bit device (device) identifier, and a 3-bit function (function) identifier. The 8-bit bus identifier bus ID, the 5-bit device identifier device ID, and the 3-bit function identifier function ID are collectively referred to as BDF for short (BDF represents bus, device, function (bus device function, BDF)). The bus ID provides 256 bus numbers for each PCIe domain. Typically, a computer system supports only one PCIe domain, that is, the entire computer system provides 256 bus numbers. Specifically, there are generally two ways to access a configuration space register of a PCIe device: memory access and input/output (input/output, I/O) access. I/O access may be simply understood as that users access the configuration space register of the PCIe device according to input/output (IN/OUT) instructions. Specifically, the first 256 bytes of a PCIe device can be accessed through an I/O port. Memory access means to map all configuration spaces of the PCIe device to a memory. After a memory address of the device is determined, the configuration space register of the PCIe device may be accessed in a memory read/write manner. When the memory access manner is used to access a configuration space register of a bus device (for example, a PCIe device), the processor stalls after an access instruction is sent, the access is subject to delay constraints, and configuration space register access cannot be performed across hosts. Therefore, how to improve performance of accessing the configuration space register of the bus device becomes an urgent problem to be resolved. SUMMARY Embodiments of this application provide a communication method, to access a configuration space register of a bus device based on a network address and information about the configuration space register of the bus device, and avoid problems caused by a memory address access manner. According to a first aspect, a communication method is provided, and is applied to a bus network. The method may be performed by a network management unit, or may be performed by a circuit or a chip configured in the network management unit. This is not limited in this application. The communication method includes: sending a request message to a bus device, where the request message is used to request to access a first configuration space register of the bus device, the request message includes a network address, first indication information, and information about the first configuration space register of the bus device, the network address is an address allocated by the network management unit to the bus device, and the first indication information indicates a type of an operation performed on the first configuration space register; and receiving a response message from the bus device in response to the request message. Based on the foregoing technical solution, when the network management unit needs to access the configuration space register of the bus device, the network management unit may include the network address and the information about the to-be-accessed configuration space register of the bus device in the request message, to access the configuration space register of the bus device. Access does not need to be performed in a memory read/write manner. Therefore, the way of accessing the configuration space register of the bus device via the request message provided in the technical solution avoids the disadvantages of the memory read/write manner, that is, stringent delay requirements and inability of perform cross-host access. With reference to the first aspect, in some implementations of the first aspect, the request message further includes a task identifier, the response message includes the task identifier, and the task identifier is used to determine that the response message is a message in response to the request message. Based on the foregoing technical solution, the request message sent by the network management unit carries the task identifier, so that when the bus device feeds back the response message for the request message, the respon