WO2023125565A1 - 网络节点的配置和访问请求的处理方法、装置 - Google Patents

网络节点的配置和访问请求的处理方法、装置 Download PDF

Info

Publication number
WO2023125565A1
WO2023125565A1 PCT/CN2022/142482 CN2022142482W WO2023125565A1 WO 2023125565 A1 WO2023125565 A1 WO 2023125565A1 CN 2022142482 W CN2022142482 W CN 2022142482W WO 2023125565 A1 WO2023125565 A1 WO 2023125565A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
network node
segment
virtual address
mapping relationship
Prior art date
Application number
PCT/CN2022/142482
Other languages
English (en)
French (fr)
Inventor
赖宗澐
赵宇粟
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023125565A1 publication Critical patent/WO2023125565A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2596Translation of addresses of the same type other than IP, e.g. translation from MAC to MAC addresses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]

Definitions

  • the present application relates to the field of network technology, in particular to a method and device for configuring network nodes and processing access requests.
  • a computing task can be completed collaboratively by multiple network nodes.
  • a first network node that initiates a computing task utilizes a physical device in a second network node to perform the task.
  • the first network node and the second network node are connected through a network bus capable of providing remote direct memory access (RDMA) services, and the first network node and the second network node are implemented using RDMA technology. data transfer between.
  • the first network node allocates system memory space for the physical devices in the second network node, and the second network node allocates system memory space for its own physical devices, and realizes data synchronization in the two system memory spaces through RDMA technology, thereby realizing the first A call from a network node to a physical device in a second network node.
  • RDMA remote direct memory access
  • the present application provides a method and device for configuring network nodes and processing access requests, which can realize cross-node access to physical devices, and is beneficial to reduce time delay.
  • the present application provides a method for configuring a network node, the method comprising: obtaining address information of a virtual address segment related to a target physical device, where the target physical device is a physical device belonging to the second network node,
  • the virtual address segment includes a first virtual address segment and a second virtual address segment, the first virtual address segment belongs to the virtual address space of the first network node and is used for the target physical device to access the first A network node, the second virtual address segment belongs to the virtual address space of the second network node and is used for the first network node to access the target physical device; according to the address information of the virtual address segment, an address is configured A mapping relationship, the address mapping relationship includes a first address mapping relationship and a second address mapping relationship, the first address mapping relationship is between the physical address space of the first network node and the second virtual address segment A mapping relationship, the second address mapping relationship is a mapping relationship between the physical address space of the second network node and the first virtual address segment.
  • the method may be performed by the first network node, or alternatively, performed by the second network node.
  • the address mapping relationship is used for the transmission of the access request related to the target physical device.
  • Access requests are used to request to read data or to request to write data.
  • the access request initiated by the first network node is used to request to write data to the virtual address corresponding to the target physical device in the second network node;
  • the virtual address corresponding to the target physical device reads data or writes data.
  • the network node can realize the invocation of the physical device across the network nodes based on the configured address mapping relationship. There is no need to use RDMA technology to synchronize data in the memory spaces of two network nodes, thereby reducing time delay.
  • the address information of the virtual address segment includes the first address of the virtual address segment and the length of the virtual address segment; or, the address information of the virtual address segment includes the first address and the last address of the virtual address segment.
  • the virtual address segment related to the target physical device includes two parts, one part is the first virtual address segment allocated by the first network node to the target physical device, and the other part is the first virtual address segment allocated by the second network node to the target physical device. Two virtual address segments.
  • obtaining address information of a virtual address segment related to the target physical device includes: the first network node assigning a first virtual address segment to the target physical device to obtain the first virtual address address information of the segment; the first network node obtains the address information of the second virtual address segment allocated by the second network node to the target physical device.
  • the first network node may actively acquire address information of the second virtual address segment, or receive address information of the second virtual address segment sent by the second network node.
  • Configuring the address mapping relationship according to the address information of the virtual address segment includes: establishing and storing the first address mapping relationship by the first network node based on the address information of the second virtual address segment; The network node sends the address information of the first virtual address segment to the second network node, so that the second network node maintains the second address mapping relationship.
  • maintaining includes at least one of establishing and storing.
  • determining the address information of the virtual address segment related to the target physical device includes: the second network node assigning a second virtual address segment to the target physical device to obtain the second virtual address segment address information; the second network node obtains address information of the first virtual address segment allocated by the first network node to the target physical device.
  • the configuring the address mapping relationship according to the address information of the virtual address segment includes: establishing and storing the second address mapping relationship by the second network node based on the address information of the first virtual address segment; The second network node sends the address information of the second virtual address segment to the first network node, so that the first network node maintains the first address mapping relationship.
  • both the first network node and the second network node comprise bus end devices.
  • the first bus terminal device in the first network node is used to communicate with the second network node by using the first address mapping relationship
  • the second bus terminal device in the second network node is used to use the second address mapping relationship A relationship is communicated with the first network node.
  • the first address mapping relationship is a mapping relationship between the physical address space corresponding to the first bus terminal device in the first network node and the second virtual address segment.
  • the first address mapping relationship may be stored by the first bus end device.
  • the second address mapping relationship is a mapping relationship between the physical address space corresponding to the second bus terminal device in the second network node and the first virtual address segment.
  • the second address mapping relationship may be stored by the second bus end device.
  • the physical address space in a network node is divided into two parts, one part corresponds to local physical devices, and the other part corresponds to non-local physical devices (ie, physical devices in other network nodes).
  • the physical devices include but are not limited to storage devices such as memory and peripheral devices such as high-speed peripheral component interconnect express (PCIe) devices.
  • PCIe peripheral component interconnect express
  • the part of the physical address space corresponding to the non-local physical device is in the charge of the bus-side device.
  • the bus-side When receiving an access request containing a virtual address and the physical address corresponding to the virtual address belongs to the physical address space in charge of the bus-side device, the bus-side The device forwards the access request to a non-local physical device.
  • the first network node may specify which virtual address in the virtual address space of the first network node the target physical device in the second network node accesses.
  • the second network node cannot recognize the virtual address in the virtual address space of the first network node, it is necessary to convert the virtual address in the virtual address space of the first network node into an input and output virtual address that the second network node can recognize (input output virtual address, IOVA) address, and then send the IOVA address to the second network node. Therefore, the address translation relationship between the IOVA segment and the first virtual address segment in the second network node also needs to be configured in the first network node.
  • the manner of configuring the address translation relationship includes: receiving address information of an IOVA segment from the second network node, where the IOVA segment belongs to the input-output virtual address space corresponding to the target physical device in the second network node, and the The IOVA segment corresponds to the first virtual address segment; according to the address information of the IOVA segment, the address translation relationship between the first virtual address segment and the IOVA segment is saved.
  • both the first virtual address segment and the IOVA segment are virtual address segments and contain continuous virtual addresses, so the address translation relationship may be the start address of the first virtual address segment and the start address of the IOVA segment The offset between addresses, and the offset is constant. In this way, the first network node can quickly convert the local virtual address into the IOVA address in the second network node, thereby improving processing efficiency.
  • multiple address translation relationships are stored in the first network node, and the first virtual address segment and the IOVA segment corresponding to different address translation relationships are all different.
  • the address translation relationship is implemented as an offset, the offsets corresponding to different address translation relationships may be equal or unequal.
  • the first virtual address segment includes a first sub-address segment and a second sub-address segment
  • the first sub-address segment is used for the target physical device to initiate an access request based on direct memory access, so
  • the second subaddress segment is used for the target physical device to initiate an interrupt request.
  • the first network node determines the target physical device by: sending a device acquisition request to the controller, where the device acquisition request is used to request the controller to allocate a physical device; receiving a device indication sent by the controller information, the device indication information is used to instruct the controller to assign the target physical device to the first network node according to the device acquisition request, so that the first network node can determine the target physical device according to the device indication information equipment.
  • the second network node may determine the target physical device in any of the following ways: first, receiving a device creation request sent by the first network node, where the device creation request includes an indication of the target physical device Information; determine the target physical device according to the device creation request; the second type is to receive the allocation information sent by the controller, the allocation information includes the indication information of the target physical equipment and the indication information of the first network node, and the allocation information is used to instruct the controller Allocating the target physical device to the first network node; determining the target physical device according to the allocation information.
  • information of multiple device resources is stored in the controller, and each device resource is a physical device. These physical devices belong to one or more network nodes.
  • the controller is used to uniformly manage these physical devices, including adding, deleting, allocating and reclaiming physical devices, so as to realize device resource pooling.
  • the present application provides a method for processing an access request, which is applied to a source network node.
  • the method includes: converting a first virtual address into a first physical address, and the first virtual address is the first access request The virtual address in; based on the mapping relationship between the first physical address and the target address, a second access request is sent to the destination network node, the second access request corresponds to the first access request, and the target address mapping relationship is adopted
  • the method configuration provided in the first aspect and any possible implementation thereof; wherein, the source network node is a first network node, the target address mapping relationship is the first address mapping relationship, and the The first access request is an access request initiated by the first network node for the target physical device in the second network node; or, the source network node is the second network node, and the target address mapping relationship is the The second address mapping relationship, the first access request is an access request for the first network node initiated by the target physical device.
  • the first network node when the first network node accesses the local physical device, the first network node first converts the virtual address in the access request into the corresponding physical address, and then sends the access request to the local physical device based on the physical address.
  • the device is the same as the process of the first network node accessing the non-local physical device.
  • the virtual address in the access request initiated by the local physical device is converted into the corresponding physical address, so as to realize the access to the storage medium, instead of the local physical device accessing the first network node.
  • the virtual address in the access request When accessing the storage medium of the network node, the virtual address in the access request is also converted into a corresponding physical address, thereby realizing access to the storage medium. Therefore, by adopting the access request processing method provided in the present application, the first network node can implement unified management of access mechanisms of local physical devices and non-local physical devices.
  • the source network node is a first network node
  • the first access request further includes a target IOVA address
  • the first access request is used to instruct the target physical device to initiate a request for the target IOVA address access
  • the target IOVA address belongs to an IOVA segment
  • the IOVA segment belongs to the input-output virtual address space corresponding to the target physical device in the second network node and corresponds to the first virtual address segment.
  • the first network node stores an address translation relationship between the first virtual address segment and the IOVA segment, and the first network node determines the target IOVA address according to the address translation relationship.
  • the address translation relationship is an offset between the start address of the first virtual address segment and the start address of the IOVA segment, and the offset is a constant.
  • the target virtual address refers to a virtual address in the first virtual address segment.
  • a device for configuring a network node which is applied to a first network node or a second network node, and the device includes: an obtaining module and a configuration module.
  • the determining module is configured to obtain address information of a virtual address segment related to a target physical device, the target physical device is a physical device belonging to the second network node, and the virtual address segment includes a first virtual address segment and a second virtual address segment.
  • a virtual address segment belongs to the virtual address space of the first network node and is used for the target physical device to access the first network node
  • the second virtual address segment belongs to the first network node
  • the virtual address space of the second network node is used for the first network node to access the target physical device.
  • the configuration module is configured to configure an address mapping relationship according to the address information of the virtual address segment, the address mapping relationship is used for transmission of an access request related to the target physical device, and the address mapping relationship includes a first address mapping relationship and a second address mapping relationship, the first address mapping relationship is the mapping relationship between the physical address space of the first network node and the second virtual address segment, the second address mapping relationship is the first The mapping relationship between the physical address space of the second network node and the first virtual address segment.
  • an access request processing device which is applied to a source network node, and the device includes: a converting module and a sending module.
  • the conversion module is used for converting the first virtual address into the first physical address, and the first virtual address is the virtual address in the first access request.
  • the sending module is configured to send a second access request to the destination network node based on the mapping relationship between the first physical address and the target address, the second access request corresponds to the first access request, and the target address mapping relationship adopts the first The method configuration described in one aspect and its possible implementation manners.
  • the source network node is a first network node
  • the target address mapping relationship is the first address mapping relationship
  • the first access request is initiated by the first network node for the second network node or
  • the source network node is a second network node
  • the target address mapping relationship is the second address mapping relationship
  • the first access request is initiated by the target physical device The access request for the first network node.
  • a computer device in a fifth aspect, includes a processor and a memory, wherein: computer instructions are stored in the memory, and the processor executes the computer instructions, so as to realize the first aspect or the second aspect and its possible implementation manners method.
  • a computer-readable storage medium stores computer instructions.
  • the computer device executes the first aspect or the second aspect. Aspects and their possible ways of implementing them.
  • a computer program product containing instructions, which, when running on a computer device, causes the computer device to execute the method of the first aspect or the second aspect and possible implementations thereof.
  • a chip including a processing circuit and an interface circuit, the interface circuit is interconnected with the processing circuit through a line, and the interface circuit is used to receive a signal from a storage medium and send the signal to the processing circuit.
  • the signal includes computer instructions stored in the storage medium; when the computer instructions are executed by the processing circuit, the processing circuit is made to execute the method of the first aspect or the second aspect and possible implementations thereof.
  • a communication system including a first network node and a second network node. Both the first network node and the second network node are configured to configure the address mapping relationship in a manner corresponding to the first aspect and its possible implementation manners.
  • the first network node and the second network node are further configured to initiate an access request related to the target physical device in a manner corresponding to the second aspect and possible implementation manners thereof.
  • FIG. 1 is a schematic diagram of a network architecture of an application scenario provided by an exemplary embodiment of the present application
  • Fig. 2 is a schematic structural diagram of a network node provided by an exemplary embodiment of the present application
  • Fig. 3 is a schematic diagram of a method for configuring a network node provided by an exemplary embodiment of the present application
  • Fig. 4 is a schematic diagram of a device allocation process provided by an exemplary embodiment of the present application.
  • Fig. 5 is a flow chart of a method for processing an access request provided by an exemplary embodiment of the present application
  • FIG. 6 is a schematic diagram of an address translation process in the device access method shown in FIG. 5;
  • Fig. 7 is a flowchart of another access request processing method provided by an exemplary embodiment of the present application.
  • FIG. 8 is a schematic diagram of an address translation process in the device access method shown in FIG. 7;
  • FIG. 9 is a schematic structural diagram of an apparatus for configuring a network node provided in an exemplary embodiment of the present application.
  • Fig. 10 is a schematic structural diagram of another access request processing device provided by an exemplary embodiment of the present application.
  • Fig. 11 is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application.
  • Network node A device that has at least one of the functions of processing data and storing data.
  • the network node may be a complete physical machine, or may be, for example, a gateway or a switching device.
  • the physical machine refers to a computer packaged into a product, for example, a server or a terminal.
  • Terminals may include desktop, laptop, handheld, vehicle-mounted user equipment (UE) equipment, etc., such as smart phones, desktop computers, tablet computers, smart TVs, smart TV boxes, ultra-mobile personal computers (ultra- mobile personal computer (UMPC), notebook computer, personal digital assistant (personal digital assistant, PDA), portable multimedia player (portable multimedia player, PMP), dedicated media player, consumer communication device, wearable device (such as smart watch ), augmented reality (augmented reality, AR) equipment, or other types of communication equipment such as virtual reality (virtual reality, VR) equipment.
  • UE vehicle-mounted user equipment
  • a physical device in a network node refers to a component or component in a network node.
  • the physical device may be a peripheral device, such as a PCIe device.
  • Physical devices include but are not limited to accelerators and network communication devices.
  • the accelerator includes but not limited to application specific integrated circuits (ASICs), field programmable gate array (field programmable gate array, FPGA), graphics processing unit (graphics processing unit, GPU) and digital signal processor (digital signal processor, DSP) and so on.
  • Network communication devices include but are not limited to network cards, optical connectors, or other transmitters, receivers, or transceivers.
  • the global refers to a group of nodes that are deployed with the bus end devices described in the embodiments of this application and can read and write data with each other using the methods described in the embodiments of this application.
  • the embodiment of the present application does not limit the position and range of this group of nodes in the actual space.
  • the set of nodes can be within a data center or across data centers, or within an enterprise campus or across cities or countries.
  • Address space It can also be called storage space, which refers to one or more segments of addresses that can be used by a certain device or instance.
  • the virtual address space of a certain device or instance can be used by the device or instance, that is, one or more virtual addresses belonging to the device or instance.
  • the virtual address space of a certain device or instance is allocated by the operating system where the device or instance resides.
  • the physical address space of a device or instance is one or more segments of physical addresses allocated to the device or instance. When the device or instance uses this physical address space, other devices or instances cannot use this physical address space. address.
  • the physical address space of an instance is allocated by the operating system that runs the instance. This allocation may be dynamic, for example, as the instance runs, the occupied physical address space becomes larger and larger, but there will be an upper limit.
  • a device's physical address space is usually fixed in size and extent.
  • An instance is a software module that can run an application program or a system program, and the software module can only be called an instance when it is run by the operating system, otherwise, it is just a piece of code.
  • instances There are many forms of instances, for example, processes and threads can be understood as a type of instance. Instances run on nodes.
  • CPU Central processing unit
  • MMU memory management unit
  • Peripheral address management mechanism The device accesses the unit in the memory through the virtual address, and the input/output memory management unit (IOMMU) converts the received virtual address according to the mapping relationship between the virtual address and the physical address. It is converted into a physical address, so that the peripheral device can access the memory space corresponding to the physical address.
  • IOMMU input/output memory management unit
  • Direct memory access A working method in which input/output (I/O) exchanges are performed entirely by hardware.
  • I/O input/output
  • the DMA control device sends address and control signals to the memory, modifies the address, counts the number of words transferred, and reports the end of the transfer operation to the CPU in an interrupt manner.
  • Bus The bus in the related art is the internal structure of the computer, and is a public communication trunk for transmitting information between various functional components in the computer.
  • the computer bus can be divided into data bus, address bus and control bus, which are used to transmit data, data address and control signals respectively.
  • the bus is the abbreviation of high performance interconnect bus (high performance interconnect bus, HPIB).
  • HPIB high performance interconnect bus
  • Each computer is connected to a high-performance interconnection bus through a bus terminal device, which is equivalent to a communication module such as a network card or a baseband antenna in network technology.
  • This application does not describe in detail the specific structures of the HPIB and the bus terminal devices, as long as the request for reading data or writing data can be processed.
  • Memory semantics refers to the communication instructions used in a physical machine when communicating between devices connected through a bus. This kind of communication is also called bus communication, which is the communication between different instances or devices belonging to the same operating system, so there is no need to use network communication technology. For example, load/store instructions are typical memory semantics.
  • the current communication technology can be divided into network communication and bus communication.
  • the information interaction involved in communication can be the transmission of data or the transmission of instructions.
  • Network communication is used for communication between the local device and the remote device.
  • the transmitted message is usually encapsulated by the protocol stack in the operating system and uses the network communication protocol.
  • the send/receive (send/receive) command in network communication technology, or the read/write (read/write) command of remote direct memory access (RDMA) is usually used to transmit information.
  • RDMA remote direct memory access
  • Bus communication is used in a device to communicate between devices connected through the bus.
  • Bus communication uses memory semantics (such as load/store instructions) to transfer information. This kind of memory semantics does not have the above-mentioned restrictions, and the communication speed of bus communication is faster than that of network communication.
  • the present application proposes a method for accessing target devices based on virtual address addressing, and realizes calling target physical devices across network nodes in a manner based on memory semantics.
  • Fig. 1 is a schematic diagram of a network architecture of an application scenario provided by an exemplary embodiment of the present application.
  • the network shown in FIG. 1 includes a plurality of network nodes 10 .
  • the network nodes 10 are connected in communication.
  • the application scenario may be a cloud computing scenario or a distributed computing scenario.
  • a program in one network node initiates a computing task or other tasks, and the computing task needs to be completed jointly by multiple network nodes 10 .
  • the network further includes a controller (not shown in the figure), and the controller is connected to each network node 10 through a network.
  • the controller is used to obtain and maintain information of physical devices of each network node 10, and perform unified management on the physical devices of each network node 10, such as allocation and recycling.
  • the functions of the aforementioned controller are integrated in a certain network node 10 .
  • Fig. 2 is a schematic structural diagram of a network node provided by an exemplary embodiment of the present application.
  • a network node includes hardware and software. It should be understood that the architecture indication shown in FIG. 2 is for ease of understanding and does not limit the architecture that can be used by the network nodes in this application. Other software parts (such as an operating system) and other hardware parts (such as a display, etc.) in the network node are not shown.
  • the hardware part includes a central processing unit (CPU) 101, a memory 102, an MMU 103, an IOMMU 104 and a bus end device 105.
  • the CPU 101 , the memory 102 and the bus terminal 105 are connected through a bus.
  • the processor 101 and the MMU 103 generally, the two are packaged into one chip.
  • the processor 101 runs the application and initiates a request for reading data or writing data, which may also be called a memory access request, that is, a request for accessing a storage medium, because reading data or writing data must find a storage medium (such as a memory) address.
  • the MMU is responsible for the address translation of the memory access request initiated by the CPU, that is, converting the virtual address in the memory access request into a physical address.
  • Memory 102 In FIG. 2, the memory is taken as an example to illustrate the storage medium on the node, and the physical form of the memory may be a memory stick. In the method of this application, in addition to being provided to local instances (such as processes), the memory can also be used by instances of other nodes. data, or requests to read data in that memory.
  • IOMMU104 The function is similar to that of MMU103, but IOMMU is responsible for address translation of memory access requests of hardware other than the CPU. For example, if the hardware is a memory, the memory access request is used to request to write data to the memory, or to request to read data in the memory.
  • the hardware other than the CPU can also be other devices with DMA.
  • Bus end device 105 also referred to as end point (EP), which is used for the network node to access the high-performance interconnection bus, and functions as a network card.
  • the bus terminal device is usually a hardware module with address translation function, similar to the network card, the bus terminal device also needs a driver installed in the operating system of the network node, so that the operating system of the network node can use it.
  • a network node can include multiple bus terminal devices, just as multiple network cards can be installed in a network node.
  • a network node can include both the bus end device and the network card.
  • the network card is not shown in FIG. 2 , but only the bus terminal device is schematically indicated.
  • this node can also only include bus-side devices.
  • one end of the bus end device can be connected to the CPU, memory or MMU, and the other end can be connected to the high-performance bus or the switch of the high-performance bus.
  • the physical device is an I/O device that supports memory semantics.
  • the device includes a management unit and a data processing unit.
  • the management unit is used to handle the device configuration operations initiated by the software.
  • the data processing unit is used to process data operations initiated by the device, for example, software-visible DMA operations and interrupt operations.
  • Program codes such as application programs, virtual device constructors (vdev constructor), virtual device drivers, and bus terminal device drivers run in the network nodes.
  • the application program refers to the application program that needs to use the device, and obtains the right to use the target device by applying to the controller.
  • the target device may be a device of a network node where the application program is located, or a device of a network node other than the network node where the application program is located.
  • the virtual device constructor is used to build local virtual devices according to the needs of the application.
  • Virtual device drivers are used to manage virtual devices.
  • the driver of the bus terminal device is a software module used to drive the hardware module of the bus terminal device in the kernel of the operating system (Operation System, OS) running on the network node.
  • the driver has the same ability as other hardware drivers, enabling the operating system to sense and use the corresponding hardware.
  • the driver is also used to configure, or update the address mapping relationship used by the bus-side device.
  • Fig. 3 is a configuration method of a network node provided by an exemplary embodiment of the present application.
  • the application node is the first network node
  • the device node is the second network node.
  • Both the first network node and the second network node are any one of the network nodes in FIG. 1 .
  • the method includes the following processes.
  • the controller maintains the device resource pool.
  • the device resource pool includes multiple devices, and these devices in the device resource pool belong to one or more network nodes.
  • Maintaining the device resource pool includes managing the information of each device in the device resource pool.
  • the information of the device includes the identifier of the network node where the device is located, the identifier of the device, the identifier of the bus terminal device in the network node where the device is located, and the like.
  • the identifier of the network node includes, but is not limited to, an Internet protocol (internet protocol, IP) address or a media access control (media access control, MAC) address of the network node.
  • the identification of the device includes but not limited to the serial number of the device, as long as the device can be uniquely identified in the device resource pool.
  • the identifier of the bus end device includes but not limited to the serial number of the bus end device, as long as the bus end device can be uniquely identified globally.
  • the device information further includes at least one of device attribute information and network configuration information.
  • the device attribute information includes at least one of device type, device memory size, device computing capability, and number of input and output units.
  • the device type includes but is not limited to a network card, an accelerator, and an x-processing unit (x-processing unit, XPU) (such as a GPU).
  • the device memory size is determined by the device type and device configuration, and is not limited here.
  • Device computing capabilities include, but are not limited to, the number of cores.
  • the number of input and output units includes, but is not limited to, the context (context) of the GPU and the number of queues of the network card.
  • the network configuration information includes at least one of bandwidth and delay of the network node to which the device belongs.
  • the information of the device further includes: status information of the device, where the status information of the device is used to indicate whether the device is occupied.
  • the information of the device also includes the identifier of the network node occupying the device and the like.
  • the controller maintains the device resource pool according to the device information reported by each network node. That is, the step 200 includes: the controller receives the device information sent by each network node; and updates the device information in the device resource pool according to the received device information.
  • the bus driver of the network node will monitor the device hot plug event. After the bus driver detects the device hot plug event, it will send device change information to the device management process of the network node, and the network node will send the device change information to the controller through the device management process.
  • the device change information is used to indicate adding and/or deleting a device.
  • the device management process is a user mode device management process in the operating system.
  • the device management process is a virtual device (udev) daemon process in the Linux system.
  • the application node sends a device acquisition request to the controller.
  • the application node refers to the network node where the instance that initiates the task is located. This instance is usually run by the CPU of the application node.
  • the device get (GET_DEVICE) request is used to request the controller to allocate a device.
  • the device acquisition request carries device description information.
  • the device description information includes at least one of device attribute information, network configuration requirements, and preference settings.
  • the network configuration requirements include at least one of bandwidth requirements and delay requirements. Preferences include local only or any. Wherein, only locally means a device requesting an application node, and arbitrarily means a device requesting an application node or a device of another network node other than the application node.
  • the instance invokes a GET_DEVICE application programming interface (application programming interface, API), and sends the device description information to the controller as a function parameter of the GET_DEVICE API, so as to send a device acquisition request to the controller.
  • API application programming interface
  • the controller receives the device acquisition request.
  • the controller allocates a device to the application node according to the device acquisition request.
  • the device assigned to the application node is the target device.
  • Fig. 4 is a schematic diagram of a device allocation process provided by an exemplary embodiment of the present application. As shown in Figure 4, in some examples, the controller allocates devices to application nodes as follows:
  • the controller determines an available device from the device resource pool according to the device description information, and the available device is a device that matches the device description information in the device acquisition request;
  • the selection strategy is a default strategy, and the default strategy is to select a target device according to network configuration information, for example, the device with the lowest delay is used as the target device. For another example, the device with the largest bandwidth is used as the target device.
  • selection policies are generated based on preferences.
  • an available device that satisfies the set condition is selected as the target device. For example, if the preference is set to local only, and the setting condition is the lowest latency, the device that belongs to the application node and has the lowest latency is selected from multiple available devices as the target device.
  • the selection strategy above is only an example, and the present application does not limit the selection strategy, as long as the target device can be determined.
  • the controller sends a first response to the application node.
  • the application node receives the first response.
  • the first response includes indication information of the target device.
  • the target device is the device assigned to the application node.
  • 203 may be replaced by the controller sending a second response to the application node , the second response is used to indicate that the device failed to acquire. If the application node receives the second response, it resends the device acquisition request to the controller, or exits the current process.
  • the second response does not include the indication information of the target device.
  • the application node After the application node receives the first response or the second response, it will generate the return value of the GET_DEVICE API according to the received response, and complete the call of the GET_DEVICE API.
  • the return value includes a device pointer and an operating status value.
  • the device pointer in the return value corresponding to the first response, the device pointer is used to point to the target device, and the operation status value is used to indicate that the device acquisition request is successful, for example, the operation status value is SUCCESS.
  • the device pointer In the return value corresponding to the second response, the device pointer is undefined, that is, the device pointer is empty, and the operation status value is used to indicate that the device acquisition request failed, for example, the operation status value is FAILURE.
  • the application node sends address information of the first virtual address segment corresponding to the target device to the device node according to the first response.
  • the first virtual address segment belongs to the virtual address space of the first network node and is used for the target physical device to access the first network node.
  • the application node may include: the application node allocates the first virtual address segment to the target device according to the first response, so as to obtain address information of the first virtual address segment; and sends the address information of the first virtual address segment corresponding to the target device to the device node.
  • the application node may allocate the first virtual address segment to the target device from the virtual address space corresponding to the instance.
  • the first virtual address segment includes a first sub-address segment and a second sub-address segment
  • the first sub-address segment is used for the target physical device to initiate a DMA-based access request, which can be called is a DMA memory segment
  • the second subaddress segment is used for the target physical device to initiate an interrupt request, and may be called an interrupt memory segment.
  • the DMA memory segment includes a DMA IO virtual address, which is used for subsequent DMA read and write operations initiated by the target device.
  • the interrupt memory segment includes an interrupt vector table based on memory semantics, which is used for the target device to subsequently initiate an interrupt to the application node.
  • the interrupt vector table is a message signal interrupt (message signal interrupt, MSI) or MSI-X interrupt vector table.
  • MSI-X is the extension and enhancement of MSI.
  • the interrupt vector table refers to a specific memory area for storing interrupt vectors.
  • the address information of the virtual address segment includes the first address of the virtual address segment and the length of the virtual address segment; or, the address information of the virtual address segment includes the first address and the last address of the virtual address segment.
  • the application node after receiving the first response, the application node will send a memory region creation (memory region, MR) request to the controller, and receive the MR information returned by the controller, and the MR information is used to indicate the target device corresponding mr.
  • MR memory region creation
  • the application node sends the address information of the DMA memory segment and the address information of the interrupt memory segment to the controller.
  • Both the DMA memory segment and the interrupt memory segment are part of the MR, so that the address information of the DMA memory segment and the address of the interrupt memory segment Information is registered in this MR.
  • Subsequent device nodes will obtain the address information of the DMA memory segment and the address information of the interrupt memory segment by accessing the MR. So far, the address information of the DMA memory segment and the address information of the interrupt memory segment are sent to the device node.
  • the MR is a logical or code-level concept, representing a segment of continuous virtual addresses.
  • the MR is globally visible, that is, all network nodes are accessible.
  • the controller is used to maintain the directory of MRs, for example including the start addresses and lengths of multiple MRs.
  • the MR directory records multiple MRs in the domain where the controller is located, so that the controller can uniformly manage the MRs in the domain.
  • An MR can be divided into multiple memory segments (memory segment, MS).
  • MS can be identified by offset and length.
  • the offset refers to the offset of the MS relative to the start address of the MR
  • the length refers to the length of the MS, that is, the size of the memory segment.
  • Each MS corresponds to a section of physical memory whose length is equal to the length of the MS.
  • the application node may send an MR creation request to the controller through the virtual device construction process vdev constructor.
  • the application node sends a device creation request to the device node, and the device creation request includes MR information and indication information of the target physical device; correspondingly, the device node receives the device creation request.
  • the device node obtains the address information of the first virtual address segment from the MR indicated by the MR information.
  • the device node opens the MR indicated by the MR information through the vdev constructor, so as to obtain the address information of the first virtual address segment.
  • the application node after receiving the first response, directly sends the address information of the first virtual address segment to the device node.
  • the device node receives address information of the first virtual address segment.
  • the device node maps the first virtual address segment into the physical address space of the device node.
  • the device node maintains the second address mapping relationship according to the received address information of the first virtual address segment, for example, establishes and saves at least one of the second address mapping relationship, the second address mapping relationship is the A mapping relationship between the physical address space and the first virtual address segment.
  • the device node stores the second address mapping relationship in the bus end device of the device node.
  • the first physical address segment corresponding to the subsequent DMA memory segment and the interrupt memory segment will be in charge of the bus end device.
  • the target physical device initiates a request to access the first virtual address segment (such as a DMA memory segment or an interrupt memory segment), it will be forwarded to the bus end device.
  • the second address mapping relationship is a mapping relationship between a physical address space corresponding to a bus terminal device of a device node in the device node and the first virtual address segment.
  • a fourth address mapping relationship is stored in the IOMMU of the device node, and the fourth address mapping relationship is a mapping relationship between the IOVA space corresponding to the target device and the physical address space of the device node.
  • the IOMMU converts the IOVA address corresponding to the received access request to obtain the physical address belonging to the first physical address segment, it can forward the access request to the bus end device.
  • the device node sends address information of the second virtual address segment to the application node.
  • the second virtual address segment belongs to the virtual address space of the second network node and is used for the first network node to access the target physical device.
  • the device node assigns the second virtual address segment to the target device to obtain address information of the second virtual address segment; and sends the address information of the second virtual address segment corresponding to the target device to the application node.
  • the second virtual address segment is used for writing configuration operations for the target device, and may also be referred to as a configuration space memory segment.
  • the device node may obtain the address information of the configuration space memory segment through the management driver of the target device.
  • the application node actively acquires address information of the second virtual address segment. For example, the device node sends the address information of the second virtual address segment to the application node, including: the device node writes the address information of the second virtual address segment into the corresponding MR, and the application node accesses the MR to obtain the second virtual address segment address information.
  • the device node may also directly send the address information of the second virtual address segment to the application node.
  • the application node receives address information of the second virtual address segment.
  • the device node also sends the address information of the IOVA segment to the application node.
  • the address information of the IOVA segment is, for example, the start address of the IOVA segment.
  • the IOVA segment belongs to the IOVA space corresponding to the target physical device in the second network node, and corresponds to the first virtual address segment.
  • the device node carries the address information of the second virtual address segment and the address information of the IOVA segment in the response to the aforementioned device creation request and sends it to the application node.
  • the device node sends the response to the vdev constructor of the application node through the vdev constructor.
  • the application node maps the second virtual address segment into the physical address space of the application node.
  • the application node maintains the first address mapping relationship according to the received address information of the second virtual address segment, for example, creates and saves at least one of the first address mapping relationship
  • the first address mapping relationship is the application node's A mapping relationship between the physical address space and the second virtual address segment.
  • the application node stores the first address mapping relationship in the bus terminal device of the application node.
  • the first address mapping relationship is a mapping relationship between the physical address space corresponding to the bus terminal device of the application node in the application node and the second virtual address segment.
  • a third address mapping relationship is stored in the MMU of the application node, and the third address mapping relationship is an address mapping relationship between the virtual memory address space corresponding to the instance and the physical address space of the application node.
  • the application node saves the address translation relationship between the first virtual address segment and the IOVA segment according to the address information of the IOVA segment.
  • the address translation relationship is an offset between the start address of the first virtual address segment and the start address of the IOVA segment, and the offset is a constant.
  • the vdev of the application node can save the offset, and efficiently convert the local virtual address into a virtual address recognizable by the target device during IO operations, improving processing efficiency.
  • the target IOVA address can be obtained by adding the target virtual address to the offset, and the conversion efficiency is high.
  • the target virtual address refers to a virtual address in the first virtual address segment.
  • multiple address translation relationships are stored in the application node, and the first virtual address segment and the IOVA segment corresponding to different address conversion relationships are all different.
  • the address translation relationship is implemented as an offset, the offsets corresponding to different address translation relationships may be equal or unequal.
  • the application node constructs a virtual device corresponding to the target device.
  • the vdev constructor of the application node makes the device bus discover the virtual device through bus re-enumeration (rescan), and loads the corresponding driver of the virtual device.
  • the driver of the virtual device can uniformly manage local or remote devices.
  • the application node has completed the creation of the virtual device corresponding to the target device and the establishment of the memory-based address mapping relationship. Subsequently, the application node can access the target device based on the address mapping relationship, and the target device can also access the application node based on the address mapping relationship.
  • the device node and the application node are different network nodes.
  • the device node and the application node may be the same network node, and the target device belongs to the application node, that is, the instance calls the The devices of the network nodes complete computing tasks.
  • the application node needs to register the address information of the first virtual address segment and the second virtual address segment corresponding to the target device in the MR.
  • the embodiment of the present application also provides a method for processing an access request. This method is realized based on the address mapping relationship established above.
  • Fig. 5 is a schematic diagram of a method for processing an access request provided by an exemplary embodiment of the present application.
  • the application node is a first network node, which may also be called a source network node
  • the device node is a second network node, which may also be called a destination network node.
  • the method includes:
  • the application node obtains a first access request.
  • the first access request includes a first virtual address.
  • the first virtual address is an address in the virtual address space corresponding to the process of the application program.
  • the first access request is used to write configuration operation data into the address space corresponding to the target device in the device node, so as to perform configuration operations on the target device.
  • Configuration operations include but not limited to device initialization (interrupt vector configuration) and IO operation configuration (DMA descriptor and payload configuration), etc.
  • the first access request carries a target IOVA address.
  • the first access request is used to instruct the target physical device to initiate access to the target IOVA address, that is, the first access request is used to instruct the target device to write data or read data to the target IOVA address.
  • the IOVA segment belongs to the IOVA address space corresponding to the target physical device in the device node, and corresponds to the first virtual address segment (for example, corresponds to the DMA memory segment), so the The first access request essentially instructs the target device to write data to or read data from a certain virtual address in the first network node.
  • the method further includes: determining the target IOVA address according to the address translation relationship between the first virtual address segment and the IOVA segment, so as to carry the target IOVA address in the second An access request is in progress.
  • the address translation relationship refer to the foregoing step 208, and a detailed description is omitted here.
  • the application node translates the first virtual address into the first physical address.
  • 302 includes: the CPU of the application node sends the first access request to the MMU of the application node; the MMU of the application node converts the first virtual address into the first physical address.
  • a third address mapping relationship is stored in the MMU of the application node, and the third address mapping relationship is an address mapping relationship between the virtual address space corresponding to the instance and the physical address space of the application node.
  • the MMU of the application node converts the first virtual address into the first physical address according to the third address mapping relationship.
  • the physical address space of the application node includes two types of physical address segments, the first type of physical address segment corresponds to the local device of the application node, and the second type of physical address segment corresponds to the non-local device.
  • the second type of physical address segment is hereinafter referred to as the first physical address segment.
  • the first physical address segment is a segment of physical address in charge of the bus end device of the application node.
  • the application node When the first physical address belongs to the first physical address segment, the application node sends a second access request based on the first physical address.
  • 303 includes:
  • the MMU of the application node sends the first access request to the bus end device of the application node.
  • the first access request carries a first physical address. Since the first physical address belongs to the first physical address segment, the MMU sends the first access request carrying the first physical address to the bus end device of the application node through the internal bus of the application node. Correspondingly, the bus end device of the application node receives the first access request.
  • the bus terminal device of the application node converts the first physical address into the second virtual address based on the first address mapping relationship.
  • the second virtual address is the virtual address corresponding to the target device in the device node, that is, the virtual address in the aforementioned configuration space memory segment (ie, the second virtual address segment).
  • the bus terminal device of the application node stores a first address mapping relationship, and the first address mapping relationship is an address mapping relationship between the first physical address segment and the configured memory segment in the device node.
  • the bus end device of the application node sends the second access request to the device node.
  • the second access request carries the second virtual address.
  • the corresponding access type of the second access request is the same as that of the first access request. Access types include reading data or writing data.
  • the bus end device of the device node receives the second access request.
  • the second access request may also include the identifier of the bus end device of the device node.
  • the identifier of the bus end device is equivalent to the bus address, so that the second access request can be sent to the destination end.
  • a terminal device identifier identifies a terminal device and is unique within a certain domain. Therefore, the identifier of the bus terminal device in a certain domain can also be called the global identifier (global identifier, GID) in this domain.
  • GID global identifier
  • the bus terminal device identifier can be configured to be globally unique. In this way, it is equivalent to specifying which bus end device the second access request should be received by. Since a node may include multiple bus end devices, the node identifier is not used.
  • the identifiers of the bus end devices may be uniformly assigned in a domain by a controller (for example, controller 1001).
  • the device node translates the second virtual address into a second physical address.
  • 304 includes: after receiving the second access request, the bus end device of the device node sends the second access request to the IOMMU of the device node; the IOMMU of the device node converts the second virtual address into the second physical address.
  • the second physical address is a physical address in the physical address space of the device node.
  • the IOMMU of the device node stores a fourth address mapping relationship, where the fourth address mapping relationship is a mapping relationship between the IOVA space corresponding to the target device in the device node and the physical address space of the device node.
  • the IOMMU of the device node converts the second virtual address into the second physical address according to the fourth address mapping relationship.
  • the device node completes access to the target device according to the second physical address.
  • write configuration operation data into the configuration space of the target device of the device node For example, write configuration operation data into the configuration space of the target device of the device node.
  • the application node can complete the initialization of the target device by accessing the configuration space of the target device, and then call the target device to perform tasks.
  • FIG. 6 is a simplified schematic diagram of the process shown in FIG. 5, showing the address translation process based on the address mapping relationship.
  • the method also includes:
  • the application node obtains a third access request, where the third access request includes a third virtual address
  • the third virtual address is an address in the physical address space of the first network node and does not belong to the first physical address segment;
  • the device in the application node is accessed according to the third physical address.
  • the third access request is initiated by the processor of the application node, and is used to access the local device in the application node; or, the third access request is initiated by the local device, and is used to access the memory of the application node, for example , the third access request includes, but is not limited to, a response to a configuration operation command, a DMA operation command, or an interrupt operation command.
  • Fig. 7 is a schematic diagram of a method for processing an access request provided by an exemplary embodiment of the present application.
  • the application node is a first network node, which may also be called a destination network node
  • the device node is a second network node, which may also be called a source network node.
  • the method includes:
  • the device node obtains the first access request.
  • the first access request carries a first virtual address, and the first virtual address is an address in the virtual address space of the device node.
  • the first access request is initiated by the target device in the device node.
  • the first access request is used to request to write data to the application node or to read data from the application node.
  • the first virtual address is the aforementioned target IOVA address. For related content, refer to 301, and a detailed description is omitted here.
  • the device node translates the first virtual address into the first physical address.
  • a fourth address mapping relationship is stored in the IOMMU of the device node, and the fourth address mapping relationship is a mapping relationship between the IOVA space corresponding to the target device and the physical address space of the device node.
  • 402 includes: the IOMMU of the device node translates the first virtual address into the first physical address according to the fourth address mapping relationship.
  • the physical address space of the device node includes two types of physical address segments.
  • the first type of physical address segment corresponds to the local devices of the device node (including peripheral devices and memory, etc.), and the second type of physical address segment corresponds to the non-local devices of the device node.
  • the second physical address segment is a segment of physical address in charge of the bus end device of the device node.
  • the device node When the first physical address belongs to the second physical address segment, the device node sends a second access request based on the first physical address.
  • 403 includes:
  • the IOMMU of the device node sends the first access request to the bus terminal device of the device node.
  • the first access request carries the first physical address. Since the first physical address belongs to the second physical address segment, the IOMMU sends the first access request carrying the first physical address to the bus end device of the device node through the internal bus of the device node. Correspondingly, the bus end device of the device node receives the first access request.
  • the bus end device of the device node converts the first physical address into the second virtual address.
  • the second virtual address is the virtual address in the virtual address segment (ie the first virtual address segment) related to the target device in the application node, that is, the virtual address in the aforementioned DMA memory segment or interrupt memory segment.
  • a second address mapping relationship is stored in the bus end device of the device node, and the second address mapping relationship is a mapping relationship between the physical address space of the device node and the first virtual address segment.
  • the bus end device of the application node converts the first physical address into the second virtual address according to the second address mapping relationship.
  • the bus end device of the device node sends the second access request to the application node.
  • the corresponding access type of the second access request is the same as that of the first access request. Access types include reading data or writing data.
  • the bus end device of the application node receives the second access request.
  • the application node translates the second virtual address into a second physical address.
  • 404 includes: the bus terminal device of the application node sends the second access request to the IOMMU of the application node; and the IOMMU of the application node converts the second virtual address into the second physical address.
  • the second physical address is a physical address in the physical address space of the application node.
  • the IOMMU of the application node stores the fifth address mapping relationship.
  • the fifth address mapping relationship includes an address mapping relationship between the IOVA address space of the application node and the physical address space of the application node.
  • the IOMMU of the application node converts the second virtual address into the second physical address according to the fifth address mapping relationship.
  • the application node completes the memory access of the target device to the application node according to the second physical address.
  • the second access request is a read operation request or a write operation request.
  • the second access request is a synchronous configuration operation response (belonging to a write operation request), and the target device writes the response result to the memory of the application node through Store semantics.
  • the second access request is an asynchronous DMA write operation request.
  • the target device writes the result to the memory of the application node through asynchronous Write semantics.
  • the second access request is an asynchronous DMA read operation request.
  • the target device reads the result from the memory of the application node to the memory of the device node through asynchronous Read semantics.
  • the second access request is an asynchronous interrupt request (belonging to a write operation request).
  • the target device writes to the MSI interrupt vector table space specified by the application node.
  • the bus end device of the application node monitors the write operation to this space, and forwards the MSI data to the application node interrupt controller.
  • the interrupt controller interrupts the CPU of the application node.
  • FIG. 8 is a simplified schematic diagram of the process shown in FIG. 7, showing the address translation process based on the address mapping relationship.
  • the memory address-based mapping relationship is used to enable the application node to call the device of the device node, which reduces the delay overhead compared with the RDMA method.
  • the unified management of the local device of the application node and the remote device is conducive to decoupling the physical location of the device and the right to use it, and realizing the sharing of device resources.
  • FIG. 9 is a structural diagram of an apparatus for accessing equipment provided by an embodiment of the present application.
  • the device can be implemented as a part or all of the device through software, hardware or a combination of the two.
  • the device provided in the embodiment of the present application can realize the process of FIG. 3 in the embodiment of the present application, and the device can be applied to a network node, where the network node is a first network node or a second network node.
  • the device includes an obtaining module 901 and a configuration module 902 .
  • the obtaining module 901 is configured to obtain address information of a virtual address segment related to a target physical device, the target physical device is a physical device belonging to the second network node, and the virtual address segment includes a first virtual address segment and a second virtual address segment Two virtual address segments, the first virtual address segment belongs to the virtual address space of the first network node and is used for the target physical device to access the first network node, the second virtual address segment belongs to the The virtual address space of the second network node is used for the first network node to access the target physical device.
  • the configuration module 902 is configured to configure an address mapping relationship according to the address information of the virtual address segment, the address mapping relationship is used for the transmission of the access request related to the target physical device, and the address mapping relationship includes a first address mapping relationship and a second address mapping relationship, the first address mapping relationship is the mapping relationship between the physical address space of the first network node and the second virtual address segment, and the second address mapping relationship is the A mapping relationship between the physical address space of the second network node and the first virtual address segment.
  • the obtaining module 901 is configured to allocate a first virtual address segment to the target physical device, so as to obtain address information of the first virtual address segment; and obtain the second network node Address information of the second virtual address segment allocated for the target physical device.
  • the obtaining module 901 is configured to allocate a second virtual address segment to the target physical device, obtain address information of the second virtual address segment; and obtain the first network node as Address information of the first virtual address segment allocated by the target physical device.
  • the configuration module 902 is configured to establish and store the first address mapping relationship based on the address information of the second virtual address segment; send the first address mapping relationship to the second network node address information of a virtual address segment, so that the second network node maintains the second address mapping relationship.
  • the configuration module 902 is configured to establish and store the second address mapping relationship based on the address information of the first virtual address segment; and send the second address mapping relationship to the first network node Address information of two virtual address segments, so that the first network node maintains the first address mapping relationship.
  • the first network node includes a first bus end device, and the first bus end device is used to communicate with the second network node using the first address mapping relationship, and the first address mapping The relationship is a mapping relationship between the physical address space corresponding to the first bus terminal device in the first network node and the second virtual address segment.
  • the second network node includes a second bus end device, and the second bus end device is used to communicate with the first network node using the second address mapping relationship, where the second address mapping relationship is the The mapping relationship between the physical address space corresponding to the second bus terminal device in the second network node and the first virtual address segment.
  • the device When the device is applied to a first network node, the device further includes: a transceiver module 903, configured to receive address information of an input-output virtual address IOVA segment from the second network node, and the address information of the IOVA segment is used for Indicate the input-output virtual address space corresponding to the target physical device in the second network node, and the IOVA segment corresponds to the first virtual address segment; the configuration module 902 is also configured to address information according to the IOVA segment , storing the address translation relationship between the first virtual address segment and the IOVA segment.
  • a transceiver module 903 configured to receive address information of an input-output virtual address IOVA segment from the second network node, and the address information of the IOVA segment is used for Indicate the input-output virtual address space corresponding to the target physical device in the second network node, and the IOVA segment corresponds to the first virtual address segment
  • the configuration module 902 is also configured to address information according to the IOVA segment , storing
  • the address translation relationship is an offset between the start address of the first virtual address segment and the start address of the IOVA segment, and the offset is a constant.
  • the first virtual address segment includes a first sub-address segment and a second sub-address segment
  • the first sub-address segment is used for the target physical device to initiate an access request based on direct memory access
  • the The second subaddress segment is used for the target physical device to initiate an interrupt request.
  • the apparatus further includes a transceiver module 903, which is configured to send a device acquisition request to the controller, and the device acquisition request is used to request the controller to allocate physical devices; receive the device indication information, where the device indication information is used to indicate the target physical device assigned by the controller to the first network node according to the device acquisition request; the determining module 901 is further configured to determine the Target physical device.
  • a transceiver module 903 which is configured to send a device acquisition request to the controller, and the device acquisition request is used to request the controller to allocate physical devices; receive the device indication information, where the device indication information is used to indicate the target physical device assigned by the controller to the first network node according to the device acquisition request; the determining module 901 is further configured to determine the Target physical device.
  • FIG. 10 is a structural diagram of an apparatus for accessing equipment provided by an embodiment of the present application.
  • the device can be implemented as a part or all of the device through software, hardware or a combination of the two.
  • the device provided in the embodiment of the present application can implement the process in FIG. 5 or 7 in the embodiment of the present application, and the device can be applied to the source network node.
  • the device includes: a conversion module 1001 and a sending module 1002 .
  • the conversion module 1001 is configured to convert a first virtual address into a first physical address, where the first virtual address is the virtual address in the first access request.
  • the sending module 1002 is configured to send a second access request to the destination network node based on the mapping relationship between the first physical address and the target address, the second access request corresponds to the first access request, and the target address mapping relationship is adopted
  • the method configuration described in the first aspect and its possible implementation manners wherein, the source network node is a first network node, the target address mapping relationship is the first address mapping relationship, and the first access request is initiated by the first network node for the second network node or, the source network node is a second network node, the target address mapping relationship is the second address mapping relationship, and the first access request is initiated by the target physical device The access request for the first network node.
  • the source network node is a first network node
  • the first access request further includes a target IOVA address
  • the first access request is used to instruct the target physical device to initiate a request for the target IOVA address access
  • the target IOVA address belongs to an IOVA segment
  • the IOVA segment belongs to the input-output virtual address space corresponding to the target physical device in the second network node and corresponds to the first virtual address segment.
  • the apparatus further includes: a determining module 1003, configured to determine a target IOVA address according to an address translation relationship between the first virtual address segment and the IOVA segment.
  • the address translation relationship is an offset between the start address of the first virtual address segment and the start address of the IOVA segment, and the offset is a constant.
  • each functional module in each embodiment of the present application can be integrated into one In the processor, it may exist separately physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.
  • the integrated module is realized in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for enabling a terminal device (which may be a personal computer, a mobile phone, or a network node, etc.) or a processor (processor) to execute all or part of the steps of the method in each embodiment of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
  • the device access device when the device access device provided in the above embodiment performs device access, it only uses the division of the above-mentioned functional modules as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. That is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the apparatus for accessing devices provided in the above embodiments is based on the same idea as the embodiments of the device accessing method, and its specific implementation process can be found in the method embodiments, and will not be repeated here.
  • FIG. 11 exemplarily provides a possible architectural diagram of a computer device 1100 .
  • the computer device 1100 includes a memory 1101 , a processor 1102 , a communication interface 1103 , a bus 1104 and a bus terminal 1105 .
  • the memory 1101 , the processor 1102 , the communication interface 1103 and the bus terminal device 1105 realize the communication connection with each other through the bus 1104 .
  • the memory 1101 may be a read-only memory (Read Only Memory, ROM), a static storage device, a dynamic storage device or a random access memory (Random Access Memory, RAM).
  • the memory 1101 may store programs, and when the programs stored in the memory 1101 are executed by the processor 1102, the processor 1102 and the communication interface 1103 are used to execute the device access method.
  • the memory 1101 may also store data sets, for example: a part of storage resources in the memory 1101 is divided into a data set storage module for storing address mapping relationships.
  • the processor 1102 may be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a graphics processing unit (graphics processing unit, GPU) or one or more integrated circuit.
  • CPU Central Processing Unit
  • ASIC Application Specific Integrated Circuit
  • GPU graphics processing unit
  • the processor 1102 may also be an integrated circuit chip with signal processing capability. During implementation, part or all of the functions of the network fault analysis device of the present application may be implemented by hardware integrated logic circuits in the processor 1102 or instructions in the form of software.
  • the above-mentioned processor 1102 can also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices , discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processing
  • ASIC application-specific integrated circuit
  • FPGA ready-made programmable gate array
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the memory 1101, and the processor 1102 reads the information in the memory 1101, and combines its hardware to complete part of the functions of the network node configuration device or the access request processing device in the embodiment of the present application.
  • the communication interface 1103 uses a transceiver module such as but not limited to a transceiver to implement communication between the computer device 1100 and other devices or communication networks. For example, the address information of the memory segment and the like may be obtained through the communication interface 1103 .
  • Bus 1104 may include pathways for transferring information between various components of computer device 1100 (eg, memory 1101 , processor 1102 , communication interface 1103 ).
  • the bus end device 1105 is used to communicate with other bus end devices.
  • a computer-readable storage medium stores computer instructions.
  • the computer device executes the above-mentioned The configuration method of the provided network node or the processing method of the access request provided above.
  • a computer program product containing instructions, which, when run on a computer device, causes the computer device to execute the above-mentioned method for configuring a network node or perform the above-mentioned processing of an access request method.
  • a chip including a processing circuit and an interface circuit, the interface circuit is interconnected with the processing circuit through a line, and the interface circuit is used to receive a signal from a storage medium and send a signal to the processing circuit.
  • the circuit sends the signal, the signal includes computer instructions stored in the storage medium; when the computer instructions are executed by the processing circuit, the processing circuit is made to execute the configuration method of the network node or perform the processing of the access request provided above method.
  • a communication system including a first network node and a second network node. Both the first network node and the second network node are configured to configure the address mapping relationship in a manner corresponding to the first aspect and its possible implementation manners.
  • the first network node and the second network node are further configured to initiate an access request related to the target physical device in a manner corresponding to the second aspect and possible implementation manners thereof.
  • all or part may be realized by software, hardware, firmware or any combination thereof, and when software is used, all or part may be realized in the form of a computer program product.
  • the computer program product includes one or more computer instructions, and when the computer program instructions are loaded and executed on the server or terminal, all or part of the processes or functions according to the embodiments of the present application will be generated.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a server or a terminal, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a digital video disk (Digital Video Disk, DVD), etc.), or a semiconductor medium (such as a solid-state hard disk, etc.).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种网络节点的配置和访问请求的处理方法、装置,属于网络技术领域。该方法包括:获得目标物理设备相关的虚拟地址段的地址信息,目标物理设备属于第二网络节点,虚拟地址段包括第一虚拟地址段和第二虚拟地址段,第一虚拟地址段属于第一网络节点的虚拟地址空间且用于供目标物理设备访问第一网络节点,第二虚拟地址段属于第二网络节点的虚拟地址空间且用于供第一网络节点访问目标物理设备;根据虚拟地址段的地址信息,配置地址映射关系,地址映射关系用于与目标物理设备相关的访问请求的传输。

