Background
The network card is a network component working on a second layer link layer, is an interface for connecting a computer and a transmission medium in a local area network, not only can realize physical connection and electric signal matching with the transmission medium of the local area network, but also relates to functions of frame sending and receiving, frame packaging and unpacking, medium access control, data encoding and decoding, data caching and the like.
Currently, common types of network card bus interfaces are PCIE and USB. Taking a network card based on a PCIE interface as an example, a flow of receiving a network packet is as follows:
the network card obtains network data from the network through the transceiver and restores the network data into data according to the functions of the network card. For example, the conventional network card frames the network data received by the physical layer, and after checking the data without errors, the ethernet frame header is removed to obtain the final data packet.
The network card copies the received data packet to the host side memory through a PCIE DMA mechanism.
The network card triggers PCIE interruption to inform the operating system that the data packet is received.
And the interrupt service function of the operating system reads the data packet from the memory and calls the corresponding protocol stack to process according to the interrupt number, and finally copies the data to the user program space.
The transmission process is then reversed:
and processing the data to be sent by the user program through the corresponding protocol stack, and storing the obtained data packet in the memory of the host side.
The host informs the network card of sending information of the data packet through the PCIE interface, such as a host side memory address, a length and the like.
The network card fetches and transmits the data packet from the corresponding host side memory through a PCIE DMA mechanism.
The network card converts the transmission data into network data of a physical layer through the self function and transmits the network data to the network. For example, the traditional network card adds an ethernet header to the head of a transmission data packet and adds an FCS check to the tail of the transmission data packet, and encapsulates the transmission data packet into a network packet, and finally converts the network packet into network data to be transmitted to a network.
In the flow of sending data or receiving data, the network card occupies a certain memory bandwidth, however, the memory bandwidth is only occupied by the network card in a smaller proportion due to the lower network bandwidth.
With the development of network technology, network bandwidth has moved towards 400Gbps ethernet gateway in 2020 and is moving towards faster 800Gbps, even 1.6 Tbps. At this time, the storage technology is slowly developed, and the problem of the memory wall is still not solved. Therefore, the difference between the network bandwidth and the memory bandwidth is increasing, resulting in that the network card needs to occupy more memory bandwidth. In this case, the memory bandwidth available to the user program running on the host is reduced, further exacerbating the memory wall problem.
The prior art has a PCIE real-time network card based on an FPGA module, which includes: the ZYNQ module comprises an FPGA chip; the PHY chip is connected with the ZYNQ module, performs data interaction with the ZYNQ module through an MII interface and/or an RMII interface, and is connected with an external interface; and the PCIE bus is connected with the ZYNQ module and used for transmitting the received data to the ZYNQ module for processing. The ZYNQ module comprises an FPGA chip with an ARM core; the FPGA chip is connected with a host memory through the PCIE bus, and the FPGA chip and the host memory perform data interaction through the PCIE bus.
However, in the prior art, the problem that the memory bandwidth occupied by data transmission through a network is too high exists, and therefore how to invent a novel network connection method with low memory bandwidth occupied is a problem to be solved urgently in the technical field.
Disclosure of Invention
The invention provides a network connection method and a network connection system based on a CXL (extensible markup language) protocol, which aim to solve the problem of overhigh memory bandwidth occupied by the prior art and have the characteristic of remarkable effect.
In order to achieve the purpose of the invention, the technical scheme is as follows:
a network connection method based on CXL protocol comprises the following steps: a host end CXL _ IP module is arranged in the host, and a network card end CXL _ IP module and a network card memory are arranged in the network card; the CXL _ IP module of the host end is connected with the CXL _ IP module of the network card end through a CXL protocol, and the CXL _ IP module of the network card end is connected with a memory of the network card;
sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network;
and receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host computer end CXL _ IP module through a network card end CXL _ IP module so as to send the network data to the host computer.
In the scheme, the CXL _ IP module of the host side is arranged in the host, and the CXL _ IP module of the network card side is arranged in the network card, so that network data transmission based on the CXL protocol is realized, and the occupancy rate of the network card to the memory bandwidth of the host side is reduced; therefore, the invention solves the problem of overhigh memory bandwidth occupied by the prior art and has the characteristic of remarkable effect.
Preferably, a network based on a PCIE protocol is further reconstructed to obtain a network application programming interface based on a CXL protocol, and the interface of the network application is referred to as a network API; and the CXL _ IP module at the host end and the CXL _ IP module at the network card end both use a network API based on a CXL protocol to carry out data transmission.
Further, sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network, wherein the specific flow is as follows:
s101, sending data of a host computer to a network card memory through a network API based on a CXL protocol; the host data comprises data to be sent and control information thereof;
s102, a host inputs a command for sending data into a network card through a network API based on a CXL protocol;
s103, the network card reads data to be sent and control information thereof in the memory of the network card according to a data sending command, and converts the read data to be sent into a corresponding data packet according to the control information;
and S104, converting the data packet into network data by the network card and uploading the network data to the network.
Further, receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host-side CXL _ IP module through a network card-side CXL _ IP module, so as to send the network data to the host, wherein the specific process is as follows:
s201, downloading network data from a network through a network card, and converting the network data into a data packet;
s202, the network card unpacks the data packet to obtain a data load, and the data load is stored in a network card memory;
s203, the host queries whether the network card receives a data packet or not through a network API based on a CXL protocol;
s204, the network card judges whether the network card memory receives data, if so, the network card informs the host computer of receiving the data packet through a network API based on the CXL protocol, and step S205 is executed; if not, go back to step S201 to receive the network decoupling data again;
s205, the host reads data from a network card memory through a network API based on a CXL protocol, and receives a data load sent from the network card.
Furthermore, the network data is binary stream data.
Further, in step S203, if the host uses the interrupt mechanism, the following steps are adopted to receive the data payload:
A1. the network card triggers the host to interrupt without being inquired by the host, obtains an interrupt number, and informs the host of receiving a data packet through a network API based on a CXL protocol;
A2. and the host reads data from the network card memory through a network API based on the CXL protocol according to the interrupt number and receives the data load sent from the network card.
A network connection system based on CXL protocol comprises a host and a network card;
the host comprises a CXL _ IP module used for receiving and transmitting data;
the network card comprises a network card end CXL _ IP module for receiving and transmitting data and a network card memory for storing host end data and network data;
the CXL _ IP module at the host end and the CXL _ IP module at the network card end are connected through a CXL protocol; the CXL _ IP module at the network card end is connected with the network card memory; sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network; and receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host computer end CXL _ IP module through the network card end CXL _ IP module so as to send the network data to the host computer.
Preferably, the network card further comprises a network offload unit for encapsulating the data packet into network data and decapsulating the network data into a data payload, and a transceiver for receiving and transmitting the network data; the network card end CXL _ IP module, the network card memory, the network unloading unit and the transceiver are sequentially connected;
the network card end CXL _ IP module receives host end data from the host end CXL _ IP module, wherein the host end data comprises data to be sent and control information thereof, and the data to be sent and the control information thereof are stored in a network card memory; after the network card end CXL-IP module receives a data sending command, the network card memory is read by the network unloading unit, the data to be sent in the network card memory is converted into a data packet according to the control information of the data to be sent, the data packet is finally converted into network data, and the network data is uploaded to a network through the transceiver;
after the transceiver downloads the network data from the network, the network unloading unit converts the network data into a data packet, unpacks the data packet to obtain a data load, and stores the data load in a network card memory; and after the CXL _ IP module of the network card end informs the host that the network data is received, reading the data load in the memory of the network card and sending the data load to the CXL _ IP module of the host.
Furthermore, the host also comprises a host memory module for storing data and a CPU for controlling the sending and receiving of the data; the host memory module, the CPU and the host end CXL _ IP module are sequentially connected;
when sending host end data to a network, a CPU controls a host memory module to send the host end data to a network card through a host end CXL _ IP module, and sends a data sending command to the network card through the host end CXL _ IP module;
when receiving network data from a network, the CPU inquires or receives the network data storage condition of the network card through the CXL _ IP module of the host computer, receives the data load of the network data according to the data storage condition and stores the data load in the memory module of the host computer.
Furthermore, the network card is a network card without an operating system, and the memory of the network card is a DRAM memory.
The invention has the following beneficial effects:
the invention realizes the network data transmission based on the CXL protocol by arranging the host end CXL _ IP module in the host and arranging the network card end CXL _ IP module in the network card, reduces the occupancy rate of the network card to the host side memory bandwidth, and simultaneously stores the sent and received data packets in the memory on the network card by arranging the network card memory, further reduces the occupancy rate of the network card to the host side memory bandwidth; therefore, the invention solves the problem of overhigh memory bandwidth occupied by the prior art and has the characteristic of remarkable effect.
Detailed Description
The invention is described in detail below with reference to the drawings and the detailed description.
Example 1
As shown in fig. 1, a network connection method based on a CXL protocol includes: a host end CXL _ IP module is arranged in the host, and a network card end CXL _ IP module and a network card memory are arranged in the network card; the CXL _ IP module at the host end is connected with the CXL _ IP module at the network card end through a CXL protocol, and the CXL _ IP module at the network card end is connected with a memory of the network card;
in this embodiment, because the CXL protocol is compatible with the PCIE protocol, the network card end CXL _ IP module is connected to the network card end CXL _ IP module by directly inserting the PCIE slot.
Sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network;
and receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host computer end CXL _ IP module through the network card end CXL _ IP module so as to send the network data to the host computer.
In a specific embodiment, a network based on a PCIE protocol is further reconstructed to obtain a network application programming interface based on a CXL protocol, and the interface of the network application is referred to as a network API; and the CXL _ IP module at the host end and the CXL _ IP module at the network card end both use a network API based on a CXL protocol to carry out data transmission.
In this embodiment, CXL is fully known as computer Express Link, and is an open industry standard for high-bandwidth low-latency device interconnect. It can be used to connect the CPU with the Accelerator, memory Buffer and Smart NIC type devices. The method is used for scenes such as AI Machine Learning, high-performance calculation and the like.
The CXL _ IP module used in this embodiment may use a CXL _ IP core provided by intel or plda.
Example 2
As shown in fig. 1, a network connection method based on a CXL protocol includes: a host end CXL _ IP module is arranged in the host, and a network card end CXL _ IP module and a network card memory are arranged in the network card; the CXL _ IP module at the host end is connected with the CXL _ IP module at the network card end through a CXL protocol, and the CXL _ IP module at the network card end is connected with a memory of the network card;
sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network;
and receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host computer end CXL _ IP module through a network card end CXL _ IP module so as to send the network data to the host computer.
In a specific embodiment, a network based on a PCIE protocol is further reconstructed to obtain a network application programming interface based on a CXL protocol, and the interface of the network application is referred to as a network API; and the CXL _ IP module at the host end and the CXL _ IP module at the network card end both use a network API based on a CXL protocol to carry out data transmission.
In a specific embodiment, sending host end data to a network card end CXL _ IP module through a host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network, wherein the specific flow is as follows:
s101, sending data of a host computer to a network card memory through a network API based on a CXL protocol; the host data comprises data to be sent and control information thereof;
s102, a host inputs a command for sending data into a network card through a network API based on a CXL protocol;
s103, the network card reads data to be sent and control information thereof in the memory of the network card according to a data sending command, and converts the read data to be sent into a corresponding data packet according to the control information;
and S104, the network card converts the data packet into network data and uploads the network data to a network.
Example 3
As shown in fig. 1, a network connection method based on a CXL protocol includes: a host end CXL _ IP module is arranged in the host, and a network card end CXL _ IP module and a network card memory are arranged in the network card; the CXL _ IP module at the host end is connected with the CXL _ IP module at the network card end through a CXL protocol, and the CXL _ IP module at the network card end is connected with a memory of the network card;
sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network;
and receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host computer end CXL _ IP module through a network card end CXL _ IP module so as to send the network data to the host computer.
In a specific embodiment, a network based on a PCIE protocol is further reconstructed to obtain a network application programming interface based on a CXL protocol, and the interface of the network application is referred to as a network API; and the CXL _ IP module at the host end and the CXL _ IP module at the network card end both use a network API based on a CXL protocol to carry out data transmission.
In a specific embodiment, sending host end data to a network card end CXL _ IP module through a host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network, wherein the specific flow is as follows:
s101, sending data of a host computer to a network card memory through a network API based on a CXL protocol; the host data comprises data to be sent and control information thereof;
s102, a host inputs a command for sending data into a network card through a network API based on a CXL protocol;
s103, the network card reads the data and the control information of the host according to the data sending command, and converts the read data to be sent into a corresponding data packet according to the control information;
and S104, converting the data packet into network data by the network card and uploading the network data to the network.
In a specific embodiment, the network data is received and stored in the network card memory, and the network data in the network card memory is sent to the host-side CXL _ IP module through the network card-side CXL _ IP module, so that the network data is sent to the host, and the specific process is as follows:
s201, downloading network data from a network through a network card, and converting the network data into a data packet;
s202, the network card unpacks the data packet to obtain a data load, and the data load is stored in a network card memory;
s203, the host queries whether the network card receives a data packet or not through a network API based on a CXL protocol;
s204, the network card judges whether the network card memory receives data, if so, the network card informs the host computer of receiving the data packet through a network API based on the CXL protocol, and step S205 is executed; if not, go back to step S201 to re-receive the network decoupling data;
s205, the host reads data from a network card memory through a network API based on a CXL protocol, and receives a data load sent from the network card.
In a specific embodiment, the network data is binary stream data.
Example 4
As shown in fig. 1, a network connection method based on a CXL protocol includes: a host end CXL _ IP module is arranged in the host, and a network card end CXL _ IP module and a network card memory are arranged in the network card; the CXL _ IP module at the host end is connected with the CXL _ IP module at the network card end through a CXL protocol, and the CXL _ IP module at the network card end is connected with a memory of the network card;
sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network;
and receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host computer end CXL _ IP module through a network card end CXL _ IP module so as to send the network data to the host computer.
In a specific embodiment, a network based on a PCIE protocol is further reconstructed to obtain a network application programming interface based on a CXL protocol, and the interface of the network application is referred to as a network API; and the CXL _ IP module at the host end and the CXL _ IP module at the network card end both use a network API based on a CXL protocol to carry out data transmission.
In a specific embodiment, sending host end data to a network card end CXL _ IP module through a host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network, wherein the specific flow is as follows:
s101, sending data of a host computer to a network card memory through a network API based on a CXL protocol; the host data comprises data to be sent and control information thereof;
s102, a host inputs a command for sending data into a network card through a network API based on a CXL protocol;
s103, the network card reads the data of the host and the control information thereof according to the data sending command, and converts the read data to be sent into a corresponding data packet according to the control information thereof;
and S104, converting the data packet into network data by the network card and uploading the network data to the network.
In a specific embodiment, the network data is received and stored in the network card memory, and the network data in the network card memory is sent to the host-side CXL _ IP module through the network card-side CXL _ IP module, so that the network data is sent to the host, and the specific process is as follows:
s201, downloading network data from a network through a network card, and converting the network data into a data packet;
s202, the network card unpacks the data packet to obtain a data load, and the data load is stored in a network card memory;
s203, the host inquires whether the network card receives a data packet or not through a network API based on a CXL protocol;
s204, the network card judges whether the network card memory receives data, if so, the network card informs the host computer of receiving the data packet through a network API based on the CXL protocol, and step S205 is executed; if not, go back to step S201 to re-receive the network decoupling data;
s205, the host reads data from a network card memory through a network API based on a CXL protocol, and receives a data load sent from the network card.
In a specific embodiment, the network data is binary stream data.
In this embodiment, an interrupt request signal may be sent to the processor when the external device is ready to receive more data. This is where the processor responds by suspending processing of the current program, and moving to processing of the program servicing the particular I/O device, this program being referred to as an interrupt handler. After the service response to the device is complete, the processor resumes the original execution.
In one embodiment, in step S203, if the host uses the interrupt mechanism, the following steps are adopted to receive the data payload:
A1. the network card triggers the host to interrupt without being inquired by the host, obtains an interrupt number, and informs the host of receiving a data packet through a network API based on a CXL protocol;
A2. and the host reads data from the network card memory through a network API based on the CXL protocol according to the interrupt number and receives the data load sent from the network card.
In this embodiment, the CXL protocol includes three sub-protocols: cxl.io, cxl.cache, cxl.memory, wherein cxl.io is an IO type, similar to conventional PCIe; the cache allows the device to access the main memory and the cache; memory allows the CPU to access the memory of the device.
As shown in fig. 3, in this embodiment, an operating system controls data packets to be transmitted between the CXL _ IP of the host side and the CXL _ IP of the network card side through the CXL _ IP-based network API; when interruption processing is not performed, the host and the network card perform data transmission in the network card memory and the host memory through the network API by transmitting CXL.memory; when the interrupt processing is carried out, the network card reports the data condition by actively sending CXL.io to the host, and then data transmission is carried out in the network card memory and the host memory through the network API; the data packet is accessed in the network card memory through the CXL _ IP modules of the host terminal and the network card terminal; the network card memory transmits data to the transceiver through the network unloading unit by the RDMA protocol.
The invention realizes the network data transmission based on the CXL protocol by arranging the host end CXL _ IP module in the host and arranging the network card end CXL _ IP module in the network card, reduces the occupancy rate of the network card to the host side memory bandwidth, and simultaneously stores the sent and received data packets in the memory on the network card by arranging the network card memory, further reduces the occupancy rate of the network card to the host side memory bandwidth; therefore, the invention solves the problem of overhigh memory bandwidth occupied by the prior art and has the characteristic of remarkable effect.
Example 5
As shown in fig. 2, a CXL protocol-based network connection system includes a host and a network card;
the host comprises a CXL _ IP module used for receiving and transmitting data;
the network card comprises a network card end CXL _ IP module for receiving and transmitting data and a network card memory for storing host end data and network data;
the CXL _ IP module at the host end and the CXL _ IP module at the network card end are connected through a CXL protocol; the CXL _ IP module at the network card end is connected with the network card memory; sending host end data to a network card end CXL _ IP module through the host end CXL _ IP module; storing the host data into the network card memory, reading the host data in the network card memory and sending the host data to the network; and receiving and storing the network data into a network card memory, and sending the network data in the network card memory to a host computer end CXL _ IP module through a network card end CXL _ IP module so as to send the network data to the host computer.
In a specific embodiment, the network card further includes a network offload unit for encapsulating the data packet into network data and decapsulating the network data into a data payload, and a transceiver for receiving and transmitting the network data; the network card end CXL _ IP module, the network card memory, the network unloading unit and the transceiver are sequentially connected;
the network card end CXL _ IP module receives host end data from the host end CXL _ IP module, wherein the host end data comprises data to be sent and control information thereof, and the data to be sent and the control information thereof are stored in a network card memory; after the network card end CXL _ IP module receives a data sending command, a network card memory is read by a network unloading unit, data to be sent in the network card memory is converted into a data packet according to control information of the data to be sent, the data packet is finally converted into network data, and the network data is uploaded to a network through a transceiver;
after the transceiver downloads the network data from the network, the network unloading unit converts the network data into a data packet, unpacks the data packet to obtain a data load, and stores the data load in a network card memory; and the CXL _ IP module of the network card end informs the host that the network data is received, reads the data load in the memory of the network card and sends the data load to the CXL _ IP module of the host.
In a specific embodiment, the host further includes a host memory module for storing data and a CPU for controlling transmission and reception of data; the host memory module, the CPU and the host end CXL _ IP module are sequentially connected;
when sending host end data to a network, a CPU controls a host memory module to send the host end data to a network card through a host end CXL _ IP module, and sends a data sending command to the network card through the host end CXL _ IP module;
when receiving network data from a network, the CPU inquires or receives the network data storage condition of the network card through the CXL _ IP module of the host computer, receives the data load of the network data according to the data storage condition and stores the data load in the memory module of the host computer.
In one embodiment, the network card is a non-operating system network card, and the network card memory is a DRAM memory.
It should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.