Data forwarding chip and server
By introducing a data forwarding chip into the server to directly read or write data in the memory space, the problem of extended data transmission when multiple processors share a network card is solved and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN201910895926.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-09-21
AI Technical Summary
In a server, when multiple processors share a network card, data needs to be transmitted to the network card through the inter-processor communication bus, resulting in increased system I/O overhead and extended data transmission delay.
Design a data forwarding chip that is connected to the network card and the target processor through the bus, receives data forwarding requests, and directly reads or writes data in the memory space through the target endpoint port to avoid cross-chip transmission between processors.
It reduces data transmission delay, reduces processor resource consumption, and improves data transmission efficiency.
Smart Images

Figure CN112540941B
Abstract
Description
Technical Field
[0001] The present application relates to the field of servers, and in particular to a data forwarding chip and a server. Background Art
[0002] With the exponential growth of data, servers are usually equipped with multiple processors, and multiple processors in the server will share a network card. However, a network card shared by multiple processors is usually only connected to one processor. When a processor that is not directly connected to the network card needs to send data through the network card, the data needs to be transmitted to the network card through the data bus between processors, which will increase the system's I / O overhead and data transmission delay. Summary of the invention
[0003] The embodiments of the present application disclose a server and a data forwarding chip, which can avoid cross-chip transmission of data between processors when the server sends or receives data, thereby reducing data transmission latency.
[0004] In a first aspect, the present application provides a server, which includes a data forwarding chip, a network card, and a target processor, wherein the data forwarding chip is connected to the network card and the target processor respectively through a bus, wherein:
[0005] The data forwarding chip is used to: receive a data forwarding request sent by the target processor or the network card;
[0006] The forwarding of the data to be forwarded specified by the data forwarding request is achieved through the target endpoint port, and the target endpoint port is an endpoint port directly connected to the memory space corresponding to the address of the data forwarding request on the data forwarding chip, wherein the address of the data forwarding request includes the source address of the data to be forwarded or the destination address to which the data to be forwarded needs to be written.
[0007] By adding a data forwarding chip for realizing data forwarding between the processor and the network card of the server, when the network card needs to read data in the target memory space of the server, the data forwarding chip reads data from the target memory space through the target endpoint port on the data forwarding chip that is directly connected to the target memory space, and then sends the read data to the network card, or when the network card needs to write data to the target memory space of the server, the data is written to the target memory space through the above-mentioned target endpoint port. This can avoid the problem that data needs to be transmitted across chips through the communication bus between processors when the server sends or receives data, thereby reducing data transmission latency.
[0008] In one possible implementation, the data forwarding chip is also used to determine the target endpoint port directly connected to the memory space corresponding to the address of the data forwarding request based on the address of the data forwarding request and the memory distribution information of the server, wherein the memory distribution information includes the correspondence between at least two endpoint ports of the multiple endpoint ports on the data forwarding chip and the memory space of the server.
[0009] In an embodiment of the present application, the data forwarding chip includes multiple endpoint ports, and the multiple endpoint ports are connected to the memory space of the processor and the server through a bus. At least two of the multiple endpoint ports are directly connected to the memory space of the server. Therefore, when the data forwarding chip or the network card reads data in the memory space or writes data to the memory space, there will be two read / write paths. The data forwarding chip can determine that the endpoint port directly connected to the memory space corresponding to the address of the data forwarding request is the target endpoint port through the correspondence between the at least two endpoint ports and the memory space of the server, and then determine that the path passing through the target endpoint port is the shortest path.
[0010] In one possible implementation, the server includes multiple processors, each of the multiple processors corresponds to a memory space in a preset address range, each processor is directly connected to the corresponding memory space in the preset address range, the memory distribution information includes a correspondence between at least two endpoint ports among the multiple endpoint ports and the memory space in the preset address range corresponding to each processor in the multiple processors, and the target processor is any one of the multiple processors.
[0011] In a possible implementation, the server may adopt a non-uniform memory access NUMA architecture, where the NUMA architecture divides the hardware resources of the server into multiple NUMA nodes, each NUMA node including one or more CPUs and memory in the server.
[0012] The data forwarding chip stores the correspondence between each endpoint port and the memory space address in the server. Each endpoint port is directly connected to the memory space within an address range. When the data forwarding chip receives the above-mentioned data forwarding request, it determines the source address or destination address of the data to be forwarded through the data forwarding request, and determines the target endpoint port directly connected to the server memory space based on the source address or destination address of the data to be forwarded, and then reads data from the memory space or writes data to the memory space through the target endpoint port.
[0013] In a possible implementation, the target processor is used to send the data forwarding request to the data forwarding chip through the bus, where the data forwarding request carries a source address storing the data to be forwarded;
[0014] The data forwarding chip is specifically used to: determine the endpoint port directly connected to the memory space corresponding to the source address as the target endpoint port according to the source address carried by the data forwarding request and the memory distribution information of the server. When the target processor needs to send data in the memory space through the network card, the target processor sends a data forwarding request carrying the source address of the data to be forwarded to the data forwarding chip, and the data forwarding chip determines the target endpoint port directly connected to the memory space corresponding to the source address of the data to be forwarded by the corresponding relationship between the source address and the above memory distribution information.
[0015] In a possible implementation, the network card is used to send the data forwarding request to the data forwarding chip, where the data forwarding request is a write data request sent by the network card to the target processor;
[0016] The data forwarding chip is specifically used to: determine, based on a preset destination address of a write data request and memory distribution information of the server, an endpoint port directly connected to the memory space corresponding to the destination address as the target endpoint port, wherein the destination address is an address corresponding to the memory space allocated by the target processor and used to cache the data to be forwarded.
[0017] In an embodiment of the present application, the server pre-allocates cache space for storing data received by the network card. After the data forwarding chip receives a write data request from the network card, it obtains the address information of the above cache space, and combines the above memory distribution information to determine the endpoint port on the data forwarding chip that is directly connected to the above cache space as the target endpoint port.
[0018] In a possible implementation manner, the data forwarding chip is further used for:
[0019] Determining a path for forwarding the data to be forwarded according to the target endpoint port, wherein the path includes the target endpoint port;
[0020] Acquire the data to be forwarded from the memory space corresponding to the source address of the data to be forwarded through the path and cache it, and send the cache address of caching the data to be forwarded to the network card, so that the network card acquires the data to be forwarded according to the cache address; or
[0021] The data to be forwarded is obtained from the network card, and the data to be forwarded is sent to the memory space corresponding to the address of the data forwarding request through the path.
[0022] In one possible implementation, the data forwarding chip obtains the data to be forwarded from the memory space corresponding to the source address through the path by means of direct memory access DMA, or the data forwarding chip sends the data to be forwarded to the memory space corresponding to the address of the data forwarding request through the path by means of direct memory access DMA.
[0023] In a possible implementation manner, the network card obtains the data to be forwarded from the cache space corresponding to the cache address of the data forwarding chip through the DMA mode.
[0024] After determining the above-mentioned target endpoint port, the data forwarding chip can determine a shortest path passing through the above-mentioned target endpoint port. The data forwarding chip obtains the data to be forwarded from the memory space corresponding to the source address of the data to be forwarded through the shortest path, or writes the data to be forwarded into the memory space corresponding to the address of the data forwarding request through the shortest path, thereby avoiding cross-chip transmission of data between processors when the network card reads data in the memory space or writes data to the memory space, increasing data transmission delay and reducing processor resource consumption.
[0025] In a specific implementation manner, the data forwarding chip and the network card are devices that support the single root input and output virtualization SR-IOV standard.
[0026] In a possible implementation, the data forwarding chip is further used to enumerate the network card, obtain information about a functional unit in the network card, and assign an address to the functional unit, wherein the functional unit is used to implement the function of the network card, and the information about the functional unit includes information about a physical function PF and / or information about a virtual function VF;
[0027] The target processor is used to: enumerate the data forwarding chip, obtain information of the proxy unit in the data forwarding chip, assign an address to the proxy unit, and send the address information of the proxy unit to the data forwarding chip, wherein the proxy unit is a proxy of the functional unit;
[0028] The data forwarding chip is further used to establish a corresponding relationship between the address information of the proxy unit and the address information of the functional unit according to the address information of the proxy unit.
[0029] In the embodiment of the present application, the server includes multiple processors, and a first processor among the multiple processors is connected to the data forwarding chip via a bus;
[0030] The data forwarding chip is further used to: enumerate the network card, obtain information of a first functional unit in the network card, and assign an address to the first functional unit, wherein the first functional unit is used to implement the function of the network card, and the information of the first functional unit includes information of a first physical function PF and / or information of a first virtual function VF;
[0031] The first processor is used to: enumerate the data forwarding chip, obtain information of a first proxy unit in the data forwarding chip, assign an address to the first proxy unit, and send the address information of the first proxy unit to the data forwarding chip, wherein the first proxy unit is a proxy of the first functional unit;
[0032] The data forwarding chip is further used to establish a corresponding relationship between the address information of the first agent unit and the address information of the first functional unit according to the address information of the first agent unit.
[0033] The server further includes a second processor, which is connected to the data forwarding chip and the first processor respectively through the bus;
[0034] The data forwarding chip is further used to: enumerate the network card, obtain information of a second functional unit in the network card, and assign an address to the second functional unit, wherein the second functional unit is used to implement the function of the network card, and the information of the second functional unit includes information of a second physical function PF and information of a second virtual function VF;
[0035] The second processor is used to: enumerate the data forwarding chip, obtain information of the second agent unit in the data forwarding chip, assign an address to the second agent unit, and send the address information of the second agent unit to the data forwarding chip, wherein the second agent unit is an agent of the second functional unit;
[0036] The data forwarding chip is further used to establish a corresponding relationship between the address information of the second agent unit and the address information of the second functional unit according to the address information of the second agent unit.
[0037] In a possible implementation, the PF information of the first functional unit includes the bus device function BDF information of the first PF and the space address of the base address register BAR; the information of the first virtual unit VF includes the BDF information and the BAR space address of the first VF; the information of the first agent unit includes the BDF and BAR space address of the first agent unit PF'; the PF information of the second functional unit includes the bus device function BDF information of the second PF and the space address of the base address register BAR; the information of the second virtual unit VF includes the BDF information and the BAR space address of the second VF; the information of the second agent unit includes the BDF and BAR space address of the second agent unit PF'.
[0038] In a possible implementation, the data forwarding chip is further used to implement forwarding of the data forwarding request between the processor and the network card based on the correspondence between the address information of the proxy unit in the data forwarding chip and the address information of the functional unit in the network card.
[0039] In one possible implementation, the data forwarding chip receives a first access request sent by the network card, wherein the first access request is used to access the target processor, the data forwarding request includes a read data request and a write data request, and the source address of the first access request is the address information of the functional unit in the network card; maps the first access request to a second access request, wherein the source address of the second access request is the address information of the proxy unit in the data forwarding chip; and sends the second access request to the target processor through the target endpoint port.
[0040] In a possible implementation, after the data forwarding chip determines the path for forwarding the data to be forwarded according to the above-mentioned target endpoint port, the data forwarding chip is also used to send the source address of the data to be forwarded to the network card, receive the first read data request sent by the network card to the target processor according to the source address of the data to be forwarded; the read data request carries the address information of the functional unit of the network card; the address information of the functional unit is replaced with the address information of the proxy unit to obtain a second read data request, and the second read data request is sent to the target processor.
[0041] In one possible implementation, the data forwarding chip receives a first write data request sent by the network card, the first write data request carries address information of a functional unit of the network card, replaces the address information of the functional unit with the address information of the proxy unit, obtains a second write data request, and sends the second write data request to the target processor.
[0042] In one possible implementation, the network card obtains the data in the corresponding memory space from the source address of the data to be forwarded through the target port through the DMA method; or, the network card writes the received data into the memory space through the target endpoint port through the DMA method.
[0043] When the above-mentioned data forwarding chip is only used to determine the above-mentioned shortest path, when the network card needs to directly obtain data in the memory unit or write data to the memory unit through the above-mentioned shortest path, the network card needs to send an access request to the target processor. The access request carries the address information of the functional unit of the network card. Since the target processor is directly connected to the data forwarding chip, the target processor cannot recognize the access request sent by the network card. When the access request passes through the data forwarding chip, the data forwarding chip will replace the information of the functional unit of the network card in the access request with the information of the corresponding proxy unit of the data forwarding chip, so that the target processor can recognize the access request.
[0044] In a possible implementation, the target processor is further used to load a driver program of the data forwarding chip, and obtain the memory distribution information by running the driver program and send the information to the data forwarding chip.
[0045] In a possible implementation, the server includes 2, 4 or 8 processors, and every two processors are connected to a network card via a data forwarding chip.
[0046] In a second aspect, the present application provides a data forwarding chip, the data forwarding chip comprising a routing module, at least two first endpoint ports and a second endpoint port, the at least two first endpoint ports are respectively connected to at least two processors of a server, and the second endpoint port is connected to a network card of the server;
[0047] A routing module, used to: respectively connect to the first endpoint port and the second endpoint port, and receive a data forwarding request sent by a target processor through the first endpoint port or receive a request sent by the network card through the second endpoint port; and forward the data to be forwarded specified by the data forwarding request through the target endpoint port, wherein the target endpoint port is an endpoint port directly connected to the memory space corresponding to the address of the data forwarding request among the at least two first endpoint ports, and the target processor is any one of the at least two processors.
[0048] In a possible implementation manner, the data forwarding chip further includes:
[0049] A recording module, used for recording memory distribution information of the server, wherein the memory distribution information includes a correspondence between the at least two first endpoint ports and the memory space of the server;
[0050] The routing module is also used for:
[0051] Memory distribution information of the server is obtained from the recording module, and the target endpoint port is determined according to the memory distribution information and the address of the data forwarding request.
[0052] In one possible implementation, the memory distribution information is obtained by the target processor loading a driver program of the data forwarding chip and running the driver program; after the routing module receives the memory distribution information sent by the target processor through the first endpoint port, the memory distribution information is sent to the recording module for storage.
[0053] In one possible implementation, the memory distribution information includes a correspondence between the at least two first endpoint ports and memory spaces in a preset address range corresponding to the at least two processors in the server, wherein the server includes multiple target processors, each of the at least two processors corresponds to a memory space in a preset address range, and each processor is directly connected to the corresponding memory space in the preset address range.
[0054] In a possible implementation, the routing module is specifically used to:
[0055] Acquire the data forwarding request sent by the target processor through the at least two first endpoint ports, wherein the data forwarding request carries a source address storing the data to be forwarded;
[0056] The target endpoint port directly connected to the memory space corresponding to the source address of the data to be forwarded is determined according to the source address carried in the data forwarding request and the memory distribution information of the server.
[0057] In a possible implementation, the routing module is specifically used to:
[0058] Acquire the data forwarding request sent by the network card through the second endpoint port, where the data forwarding request is a write data request sent by the network card to the target processor;
[0059] According to the preset destination address of the write data request and the memory distribution information of the server, determine the target endpoint port directly connected to the memory space corresponding to the preset destination address of the write data request, wherein the preset destination address of the write data request is the address corresponding to the memory space allocated by the target processor for caching the data to be forwarded.
[0060] In a possible implementation, the routing module is specifically used to:
[0061] Determine, according to the target endpoint port, a path for forwarding the data to be forwarded, wherein the path includes a target endpoint port directly connected to a memory space corresponding to an address of the data forwarding request;
[0062] The data forwarding chip further includes a direct memory access (DMA) engine, which is used to: obtain the data to be forwarded from the memory space corresponding to the source address of the data to be forwarded through the path and cache it, and send a cache address of the data to be forwarded to the network card, so that the network card obtains the data to be forwarded according to the cache address; or
[0063] The data to be forwarded is obtained from the network card, and the data to be forwarded is sent to the memory space corresponding to the address of the data forwarding request through the path.
[0064] In a possible implementation, the routing module is further used to: enumerate the network card, obtain information about a functional unit in the network card, and assign an address to the functional unit, wherein the functional unit is used to implement the function of the network card, and the information about the functional unit includes information about a physical function PF and / or information about a virtual function VF;
[0065] Receiving address information of a proxy unit sent by a target processor, wherein the proxy unit is a proxy of the functional unit, and the address information of the proxy unit is obtained after the target processor enumerates the data forwarding chip, obtains information of the proxy unit in the data forwarding chip, and allocates an address to the proxy unit;
[0066] According to the address information of the proxy unit, a correspondence relationship between the address information of the proxy unit and the address information of the functional unit is established, and the correspondence relationship between the address information of the proxy unit and the address information of the functional unit is sent to the recording module for storage.
[0067] In a possible implementation, after the routing module determines the path for forwarding the data to be forwarded according to the target endpoint port, the routing module is further used to send the source address of the data to be forwarded to the network card, and receive a read data request sent by the network card to the target processor according to the source address of the data to be forwarded; or, when the network card needs to write the data to be forwarded into the memory space, receive a write data request sent by the network card; and send the read data request or the write data request to the target processor through the path.
[0068] In a possible implementation, the routing module is also used to: receive an access request sent by the network card, and forward the access request to the target processor based on the correspondence between the address information of the functional unit in the network card and the address information of the proxy unit in the data forwarding chip, wherein the access request is a read data request or a write data request.
[0069] In a possible implementation, the routing module receives a first access request sent by the network card, wherein the first access request is used to access the target processor, the data forwarding request includes a read data request and a write data request, and the source address of the first access request is the address information of the functional unit in the network card; maps the first access request to a second access request, wherein the source address of the second access request is the address information of the proxy unit in the data forwarding chip; and sends the second access request to the target processor through the target endpoint port.
[0070] In a possible implementation, the data forwarding chip may be implemented by a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC) chip.
[0071] In a third aspect, an embodiment of the present application provides a data forwarding method, which includes: a data forwarding chip receives a data forwarding request sent by a target processor or a network card; the data forwarding chip implements forwarding of the data to be forwarded specified by the data forwarding request through a target endpoint port, and the target endpoint port is an endpoint port directly connected to the memory space corresponding to the address of the data forwarding request among at least two first endpoint ports on the data forwarding chip. Wherein, the data forwarding chip includes the at least two first endpoint ports and the second endpoint port, the at least two first endpoint ports are respectively connected to at least two processors of the server, the second endpoint port is connected to the network card of the server, and the target processor is any one of the at least two processors.
[0072] In a possible implementation, the data forwarding chip determines the target endpoint port based on the address of the data forwarding request and the memory distribution information of the server, wherein the memory distribution information includes the correspondence between the at least two first endpoint ports and the memory space of the server.
[0073] In one possible implementation, the memory distribution information includes a correspondence between the at least two first endpoint ports and the memory space of a preset address range corresponding to the at least two processors, wherein each of the at least two processors corresponds to a memory space of a preset address range, and each processor is directly connected to the corresponding memory space of the preset address range.
[0074] In a possible implementation, it is characterized in that the data forwarding chip determines the target endpoint port according to the address of the data forwarding request and the memory distribution information of the server, including:
[0075] The data forwarding chip obtains the data forwarding request sent by the target processor through any one of the at least two first endpoint ports, where the data forwarding request carries the source address of the data to be forwarded;
[0076] The data forwarding chip determines, according to the source address carried in the data forwarding request and the memory distribution information of the server, that a first endpoint port directly connected to the memory space corresponding to the source address is the target endpoint port.
[0077] In a possible implementation, the data forwarding chip determines the target endpoint port according to the address of the data forwarding request and the memory distribution information of the server, including:
[0078] The data forwarding chip receives a data forwarding request sent by the network card, where the data forwarding request is a write data request sent by the network card to the target processor;
[0079] The data forwarding chip determines, based on a preset destination address of a write data request and memory distribution information of the server, that an endpoint port directly connected to a memory space corresponding to the destination address is the target endpoint port, wherein the destination address is an address corresponding to a memory space allocated by the target processor and used to cache the data to be forwarded.
[0080] In a possible implementation, the data forwarding chip implements forwarding of the data to be forwarded specified by the data forwarding request through the target endpoint port, including:
[0081] The data forwarding chip determines a path for forwarding the data to be forwarded according to the target endpoint port, wherein the path includes the target endpoint port;
[0082] The data forwarding chip obtains and caches the data to be forwarded from the memory space corresponding to the source address of the data to be forwarded through the path, and sends the cache address of the data to be forwarded to the network card, so that the network card obtains the data to be forwarded according to the cache address; or
[0083] The data forwarding chip obtains the data to be forwarded from the network card, and sends the data to be forwarded to the memory space corresponding to the address of the data forwarding request through the path.
[0084] In a possible implementation, before the data forwarding chip forwards the data to be forwarded specified by the data forwarding request through the target endpoint port, the further step includes:
[0085] The data forwarding chip enumerates the network card, obtains information about a functional unit in the network card, and allocates an address to the functional unit, wherein the functional unit is used to implement a function of the network card, and the information about the functional unit includes information about a physical function PF and / or information about a virtual function VF;
[0086] The data forwarding chip receives address information of a proxy unit sent by a target processor, wherein the proxy unit is a proxy of the functional unit in the data forwarding chip, and the address information of the proxy unit is obtained after the target processor enumerates the data forwarding chip, obtains information of the proxy units in the data forwarding chip, and allocates an address to the proxy unit;
[0087] The data forwarding chip establishes a corresponding relationship between the address information of the proxy unit and the address information of the functional unit according to the address information of the proxy unit.
[0088] In a possible implementation, the method further includes: the data forwarding chip enumerating the network card, obtaining information of a first functional unit in the network card, and allocating an address to the first functional unit, wherein the first functional unit is used to implement a function of the network card, and the information of the first functional unit includes information of a first physical function PF and / or information of a first virtual function VF;
[0089] The data forwarding chip receives information of a first proxy unit in the data forwarding chip sent by the first processor, where the first proxy unit is a proxy of the first functional unit, and the address information of the first proxy unit is obtained after the first processor enumerates the data forwarding chip, obtains information of the first proxy unit in the data forwarding chip, and allocates an address to the first proxy unit;
[0090] The data forwarding chip establishes a corresponding relationship between the address information of the first agent unit and the address information of the first functional unit according to the address information of the first agent unit.
[0091] In a possible implementation, the data forwarding chip enumerates the network card, obtains information about a second functional unit in the network card, and allocates an address to the second functional unit, wherein the second functional unit is used to implement a function of the network card, and the information about the second functional unit includes information about a second physical function PF and information about a second virtual function VF;
[0092] The data forwarding chip receives information about a second proxy unit in the data forwarding chip sent by a second processor, wherein the second proxy unit is a proxy of the second functional unit, and the address information of the second proxy unit is obtained after the second processor enumerates the data forwarding chip, obtains information about the second proxy unit in the data forwarding chip, and allocates an address to the second proxy unit;
[0093] The data forwarding chip establishes a corresponding relationship between the address information of the second agent unit and the address information of the second functional unit according to the address information of the second agent unit.
[0094] In a possible implementation, the method further includes:
[0095] The data forwarding chip implements forwarding of the data forwarding request between the target processor and the network card according to the address information of the proxy unit and the address information of the functional unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0097] Figure 1 is a schematic diagram of a NUMA architecture provided in an embodiment of the present application;
[0098] Figure 2It is a schematic diagram of communication between multi-socket servers provided in an embodiment of the present application;
[0099] Figure 3 is a schematic diagram of another communication between multi-socket servers provided in an embodiment of the present application;
[0100] Figure 4 This is a schematic diagram of the connection between a data forwarding chip, a server and a network card provided in an embodiment of the present application;
[0101] Figure 5 This is a schematic diagram of the correspondence between a data forwarding chip, a server, and a network card in an SR-IOV mode provided by an embodiment of the present application;
[0102] Figure 6 This is a flow chart of a method for a server to send data provided by an embodiment of the present application;
[0103] Figure 7 This is a flow chart of another method for a server to send data provided by an embodiment of the present application;
[0104] Figure 8 This is a schematic diagram of the connection between a data forwarding chip, a 4P server and a network card provided in an embodiment of the present application;
[0105] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0106] In order to help those skilled in the art better understand the technical solution of the present application, some concepts involved in the embodiments of the present application are first introduced.
[0107] Bus device function (BDF): A unique identifier for each function in a peripheral component interface express (PCIe) device. Each PCIe device can have only one function or up to eight functions. Regardless of how many functions a PCIe device has, each function has a unique and independent configuration space. PCIe configuration software (such as the PCIe root complex, etc.) can identify the logical topology of the PCIe bus system, as well as each bus, each PCIe device, and each function of the PCIe device, that is, it can identify the BDF. In BDF, the Bus Number occupies 8 bits, the Device Number occupies 5 bits, and the Function Number occupies 3 bits.
[0108] PCIe device enumeration: The PCIe architecture is generally composed of PCIe devices such as the root complex, switch, and endpoint. In the root complex and switch, there are usually embedded endpoints (such devices have no external PCIe interface). When the computer system where the PCIe device is located is started, the central processing unit (CPU) needs to identify these devices. The root complex usually uses a specific algorithm, such as a depth-first algorithm, to visit every possible branch path until it can no longer be accessed in depth, and each PCIe device is only visited once. This process is called PCIe device enumeration.
[0109] Single root input / output virtualization (SR-IOV) technology: A hardware-based virtualization solution that improves performance and scalability. With SR-IOV technology, a single input / output (I / O) resource can be shared by multiple virtual machines, each of which has access to a unique I / O resource. PCIe devices (such as Ethernet ports) with SR-IOV enabled and with appropriate hardware and operating system (OS) support can appear as multiple separate physical devices, each with its own PCIe configuration space. The technology abstracts two types of functions for users to use, called physical functions (PF) and virtual functions (VF). PF is a full-featured PCIe function that can be discovered, managed, and processed like any other PCIe device. PF has fully configured resources and can be used to configure or control PCIe devices. VF is a function associated with a PF. It is a lightweight PCIe function that can share one or more physical resources with a PF and other VFs associated with the same PF. VFs are only allowed to have configuration resources for their own behavior. Each device that implements SR-IOV can have one PF or multiple PFs, and each PF can have up to 64,000 VFs associated with it. PFs can create VFs through registers that are designed with properties dedicated to this purpose. Each VF has a PCIe internal space that maps its register set. The VF device driver operates on the register set to enable its functionality and appears as an actual PCIe device. Each PF or VF has a unique BDF in the PCIe bus system.
[0110] Multi-PF scenario: refers to a physical port of a physical network card that can be divided into multiple PFs, that is, only one port is physically available, but multiple independent PCIe devices, independent network ports, independent media access control (MAC) addresses, etc. can be seen in the basic input / output system (BIOS) scan and OS. For example: Intel XL710 network card, supporting 40 Gigabit Ethernet (GE), has one physical network port; the 40GE network port can be divided into four 10GE network ports, which is a scenario where one physical port is divided into four PFs.
[0111] Transaction layer packet (TLP) message: PCIe bus uses transactions to transmit data, which is also called TLP message. TLP message usually contains message header, data segment, and checksum information. PCIe messages are mainly divided into: memory access read / write, I / O access read / write, configuration space access read / write, and message transactions.
[0112] Base address register (BAR) space address: Each PCIe device (such as PF or VF) has its own internal space, which cannot be directly accessed by the CPU. When the CPU needs to read data from the internal space of PF or VF, the root complex first reads the data from PF or VF to the CPU-accessible memory through TLP messages, and then the CPU reads the data from the accessible memory; if the CPU wants to write data to the internal space of PF or VF, the data is first written to the memory, and then the root complex writes the data to the internal space of PF or VF through TLP messages.
[0113] Virtualization: Virtualization is the abstraction of one form of resources into another form. Virtualization is essentially a simulation. System virtualization is the virtualization of a physical computer system (Host) into one or more VMs. Each VM has its own hardware, such as CPU, memory, and various peripherals. Each VM can run its own OS and applications. The hardware resources owned by the VM can be either software simulated or real physical hardware.
[0114] The following first introduces the application scenario of the device provided by the present application. With the exponential growth of data, the server is usually equipped with a motherboard with multiple CPU slots (multi-socket) and a network interface card (NIC). Each CPU slot can be inserted with a processor, that is, the server includes multiple CPUs, and the multiple CPUs are connected through a communication bus. However, multiple CPUs in the server share a network card, and the network card shared by multiple CPUs is only connected to one of the CPUs. When a CPU that is not directly connected to the network card needs to send data to the network through the network card, the data needs to be transmitted to the network card through the communication bus between processors, which will increase the system's I / O overhead and data transmission delay. Among them, the above-mentioned communication bus includes but is not limited to a quick path interconnect (QPI) bus, a super interconnect channel (UPI) bus or an Intel accelerator link ( acceleratorlink, IAL) bus, etc.
[0115] For example, taking the server adopting non-uniform memory access architecture (NUMA) as an example, Figure 1 It is a schematic diagram of the NUMA architecture. The NUMA architecture divides the hardware resources of the server into multiple NUMA nodes. Each NUMA node includes one or more CPUs, memory, and memory controllers in the server. The CPU in each NUMA node is directly connected to the memory, and the memory in each NUMA node is separated from each other. Information can be exchanged between each NUMA node, so each CPU can access the memory of the entire computer system. Each NUMA node shares a memory controller. The memory resources in the NUMA node are equivalent to all CPUs in the NUMA node, that is, the memory in each NUMA node is local memory for the CPU in the NUMA node, but it is remote memory for CPUs in other NUMA nodes. The speed at which each CPU accesses local memory is faster than the speed at which it accesses remote memory.
[0116] Figure 2It is a schematic diagram of communication between two multi-socket servers, wherein server 100 and server 200 each include two sockets. If each socket is used as a NUMA node, each NUMA node includes a CPU and corresponding memory. The two CPUs in each server share a network card, and the network card of each server is directly connected to one of the CPUs for communication. The CPU directly connected to the network card is used as the local CPU (local CPU), and the other CPU is used as the remote CPU (remote CPU). In server 100, if the data of the application running on the remote CPU needs to be transmitted over the network, and the memory requested by the application is in the NUMA node where the above-mentioned remote CPU is located, that is, the data of the application is in the local memory corresponding to the remote CPU, then the data of the application needs to be transmitted to the network card via the communication bus between the remote CPU and the local CPU, and then sent to the network through the network card. If, in the server 200 that receives the above data, an application that needs to use the above data runs in the remote CPU of the server 200, and the memory requested by the application is the local memory corresponding to the remote CPU of the server 200, then after receiving the above data, the network card of the server 200 needs to send the data to the local memory corresponding to the remote CPU through the communication bus between the CPUs.
[0117] When the above servers send or receive data, the data may be transmitted across chips (that is, the data needs to be transmitted to the network card through the communication bus between the CPUs). This data transmission method will increase the CPU occupancy rate and increase the data transmission delay.
[0118] Figure 3 This is another schematic diagram of communication between multi-socket servers. Figure 3 The network card can provide multiple PCIe interfaces, so that each CPU in the server can be directly connected to the network card through the bus. For example, if the server 100 includes two CPUs, the network card can provide two PCIe interfaces, and each CPU can directly send data to the network card. Figure 1 When the mid-to-remote CPU sends data, the data needs to be transmitted across the processor bus to the network card, and finally sent to other servers by the network card.
[0119] But in the above Figure 3In the server shown, it is necessary to manually configure the NUMA policy of the server, that is, manually set the server to allocate local memory (that is, memory located in the same NUMA node as the CPU running the application) to the application when the application is running to store the application's data, and when the application's data needs to be sent to other servers, the CPU running the application sends the data to the network card through the interface connecting the CPU and the network card. This method requires the application to be aware of the server's NUMA information. When the application is running, it applies for local memory based on the perceived NUMA information, and when the application needs to send data, the CPU running the application can send the data directly to the network card, thereby avoiding the above-mentioned Figure 1 The remote CPU shown in needs to send data to the network card through the inter-processor bus.
[0120] The NUMA information includes hardware structures and logical architectures such as the number of NUMA nodes in the server, the number of processors in each NUMA node, the size of the memory in each NUMA node, and the address range of the memory in each NUMA node. Figure 3 In the example, the NUMA information of the server 100 includes the address range of the memory in each NUMA node in the server and the mapping relationship between the above-mentioned multiple NUMA nodes and multiple network cards, specifically including: the server 30 includes two NUMA nodes, NUMA node A and NUMA node B, NUMA node A includes CPU0 and memory 0 (memory0), the address range of the memory of memory0, NUMA node B includes CPU1 and memory 1 (memory1), the address range of the memory of memory1, NUMA node A is connected to the interface A of the network card, and NUMA node B is connected to the interface B of the network card. When the application runs in CPU0 of NUMA node A, the application applies for the cache area in the local memory memory0 for caching data according to the perceived NUMA information of the server 30. When CPU0 needs to send the data of the application to other servers, CPU0 sends the data to the network card through the interface A with the network card.
[0121] However, most current native applications are unable to perceive the server's NUMA information. If an application is unable to perceive the server's NUMA information, when the application is running, the operating system will allocate memory in other NUMA nodes to the application for caching data. If the local memory corresponding to the CPU running the application is insufficient and remote memory needs to be allocated for caching data, then when the application's data needs to be sent, the CPU needs to access the remote memory to obtain the application's data in the remote memory, and then send it to the network card. Alternatively, the operating system will allocate local memory for the application, but when sending the application's data, the operating system may choose to send the data to the network card through an interface in other NUMA nodes that is connected to the network card. For example, Figure 3 In the example, the application is running in CPU0 of server 100, and the memory allocated by CPU0 to the application is located in memory0 of node A. When CPU0 needs to send data of the application, it may choose to send the data to the network card through the I / O interface of node B. In this case, the data still needs to be transmitted across chips, that is, the data needs to be transmitted from the memory module memory0 of node A through the communication bus between nodes and CPU1 to the network card. Therefore, Figure 3 The network card shown in the figure still has the problem of increased CPU overhead and prolonged data transmission.
[0122] In order to solve the problem that when the above-mentioned server sends data, the data needs to be transmitted across chips to reach the network card, which increases CPU overhead and data transmission delay, the embodiment of the present application provides a data forwarding chip, which has multiple processors, each processor corresponds to a memory space with a preset address range, and the embodiment of the present application takes the above-mentioned NUMA architecture server as an example for explanation. Figure 4 As shown, Figure 4 3 is a schematic diagram of a dual-path (2P) server provided in an embodiment of the present application, wherein the server 30 includes a CPU0, a CPU1, a data forwarding chip 500, and a network card 600, wherein the CPU0 is located in a NUMA node 310, and the CPU1 is located in a NUMA node 320, and the CPU0 and the CPU1 are connected via a communication bus 330, wherein the communication bus includes but is not limited to a quick path interconnect (QPI) bus, a super path interconnect (UPI) bus, or an Intel accelerator link ( The CPU0 and CPU1 are connected to the data forwarding chip 500 through a bus respectively, and the data forwarding chip 500 is connected to the network card 600 through a bus, wherein the bus includes but is not limited to a PCIe bus or a UPI bus.
[0123] The data forwarding chip 500 includes an interface module 510, a routing module 520, a recording module 530, a direct memory access (DMA) engine 540, and a second endpoint port 550. The interface module 510 includes a plurality of first endpoint ports for connecting to the socket of the server, wherein at least two of the plurality of first endpoint ports are connected to the memory space corresponding to the processor. In the embodiment of the present application, the interface module 510 includes two first endpoint ports: a first endpoint port 5101 and a first endpoint port 5102 as an example. The first endpoint port 5101 is directly connected to the CPU0 and the memory 0 in the NUMA node 310 through a bus, and the first endpoint port 5102 is directly connected to the CPU1 and the memory 1 in the NUMA node 320 through a bus. The routing module 520 is used to control the data forwarding chip 500. For example, after receiving the data sending request sent by the CPU, the path to obtain the target data is determined according to the address information of the target data to be sent; or, when receiving the data, the path to write the data into the server memory is determined according to the destination address information of the received data; the recording module 530 is used to record the NUMA information of the server; the DMA engine 540 is used to read or write data, for example, read data from the server's memory or write the received data sent by other servers into the server's memory. The second endpoint port 550 is connected to the network card 600 through the PCIe bus as the root port in the root complex. The root complex is the root node of the PCIe topology structure, which usually includes the Host bridge, the root complex and the internal bus. In the embodiment of the present application, the Host bridge can be implemented by the routing module 520. Of course, the Host bridge can also be implemented by other control components in the data forwarding chip 500 or other control devices between the data forwarding chip 500 and the network card 600, which is not specifically limited in the embodiment of the present application.
[0124] The endpoint port 610 of the network card 600 is connected to the second endpoint port 550 of the data forwarding chip 500 through the PCIe bus. The network card 600 is connected to the network through the network port 620. The network card 600 also includes a main control chip 630 and a DMA engine 640. The main control chip 630 is used to control the network card 600, and the DMA engine 640 is used to read or write data, for example, reading data from the data forwarding chip 500 or writing data received from other servers into the data forwarding chip 500.
[0125] In the embodiment of the present application, the data forwarding chip 500 and the network card 600 both support and start the SR-IOV technology, CPU0 runs VM3101, CPU2 runs VM3201, and the data forwarding chip 500 is implemented by a field programmable gate array (FPGA). Figure 4 The implementation of the server 30 is described as follows: Figure 5 As shown, the network card 600 includes PF601 and PF602, and VF6011 is associated with PF601, and VF6021 is associated with PF602.
[0126] After the above-mentioned data forwarding chip 500 is inserted into the server 30 to connect the CPU and the network card 600, the data forwarding chip 500 will enumerate the network card 600 from the perspective of PCIe enumeration to obtain the PF information and VF information of the network card. In an embodiment of the present application, the routing module 520 in the data forwarding chip 500 can serve as the root node of the PCIe topology structure, and discover the PCIe endpoint device connected to the second endpoint port 550 through PCIe enumeration: the network card 600. For example, the routing module 520 discovers the network card 600 and further discovers PF601 and PF602 in the network card 600 through PCIe enumeration. The routing module 520 enables the VFEnable register of the SR-IOV configuration space of each PF, configures the properties of the VF to discover the VF, such as discovering VF6011 and VF6021. Exemplarily, the data forwarding chip 500 discovers VF 6011 by configuring the SR-IOV capability of PF 601 , and discovers VF 6021 by configuring the SR-IOV capability of PF 602 .
[0127] The routing module 520 discovers PF and VF through PCIe enumeration, and allocates corresponding BDFs to the discovered PF and VF according to the positions of PF and VF in the PCIe topology, and stores the allocated BDFs in the recording module 530. For example, the routing module 520 stores the BDF of PF601, the BDF of VF6011, the BDF of PF602, and the BDF of VF6021 in the recording module 530. At the same time, the routing module 520 also obtains the BAR space size of each functional unit (such as PF or VF) through enumeration and configures the BAR space address. Taking VF6011 as an example, the routing module 520 obtains the BAR space size of VF6011, configures the starting address and address length of the BAR space of VF6011, and the configured starting address and address length of the BAR space of VF6011 are the BAR space address information of VF6011. In a similar implementation, the routing module 520 can also obtain the BAR space address of PF 602 , the BAR space address of PF 602 , and the BAR space address information of VF 6021 . After obtaining the BAR space address of each functional unit, the routing module 520 stores it in the recording module 530 .
[0128] Optionally, the recording module 530 may be an independent memory in the data forwarding chip 500, such as a random access memory (RAM), etc., for storing the BDF information and the BAR space address information. Of course, the routing module 520 may also store the BDF information and the BAR space address information in other memories, which may be memories outside the data forwarding chip 500. The embodiment of the present application does not limit the specific location of storing the BDF information and the BAR space address information.
[0129] After the data forwarding chip 500 enumerates the network card and obtains the PF information and VF information of the network card, the data forwarding chip 500 presents a PCIe device to the CPU, that is, the data forwarding chip 500 acts as a data forwarding device between the CPU and the network card, and presents a network card function to the CPU. The CPU will use the chip as a network card device, and then perform PCIe enumeration on the data forwarding chip 500 to obtain the PF' information and VF' information of the above chip 500. That is, CPU0 and CPU1 can also serve as the root node of the PCIe topology structure, and discover the endpoint device in the data forwarding chip 500 through PCIe enumeration. When CPU0 and CPU1 perform PCIe enumeration on the data forwarding chip 500, CPU0 discovers PF601' through the first endpoint port 5101, and CPU1 discovers PF602' through the first endpoint port 5102. Taking the enumeration of CPU0 as an example, CPU0 reads the register of the first endpoint port 5101, and the register stores information identifying PF601'. CPU0 discovers PF601' based on the information.
[0130] The information used to identify the PF function in the register of the first endpoint port of the data forwarding chip 500 may be configured when the data forwarding chip 500 is manufactured, or may be configured in the register of the first endpoint port by the routing module 520 according to the PF and VF information in the network card 600 after obtaining the PF information and VF information in the network card 600. If the information used to identify the PF function in the register of the first endpoint port is configured when it is manufactured, it is necessary to configure the corresponding PF function according to the relevant information of the network card that may be connected when the data forwarding chip 500 is manufactured.
[0131] After enumerating the PF601' information in the data forwarding chip 500, the above-mentioned CPU0 enables the VF Enable register of the SR-IOV configuration space of PF601', and configures the properties of the VF to discover VF6011'. For example, CPU0 discovers VF6011' by configuring the SR-IOV capability of PF601'. CPU0 allocates corresponding BDFs to PF601' and VF6011' according to their positions in the PCIe topology. CPU0 also obtains the BAR space size of PF' and VF' through enumeration and configures the BAR space address. Taking VF6011' as an example, CPU0 obtains the BAR space size of VF6011', configures the starting address and address length of the BAR space of VF6011', and the configured starting address and address length of the BAR space of VF6011' are the BAR space address information of VF6011'.
[0132] After completing the enumeration, CPU0 sends the BDF information and BAR space address information of PF601', and the BDF information and BAR space address information of VF6011' to the data forwarding chip 500 through TLP messages. According to the information sent by CPU0, the routing module 520 establishes a corresponding relationship between the BDF of PF601' and the BDF of PF601, and a corresponding relationship between the BDF of VF6011' and the BDF of VF6011, and stores the established corresponding relationship in the recording module 530. At the same time, the routing module 520 establishes a corresponding relationship between the BAR space address of PF601' and the BAR space address of PF601, and a corresponding relationship between the BAR space address of VF6011' and the BAR space address of VF6011, and stores the established corresponding relationship in the recording module 530.
[0133] Through the enumeration of the data forwarding chip 500 by the CPU0, PF601' can be regarded as the agent of PF601 in the data forwarding chip 500, or PF601' is the virtual PF corresponding to PF601 in the data forwarding chip 500; VF6011' can be regarded as the agent of VF6011 in the data forwarding chip 500, or VF6011' is the virtual VF corresponding to VF6011 in the data forwarding chip 500. CPU0 finds through enumeration that the data forwarding chip 500 has the function of PF (PF601') and the function of VF (VF6011'), and can use the data forwarding chip 500 as a network card on the PCIe link, and implement the forwarding of data messages or command messages through the data forwarding chip 500. The data forwarding chip 500 then forwards the received data messages or command messages between the data forwarding chip 500 and the network card 600 according to the stored corresponding relationship.
[0134] It can be understood that the process of CPU1 enumerating the data forwarding chip 500 is similar to the process of CPU0 enumerating the data forwarding chip 500. For example, when CPU1 performs PCIe enumeration as the root node of the PCIe topology structure, CPU1 discovers PF602' and configures VF6021'. After completing the enumeration, CPU1 sends the BDF information and BAR space address information of PF602', and the BDF information and BAR space address information of VF6021' to the routing module 520 through a TLP message. The routing module 520 stores the correspondence between the BDF of PF602' and the BDF of PF602, and the correspondence between the BDF of VF6021' and the BDF of VF6021 in the recording module 530. At the same time, the routing module 520 stores the correspondence between the BAR space address of PF602 ′ and the BAR space address of PF602 , and the correspondence between the BAR space address of VF6021 ′ and the BAR space address of VF6021 in the recording module 530 .
[0135] After the two CPUs of the server 30 are respectively enumerated to the data forwarding chip 500, the server loads the driver of the data forwarding chip 500, which includes the code for querying the NUMA information of the server. After the server 30 loads the driver of the data forwarding chip 500, CPU0 or CPU1 obtains the NUMA information of the server 30 by running the driver, and sends the obtained NUMA information to the data forwarding chip 500 through the first endpoint port 5101 or the first endpoint port 5102, wherein the NUMA information of the server 30 includes the size of the memory corresponding to each NUMA node in the NUMA node 310 and the NUMA node 320, the address range corresponding to the memory, and the endpoint port information connected to each NUMA node. After receiving the above NUMA information through the first endpoint port 5101 or the first endpoint port 5102, the routing module 520 sends the above NUMA information to the recording module 530 for recording. At the same time, the recording module 530 may store the correspondence between PF' and PF, VF' and VF, for example, the correspondence between the BDF of PF601' and the BDF of PF601, and the correspondence between the BDF of VF6011' and the BDF of VF6011; the correspondence between the BAR space address of PF601' and the BAR space address of PF601, and the correspondence between the BAR space address of VF6011' and the BAR space address of VF6011; the correspondence between the BDF of PF602' and the BDF of PF602, and the correspondence between the BDF of VF6021' and the BDF of VF6021; the correspondence between the BAR space address of PF602' and the BAR space address of PF602, and the correspondence between the BAR space address of VF6021' and the BAR space address of VF6021.
[0136] It should be noted that, in order to clearly show the composition of the data forwarding chip 500 and the connection relationship between the data forwarding chip 500 and the CPU and the network card, the proxy units in the data forwarding chip 500, such as PF601', VF6011', PF602' and VF6021', are not shown in the figure. The proxy units mentioned in other embodiments of the present application are no longer shown in the corresponding data forwarding chip.
[0137] It can be understood that the above embodiment takes the case where a network card supports two PFs and each PF is associated with one VF as an example to describe the technical solution provided in the embodiment of the present application. In specific implementation, a network card may support multiple PFs, and each PF may be associated with multiple VFs. For example, PF601 is associated with 64 VFs (VF0-VF63), and PF601' in the data forwarding chip 500 is associated with 64 VF's (VF0'-VF63'), wherein VF0-VF63 corresponds to VF0'-VF63' one-to-one. If a VF corresponds to a virtual machine (VM) in a CPU, for example, 64 VMs (VM0-VM63) are running in CPU0, then VF0'-VF63' associated with PF601' corresponds to VM0-VM63 running in CPU0 one-to-one, and is used to implement the forwarding of data messages or command messages in VM0-VM63. Similarly, 64 VMs (VM64-VM127) are running in CPU1, and VF64'-VF127' associated with PF602' corresponds one-to-one with VM64-VM127 running in CPU1, and is used to forward data messages or command messages in VM64-VM127.
[0138] The following uses the example of sending and receiving data from the server to introduce the method of using the data forwarding chip to implement data forwarding between the CPU and the network card. Figure 6 As shown, Figure 6 : is a flow chart of a method for a server to send data provided by an embodiment of the present application, the method comprising:
[0139] 601. CPU0 initiates a data sending request.
[0140] by Figure 5 Taking the server shown as an example, the application running on CPU0 in the server 30 needs to send target data. For example, the application runs in VM9 in CPU0. CPU0 initiates a data sending request to the data forwarding chip 500 by running the driver corresponding to VM9. After encapsulating the above data sending request into the corresponding descriptor, it writes the pointer corresponding to the descriptor into the doorbell (DB) register and notifies the routing module 520 of the data forwarding chip 500, wherein the above pointer indicates the location information of the above descriptor, and the above descriptor includes the source address of the above target data, the type of target data, and the length of the target data, etc.
[0141] 602. The data forwarding chip 500 determines a target path for acquiring the target data according to the data sending request, and acquires the target data through the target path.
[0142] The routing module 520 obtains the above-mentioned descriptor from the queue corresponding to CPU0 through the first endpoint port 5101 according to the pointer, obtains the source address of the target data in the descriptor, and obtains the NUMA information of the stored server 30 from the recording module 530, and then determines that the target data is located in the target NUMA node among the multiple NUMA nodes in the server according to the source address of the target data in the descriptor, and determines the target endpoint port connected to the target NUMA node according to the NUMA information of the above-mentioned server 30, and then determines that the path for obtaining the above-mentioned target data through the above-mentioned target endpoint port is the shortest path, and finally obtains the target data of the memory space of the server 30 from the above-mentioned shortest path through the DMA engine 540, and stores the target data in the cache of the data forwarding chip 500.
[0143] For example, if an application is running on CPU0 in the above-mentioned server 30, the memory space requested by the application is local memory, that is, the data of the application is stored in memory0. When the application needs to send target data, CPU0 encapsulates the above-mentioned data sending request into a corresponding descriptor through the driver of the chip, and then writes the descriptor into the submission queue (SQ), and notifies the routing module 520 of the data forwarding chip 500 to obtain the descriptor from the SQ corresponding to CPU0 by writing the DB register. Or CPU0 in the above-mentioned server 30 converts the above-mentioned data sending request into a communication message between processors and sends it to CPU1, and CPU1 parses the communication message to obtain the above-mentioned data sending request and encapsulates the data sending request into the corresponding descriptor, and then writes the descriptor into the SQ queue in the memory corresponding to CPU1, and CPU1 notifies the routing module of the chip 500 to obtain the above-mentioned descriptor from the corresponding SQ queue of CPU1 by writing the DB register.
[0144] In the embodiment of the present application, the process of the data forwarding chip 500 acquiring the target data is described by taking the above-mentioned CPU0 sending the data sending request to CPU1 and CPU1 notifying the data forwarding chip 500 as an example. The routing module 520 of the data forwarding chip 500 acquires the above-mentioned descriptor from the SQ corresponding to the above-mentioned CPU1 through the first endpoint port 5102, determines that the above-mentioned target data is located in memory0 according to the source address of the target data in the descriptor, and determines that memory0 is located in the NUMA node 310 according to the NUMA information of the server 30 acquired from the recording module 530, and the first endpoint port 5101 of the data forwarding chip 500 is connected to the NUMA node 310, so the routing module 520 determines that reading the above-mentioned target data through the path "first endpoint port 5101->memory0" is the shortest path. Then the DMA engine 540 initiates a DMA read request to CPU0 through the first endpoint port 5101, and reads the target data into the cache of the above-mentioned data forwarding chip 500 through "memory0->first endpoint port 5101".
[0145] 603. The data forwarding chip 500 notifies the network card 600 of the cache address.
[0146] The above-mentioned cache address is the address used to cache the above-mentioned target data in the data forwarding chip 500. After the DMA engine reads the target data into the cache of the data forwarding chip 500, the routing module 520 encapsulates the cache address of the target data into a descriptor, and writes the above-mentioned descriptor into the SQ queue of the data forwarding chip 500, and then notifies the main control chip 630 of the network card 600 of the pointer corresponding to the above-mentioned descriptor by writing the DB register.
[0147] 604. The network card 600 obtains the cache address, and obtains the target data according to the cache address.
[0148] After the main control chip 630 of the network card 600 obtains the descriptor in the SQ queue of the above-mentioned data forwarding chip 500, the network card 600 sends a DMA read request to the routing module 520 of the above-mentioned data forwarding chip 500 through the DMA engine 640, reads the above-mentioned target data from the above-mentioned cache address of the data forwarding chip, and caches it in the sending queue and sends it to the network.
[0149] 605. The data forwarding chip sends an interrupt message to notify CPU0 that the data transmission is completed.
[0150] After sending the above-mentioned target data, the DMA engine 640 of the network card 600 sends an interrupt message to the routing module 520 of the data forwarding chip 500 to notify the routing module 520 that the data sending is completed. After the routing module 520 receives the information that the above-mentioned target data has been sent, it sends an interrupt message to CPU0 through the first endpoint port 5101 in the above-mentioned shortest path to notify CPU0 that the data sending is completed.
[0151] In the process of implementing data forwarding between CPU0 and network card 600, the data forwarding chip 500 reads the target data into the cache of the data forwarding chip, then notifies the network card 600 of the cache address of the target data in the data forwarding chip 500, and then the network card 600 reads the target data from the cache of the data forwarding chip 500. Optionally, after determining the shortest path for reading the target data from the memory, the data forwarding chip 500 does not read the target data from the memory, but sends the address information of the target data to the network card 600, and the network card 600 initiates a read request to CPU0. After receiving the read request from the network card, the data forwarding chip 500 sends the read request to CPU0 through the determined shortest path, and the network card 600 reads the target data from the memory through the shortest path.
[0152] In a specific implementation, the data forwarding chip 500 implements the process of forwarding data between the CPU0 and the network card 600 as follows: Figure 7 As shown, including:
[0153] 701. CPU0 initiates a data sending request.
[0154] The way in which CPU0 initiates a data sending request can be referred to the detailed description in 601 above. In the embodiment of the present application, in addition to notifying the data forwarding chip 500 of the address information of the target data, CPU0 also sends the BDF information and BAR space address information of the VF' corresponding to the VM that initiates the data sending request to the data forwarding chip 500.
[0155] 702 . The data forwarding chip 500 receives a data sending request, determines a target path for acquiring the target data according to the data sending request, and sends address information of the target data in the data sending request to the network card 600 .
[0156] The data forwarding chip 500 receives the data sending request through the first endpoint port 5101 . The process in which the routing module 520 of the data forwarding chip 500 determines the target path according to the data sending request can be referred to in 602 above and will not be described in detail here.
[0157] After receiving the above data transmission request, the routing module 520 of the data forwarding chip 500 parses the data transmission request to obtain the source address of the target data in the above data transmission request, and then sends the source address of the target data to the network card 600. When the routing module 520 sends the source address of the target data to the network card, since the routing module 520 receives the above data transmission request through the first endpoint port 5101, what CPU0 enumerates through the above first endpoint port 5101 is PF601', and PF601' corresponds to PF601 in the network card 600, the routing module 520 sends the address information of the above target data to PF601 or any VF associated with PF601. Exemplarily, if the above data transmission request is sent by VM1 in the above CPU0, and the VF corresponding to VM1 in the network card is VF1, the routing module 520 sends the address information of the above target data to VF1 in the network card 600.
[0158] 703. The network card 600 sends a read request to CPU0 according to the address information of the received target data.
[0159] After receiving the source address of the target data, the PF or VF of the network card 600 initiates a read request to CPU0 through the DMA engine 640 , and the read request carries the source address information of the target data.
[0160] 704. The data forwarding chip 500 receives the read request sent by the network card 600, and forwards the read request to CPU0.
[0161] It can be understood that, since CPU0 and CPU1 are directly connected to the data forwarding chip 500, what CPU0 and CPU1 enumerate is the proxy unit PF' or VF' in the data forwarding chip 500, and CPU0 and CPU1 can only recognize the information sent by the proxy unit in the data forwarding chip 500. Therefore, after receiving the above-mentioned read request, the routing module 520 of the data forwarding chip 500 needs to add the BDF information and BAR space address information of a PF' or a VF' in the read request, wherein the BDF information and BAR space address information of a PF' or a VF' added in the above-mentioned read request is the BDF information and BAR space address information of any one of the PF' or VF' corresponding to the endpoint port that receives the above-mentioned data sending request, and the PF' or VF' corresponding to the endpoint port is the PF' or VF' enumerated by the CPU through the endpoint port. Alternatively, when the read request includes the BDF information and BAR space address information of the PF or VF receiving the address information of the target data, the routing module 520 replaces the BDF information and BAR space address information of the PF or VF with the corresponding BDF information and BAR space address information of the PF' or VF'.
[0162] Exemplarily, when the routing module 520 of the data forwarding chip 500 receives a data transmission request sent by CPU0 through the first endpoint port 5101, since CPU0 enumerates PF601' through the first endpoint port 5101, the routing module 520 adds the BDF information and BAR space address information of PF601' to the read request when receiving the read request corresponding to the data transmission request, and then sends the modified read request to CPU0 through the first endpoint port 5101. For another example, after the routing module 520 sends the source address of the target data to VF1 in the network card 600 in the above 702, if the read request sent by the DMA 640 includes the BDF information and BAR space address information corresponding to VF1, the routing module 520 replaces the BDF information and BAR space address information corresponding to VF1 in the read request with the BDF information and BAR space address information of VF1', or replaces them with the BDF information and BAR space address information of PF601' after receiving the above read request. After performing the above modification on the received read request, the routing module 520 sends the modified read request to CPU0 through the above determined target path.
[0163] 705. The network card 600 reads the target data, and sends an interrupt message to the CPU0 after sending the read target data.
[0164] After the DMA engine 640 of the network card 600 reads the target data from the memory through the above-mentioned target path and sends it, it sends an interrupt message to the routing module 520 of the data forwarding chip 500. After receiving the above-mentioned interrupt message, the routing module 520 forwards the interrupt message to CPU0 through the first endpoint port 5101 in the above-mentioned target path to notify CPU0 that the target data sending is completed.
[0165] When the server 30 receives data, after the network card 600 receives the data message sent by the network, the DMA engine 640 of the network card 600 sends a DMA write request to the routing module 520 of the data forwarding chip 500, and sends the data message to the data forwarding chip 500 for caching. When the driver of the data forwarding chip 500 is successfully registered, the driver of the data forwarding chip 500 will apply to the server for a target cache for caching the data message received by the network card 600. The recording module 530 in the data forwarding chip 500 stores the destination address of the target cache, or the network card 600 sends the destination address of the target cache together with the data message to the routing module 520. After receiving the data message, the routing module 520 determines that the target cache belongs to memory0 according to the destination address of the target cache, and determines that memory0 is located in the NUMA node 310 according to the NUMA information of the server 30 recorded in the recording module 530, and the first endpoint port 5101 of the data forwarding chip 500 is connected to the NUMA node 310, so the routing module 520 determines that the path of sending the data message to the target cache through the path "first endpoint port 5101->memory0" is the shortest path. The DMA engine 540 in the data forwarding chip 500 initiates a DMA write request to CPU0 through the first endpoint port 5101, and then moves the data message to the target cache in memory0 according to the above path.
[0166] After the network card 600 receives the data packet sent by other servers, the data packet can be cached in the cache of the network card 600. The DMA engine 640 of the network card 600 sends a write request to the routing module 520 of the data forwarding chip 500. The write request includes the destination address of the above-mentioned target cache. After receiving the above-mentioned write request, the routing module 520 determines that the target cache belongs to memory0 according to the destination address of the above-mentioned target cache recorded in the recording module 530, and determines that memory0 is located in the NUMA node 310 according to the NUMA information of the server 30 recorded in the recording module 530, and the first endpoint port 5101 of the data forwarding chip 500 is connected to the NUMA node 310. Therefore, the routing module 520 determines that the path of sending the data packet to the target cache through the path "first endpoint port 5101->memory0" is the shortest path. Then the routing module 520 forwards the write request to CPU0, and then the DMA engine 640 of the network card 600 writes into the above-mentioned target cache through the above-mentioned shortest path. Among them, the way in which the routing module forwards the write request to CPU0 can refer to the way in which the read request is sent to CPU0 in the above-mentioned 704, and will not be repeated here.
[0167] In the embodiment of the present application, the data forwarding chip can be implemented by a field programmable gate array (FPGA), or by an application-specific integrated circuit (ASIC), which is not specifically limited in the embodiment of the present application. It can be understood that when the data forwarding chip is an FPGA chip, since the FPGA chip has a memory, the data forwarding chip 500 can cache the read or received data in the memory of the FPGA when reading data from the memory of the server or receiving data sent by other servers. When the data forwarding chip is an ASIC chip, since the ASIC chip does not have a memory, if the data forwarding chip is an ASIC chip, the data forwarding chip 500 needs to be connected to an external memory to cache the read data or received data in the external memory.
[0168] Above Figure 4 The server in the example is a 2P server. In a specific implementation, the server may include two or more CPUs. For example, the server may be a 4P or 8P server. In this case, each of the two CPUs is connected to one of the network cards via a data forwarding chip. Figure 8 As shown, when the server is a 4P server, the server 30 includes CPU0, CPU1, CPU2 and CPU3, wherein CPU0 and CPU2 are connected to the network card 600 via the data forwarding chip 500, and CPU1 and CPU3 are connected to the network card 800 via the data forwarding chip 700, wherein the implementation method of the data forwarding chip 700 is the same as the implementation method of the above-mentioned data forwarding chip 500, which will not be repeated here.
[0169] In a possible implementation, the above-mentioned data message is data required by an application running on the server 30. The application will apply for a cache from the processor when running. If the cache applied by the application for storing the above-mentioned data message is different from the target cache applied by the driver of the above-mentioned data forwarding chip, then after the DMA engine 540 sends the data message to the target cache applied by the driver of the above-mentioned data forwarding chip, the data message will be copied from the target cache to the cache applied by the application. If the above-mentioned target cache and the cache applied by the above-mentioned application are located in different NUMA nodes, when the above-mentioned data message is copied from the target cache to the cache applied by the application, the data message needs to be transmitted across chips. In an embodiment of the present application, by configuring to specify that when the application needs to receive data, the cache applied by the above-mentioned application and the target cache applied by the data forwarding chip driver are located in the same NUMA node, cross-chip transmission of data messages is prevented.
[0170] By acquiring and recording the memory distribution information of the server and the mapping relationship between the interface in the server and the data forwarding chip, when a server with multiple processors and multiple memories (e.g., a server using a NUMA architecture) sends or receives data, the data forwarding chip can determine the shortest path to obtain the target data according to the destination address of the target data to be sent, the memory distribution information in the server, and the mapping relationship, and read the target data through the determined shortest path; or when receiving data sent by other servers, the chip can determine the shortest path to send the received data to the destination address according to the destination address assigned by the server to the received data, as well as the memory distribution information and the mapping relationship. Therefore, the application does not need to perceive the memory distribution information, that is, it can avoid the cross-chip transmission of data between processors when the server sends or receives data, thereby reducing the data transmission delay, reducing the processor overhead, and improving the processor utilization.
[0171] Fig. 9 is a schematic diagram of the structure of a computer device 900 provided in an embodiment of the present application, such as Fig. 9 As shown, the computer device includes a CPU 901, a CPU 902, a data forwarding chip 903 and a network card 904. The data forwarding chip 903 is respectively connected to the CPU 901, the CPU 902 and the network card 904 through a bus. The network card 904 includes multiple functional units generated by virtualization technologies. For example, the network card 904 includes multiple PFs or VFs generated based on SR-IOV virtualization technology.
[0172] The data forwarding chip 903 is used to obtain information of the first functional unit and the second functional unit in the network card 904 and allocate addresses to the first functional unit and the second functional unit respectively. The first functional unit and the second functional unit are both used to implement the functions of the network card 904.
[0173] The above-mentioned CPU901 and CPU902 respectively obtain the information of the first agent unit and the second agent unit in the above-mentioned data forwarding chip 903, and assign addresses to the first agent unit and the second agent unit respectively, and then send the address information of the first agent unit and the second agent unit to the above-mentioned data forwarding chip 903 respectively, wherein the first agent unit is an agent of the first functional unit, and the second agent unit is an agent of the second functional unit.
[0174] The data forwarding chip 903 is also used to establish a correspondence between the address information of the first agent unit and the address information of the first functional unit, and a correspondence between the address information of the second agent unit and the address information of the second functional unit according to the address information of the first agent unit and the second agent unit, and realize the forwarding of messages between CPU901 or CPU902 and the network card 904 according to the above correspondence.
[0175] In a specific implementation, the CPU 901 or the CPU 902 is used to send a data sending request to the data forwarding chip 903 , and the data sending request instructs the data forwarding chip 903 to obtain target data that the computer device needs to send from the memory of the computer device 900 .
[0176] The above-mentioned data forwarding chip 903 is used to obtain the data sending request sent by the above-mentioned CPU901 or CPU902, and determine the shortest path to obtain the target data according to the target address in the above-mentioned data sending request, and obtain the above-mentioned target data through the determined shortest path, and send the obtained target data to the network card 904.
[0177] The network card 904 is used to send the target data to the network after receiving the target data sent by the data forwarding chip.
[0178] In a specific implementation manner, the network card 904 is further used to receive data packets sent by other computer devices through the network, and send the data packets to the data forwarding chip 903. The data forwarding chip 903 is also used to determine the shortest path for writing the data packets to the target address according to the target address of the cache space allocated by the server for the data received by the network card 904, and send the data packets to the target address through the determined shortest path.
[0179] Specifically, the method for the data forwarding chip 903 in the computer device 900 to discover the first functional unit and the second functional unit of the network card 904, and to read data from the memory space through the shortest path or to send data to the memory space through the shortest path, can refer to the introduction of the data forwarding chip 903 in the above embodiment, which will not be elaborated in detail here. The method for the CPU 901 or the CPU 902 to discover the first agent unit and the second agent unit of the data forwarding chip 903 can refer to the enumeration process of the CPU0 in the above embodiment, which will not be elaborated in detail here.
[0180] In a specific implementation, the server adopts a NUMA architecture. After loading the driver of the data forwarding chip 903, the CPU runs the driver of the data forwarding chip 903 to obtain the NUMA information of the server, and sends the NUMA information of the server to the data forwarding chip 903. After receiving the data sending request, the data forwarding chip 903 determines that the target data is located in a target NUMA node among multiple NUMA nodes in the server according to the target address in the data sending request, and determines the target endpoint port connected to the target NUMA node according to the NUMA information of the server 900, and then determines that the path for obtaining the target data through the target endpoint port is the shortest path, and finally obtains the target data in the memory space of the server 30 through the shortest path, determines the shortest path for obtaining the target data, obtains the target data through the determined shortest path, and sends the obtained target data to the network card 904.
[0181] In an embodiment of the present application, the data forwarding chip 903 includes: an interface module 9031, a routing module 9032, a recording module 9033, a DMA engine module 9034 and a second endpoint port 9035, wherein the interface module 9031 includes a first endpoint port 90311 and a first endpoint port 90312, and the data forwarding chip 903 is connected to the CPU 901 through the first endpoint port 90311, and is connected to the CPU 902 through the first endpoint port 90312.
[0182] The routing module 9032 is used to obtain information of the first functional unit in the network card 904, assign an address to the first functional unit, obtain address information of the first proxy unit, and establish a corresponding relationship between the address information of the first proxy unit and the address information of the first functional unit; wherein the first functional unit is a unit generated based on virtualization technology in the network card 904, and the first proxy unit is a proxy of the first functional unit;
[0183] The recording module 9033 is used to store the correspondence between the address information of the first agent unit and the address information of the first functional unit;
[0184] The routing module 9032 is further used to forward messages, such as data messages or command messages, between the CPU 901 and the network adapter according to the correspondence between the address information of the first agent unit and the address information of the first functional unit.
[0185] The above-mentioned data forwarding chip 903 is also used to obtain the data sending request sent by the above-mentioned CPU901 or CPU902, and determine the shortest path to obtain the target data according to the address in the above-mentioned data sending request, and obtain the above-mentioned target data through the determined shortest path, and then send the obtained target data to the network card 904.
[0186] The specific implementation of the data forwarding chip 903 can be as follows: Figure 4 or Figure 5 The relevant description of the data forwarding chip 500 will not be repeated here.
[0187] It should be understood that the structure of the chip or server described in the above embodiments is only exemplary, and the functions of the chip or server described above can also be implemented in other ways. For example, the structure of the data forwarding chip is only a division of logical functions, and there can be other division methods in actual implementation. In addition, in the embodiments of the present application, each functional chip can be integrated in one module, or each chip can exist separately. The above introduction to the embodiments of the present application is an explanation of the principles of the chip and server provided in the present application using specific examples. The above embodiments are only used to help understand the core idea of the present application. For those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and scope of application. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A server, characterized in that: The server comprises: a data forwarding chip, a network card and a target processor. The server comprises a plurality of processors. The target processor is any one of the plurality of processors. The data forwarding chip is connected to the network card and the plurality of processors respectively through a bus. The data forwarding chip is used to: receive a data forwarding request sent by the target processor or the network card; A target endpoint port is determined according to the address of the data forwarding request and the memory distribution information of the server, wherein the memory distribution information includes a correspondence between at least two endpoint ports among a plurality of endpoint ports on the data forwarding chip and the memory space of the server; forwarding of the data to be forwarded specified by the data forwarding request is achieved through the target endpoint port, and the target endpoint port is an endpoint port directly connected to the memory space corresponding to the address of the data forwarding request on the data forwarding chip.
2. The server according to claim 1, characterized in that: Each of the multiple processors corresponds to a memory space within a preset address range, and each processor is directly connected to the corresponding memory space within the preset address range. The memory distribution information includes a correspondence between at least two endpoint ports among the multiple endpoint ports and the memory space within the preset address range corresponding to the multiple processors.
3. The server according to claim 1 or 2, characterized in that: The target processor is configured to send the data forwarding request to the data forwarding chip through the bus, wherein the data forwarding request carries the source address of the data to be forwarded; The data forwarding chip is specifically used to: determine, according to the source address carried in the data forwarding request and the memory distribution information of the server, the endpoint port directly connected to the memory space corresponding to the source address as the target endpoint port.
4. The server according to claim 1 or 2, characterized in that: The network card is used to send the data forwarding request to the data forwarding chip, where the data forwarding request is a write data request sent by the network card to the target processor; The data forwarding chip is specifically used to: determine, based on a preset destination address of a write data request and memory distribution information of the server, an endpoint port directly connected to the memory space corresponding to the destination address as the target endpoint port, wherein the destination address is an address corresponding to the memory space allocated by the target processor and used to cache the data to be forwarded.
5. The server according to claim 4 or 2, characterized in that: The data forwarding chip is also used for: Determining a path for forwarding the data to be forwarded according to the target endpoint port, wherein the path includes the target endpoint port; Acquire the data to be forwarded from the memory space corresponding to the source address of the data to be forwarded through the path and cache it, and send the cache address of caching the data to be forwarded to the network card, so that the network card acquires the data to be forwarded according to the cache address; or The data to be forwarded is obtained from the network card, and the data to be forwarded is sent to the memory space corresponding to the address of the data forwarding request through the path.
6. The server according to claim 1 or 2, characterized in that ; The data forwarding chip is further used to enumerate the network card, obtain information about functional units in the network card, and assign addresses to the functional units, wherein the functional units are used to implement the functions of the network card, and the information about the functional units includes information about physical functions PF and / or information about virtual functions VF; The target processor is used to: enumerate the data forwarding chip, obtain information of the proxy unit in the data forwarding chip, assign an address to the proxy unit, and send the address information of the proxy unit to the data forwarding chip, wherein the proxy unit is a proxy of the functional unit; The data forwarding chip is further used to establish a corresponding relationship between the address information of the proxy unit and the address information of the functional unit according to the address information of the proxy unit.
7. The server according to claim 6, characterized in that: The data forwarding chip is further used to implement forwarding of the data forwarding request between the target processor and the network card according to the correspondence between the address information of the proxy unit in the data forwarding chip and the address information of the functional unit in the network card.
8. The server according to any one of claims 1, 2 or 7, characterized in that: The target processor is also used to load the driver program of the data forwarding chip, and obtain the memory distribution information by running the driver program and send it to the data forwarding chip.
9. A data forwarding chip, characterized in that: The data forwarding chip includes a routing module, at least two first endpoint ports and a second endpoint port, wherein the at least two first endpoint ports are respectively connected to at least two processors of the server, and the second endpoint port is connected to the network card of the server; The routing module is connected to the first endpoint port and the second endpoint port respectively, and receives a data forwarding request sent by the target processor through the first endpoint port or receives a data forwarding request sent by the network card through the second endpoint port. Acquire memory distribution information of the server, and determine a target endpoint port according to the memory distribution information and the address of the data forwarding request, wherein the memory distribution information includes a correspondence between the at least two first endpoint ports and the memory space of the server; The forwarding of the data to be forwarded specified by the data forwarding request is achieved through the target endpoint port. The target endpoint port is an endpoint port among the at least two first endpoint ports that is directly connected to the memory space corresponding to the address of the data forwarding request, and the target processor is any one of the at least two processors.
10. The chip according to claim 9, characterized in that: The data forwarding chip also includes: A recording module, used to record the memory distribution information of the server; The routing module is specifically used for: Memory distribution information of the server is obtained from the recording module, and the target endpoint port is determined according to the memory distribution information and the address of the data forwarding request.
11. The chip according to claim 10, characterized in that: The memory distribution information includes a correspondence between the at least two first endpoint ports and the memory space in a preset address range corresponding to the at least two processors in the server, wherein each of the at least two processors corresponds to a memory space in a preset address range, and each processor is directly connected to the corresponding memory space in the preset address range.
12. The chip according to claim 10 or 11, characterized in that: The routing module is specifically used for: Acquire the data forwarding request sent by the target processor through the first endpoint port, wherein the data forwarding request carries the source address of the data to be forwarded; According to the source address carried in the data forwarding request and the memory distribution information of the server, a first endpoint port directly connected to the memory space corresponding to the source address is determined as the target endpoint port.
13. The chip according to claim 10 or 11, characterized in that: The routing module is specifically used for: Acquire the data forwarding request sent by the network card through the second endpoint port, where the data forwarding request is a write data request sent by the network card to the processor; According to the preset destination address of the write data request and the memory distribution information of the server, the first endpoint port directly connected to the memory space corresponding to the destination address is determined as the target endpoint port, wherein the destination address is the address corresponding to the memory space allocated by the target processor and used to cache the data to be forwarded.
14. The chip according to claim 10 or 11, characterized in that: The routing module is specifically used for: Determining a path for forwarding the data to be forwarded according to the target endpoint port, wherein the path includes the target endpoint port; The data forwarding chip further includes a direct memory access (DMA) engine, which is used to: obtain the data to be forwarded from the memory space corresponding to the source address of the data to be forwarded through the path and cache it, and send a cache address of the data to be forwarded to the network card, so that the network card obtains the data to be forwarded according to the cache address; or The data to be forwarded is obtained from the network card, and the data to be forwarded is sent to the memory space corresponding to the address of the data forwarding request through the path.
15. The chip according to claim 10 or 11, characterized in that: The routing module is further used to: enumerate the network card, obtain information about functional units in the network card, and assign addresses to the functional units, wherein the functional units are used to implement the functions of the network card, and the information about the functional units includes information about physical functions PF and / or information about virtual functions VF; receiving address information of a proxy unit sent by the target processor, wherein the proxy unit is a proxy of the functional unit; According to the address information of the proxy unit, a correspondence relationship between the address information of the proxy unit and the address information of the functional unit is established, and the correspondence relationship between the address information of the proxy unit and the address information of the functional unit is sent to the recording module for storage.
16. The chip according to claim 15, characterized in that: The routing module is also used to: According to the correspondence between the address information of the functional unit in the network card and the address information of the proxy unit in the data forwarding chip, the data forwarding request is forwarded between the processor and the network card.
17. A data forwarding method, characterized in that: include: The data forwarding chip receives a data forwarding request sent by a target processor or a network card; The data forwarding chip determines the target endpoint port according to the address of the data forwarding request and the memory distribution information of the server, wherein the memory distribution information includes a correspondence between at least two first endpoint ports and the memory space of the server; The data forwarding chip forwards the data to be forwarded specified by the data forwarding request through the target endpoint port, and the target endpoint port is an endpoint port directly connected to the memory space corresponding to the address of the data forwarding request among at least two first endpoint ports on the data forwarding chip; Among them, the data forwarding chip includes at least two first endpoint ports and a second endpoint port, the at least two first endpoint ports are respectively connected to at least two processors of the server, the second endpoint port is connected to the network card of the server, and the target processor is any one of the at least two processors.
18. The method according to claim 17, characterized in that The memory distribution information includes a correspondence between the at least two first endpoint ports and the memory space of a preset address range corresponding to the at least two processors, wherein each of the at least two processors corresponds to a memory space of a preset address range, and each processor is directly connected to the corresponding memory space of the preset address range.
19. The method according to claim 17 or 18, characterized in that The data forwarding chip determines the target endpoint port according to the address of the data forwarding request and the memory distribution information of the server, including: The data forwarding chip obtains the data forwarding request sent by the target processor through any one of the at least two first endpoint ports, where the data forwarding request carries the source address of the data to be forwarded; The data forwarding chip determines, according to the source address carried in the data forwarding request and the memory distribution information of the server, that a first endpoint port directly connected to the memory space corresponding to the source address is the target endpoint port.
20. The method according to claim 17 or 18, characterized in that The data forwarding chip determines the target endpoint port according to the address of the data forwarding request and the memory distribution information of the server, including: The data forwarding chip receives a data forwarding request sent by the network card, where the data forwarding request is a write data request sent by the network card to the target processor; The data forwarding chip determines, based on a preset destination address of a write data request and memory distribution information of the server, that a first endpoint port directly connected to a memory space corresponding to the destination address is the target endpoint port, wherein the destination address is an address corresponding to a memory space allocated by the target processor and used to cache the data to be forwarded.
21. The method according to claim 17 or 18, characterized in that The data forwarding chip implements forwarding of the data to be forwarded specified by the data forwarding request through the target endpoint port, including: The data forwarding chip determines a path for forwarding the data to be forwarded according to the target endpoint port, wherein the path includes the target endpoint port; The data forwarding chip obtains and caches the data to be forwarded from the memory space corresponding to the source address of the data to be forwarded through the path, and sends the cache address of the data to be forwarded to the network card, so that the network card obtains the data to be forwarded according to the cache address; or The data forwarding chip obtains the data to be forwarded from the network card, and sends the data to be forwarded to the memory space corresponding to the address of the data forwarding request through the path.
22. The method according to claim 17 or 18, characterized in that Before the data forwarding chip forwards the data to be forwarded specified by the data forwarding request through the target endpoint port, the method further includes: The data forwarding chip enumerates the network card, obtains information about a functional unit in the network card, and allocates an address to the functional unit, wherein the functional unit is used to implement a function of the network card, and the information about the functional unit includes information about a physical function PF and / or information about a virtual function VF; The data forwarding chip receives address information of a proxy unit sent by a target processor, wherein the proxy unit is a proxy of the functional unit in the data forwarding chip; The data forwarding chip establishes a corresponding relationship between the address information of the proxy unit and the address information of the functional unit according to the address information of the proxy unit.
23. The method according to claim 22, characterized in that The method further comprises: The data forwarding chip implements forwarding of the data forwarding request between the target processor and the network card according to the address information of the proxy unit and the address information of the functional unit.
Citation Information
Patent Citations
Method and apparatus for pci bus address based routing with integrated did
CN101013989A
Method for accessing cache and fake cache agent
CN102388373A
Data forwarding device and method
CN104579695A
Message forwarding method and device
CN106936739A
Multiple Active L3 Gateways for Logical Networks
US20170142012A1