Description

网络节点的配置和访问请求的处理方法、装置
本申请要求于2021年12月31日提交的申请号为202111668414.8、发明名称为“网络节点的配置和访问请求的处理方法、装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及网络技术领域,特别涉及一种网络节点的配置和访问请求的处理方法、装置。
背景技术
在分布式计算场景中,一个计算任务可以由多个网络节点协同完成。例如,发起计算任务的第一网络节点利用第二网络节点中的物理设备来执行任务。
相关技术中,第一网络节点和第二网络节点之间通过能够提供远端直接内存访问(remote direct memory access,RDMA)服务的网络总线连接,利用RDMA技术实现第一网络节点和第二网络节点之间的数据传输。第一网络节点为第二网络节点中的物理设备分配系统内存空间,第二网络节点为自身的物理设备分配系统内存空间,通过RDMA技术实现两个系统内存空间内的数据的同步,从而实现第一网络节点对第二网络节点中物理设备的调用。
然而,该交互方式步骤较复杂,且时延开销较大。
发明内容
本申请提供了一种网络节点的配置和访问请求的处理方法、装置,能够实现跨节点访问物理设备,且有利于降低时延。
第一方面,本申请提供了一种网络节点的配置方法,该方法包括:获得目标物理设备相关的虚拟地址段的地址信息,所述目标物理设备为属于所述第二网络节点的物理设备,所述虚拟地址段包括第一虚拟地址段和第二虚拟地址段,所述第一虚拟地址段属于所述第一网络节点的虚拟地址空间且用于供所述目标物理设备访问所述第一网络节点,所述第二虚拟地址段属于所述第二网络节点的虚拟地址空间且用于供所述第一网络节点访问所述目标物理设备;根据所述虚拟地址段的地址信息,配置地址映射关系,所述地址映射关系包括第一地址映射关系和第二地址映射关系,所述第一地址映射关系为所述第一网络节点的物理地址空间与所述第二虚拟地址段之间的映射关系,所述第二地址映射关系为所述第二网络节点的物理地址空间与所述第一虚拟地址段之间的映射关系。
该方法可以由第一网络节点执行,或者,由第二网络节点执行。
在本申请中,地址映射关系用于与所述目标物理设备相关的访问请求的传输。访问请求用于请求读数据或者请求写数据。例如,由第一网络节点发起的访问请求用于请求向第二网络节点中目标物理设备对应的虚拟地址写数据,又例如,由目标物理设备发起的访问请求用于请求向第一网络节点中目标物理设备对应的虚拟地址读数据或者写数据。
本申请通过配置与目标物理设备相关的地址映射关系,使得网络节点能够基于所配置的 地址映射关系,实现跨网络节点的物理设备的调用。无需使用RDMA技术实现两个网络节点的内存空间内数据的同步,从而减小了时延。
在本申请中,虚拟地址段的地址信息包括该虚拟地址段的首地址和虚拟地址段的长度;或者,虚拟地址段的地址信息包括该虚拟地址段的首地址和尾地址。
在本申请中,与目标物理设备相关的虚拟地址段包括两部分,一部分是第一网络节点为目标物理设备分配的第一虚拟地址段,另一部分是第二网络节点为目标物理设备分配的第二虚拟地址段。
对于第一网络节点而言,获得目标物理设备相关的虚拟地址段的地址信息,包括:所述第一网络节点为所述目标物理设备分配第一虚拟地址段,以得到所述第一虚拟地址段的地址信息;所述第一网络节点得到所述第二网络节点为所述目标物理设备分配的第二虚拟地址段的地址信息。在一些示例中,第一网络节点可以主动获取第二虚拟地址段的地址信息,或者,接收第二网络节点发送的第二虚拟地址段的地址信息。
根据所述虚拟地址段的地址信息,配置地址映射关系,包括:所述第一网络节点基于所述第二虚拟地址段的地址信息,建立并存储所述第一地址映射关系;所述第一网络节点向所述第二网络节点发送所述第一虚拟地址段的地址信息,以使所述第二网络节点维护所述第二地址映射关系。这里,维护包括建立和存储中的至少一种。
第二网络节点获得虚拟地址段的地址信息和配置地址映射关系的方式与第一网络节点类似。对于第二网络节点而言,确定目标物理设备相关的虚拟地址段的地址信息,包括:所述第二网络节点为所述目标物理设备分配第二虚拟地址段,以得到所述第二虚拟地址段的地址信息;所述第二网络节点得到所述第一网络节点为所述目标物理设备分配的第一虚拟地址段的地址信息。
所述根据所述虚拟地址段的地址信息,配置地址映射关系,包括:所述第二网络节点基于所述第一虚拟地址段的地址信息,建立并存储所述第二地址映射关系;所述第二网络节点向所述第一网络节点发送所述第二虚拟地址段的地址信息,以使所述第一网络节点维护所述第一地址映射关系。
在本申请中,第一网络节点和第二网络节点均包括总线端设备。第一网络节点中的第一总线端设备用于使用所述第一地址映射关系与所述第二网络节点通信,第二网络节点中的第二总线端设备用于使用所述第二地址映射关系与所述第一网络节点通信。
所述第一地址映射关系为所述第一总线端设备在所述第一网络节点中对应的物理地址空间与所述第二虚拟地址段之间的映射关系。第一地址映射关系可以由第一总线端设备存储。所述第二地址映射关系为所述第二总线端设备在所述第二网络节点中对应的物理地址空间与所述第一虚拟地址段之间的映射关系。第二地址映射关系可以由第二总线端设备存储。
在本申请中,一个网络节点中的物理地址空间分为两个部分,一部分与本地物理设备对应,另一部分与非本地物理设备(即其他网络节点中的物理设备)对应。示例性地,物理设备包括但不限于内存等存储设备和高速外设部件互连(peripheral component interconnect express,PCIe)设备等外围设备。与非本地物理设备对应的这部分物理地址空间由总线端设备负责,当收到包含虚拟地址的访问请求且该虚拟地址对应的物理地址属于由总线端设备负责的物理地址空间时,通过总线端设备将访问请求转发至非本地物理设备。
在一些示例中,第一网络节点可以指定第二网络节点中的目标物理设备访问第一网络节 点的虚拟地址空间中的哪个虚拟地址。但是由于第二网络节点无法识别第一网络节点的虚拟地址空间中的虚拟地址,因此,需要将第一网络节点的虚拟地址空间中的虚拟地址转换为第二网络节点能够识别的输入输出虚拟地址(input output virtual address,IOVA)地址,然后将IOVA地址发送给第二网络节点。因此,第一网络节点中还需要配置第二网络节点中的IOVA段和第一虚拟地址段之间的地址转换关系。
配置该地址转换关系的方式包括:接收来自所述第二网络节点的IOVA段的地址信息,所述IOVA段属于第二网络节点中与所述目标物理设备对应的输入输出虚拟地址空间,且所述IOVA段与所述第一虚拟地址段相对应;根据所述IOVA段的地址信息,保存所述第一虚拟地址段和所述IOVA段之间的地址转换关系。
在一些示例中,第一虚拟地址段和IOVA段均为虚拟地址段且包含连续的虚拟地址,所以地址转换关系可以为所述第一虚拟地址段的起始地址和所述IOVA段的起始地址之间的偏移量,且所述偏移量为常量。这样,第一网络节点可以快速将本地虚拟地址转换为第二网络节点中的IOVA地址,提高处理效率。
在一些示例中,第一网络节点中保存有多个地址转换关系,不同的地址转换关系所对应第一虚拟地址段和IOVA段均不相同。当地址转换关系实现为偏移量时,不同的地址转换关系对应的偏移量可以相等或者不相等。
在本申请中,所述第一虚拟地址段包括第一子地址段和第二子地址段,所述第一子地址段用于供所述目标物理设备发起基于直接内存访问的访问请求,所述第二子地址段用于供所述目标物理设备发起中断请求。
在一些示例中,第一网络节点通过以下方式确定目标物理设备:向控制器发送设备获取请求,所述设备获取请求用于请求所述控制器分配物理设备;接收所述控制器发送的设备指示信息,所述设备指示信息用于指示所述控制器根据所述设备获取请求为所述第一网络节点分配的目标物理设备,从而第一网络节点可以根据所述设备指示信息确定所述目标物理设备。
在一些示例中,第二网络节点可以通过以下方式中的任一种确定目标物理设备:第一种、接收第一网络节点发送的设备创建请求,该设备创建请求包括所述目标物理设备的指示信息;根据设备创建请求确定目标物理设备;第二种、接收控制器发送的分配信息,该分配信息包括目标物理设备的指示信息和第一网络节点的指示信息,该分配信息用于指示控制器将目标物理设备分配给第一网络节点;根据该分配信息确定目标物理设备。
在一些示例中,控制器中保存有多个设备资源的信息,每个设备资源为一个物理设备。这些物理设备属于一个或多个网络节点。控制器用于统一管理这些物理设备,包括物理设备的添加、删除、分配以及回收等,从而实现设备资源池化。
第二方面,本申请提供了一种访问请求的处理方法,应用于源网络节点,所述方法包括:将第一虚拟地址转换为第一物理地址,所述第一虚拟地址为第一访问请求中的虚拟地址;基于所述第一物理地址和目标地址映射关系向目的网络节点发送第二访问请求,所述第二访问请求与所述第一访问请求对应,所述目标地址映射关系是采用第一方面及其任一可能的实现方式提供的所述的方法配置的;其中,所述源网络节点为第一网络节点,所述目标地址映射关系为所述第一地址映射关系,所述第一访问请求是所述第一网络节点发起的针对所述第二网络节点中的目标物理设备的访问请求;或者,所述源网络节点为第二网络节点,所述目标 地址映射关系为所述第二地址映射关系,所述第一访问请求是所述目标物理设备发起的针对所述第一网络节点的访问请求。
从上层应用的角度来看,当第一网络节点访问本地物理设备时,第一网络节点先将访问请求中的虚拟地址转换为对应的物理地址,然后基于该物理地址将访问请求发送给本地物理设备,与第一网络节点访问非本地物理设备的过程相同。而当本地物理设备访问第一网络节点的存储介质时,将本地物理设备发起的访问请求中的虚拟地址转换为对应的物理地址,从而实现对存储介质的访问,而非本地物理设备访问第一网络节点的存储介质时,同样将访问请求中的虚拟地址转换为对应的物理地址,从而实现对存储介质的访问。因此,采用本申请提供的访问请求的处理方法,第一网络节点可以实现本地物理设备和非本地物理设备的访问机制的统一管理。
在一些示例中,所述源网络节点为第一网络节点,所述第一访问请求中还包括目标IOVA地址,所述第一访问请求用于指示所述目标物理设备发起针对所述目标IOVA地址的访问,所述目标IOVA地址属于IOVA段,所述IOVA段属于第二网络节点中与所述目标物理设备对应的输入输出虚拟地址空间,且与所述第一虚拟地址段相对应。
在一些示例中,第一网络节点中保存有第一虚拟地址段和IOVA段之间的地址转换关系,第一网络节点根据该确定目标IOVA地址。
示例性地,所述地址转换关系为所述第一虚拟地址段的起始地址和所述IOVA段的起始地址之间的偏移量,且所述偏移量为常量。这种情况下,只需要将目标虚拟地址与该偏移量相加,即可得到目标IOVA地址,转换效率高。这里,目标虚拟地址是指第一虚拟地址段中的虚拟地址。
第三方面,提供了一种网络节点的配置装置,应用于第一网络节点或者第二网络节点,所述装置包括:获得模块和配置模块。其中,确定模块用于获得目标物理设备相关的虚拟地址段的地址信息,所述目标物理设备为属于所述第二网络节点的物理设备,所述虚拟地址段包括第一虚拟地址段和第二虚拟地址段,所述第一虚拟地址段属于所述第一网络节点的虚拟地址空间且用于供所述目标物理设备访问所述第一网络节点,所述第二虚拟地址段属于所述第二网络节点的虚拟地址空间且用于供所述第一网络节点访问所述目标物理设备。配置模块用于根据所述虚拟地址段的地址信息,配置地址映射关系,所述地址映射关系用于与所述目标物理设备相关的访问请求的传输,所述地址映射关系包括第一地址映射关系和第二地址映射关系,所述第一地址映射关系为所述第一网络节点的物理地址空间与所述第二虚拟地址段之间的映射关系,所述第二地址映射关系为所述第二网络节点的物理地址空间与所述第一虚拟地址段之间的映射关系。
第四方面,提供了一种访问请求的处理装置,应用于源网络节点,所述装置包括:转换模块和发送模块。转换模块用于将第一虚拟地址转换为第一物理地址,所述第一虚拟地址为第一访问请求中的虚拟地址。发送模块用于基于所述第一物理地址和目标地址映射关系向目的网络节点发送第二访问请求,所述第二访问请求与所述第一访问请求对应,所述目标地址映射关系是采用第一方面及其可能的实现方式所述的方法配置的。其中,所述源网络节点为第一网络节点,所述目标地址映射关系为所述第一地址映射关系,所述第一访问请求是所述第一网络节点发起的针对所述第二网络节点中的目标物理设备的访问请求;或者,所述源网络节点为第二网络节点,所述目标地址映射关系为所述第二地址映射关系,所述第一访问请 求是所述目标物理设备发起的针对所述第一网络节点的访问请求。
第五方面,提供了一种计算机设备,计算机设备包括处理器和存储器,其中:存储器中存储有计算机指令,处理器执行计算机指令,以实现第一方面或第二方面及其可能的实现方式的方法。
第六方面,提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机指令,当计算机可读存储介质中的计算机指令被计算机设备执行时,使得计算机设备执行第一方面或第二方面及其可能的实现方式的方法。
第七方面,提供了一种包含指令的计算机程序产品,当其在计算机设备上运行时,使得计算机设备执行上述第一方面或第二方面及其可能的实现方式的方法。
第八方面,提供了一种芯片,包括处理电路和接口电路,所述接口电路与所述处理电路通过线路互联,所述接口电路用于从存储介质接收信号,并向所述处理电路发送所述信号,所述信号包括所述存储介质中存储的计算机指令;当所述计算机指令被处理电路执行时,使得处理电路执行第一方面或第二方面及其可能的实现方式的方法。
第九方面,提供了一种通信系统,包括第一网络节点和第二网络节点。第一网络节点和第二网络节点均用于按照第一方面及其可能的实施方式中对应的方式配置地址映射关系。
在一些示例中,第一网络节点和第二网络节点还用于按照第二方面及其能的实施方式中对应的方式发起与目标物理设备相关的访问请求。
附图说明
图1是本申请一个示例性实施例提供的应用场景的网络架构示意图;
图2是本申请一个示例性实施例提供的一种网络节点的结构示意图;
图3是本申请一个示例性实施例提供的一种网络节点的配置方法的示意图;
图4是本申请一个示例性实施例提供的一种设备的分配过程的示意图;
图5是本申请一个示例性实施例提供的一种访问请求的处理方法的流程图;
图6是图5所示设备访问方法中的地址转换过程的示意图;
图7是本申请一个示例性实施例提供的另一种访问请求的处理方法的流程图;
图8是图7所示设备访问方法中的地址转换过程的示意图;
图9是本申请一个示例性实施例提供的一种网络节点的配置装置的结构示意图;
图10是本申请一个示例性实施例提供的另一种访问请求的处理装置的结构示意图;
图11是本申请一个示例性实施例提供的一种计算机设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
为了便于理解本申请实施例,下面先对本申请实施例涉及的进行说明。
网络节点:具有处理数据和存储数据这两种功能中至少一种功能的设备。本申请实施例中,网络节点可以是完整的物理机,也可以是如网关、交换设备等。这里,物理机是指封装成一个产品的计算机,例如,服务器或者终端等。终端可以包括桌面型、膝上型、手持型、车载型用户终端(user equipment,UE)设备等,例如智能手机、台式电脑、平板电脑、智能 电视、智能电视盒子,超级移动个人计算机(ultra-mobile personal computer,UMPC)、笔记本电脑、个人数字助理(personal digital assistant,PDA)、便携式多媒体播放器(portable multimedia player,PMP)、专用媒体播放器、消费类通信设备、可穿戴设备(例如智能手表)、增强现实(augmented reality,AR)设备、或者虚拟现实(virtual reality,VR)设备等其他类型的通信设备。
网络节点中的物理设备(下文简称为设备):指网络节点中的部件或者组件。例如,当网络节点是物理机时,CPU和内存都是该网络节点中的物理设备。在本申请中,物理设备可以为外围设备,例如PCIe设备。物理设备包括但不限于加速器和网络通信设备等。示例性地,加速器包括但不限于专用集成电路(application specific integrated circuits,ASICs)、现场可编程门阵列(field programmable gate array,FPGA),图形处理器(graphics processing unit,GPU)和数字信号处理器(digital signal processor,DSP)等。网络通信设备包括但不限于网卡、光连接器或者其他发送器、接收器或者收发器等。
全局:全局所指的范围是部署有本申请实施例描述的总线端设备,且可以使用本申请实施例描述的方法相互读写数据的一组节点。本申请实施例不限定这一组节点在实际空间中的位置和范围。例如,这一组节点可以在一个数据中心内,也可以跨数据中心,或者,可以在一个企业园区内,也可以跨城市或者国家。
地址空间:也可以叫存储空间,指能被某个设备或者实例使用的一段或者多段地址。例如,某个设备或者实例的虚拟地址空间,就是能被该设备或者实例使用的,也就是属于该设备或者实例的一段或者多段虚拟地址。某个设备或者实例的虚拟地址空间是由该设备或者实例所在的操作系统分配的。又例如,某个设备或者实例的物理地址空间,就是分配给该设备或者实例使用的一段或者多段物理地址,在该设备或者实例使用这个物理地址空间时,其他设备或者实例无法使用这个物理地址空间中地址。实例的物理地址空间是运行该实例的操作系统分配的。这个分配可能是动态的,例如随着实例的运行,占用的物理地址空间越来越大,但是会有一个上限。设备的物理地址空间的大小和范围通常是固定的。
实例:实例是可以运行应用程序或者系统程序的软件模块,且,该软件模块在被操作系统运行时才能称为实例,否则,只是一段代码。实例有多种表现形式,例如进程和线程都可以理解为实例的一种。实例运行于节点。
中央处理器(central processing unit,CPU)虚拟地址管理机制:CPU通过虚拟地址来访问内存中的单元。CPU发出虚拟地址,内存管理单元(memory management unit,MMU)根据虚拟地址和物理地址之间的映射关系,将接收到的虚拟地址转换为物理地址,使得CPU能够访问该物理地址对应的内存空间。CPU发出的虚拟地址属于CPU分配给进程的虚拟内存空间,设备发出的虚拟地址属于I/O地址空间。
外设地址管理机制:设备通过虚拟地址来访问内存中的单元,输入输出内存管理单元(input/output memory management unit,IOMMU)根据虚拟地址和物理地址之间的映射关系,将接收到的虚拟地址转换为物理地址,使得外围设备能够访问该物理地址对应的内存空间。
直接存储器访问(direct memory access,DMA):一种完全由硬件执行输入/输出(input/output,I/O)交换的工作方式。在这种方式中,DMA控制设备从CPU完全接管对总线的控制,数据交换不经过CPU,而直接在内存和I/O设备之间进行。DMA控制设备向内存发送地址和控制信号、修改地址、对传送的字的个数计数,并且以中断方式向CPU报告传送 操作的结束。
总线(bus):相关技术中的总线是计算机的内部结构,是计算机中各种功能部件之间传送信息的公共通信干线。计算机的总线可以划分为数据总线、地址总线和控制总线,分别用来传输数据、数据的地址以及控制信号。本申请实施例中,总线是高性能互联总线(high performance interconnect bus,HPIB)的简称,不仅可以连接一个计算机内部的各种部件,也可以代替网络,在不同的计算机之间铺设,从而连接不同的计算机。每个计算机通过总线端设备接入高性能互联总线,总线端设备相当于网络技术中的网卡或基带天线等通信模块。本申请对HPIB和总线端设备的具体结构不做详细描述,只要能够完成处理用于读数据或者写数据的请求即可。
内存语义:内存语义是指一个物理机中,通过总线连接的各个器件之间通信时,所使用的通信指令。这种通信也称为总线通信,是同属于一个操作系统中的不同实例或者设备之间的通信,因此不需要使用网络通信技术。例如,装载/存储(load/store)指令就是典型的内存语义。
目前的通信技术,可以分为网络通信和总线通信。通信涉及的信息交互,可以是传输数据,也可以是传输指令。网络通信用于本端设备与远端设备之间的通信,传输的报文通常经过操作系统中协议栈的封装,使用网络通信协议。网络通信中通常使用网络通信技术中的发送/接收(send/receive)指令,或者远程直接内存访问(remote direct memory access,RDMA)的读/写(read/write)指令来传输信息。这些语义使用之前需要先建立连接,简称建链,当集群规模不断增大时,建链的开销会非常大。并且,虽然RDMA提供的网络语义绕过了位于操作系统的内核中的协议栈,能够有效降低端到端的网络时延,但它的异步通知机制以及网卡冗长的发送流程,依然制约了时延的进一步降低。总线通信用于一个设备中,通过总线连接的各个器件之间的通信。总线通信使用内存语义(例如load/store指令)来传输信息。这种内存语义没有上述的限制,总线通信的通信速度比网络通信更快。
本申请提出了基于虚拟地址寻址的关于目标设备的访问方法,实现了基于内存语义的方式跨网络节点调用目标物理设备。
图1是本申请一个示例性实施例提供的应用场景的网络架构示意图。图1所示的网络中包括多个网络节点10。各网络节点10之间通信连接。
该应用场景可以为云计算场景或者分布式计算场景。在这两种计算场景中,一个网络节点中的程序发起计算任务或其他任务,该计算任务需要多个网络节点10共同完成。
在一些示例中,该网络中还包括控制器(图未示),该控制器与各个网络节点10之间通过网络连接。该控制器用于获取以及维护各个网络节点10的物理设备的信息、以及对各个网络节点10的物理设备进行统一管理,例如分配和回收等。
在另一些示例中,将前述控制器的功能集成在某个网络节点10中。
图2是本申请一个示例性实施例提供的网络节点的结构示意图。如图2所示,网络节点包括硬件和软件两部分。应理解,图2所示的架构指示为了便于理解,并不是对本申请中的网络节点可使用的架构的限制。该网络节点中的其他软件部分(例如操作系统)和其他硬件部分(如显示器等)并未显示。
硬件部分包括中央处理器(CPU)101、内存102、MMU103、IOMMU104和总线端设备 105。CPU101、内存102和总线端设备105之间通过总线连接。
其中,处理器101和MMU103:两者一般是封装成一个芯片的。处理器101运行应用,发起用于读数据或者写数据的请求,也可以被称为访存请求,即访问存储介质的请求,因为读数据或者写数据都要找到存储介质(例如内存)中的地址。MMU负责由CPU发起的访问内存的请求的地址翻译,也就是将访存请求中的虚拟地址转换成物理地址。
内存102:图2中以内存为例示意该节点上的存储介质,该内存的物理形态可以是内存条。在本申请的方法中,内存除了提供给本地的实例(例如进程)使用,还可以被其他节点的实例使用,其他节点的实例使用的方式是通过请求和本申请描述的方法,向这个内存写数据,或者请求读取该内存中的数据。
IOMMU104:和MMU103的功能类似,但IOMMU负责的是除了CPU之外的硬件的访存请求的地址翻译。例如,该硬件为内存,则访存请求就是用于请求向内存写数据,或者请求读取内存中的数据。除了CPU之外的硬件还可以是其他具有DMA的器件。
总线端设备105:也简称端设备(end point,EP),用于该网络节点接入高性能互联总线,作用相当于网卡。总线端设备通常是一个具有地址转换功能的硬件模块,类似网卡,总线端设备也需要一个驱动安装在网络节点的操作系统中,才能使网络节点的操作系统使用它。一个网络节点中可以包括多个总线端设备,正如一个网络节点中可以安装多张网卡。一个网络节点中可以既包括总线端设备,又包括网卡。图2中没有画出网卡,只示意性地指示了总线端设备。如果该网络节点的远程通信全部通过高性能互联总线,也就是都使用内存语义去交互信息,那么这个节点也可以只包括总线端设备。实际布线时,总线端设备可以一端与CPU、内存或者MMU连接,另一端与高性能总线或者高性能总线的交换机连接。
在本申请实施例中,物理设备是支持内存语义的I/O设备。设备包括管理单元和数据处理单元。管理单元用于处理软件发起的设备配置操作。数据处理单元用于处理设备发起的数据操作,例如,软件可见的DMA操作和中断操作。
网络节点中运行有应用程序、虚拟设备构造器(vdev constructor)、虚拟设备驱动、总线端设备的驱动等程序代码。这里,应用程序是指需要使用设备的应用程序,通过向控制器申请,获得目标设备的使用权。该目标设备可以是应用程序所在网络节点的设备,或者,是应用程序所在网络节点之外的网络节点的设备。虚拟设备构造器用于按照应用程序的需求,构建本地虚拟设备。虚拟设备驱动用于管理虚拟设备。总线端设备的驱动是网络节点上运行的操作系统(Operation System,OS)的内核中,用于驱动总线端设备这个硬件模块的软件模块。该驱动具有与其他的硬件的驱动相同的,使操作系统能够感应和使用相应的硬件的这个能力。另一个方面,该驱动还用于配置,或者说叫更新该总线端设备使用的地址映射关系。
图3是本申请一个示例性实施例提供的网络节点的配置方法。该方法中,应用节点为第一网络节点,设备节点为第二网络节点。第一网络节点和第二网络节点均为图1中的任一个网络节点。如图3所示,该方法包括如下几个过程。
200:控制器维护设备资源池。
该设备资源池中包括多个设备,设备资源池中的这些设备属于一个或多个网络节点。
维护设备资源池包括管理设备资源池中各个设备的信息。设备的信息包括设备所在的网络节点的标识、设备的标识和设备所在网络节点中的总线端设备的标识等。网络节点的标识包括但不限于网络节点的网际互连协议(internet protocol,IP)地址或媒体访问控制(media  access control,MAC)地址等。设备的标识包括但不限于设备的编号等,只要能够在设备资源池中唯一识别该设备即可。总线端设备的标识包括但不限于总线端设备的编号等,只要能够在全局中唯一识别该总线端设备即可。
在一些示例中,设备的信息还包括设备属性信息和网络配置信息中的至少一种。其中,设备属性信息包括设备类型、设备内存大小、设备计算能力和输入输出单元数中的至少一种。设备类型包括但不限于网卡、加速器和x处理器(x-processing unit,XPU)(例如GPU)等。设备内存大小由设备类型和设备配置等决定,在此不做限制。设备计算能力包括但不限于核的数量。输入输出单元数包括但不限于GPU的上下文(context)和网卡的队列数等。网络配置信息包括设备所属的网络节点的带宽和时延中的至少一种。
在一些示例中,设备的信息还包括:设备的状态信息,该设备的状态信息用于表示设备是否被占用。当该设备的状态信息表示设备被占用时,该设备的信息还包括占用该设备的网络节点的标识等。
在本申请实施例中,控制器根据各个网络节点上报的设备的信息,维护设备资源池。也即是,该步骤200包括:控制器接收各网络节点发送的设备的信息;根据接收到的设备信息更新设备资源池中的设备的信息。
在网络节点启动时,会进行设备发现枚举,从而获得网络节点所包含的设备的信息,并将设备的信息发送给控制器。
在网络节点的工作过程中,网络节点的总线驱动器会监测设备热插拔事件。当总线驱动器监测到设备热插拔事件之后,会向网络节点的设备管理进程发送设备变化信息,网络节点通过设备管理进程向控制器发送设备变化信息。该设备变化信息用于指示增加和/或删除设备。
示例性地,该设备管理进程为操作系统中的用户态设备管理进程。例如,设备管理进程为Linux系统中的虚拟设备(udev)守护进程。
201:应用节点向控制器发送设备获取请求。
其中,应用节点指发起任务的实例所在的网络节点。该实例通常由应用节点的CPU运行。该设备获取(GET_DEVICE)请求用于请求控制器分配设备。
在一些示例中,该设备获取请求中携带设备描述信息。设备描述信息包括设备属性信息、网络配置要求以及偏好设置中的至少一种。
其中,设备属性信息的相关内容参见200,在此省略详细描述。网络配置要求包括带宽要求和时延要求中的至少一种。偏好设置包括仅本地(local only)或者任意(any)等。其中,仅本地表示请求应用节点的设备,任意表示请求应用节点的设备或者应用节点之外的其他网络节点的设备。
示例性地,实例调用GET_DEVICE应用程序接口(application programming interface,API),并将设备描述信息作为GET_DEVICE API的函数参数发送给控制器,以向控制器发送设备获取请求。
相应地,控制器接收该设备获取请求。
需要是说明的是,在应用节点发送设备获取请求之后,会同步阻塞,等待结果返回。
202:控制器根据设备获取请求,为应用节点分配设备。
分配给应用节点的设备,即为目标设备。
图4是本申请一个示例性实施例提供的设备的分配过程的示意图。如图4所示,在一些 示例中,控制器按照以下方式为应用节点分配设备:
2021:控制器根据设备描述信息从设备资源池中确定可用设备,该可用设备为与设备获取请求中的设备描述信息匹配的设备;
2022:若确定出的可用设备的数量为1,则将该可用设备确定为目标设备。
2023:若确定出的可用设备的数量大于1,即确定给出多个可用设备,则按照选择策略从多个可用设备中选择一个作为目标设备。
在一些示例中,选择策略为默认策略,该默认策略为根据网络配置信息选择目标设备,例如,将时延最低的设备作为目标设备。又例如,将带宽最大的设备作为目标设备。
在另一些示例中,选择策略根据偏好设置生成。示例性地,从偏好设置对应的可用设备中,选择满足设定条件的可用设备作为目标设备。例如,偏好设置为仅本地,设定条件为时延最低,则从多个可用设备中选择属于应用节点且时延最低的设备,作为目标设备。
以上的选择策略仅为举例,本申请对选择策略不做限制,只要能够确定出目标设备即可。
203:控制器向应用节点发送第一响应。
相应地,应用节点接收第一响应。
在一些示例中,如果202中确定出了目标设备,则该第一响应包括目标设备的指示信息。该目标设备即为分配给该应用节点的设备。
在另一些示例中,如果202中未能确定出目标设备,即控制器从设备资源池中确定出的可用设备的数量为0时,则203可被替代为控制器向应用节点发送第二响应,该第二响应用于指示设备获取失败。如果应用节点接收到第二响应,则重新向控制器发送设备获取请求,或者,退出当前流程。
示例性地,该第二响应中不包括目标设备的指示信息。
应用节点接收到该第一响应或者第二响应之后,会根据接收到的响应生成GET_DEVICE API的返回值,完成GET_DEVICE API的调用。返回值包括设备指针和操作状态值。示例性地,第一响应对应的返回值中,设备指针用于指向目标设备,操作状态值用于表示设备获取请求成功,例如操作状态值为SUCCESS。第二响应对应的返回值中,设备指针未定义,即设备指针为空,操作状态值用于表示设备获取请求失败,例如,操作状态值为FAILURE。
204:应用节点根据第一响应,向设备节点发送目标设备对应的第一虚拟地址段的地址信息。
这里,第一虚拟地址段属于所述第一网络节点的虚拟地址空间且用于供所述目标物理设备访问所述第一网络节点。
204可以包括:应用节点根据第一响应为目标设备分配第一虚拟地址段,以得到第一虚拟地址段的地址信息;向设备节点发送目标设备对应的第一虚拟地址段的地址信息。这里,应用节点可以从与实例对应的虚拟地址空间中为目标设备分配第一虚拟地址段。
在本申请实施例中,第一虚拟地址段包括第一子地址段和第二子地址段,所述第一子地址段用于供所述目标物理设备发起基于DMA的访问请求,可以被称为DMA内存段,所述第二子地址段用于供所述目标物理设备发起中断请求,可以被称为中断内存段。
其中,DMA内存段包括DMA IO虚拟地址,用于供目标设备后续发起DMA读写操作。中断内存段包括基于内存语义的中断向量表,用于供目标设备后续发起对应用节点的中断。中断向量表为消息信号中断(message signal interrupt,MSI)或者MSI-X中断向量表。其中, MSI-X是MSI的扩展和增强。这里,中断向量表是指存放中断向量的一个特定的内存区域。
在本申请实施例中,虚拟地址段的地址信息包括该虚拟地址段的首地址和虚拟地址段的长度;或者,虚拟地址段的地址信息包括该虚拟地址段的首地址和尾地址。
在一些示例中,应用节点在收到第一响应之后,会向控制器发送内存区域创建(memory region,MR)请求,以及接收控制器返回的MR信息,该MR信息用于指示目标设备对应的MR。
然后,应用节点将DMA内存段的地址信息和中断内存段的地址信息发送给控制器,DMA内存段和中断内存段均为MR的一部分,以将DMA内存段的地址信息和中断内存段的地址信息注册在该MR中。后续设备节点将通过访问该MR,获得DMA内存段的地址信息和中断内存段的地址信息。至此,实现将DMA内存段的地址信息和中断内存段的地址信息发送给设备节点。
在本申请实施例中,该MR是一个逻辑上或者代码层面的概念,表示一段连续的虚拟地址。该MR是全局可见的,即所有的网络节点均可访问。控制器用于维护MR的目录,例如包括多个MR的起始地址和长度。MR的目录由于记录该控制器所在域内的多个MR,这样,控制器可以统一管理这个域内的MR。
一个MR可以划分为多个内存段(memory segment,MS)。MS可以以偏移量和长度作为标识。其中,偏移量是指MS相对于MR的起始地址的偏移,长度是指MS的长度,即内存片段的大小。每个MS对应一段长度等于该MS的长度的物理内存。
示例性地,应用节点可以通过虚拟设备构建进程vdev constructor向控制器发送MR创建请求。
在一些示例中,应用节点向设备节点发送设备创建请求,该设备创建请求包括MR信息和目标物理设备的指示信息;相应地,设备节点接收该设备创建请求。设备节点从MR信息所指示的MR中获取第一虚拟地址段的地址信息。示例性地,设备节点通过vdev constructor打开MR信息所指示的MR,从而获取第一虚拟地址段的地址信息。
在另一些示例中,应用节点在收到第一响应之后,直接向设备节点发送第一虚拟地址段的地址信息。相应地,设备节点接收第一虚拟地址段的地址信息。
205:设备节点将第一虚拟地址段映射到设备节点的物理地址空间中。
也即是,设备节点根据接收到的第一虚拟地址段的地址信息维护第二地址映射关系,例如建立和保存第二地址映射关系中的至少一种,该第二地址映射关系为设备节点的物理地址空间与所述第一虚拟地址段之间的映射关系。例如,设备节点将第二地址映射关系保存在的设备节点的总线端设备中。这样,后续DMA内存段和中断内存段对应的第一物理地址段将由该总线端设备负责。后续如果目标物理设备发起访问第一虚拟地址段(例如DMA内存段或中断内存段)的请求,都将被转发给该总线端设备。
示例性地,所述第二地址映射关系为设备节点的总线端设备在所述设备节点中对应的物理地址空间与所述第一虚拟地址段之间的映射关系。
此外,设备节点的IOMMU中存储有第四地址映射关系,该第四地址映射关系为目标设备对应的IOVA空间和设备节点的物理地址空间之间的映射关系。这样,IOMMU在对接收到的访问请求对应的IOVA地址进行转换,得到属于该第一物理地址段的物理地址时,能够将该访问请求转发给该总线端设备。
206:设备节点向应用节点发送第二虚拟地址段的地址信息。
该第二虚拟地址段属于所述第二网络节点的虚拟地址空间且用于供所述第一网络节点访问所述目标物理设备。
206可以包括:设备节点为目标设备分配第二虚拟地址段,以得到第二虚拟地址段的地址信息;向应用节点发送目标设备对应的第二虚拟地址段的地址信息。
在一些示例中,第二虚拟地址段用于写入针对目标设备的配置操作,也可以被称为配置空间内存段。示例性地,设备节点可以通过目标设备的管理驱动程序获得配置空间内存段的地址信息。
在一些示例中,应用节点主动获取第二虚拟地址段的地址信息。例如,设备节点向应用节点发送第二虚拟地址段的地址信息,包括:设备节点将第二虚拟地址段的地址信息写入对应的MR中,应用节点访问该MR,从而获得第二虚拟地址段的地址信息。
在其他实施例中,设备节点也可以直接将第二虚拟地址段的地址信息发送给应用节点。相应地,应用节点接收第二虚拟地址段的地址信息。
在一些示例中,设备节点还向应用节点发送IOVA段的地址信息。IOVA段的地址信息例如IOVA段的起始地址。IOVA段属于第二网络节点中与目标物理设备对应的IOVA空间,且与所述第一虚拟地址段相对应。
在一些示例中,设备节点将第二虚拟地址段的地址信息和IOVA段的地址信息携带在前述设备创建请求的应答中发送给应用节点。
示例性地,设备节点通过vdev constructor向应用节点的vdev constructor发送该应答。
207:应用节点将第二虚拟地址段映射到应用节点的物理地址空间中。
也即是,应用节点根据接收到的第二虚拟地址段的地址信息维护第一地址映射关系,例如创建和保存第一地址映射关系中的至少一种,该第一地址映射关系为应用节点的物理地址空间与第二虚拟地址段之间的映射关系。例如,应用节点将第一地址映射关系保存在应用节点的总线端设备中。第一地址映射关系为应用节点的总线端设备在应用节点中对应的物理地址空间与所述第二虚拟地址段之间的映射关系。
此外,应用节点的MMU中存储有第三地址映射关系,该第三地址映射关系为实例对应的虚拟内存地址空间和应用节点的物理地址空间之间的地址映射关系。
208:应用节点根据IOVA段的地址信息,保存所述第一虚拟地址段和所述IOVA段之间的地址转换关系。
在一些示例中,地址转换关系为所述第一虚拟地址段的起始地址和所述IOVA段的起始地址之间的偏移量,且所述偏移量为常量。应用节点的vdev可保存该偏移量,并在IO操作时高效的将本地虚拟地址转化为目标设备可识别的虚拟地址,提高处理效率。例如,将目标虚拟地址与该偏移量相加,即可得到目标IOVA地址,转换效率高。这里,目标虚拟地址是指第一虚拟地址段中的虚拟地址。
在一些示例中,应用节点中保存有多个地址转换关系,不同的地址转换关系所对应第一虚拟地址段和IOVA段均不相同。当地址转换关系实现为偏移量时,不同的地址转换关系对应的偏移量可以相等或者不相等。
在第二地址映射关系建立并保存完成之后,应用节点构造目标设备对应的虚拟设备。应用节点的vdev constructor通过总线重枚举(rescan)的方式,使得设备总线发现该虚拟设备, 并加载虚拟设备相应的驱动程序。虚拟设备的驱动程序可以统一管理本地或者远端设备。
至此,应用节点完成了目标设备对应的虚拟设备的创建,以及基于内存的地址映射关系的建立。后续,应用节点可以基于地址映射关系访问目标设备,目标设备也可以基于该地址映射关系访问应用节点。
需要说明的是,在前述过程205~208中,设备节点与应用节点为不同的网络节点,在其他示例中,设备节点与应用节点可以为同一网络节点,目标设备属于应用节点,即实例调用所在网络节点的设备完成计算任务。在这种情况下,如果通过MR来管理虚拟地址段,则应用节点需要将目标设备对应的第一虚拟地址段和第二虚拟地址段的地址信息均注册到MR中。
本申请实施例还提供了一种访问请求的处理方法。该方法基于前述建立的地址映射关系实现。
图5是本申请一个示例性实施例提供的访问请求的处理方法的示意图。在该方法中,应用节点为第一网络节点,也可以被称为源网络节点,设备节点为第二网络节点,也可以被称为目的网络节点。如图5所示,该方法包括:
301:应用节点获得第一访问请求。
第一访问请求包括第一虚拟地址。第一虚拟地址为应用程序的进程对应的虚拟地址空间中的地址。
在一些示例中,该第一访问请求用于向设备节点中目标设备对应的地址空间写入配置操作数据,以对目标设备进行配置操作。配置操作包括但不限于设备初始化(中断向量配置)以及IO操作配置(DMA描述符和载荷配置)等。
在另一些示例中,该第一访问请求中携带有目标IOVA地址。所述第一访问请求用于指示所述目标物理设备发起针对所述目标IOVA地址的访问,也即是,该第一访问请求用于指示目标设备向目标IOVA地址写数据或者读数据。
由于所述目标IOVA地址属于IOVA段,所述IOVA段属于设备节点中与目标物理设备对应的IOVA地址空间,且与所述第一虚拟地址段相对应(例如与DMA内存段对应),所以该第一访问请求实质上是指示目标设备向第一网络节点中的某个虚拟地址写数据或者从该虚拟地址读数据。
在这种情况下,在该步骤301之前,该方法还包括:根据所述第一虚拟地址段和所述IOVA段之间的地址转换关系确定目标IOVA地址,以便将该目标IOVA地址携带在第一访问请求中。该地址转换关系的相关内容参见前述步骤208,在此省略详细描述。
302:应用节点将第一虚拟地址转换为第一物理地址。
示例性地,302包括:应用节点的CPU将第一访问请求发送给应用节点的MMU;应用节点的MMU将第一虚拟地址转换为第一物理地址。
应用节点的MMU中存储有第三地址映射关系,该第三地址映射关系为实例对应的虚拟地址空间和应用节点的物理地址空间之间的地址映射关系。应用节点的MMU根据该第三地址映射关系将第一虚拟地址转换为第一物理地址。
应用节点的物理地址空间包括两类物理地址段,第一类物理地址段对应应用节点的本地设备,第二类物理地址段对应非本地设备。该第二类物理地址段在下文中被称为第一物理地址段。该第一物理地址段是由应用节点的总线端设备负责的一段物理地址。
303:当第一物理地址属于第一物理地址段时,应用节点基于第一物理地址发送第二访问请求。
示例性地,303包括:
第一步、应用节点的MMU将第一访问请求发送给应用节点的总线端设备。
该第一访问请求携带第一物理地址。由于该第一物理地址属于第一物理地址段,所以MMU将该携带第一物理地址的第一访问请求通过应用节点的内部总线发送给应用节点的总线端设备。相应地,应用节点的总线端设备接收该第一访问请求。
第二步、应用节点的总线端设备基于第一地址映射关系,将第一物理地址转换为第二虚拟地址。
第二虚拟地址为设备节点中与目标设备对应的虚拟地址,即前述配置空间内存段(即第二虚拟地址段)中的虚拟地址。应用节点的总线端设备存储有第一地址映射关系,该第一地址映射关系为第一物理地址段与设备节点中配置内存段之间的地址映射关系。
第三步、应用节点的总线端设备将第二访问请求发送给设备节点。
该第二访问请求携带该第二虚拟地址。该第二访问请求与第一访问请求的对应的访问类型相同。访问类型包括读数据或写数据。相应地,设备节点的总线端设备接收该第二访问请求。
需要说明的是,该第二访问请求还可以包括设备节点的总线端设备的标识。该总线端设备的标识相当于总线地址,从而使得第二访问请求能够被发送到目的端。总线端设备标识指示一个总线端设备,在某个域里是唯一的。因此,某个域中的总线端设备的标识也可以称为这个域中的全局标识(global identifier,GID)。在某些实现方式中,可以将总线端设备标识配置为全局唯一。这样,相当于指明了第二访问请求应被哪个总线端设备接收,由于一个节点中可以包括多个总线端设备,所以并没有使用节点标识。总线端设备的标识可以由控制器(例如controller 1001)在一个域内统一分配。
304:设备节点将第二虚拟地址转换为第二物理地址。
示例性地,304包括:设备节点的总线端设备接收到第二访问请求后,向设备节点的IOMMU发送该第二访问请求;设备节点的IOMMU将第二虚拟地址转换为第二物理地址。
第二物理地址为设备节点的物理地址空间中的物理地址。设备节点的IOMMU存储有第四地址映射关系,该第四地址映射关系为设备节点中目标设备对应的IOVA空间和设备节点的物理地址空间之间的映射关系。设备节点的IOMMU根据该第四地址映射关系将第二虚拟地址转换为第二物理地址。
305:设备节点根据第二物理地址,完成对目标设备的访问。
例如,将配置操作数据写入设备节点的目标设备的配置空间。
应用节点通过对目标设备的配置空间的访问,即可完成目标设备的初始化,进而调用目标设备执行任务。
图6为图5所示过程的简化示意图,展示了基于地址映射关系的地址转换过程。
在一些示例中,该方法还包括:
应用节点获得第三访问请求,第三访问请求包括第三虚拟地址;
将第三虚拟地址转换为第三物理地址,第三物理地址为第一网络节点的物理地址空间中的地址,且不属于第一物理地址段;
根据第三物理地址访问应用节点中的设备。
可选地,第三访问请求由应用节点的处理器发起,用于对应用节点中的本地设备进行访问;或者,第三访问请求由本地设备发起,用于对应用节点的内存进行访问,例如,该第三访问请求包括但不限于配置操作指令的应答、DMA操作指令或者中断操作指令。
图7是本申请一个示例性实施例提供的访问请求的处理方法的示意图。在该方法中,应用节点为第一网络节点,也可以被称为目的网络节点,设备节点为第二网络节点,也可以被称为源网络节点。如图7所示,该方法包括:
401:设备节点获得第一访问请求。
该第一访问请求中携带第一虚拟地址,该第一虚拟地址为设备节点的虚拟地址空间中的地址。
该第一访问请求是设备节点中的目标设备发起的。该第一访问请求用于请求向应用节点写数据或者从应用节点读数据。在一些示例中,第一虚拟地址为前述目标IOVA地址,相关内容参见301,在此省略详细描述。
402:设备节点将第一虚拟地址转换为第一物理地址。
设备节点的IOMMU中存储有第四地址映射关系,该第四地址映射关系为目标设备对应的IOVA空间和设备节点的物理地址空间之间的映射关系。402包括:设备节点的IOMMU根据该第四地址映射关系将第一虚拟地址转换为第一物理地址。
该设备节点的物理地址空间包括两类物理地址段,第一类物理地址段对应设备节点的本地设备(包括外围设备和内存等),第二类物理地址段对应设备节点的非本地设备。下文中被称为第二物理地址段。该第二物理地址段是由设备节点的总线端设备负责的一段物理地址。
403:当第一物理地址属于第二物理地址段时,设备节点基于第一物理地址发送第二访问请求。
示例性地,403包括:
第一步、设备节点的IOMMU将第一访问请求发送给设备节点的总线端设备。
这里,该第一访问请求携带第一物理地址。由于该第一物理地址属于第二物理地址段,所以IOMMU将该携带第一物理地址的第一访问请求通过设备节点的内部总线发送给设备节点的总线端设备。相应地,设备节点的总线端设备接收该第一访问请求。
第二步、设备节点的总线端设备将第一物理地址转换为第二虚拟地址。
该第二虚拟地址为应用节点中与目标设备相关的虚拟地址段(即第一虚拟地址段)中的虚拟地址,即为前述DMA内存段或者中断内存段中的虚拟地址。
设备节点的总线端设备中存储有第二地址映射关系,该第二地址映射关系为设备节点的物理地址空间与第一虚拟地址段之间的映射关系。应用节点的总线端设备根据该第二地址映射关系将第一物理地址转换为第二虚拟地址。
第三步、设备节点的总线端设备将第二访问请求发送给应用节点。
将第二访问请求携带该第二虚拟地址。该第二访问请求与第一访问请求的对应的访问类型相同。访问类型包括读数据或写数据。相应地,应用节点的总线端设备接收该第二访问请求。
404:应用节点将第二虚拟地址转换为第二物理地址。
示例性地,404包括:应用节点的总线端设备向应用节点的IOMMU发送该第二访问请求;应用节点的IOMMU将第二虚拟地址转换为第二物理地址。第二物理地址为应用节点的物理地址空间中的物理地址。
应用节点的IOMMU存储有第五地址映射关系。该第五地址映射关系包括应用节点的IOVA地址空间和应用节点的物理地址空间之间的地址映射关系。应用节点的IOMMU根据该第五地址映射关系将第二虚拟地址转换为第二物理地址。
405:应用节点根据该第二物理地址完成目标设备对应用节点的内存访问。
可选地,该第二访问请求为读操作请求或者写操作请求。
在一些示例中,该第二访问请求为同步的配置操作的应答(属于写操作请求),目标设备通过Store语义将应答结果写入到应用节点的内存。
在另一些示例中,该第二访问请求为异步DMA的写操作请求。目标设备通过异步Write语义将结果写入到应用节点的内存。
在又一些示例中,该第二访问请求为异步DMA的读操作请求。目标设备通过异步Read语义将结果从应用节点的内存读取到设备节点内存。
在又一些示例中,该第二访问请求为异步中断请求(属于写操作请求)。目标设备写入应用节点指定的MSI中断向量表空间。应用节点的总线端设备监控对此空间的写入操作,并将MSI数据转发到应用节点中断控制器。中断控制器中断应用节点的CPU。
图8为图7所示过程的简化示意图,展示了基于地址映射关系的地址转换过程。
在本申请实施例中,利用基于内存地址的映射关系,使得应用节点能够调用设备节点的设备,相对于使用RDMA方式,减小了时延开销。并且,对应用节点本地的设备和远端设备(即非应用节点的本地设备)进行统一管理,有利于将设备的物理位置和使用权解耦,实现设备资源的共享。
图9是本申请实施例提供的一种设备访问装置的结构图。该装置可以通过软件、硬件或者两者的结合实现成为装置中的部分或者全部。本申请实施例提供的装置能够实现本申请实施例图3的流程,该装置可以应用于网络节点,该网络节点为第一网络节点或第二网络节点。如图9所示,该装置包括获得模块901和配置模块902。其中,获得模块901用于获得目标物理设备相关的虚拟地址段的地址信息,所述目标物理设备为属于所述第二网络节点的物理设备,所述虚拟地址段包括第一虚拟地址段和第二虚拟地址段,所述第一虚拟地址段属于所述第一网络节点的虚拟地址空间且用于供所述目标物理设备访问所述第一网络节点,所述第二虚拟地址段属于所述第二网络节点的虚拟地址空间且用于供所述第一网络节点访问所述目标物理设备。配置模块902用于根据所述虚拟地址段的地址信息,配置地址映射关系,所述地址映射关系用于与所述目标物理设备相关的访问请求的传输,所述地址映射关系包括第一地址映射关系和第二地址映射关系,所述第一地址映射关系为所述第一网络节点的物理地址空间与所述第二虚拟地址段之间的映射关系,所述第二地址映射关系为所述第二网络节点的物理地址空间与所述第一虚拟地址段之间的映射关系。
当该装置应用于第一网络节点时,获得模块901用于为所述目标物理设备分配第一虚拟地址段,以得到所述第一虚拟地址段的地址信息;以及得到所述第二网络节点为所述目标物理设备分配的第二虚拟地址段的地址信息。
当该装置应用于第二网络节点时,获得模块901用于为所述目标物理设备分配第二虚拟地址段,得到所述第二虚拟地址段的地址信息;以及得到所述第一网络节点为所述目标物理设备分配的第一虚拟地址段的地址信息。
当该装置应用于第一网络节点时,配置模块902用于基于所述第二虚拟地址段的地址信息,建立并存储所述第一地址映射关系;向所述第二网络节点发送所述第一虚拟地址段的地址信息,以使所述第二网络节点维护所述第二地址映射关系。
当该装置应用于第二网络节点时,配置模块902用于基于所述第一虚拟地址段的地址信息,建立并存储所述第二地址映射关系;向所述第一网络节点发送所述第二虚拟地址段的地址信息,以使所述第一网络节点维护所述第一地址映射关系。
在一些示例中,所述第一网络节点包括第一总线端设备,所述第一总线端设备用于使用所述第一地址映射关系与所述第二网络节点通信,所述第一地址映射关系为所述第一总线端设备在所述第一网络节点中对应的物理地址空间与所述第二虚拟地址段之间的映射关系。或者,所述第二网络节点包括第二总线端设备,所述第二总线端设备用于使用所述第二地址映射关系与所述第一网络节点通信,所述第二地址映射关系为所述第二总线端设备在所述第二网络节点中对应的物理地址空间与所述第一虚拟地址段之间的映射关系。
当该装置应用于第一网络节点时,该装置还包括:收发模块903,用于接收来自所述第二网络节点的输入输出虚拟地址IOVA段的地址信息,所述IOVA段的地址信息用于指示第二网络节点中与所述目标物理设备对应的输入输出虚拟地址空间,且所述IOVA段与所述第一虚拟地址段相对应;配置模块902还用于根据所述IOVA段的地址信息,保存所述第一虚拟地址段和所述IOVA段之间的地址转换关系。
示例性地,所述地址转换关系为所述第一虚拟地址段的起始地址和所述IOVA段的起始地址之间的偏移量,且所述偏移量为常量。
示例性地,所述第一虚拟地址段包括第一子地址段和第二子地址段,所述第一子地址段用于供所述目标物理设备发起基于直接内存访问的访问请求,所述第二子地址段用于供所述目标物理设备发起中断请求。
在一些示例中,该装置还包括收发模块903,该收发模块903用于向控制器发送设备获取请求,所述设备获取请求用于请求所述控制器分配物理设备;接收所述控制器发送的设备指示信息,所述设备指示信息用于指示所述控制器根据所述设备获取请求为所述第一网络节点分配的目标物理设备;确定模块901还用于根据所述设备指示信息确定所述目标物理设备。
图10是本申请实施例提供的一种设备访问装置的结构图。该装置可以通过软件、硬件或者两者的结合实现成为装置中的部分或者全部。本申请实施例提供的装置能够实现本申请实施例图5或图7的流程,该装置可以应用于源网络节点。如图10所示,该装置包括:转换模块1001和发送模块1002。转换模块1001用于将第一虚拟地址转换为第一物理地址,所述第一虚拟地址为第一访问请求中的虚拟地址。发送模块1002用于基于所述第一物理地址和目标地址映射关系向目的网络节点发送第二访问请求,所述第二访问请求与所述第一访问请求对应,所述目标地址映射关系是采用第一方面及其可能的实现方式所述的方法配置的。其中,所述源网络节点为第一网络节点,所述目标地址映射关系为所述第一地址映射关系,所述第一访问请求是所述第一网络节点发起的针对所述第二网络节点中的目标物理设备的访问请求; 或者,所述源网络节点为第二网络节点,所述目标地址映射关系为所述第二地址映射关系,所述第一访问请求是所述目标物理设备发起的针对所述第一网络节点的访问请求。
在一些示例中,所述源网络节点为第一网络节点,所述第一访问请求中还包括目标IOVA地址,所述第一访问请求用于指示所述目标物理设备发起针对所述目标IOVA地址的访问,所述目标IOVA地址属于IOVA段,所述IOVA段属于第二网络节点中与所述目标物理设备对应的输入输出虚拟地址空间,且与所述第一虚拟地址段相对应。
在一些示例中,该装置还包括:确定模块1003,用于根据所述第一虚拟地址段和所述IOVA段之间的地址转换关系确定目标IOVA地址。
在一些示例中,所述地址转换关系为所述第一虚拟地址段的起始地址和所述IOVA段的起始地址之间的偏移量,且所述偏移量为常量。
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时也可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成为一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
该集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端设备(可以是个人计算机,手机,或者网络节点等)或处理器(processor)执行本申请各个实施例该方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是:上述实施例提供的设备访问装置在进行设备访问时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的设备访问装置与设备访问方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
本申请实施例中还提供了一种计算机设备。图11示例性的提供了计算机设备1100的一种可能的架构图。
计算机设备1100包括存储器1101、处理器1102、通信接口1103、总线1104和总线端设备1105。其中,存储器1101、处理器1102、通信接口1103和总线端设备1105通过总线1104实现彼此之间的通信连接。
存储器1101可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器1101可以存储程序,当存储器1101中存储的程序被处理器1102执行时,处理器1102和通信接口1103用于执行设备访问方法。存储器1101还可以存储数据集合,例如:存储器1101中的一部分存储资源被划分成一个数据集存储模块,用于存储地址映射关系。
处理器1102可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),图形处理器(graphics processing unit,GPU)或者一个或多个集成电路。
处理器1102还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请的网络故障分析装置的部分或全部功能可以通过处理器1102中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1102还可以是通用处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请上述实施例中的公开的各方法。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1101,处理器1102读取存储器1101中的信息,结合其硬件完成本申请实施例的网络节点的配置装置或者访问请求的处理装置的部分功能。
通信接口1103使用例如但不限于收发器一类的收发模块,来实现计算机设备1100与其他设备或通信网络之间的通信。例如,可以通过通信接口1103获取内存段的地址信息等。
总线1104可包括在计算机设备1100各个部件(例如,存储器1101、处理器1102、通信接口1103)之间传送信息的通路。
总线端设备1105用于与其他总线端设备通信。
上述各个附图对应的流程的描述各有侧重,某个流程中没有详述的部分,可以参见其他流程的相关描述。
本申请实施例中,还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机指令,当计算机可读存储介质中存储的计算机指令被计算机设备执行时,使得计算机设备执行上述所提供的网络节点的配置方法或者执行上述所提供的访问请求的处理方法。
本申请实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机设备上运行时,使得计算机设备执行上述所提供的网络节点的配置方法或者执行上述所提供的访问请求的处理方法。
本申请实施例中,还提供了一种芯片,包括处理电路和接口电路,所述接口电路与所述处理电路通过线路互联,所述接口电路用于从存储介质接收信号,并向所述处理电路发送所述信号,所述信号包括所述存储介质中存储的计算机指令;当所述计算机指令被处理电路执行时,使得处理电路执行网络节点的配置方法或者执行上述所提供的访问请求的处理方法。
本申请实施例中,还提供了一种通信系统,包括第一网络节点和第二网络节点。第一网络节点和第二网络节点均用于按照第一方面及其可能的实施方式中对应的方式配置地址映射关系。
在一些示例中,第一网络节点和第二网络节点还用于按照第二方面及其能的实施方式中对应的方式发起与目标物理设备相关的访问请求。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现,当 使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令,在服务器或终端上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴光缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是服务器或终端能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(如软盘、硬盘和磁带等),也可以是光介质(如数字视盘(Digital Video Disk,DVD)等),或者半导体介质(如固态硬盘等)。
以上所述仅为本申请的可选实施例,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应该以权利要求的保护范围为准。

Claims (17)

  1. 一种网络节点的配置方法,其特征在于,应用于第一网络节点或者第二网络节点,所述方法包括:
    获得目标物理设备相关的虚拟地址段的地址信息,所述目标物理设备为属于所述第二网络节点的物理设备,所述虚拟地址段包括第一虚拟地址段和第二虚拟地址段,所述第一虚拟地址段属于所述第一网络节点的虚拟地址空间且用于供所述目标物理设备访问所述第一网络节点,所述第二虚拟地址段属于所述第二网络节点的虚拟地址空间且用于供所述第一网络节点访问所述目标物理设备;
    根据所述虚拟地址段的地址信息,配置地址映射关系,所述地址映射关系用于与所述目标物理设备相关的访问请求的传输,所述地址映射关系包括第一地址映射关系和第二地址映射关系,所述第一地址映射关系为所述第一网络节点的物理地址空间与所述第二虚拟地址段之间的映射关系,所述第二地址映射关系为所述第二网络节点的物理地址空间与所述第一虚拟地址段之间的映射关系。
  2. 根据权利要求1所述的方法,其特征在于,所述获得目标物理设备相关的虚拟地址段的地址信息,包括:
    所述第一网络节点为所述目标物理设备分配第一虚拟地址段,以得到所述第一虚拟地址段的地址信息;
    所述第一网络节点得到所述第二网络节点为所述目标物理设备分配的第二虚拟地址段的地址信息;
    或者,
    所述获得目标物理设备相关的虚拟地址段的地址信息,包括:
    所述第二网络节点为所述目标物理设备分配第二虚拟地址段,以得到所述第二虚拟地址段的地址信息;
    所述第二网络节点得到所述第一网络节点为所述目标物理设备分配的第一虚拟地址段的地址信息。
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述虚拟地址段的地址信息,配置地址映射关系,包括:
    所述第一网络节点基于所述第二虚拟地址段的地址信息,建立并存储所述第一地址映射关系;
    所述第一网络节点向所述第二网络节点发送所述第一虚拟地址段的地址信息,以使所述第二网络节点维护所述第二地址映射关系;
    或者,
    所述根据所述虚拟地址段的地址信息,配置地址映射关系,包括:
    所述第二网络节点基于所述第一虚拟地址段的地址信息,建立并存储所述第二地址映射关系;
    所述第二网络节点向所述第一网络节点发送所述第二虚拟地址段的地址信息、,以使所述第一网络节点维护所述第一地址映射关系。
  4. 根据权利要求3所述的方法,其特征在于,所述第一网络节点包括第一总线端设备,所述第一总线端设备用于使用所述第一地址映射关系与所述第二网络节点通信,所述第一地址映射关系为所述第一总线端设备在所述第一网络节点中对应的物理地址空间与所述第二虚拟地址段之间的映射关系;或者,
    所述第二网络节点包括第二总线端设备,所述第二总线端设备用于使用所述第二地址映射关系与所述第一网络节点通信,所述第二地址映射关系为所述第二总线端设备在所述第二网络节点中对应的物理地址空间与所述第一虚拟地址段之间的映射关系。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述方法应用于所述第一网络节点,所述方法还包括:
    接收来自所述第二网络节点的输入输出虚拟地址IOVA段的地址信息,所述IOVA段属于第二网络节点中与所述目标物理设备对应的输入输出虚拟地址空间,且所述IOVA段与所述第一虚拟地址段相对应;
    根据所述IOVA段的地址信息,保存所述第一虚拟地址段和所述IOVA段之间的地址转换关系。
  6. 根据权利要求5所述的方法,其特征在于,所述地址转换关系为所述第一虚拟地址段的起始地址和所述IOVA段的起始地址之间的偏移量,且所述偏移量为常量。
  7. 根据权利要求1至6任一项所述的方法,其特征在于,所述第一虚拟地址段包括第一子地址段和第二子地址段,所述第一子地址段用于供所述目标物理设备发起基于直接内存访问的访问请求,所述第二子地址段用于供所述目标物理设备发起中断请求。
  8. 根据权利要求1至7任一项所述的方法,其特征在于,所述方法应用于所述第一网络节点,所述方法还包括:
    向控制器发送设备获取请求,所述设备获取请求用于请求所述控制器分配物理设备;
    接收所述控制器发送的设备指示信息,所述设备指示信息用于指示所述控制器根据所述设备获取请求为所述第一网络节点分配的目标物理设备。
  9. 一种访问请求的处理方法,其特征在于,应用于源网络节点,所述方法包括:
    将第一虚拟地址转换为第一物理地址,所述第一虚拟地址为第一访问请求中的虚拟地址;
    基于所述第一物理地址和目标地址映射关系向目的网络节点发送第二访问请求,所述第二访问请求与所述第一访问请求对应,所述目标地址映射关系是采用权1至8任一项所述的方法配置的;
    其中,所述源网络节点为第一网络节点,所述目标地址映射关系为所述第一地址映射关系,所述第一访问请求是所述第一网络节点发起的针对所述第二网络节点中的目标物理设备 的访问请求;或者,所述源网络节点为第二网络节点,所述目标地址映射关系为所述第二地址映射关系,所述第一访问请求是所述目标物理设备发起的针对所述第一网络节点的访问请求。
  10. 根据权利要求9所述的方法,其特征在于,所述源网络节点为第一网络节点,所述第一访问请求中还包括目标IOVA地址,所述第一访问请求用于指示所述目标物理设备发起针对所述目标IOVA地址的访问,所述目标IOVA地址属于IOVA段,所述IOVA段属于第二网络节点中与所述目标物理设备对应的输入输出虚拟地址空间,且与所述第一虚拟地址段相对应。
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:
    根据所述第一虚拟地址段和所述IOVA段之间的地址转换关系确定目标IOVA地址。
  12. 根据权利要求11所述的方法,其特征在于,所述地址转换关系为所述第一虚拟地址段的起始地址和所述IOVA段的起始地址之间的偏移量,且所述偏移量为常量。
  13. 一种网络节点的配置装置,其特征在于,应用于第一网络节点或者第二网络节点,所述装置包括:
    获得模块,用于获得目标物理设备相关的虚拟地址段的地址信息,所述目标物理设备为属于所述第二网络节点的物理设备,所述虚拟地址段包括第一虚拟地址段和第二虚拟地址段,所述第一虚拟地址段属于所述第一网络节点的虚拟地址空间且用于供所述目标物理设备访问所述第一网络节点,所述第二虚拟地址段属于所述第二网络节点的虚拟地址空间且用于供所述第一网络节点访问所述目标物理设备;
    配置模块,用于根据所述虚拟地址段的地址信息,配置地址映射关系,所述地址映射关系用于与所述目标物理设备相关的访问请求的传输,所述地址映射关系包括第一地址映射关系和第二地址映射关系,所述第一地址映射关系为所述第一网络节点的物理地址空间与所述第二虚拟地址段之间的映射关系,所述第二地址映射关系为所述第二网络节点的物理地址空间与所述第一虚拟地址段之间的映射关系。
  14. 一种访问请求的处理装置,其特征在于,应用于源网络节点,所述装置包括:
    转换模块,用于将第一虚拟地址转换为第一物理地址,所述第一虚拟地址为第一访问请求中的虚拟地址;
    发送模块,用于基于所述第一物理地址和目标地址映射关系向目的网络节点发送第二访问请求,所述第二访问请求与所述第一访问请求对应,所述目标地址映射关系是采用权1至8任一项所述的方法配置的;
    其中,所述源网络节点为第一网络节点,所述目标地址映射关系为所述第一地址映射关系,所述第一访问请求是所述第一网络节点发起的针对所述第二网络节点中的目标物理设备的访问请求;或者,所述源网络节点为第二网络节点,所述目标地址映射关系为所述第二地址映射关系,所述第一访问请求是所述目标物理设备发起的针对所述第一网络节点的访问请 求。
  15. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,其中:
    所述存储器中存储有计算机指令;
    所述处理器执行所述计算机指令,以实现权利要求1-8中任一项权利要求所述的方法,或者,实现权利要求9-12中任一项权利要求所述的方法。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机可读存储介质中的计算机指令被计算机设备执行时,使得所述计算机设备执行权利要求1-8中任一项权利要求所述的方法,或者,执行权利要求9-12中任一项权利要求所述的方法。
  17. 一种计算机程序产品,其特征在于,所述计算机程序产品包括:计算机程序代码,所述程序代码包括用于实现权利要求1-8中任一项权利要求所述的方法,或者,实现权利要求9-12中任一项权利要求所述的方法。
PCT/CN2022/142482 2021-12-31 2022-12-27 网络节点的配置和访问请求的处理方法、装置 WO2023125565A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111668414.8A CN116418848A (zh) 2021-12-31 2021-12-31 网络节点的配置和访问请求的处理方法、装置
CN202111668414.8 2021-12-31

Publications (1)

Publication Number Publication Date
WO2023125565A1 true WO2023125565A1 (zh) 2023-07-06

Family

ID=86997954

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/142482 WO2023125565A1 (zh) 2021-12-31 2022-12-27 网络节点的配置和访问请求的处理方法、装置

Country Status (2)

Country Link
CN (1) CN116418848A (zh)
WO (1) WO2023125565A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785493B (zh) * 2024-02-28 2024-05-07 苏州元脑智能科技有限公司 嵌入式系统的硬件资源访问方法、装置及服务器

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105580010A (zh) * 2014-09-01 2016-05-11 华为技术有限公司 访问文件的方法、装置和存储系统
US20170185546A1 (en) * 2014-09-16 2017-06-29 Huawei Technologies Co., Ltd. Remote Resource Access Method and Switching Device
CN107729159A (zh) * 2017-09-29 2018-02-23 华为技术有限公司 一种共享内存的地址映射方法及装置
CN111221758A (zh) * 2019-09-30 2020-06-02 华为技术有限公司 处理远程直接内存访问请求的方法和计算机设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105580010A (zh) * 2014-09-01 2016-05-11 华为技术有限公司 访问文件的方法、装置和存储系统
US20170185546A1 (en) * 2014-09-16 2017-06-29 Huawei Technologies Co., Ltd. Remote Resource Access Method and Switching Device
CN107729159A (zh) * 2017-09-29 2018-02-23 华为技术有限公司 一种共享内存的地址映射方法及装置
CN111221758A (zh) * 2019-09-30 2020-06-02 华为技术有限公司 处理远程直接内存访问请求的方法和计算机设备

Also Published As

Publication number Publication date
CN116418848A (zh) 2023-07-11

Similar Documents

Publication Publication Date Title
US10365830B2 (en) Method, device, and system for implementing hardware acceleration processing
US11929927B2 (en) Network interface for data transport in heterogeneous computing environments
US9329783B2 (en) Data processing system and data processing method
US7921151B2 (en) Managing a plurality of processors as devices
US20180239726A1 (en) Data transmission method, device, and system
CN108984465B (zh) 一种消息传输方法及设备
CN113688072B (zh) 数据处理方法及设备
EP1805626A2 (en) External data interface in a computer architecture for broadband networks
US11829309B2 (en) Data forwarding chip and server
WO2023066268A1 (zh) 一种处理请求的方法、装置及系统
CN115357416B (zh) 一种跨系统进行数据处理的方法及装置
WO2023125565A1 (zh) 网络节点的配置和访问请求的处理方法、装置
US9703516B2 (en) Configurable interface controller
WO2015055117A1 (zh) 一种内存访问的方法、设备和系统
CN109698845B (zh) 数据传输的方法、服务器、卸载卡及存储介质
US10346209B2 (en) Data processing system for effectively managing shared resources
WO2023030178A1 (zh) 一种基于用户态协议栈的通信方法及相应装置
KR20190108001A (ko) 네트워크온칩 및 이를 포함하는 컴퓨팅 장치
CN116136790A (zh) 任务处理方法和装置
CN115442239B (zh) 带宽资源分配方法、PCIe通道切换器及电子设备
WO2023216603A1 (zh) 一种内存共享方法以及装置
CN118159951A (zh) 一种处理请求的方法、装置及系统
CN117632843A (zh) 一种数据处理方法、装置、片上系统和电子设备
WO2012143942A2 (en) Network interface sharing in multi host computing systems
CN115858422A (zh) 页表的处理方法、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22914817

Country of ref document: EP

Kind code of ref document: A1