WO2021063154A1 - Queue communication method and system, and related devices - Google Patents

Queue communication method and system, and related devices Download PDF

Info

Publication number
WO2021063154A1
WO2021063154A1 PCT/CN2020/113497 CN2020113497W WO2021063154A1 WO 2021063154 A1 WO2021063154 A1 WO 2021063154A1 CN 2020113497 W CN2020113497 W CN 2020113497W WO 2021063154 A1 WO2021063154 A1 WO 2021063154A1
Authority
WO
WIPO (PCT)
Prior art keywords
queue
data
host
network card
forwarding
Prior art date
Application number
PCT/CN2020/113497
Other languages
French (fr)
Chinese (zh)
Inventor
李涛
江锦毅
李生
周宇
杨荣玉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021063154A1 publication Critical patent/WO2021063154A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • This application relates to the field of computers, and in particular to a method, system and related equipment for queue communication.
  • Cloud computing is based on a configurable shared computing resource pool to provide users with convenient, on-demand access services.
  • cloud computing service providers will provide a variety of virtual machine specifications, and flexibly distribute virtual machines of different specifications according to user needs. For example, when users have greater demands on the network, users can be divided into a large-format virtual machine with a 64-bit Virtual Central Processing Unit (vCPU) and 128GB of storage space.
  • vCPU Virtual Central Processing Unit
  • the virtual machine runs on the computing device, and configuring the virtual machine also includes allocating multiple host queues on the computing device to the virtual machine.
  • a virtual machine communicates with a device other than the computing device where it is located, it needs to send data to the network card.
  • For a virtual machine with a configured network card queue when you need to send data to the network card, you can directly send the data to be sent to the host queue assigned to the virtual machine, and then the host queue assigned to the virtual machine and the network card queue on the network card pass The queue communication mechanism copies the to-be-sent data in the host queue allocated to the virtual machine to the network card queue of the network card to complete a data communication between the virtual machine and the network card.
  • the host queue on the computing device and the network card queue of the network card are one-to-one mapping.
  • the data to be sent from the virtual machine stored in a host queue of the computing device can only be sent to the network card A network card queue on the.
  • the performance of queue communication is restricted by the forwarding ability of the host queue on the computing device and the forwarding ability of the network card queue of the network card.
  • the virtual machine sends data to the network card, it is subject to the forwarding ability of the virtual machine vCPU.
  • the forwarding ability of the queue assigned to the virtual machine on the host is usually weaker than the forwarding ability of the queue on the network card, which causes the forwarding performance of the queue on the network card to not be fully utilized. , Affect the efficiency of communication.
  • the present application provides a queue communication method, system and related equipment, which are used to solve the problem that the queue forwarding performance on the network card cannot be fully utilized, which causes the communication efficiency to be affected.
  • a method for queue communication is provided, the method is applied to a forwarding device, the forwarding device is connected to a computing device, the forwarding device includes at least one forwarding queue, and the computing device includes multiple host queues, A plurality of data to be sent are stored in the plurality of host queues, and the method includes:
  • the forwarding device receives a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue and the The second host queues all belong to the multiple host queues;
  • the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, obtains the first data to be sent from the first host queue, and obtains the first data to be sent from the first host queue. 2. Obtain the second data to be sent from the host queue;
  • the forwarding device stores the first to-be-sent data and the second to-be-sent data into the first host queue and the second host respectively according to the queue correspondence between the forwarding queue and the host queue A forwarding queue corresponding to the queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  • the method before the forwarding device receives the first doorbell message from the computing device, the method further includes: the forwarding device receives a device query message from the computing device; responding to the device query Message, the forwarding device reports the number of extended forwarding queues to the computing device, where the number of extended forwarding queues is determined by the number of the at least one forwarding queue and the expansion coefficient, and the extended The subsequent number of forwarding queues is used to establish the queue correspondence.
  • the forwarding device includes an attribute register, and the number of the extended forwarding queues is stored in the attribute register; the forwarding device reporting the number of extended forwarding queues to the computing device includes : The forwarding device queries the attribute register, obtains the number of the extended forwarding queues from the attribute register, and reports the number of the extended forwarding queues to the computing device.
  • the forwarding device sends the expanded number of forwarding queues to the computing device, so that the computing device can allocate multiple host queues to one forwarding queue to generate a queue correspondence relationship, without any upgrade of the computing device. , It can solve the problem that the queue forwarding performance on the network card cannot be fully exerted because the host queue forwarding performance is lower than the network card queue, and the communication efficiency is improved.
  • the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so
  • the second head pointer indicates the second data to be sent, and multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple hosts of the computing device
  • the head pointer and the tail pointer of a host queue in the queue, the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue;
  • Obtaining the information of the first host queue and the information of the second host queue in the message includes: the forwarding device obtains the first head pointer and the second head pointer from the first doorbell message;
  • the forwarding queue acquiring the first to-be-sent data from the first host queue includes: the forwarding device refreshes the head pointer corresponding to the first host queue in the plurality of
  • the forwarding device includes a queue expansion device and a network card
  • the at least one forwarding queue includes at least one queue expansion device queue and at least one network card queue
  • the at least one queue expansion device queue is located in the queue expansion device.
  • the at least one network card queue is located in the network card
  • the at least one set of head pointers and the at least one set of tail pointers are stored in the queue expansion device
  • the queue correspondence relationship includes a first queue correspondence relationship and a second queue
  • the first queue correspondence is the correspondence between the multiple host queues and the at least one queue expansion device queue
  • the second queue correspondence is the at least one network card queue and the at least one queue
  • the corresponding relationship between the expansion device queues, the at least one network card queue corresponds to the at least one queue expansion device queue
  • the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers
  • the group tail pointers respectively correspond to the head pointer and the tail pointer of a host queue in the pluralit
  • the queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tails.
  • Pointers the network card stores at least one set of network card head pointers and at least one set of network card tail pointers, the at least one set of queue expansion device head pointers corresponds to the at least one set of network card head pointers, and the at least one The tail pointer of the group queue expansion device corresponds to the tail pointer of the at least one group of network cards in a one-to-one correspondence;
  • the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message , Including: the queue expansion device in the forwarding device obtains the first head pointer and the second head pointer from the first doorbell message; the forwarding device obtains the first head pointer from the first host queue
  • the data to be sent includes: the queue expansion device in the forwarding device refreshes the head pointer corresponding to the first host queue among the multiple sets of head pointers according to the first head pointer and
  • a plurality of host queues in the computing device and a queue expansion device queue in the queue expansion device generate a first queue correspondence
  • a queue expansion device queue in the queue expansion device and a network card queue in a network card generate a first queue correspondence relationship.
  • the first data to be sent is a first direct memory access DMA read descriptor
  • the second data to be sent is a second DMA read descriptor
  • the first data to be sent is And after the second data to be sent is stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: the network card in the forwarding device reads the descriptor according to the first DMA and the second DMA read descriptor to generate a first DMA read command and a second DMA read command; the network card in the forwarding device sends the first DMA read command and the second DMA read command to the queue expansion device in the forwarding device; The queue expansion device in the forwarding device obtains first data to be read from the computing device according to the first DMA read command, and obtains second data to be read from the computing device according to the second DMA read command The queue expansion device in the forwarding device forwards the first data to be read and the second data to be read to the network card in the forwarding device.
  • the first data to be sent is a first DMA write descriptor
  • the second data to be sent is a second DMA write descriptor, wherein the first DMA write descriptor is used to transfer the first DMA write descriptor.
  • a data to be written is written from the queue expansion device to the computing device
  • the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device
  • the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device.
  • the storing of the first data to be sent and the second data to be sent in the first host queue and the queue expansion device queue corresponding to the second host queue includes: the queue expansion device in the forwarding device transfers the first The DMA write descriptor is converted into a first network card DMA write descriptor, and the second DMA write descriptor is converted into a second network card DMA write descriptor, where the first DMA write descriptor is used to transfer the first to be written Incoming data is written from the network card to the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card to the queue expansion device; the queue expansion in the forwarding device
  • the device stores the first network card DMA write descriptor and the second network card DMA write descriptor in the corresponding queue expansion device queue; the storing the first data to be sent and the second data to be sent in After the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: the network card in the forwarding device obtains the data stored in the network card
  • the DMA write descriptor of the second network card obtain the second piece of data stored in the network card and corresponding to the DMA write descriptor of the second network card.
  • Fragmented data wherein the first to-be-written data includes n first fragmented data, and the second to-be-written data includes m second fragmented data;
  • the network card in the forwarding device is based on the The first network card DMA write descriptor and the first fragmented data generate a first DMA write command, and the second network card DMA write descriptor and the second fragmented data generate a second DMA write command;
  • the forwarding The network card in the device sends the first DMA write command and the second DMA write command to the queue expansion device;
  • n a third DMA write command is generated according to the first data to be written, and in the case that the number of the second fragmented data is m,
  • the queue expansion device stores the first piece of data sent by the network card in the memory, and when all n pieces of data of the first data to be written are collected, the first data to be written is sent
  • the data received by the network card is usually fragmented data, thereby avoiding the problem that the computing device receives out-of-sequence of the first fragmented data and causing the computing device to deal with the problem of heavy processing pressure, thereby improving the efficiency of queue communication.
  • the method further includes: in the forwarding device The network card sends a completion message and an interrupt message to the queue expansion device; the queue expansion device in the forwarding device sends the completion message and interrupt message to the computing device, so that the computing device refreshes the first host according to the completion message The tail pointer of the queue and the second host queue.
  • a queue communication system in a second aspect, includes a forwarding device and a computing device, the forwarding device is connected to the computing device, the forwarding device includes at least one forwarding queue, and the computing device includes multiple host queues , Multiple data to be sent are stored in the multiple host queues, where:
  • the computing device is configured to send a first command message to the forwarding device, where the first doorbell message carries information about the first host queue and the second host queue, and the first host queue and the all The second host queues all belong to the multiple host queues;
  • the forwarding device is used to receive the first doorbell message from the computing device
  • the forwarding device is configured to obtain the information of the first host queue and the information of the second host queue from the first doorbell message, obtain the first data to be sent from the first host queue, and obtain the first data to be sent from the first host queue. Acquiring the second to-be-sent data from the second host queue;
  • the forwarding device is configured to store the first data to be sent and the second data to be sent into the first host queue and the first host queue according to the queue correspondence between the forwarding queue and the host queue. Two forwarding queues corresponding to the host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  • the computing device is configured to send a device query message to the forwarding device before sending the first doorbell message to the forwarding device; the forwarding device is configured to receive a device query from the computing device Message; the forwarding device is used to report the number of extended forwarding queues to the computing device in response to the device query message, wherein the number of extended forwarding queues is determined by the number of the at least one forwarding queue The number and expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence relationship.
  • the forwarding device includes an attribute register, and the number of the expanded forwarding queues is stored in the attribute register; the forwarding device is used to query the attribute register and obtain it from the attribute register The number of the extended forwarding queues is reported to the computing device.
  • the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so
  • the second head pointer indicates the second data to be sent
  • multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple hosts of the computing device
  • the head pointer and the tail pointer of a host queue in the queue, the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue; Acquire the first head pointer and the second head pointer in a doorbell message;
  • the forwarding device is configured to refresh the head pointers corresponding to the first host queue in the multiple sets of head pointers according to the first head pointers
  • the forwarding device is used to obtain the first host queue from the first host queue according to the head pointer corresponding to the first host queue after being refreshed, and the
  • the forwarding device includes a queue expansion device and a network card
  • the at least one forwarding queue includes at least one queue expansion device queue and at least one network card queue
  • the at least one queue expansion device queue is located in the queue expansion device.
  • the at least one network card queue is located in the network card
  • the at least one set of head pointers and the at least one set of tail pointers are stored in the queue expansion device
  • the queue correspondence relationship includes a first queue correspondence relationship and a second queue
  • the first queue correspondence is the correspondence between the multiple host queues and the at least one queue expansion device queue
  • the second queue correspondence is the at least one network card queue and the at least one queue
  • the corresponding relationship between the expansion device queues, the at least one network card queue corresponds to the at least one queue expansion device queue
  • the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers
  • the group tail pointers respectively correspond to the head pointer and the tail pointer of a host queue in the pluralit
  • the queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tails.
  • Pointers the network card stores at least one set of network card head pointers and at least one set of network card tail pointers, the at least one set of queue expansion device head pointers corresponds to the at least one set of network card head pointers, and the at least one The tail pointer of the group queue expansion device corresponds to the at least one group of network card tail pointers one-to-one;
  • the queue expansion device is configured to obtain the first head pointer and the second head pointer from the first doorbell message;
  • the queue expansion device is configured to refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer and the first queue correspondence;
  • the queue expansion device is configured to Acquiring the first data to be sent from the first host queue according to the head pointer corresponding to the first host queue after the refresh and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers;
  • the first data to be sent is a first direct memory access DMA read descriptor
  • the second data to be sent is a second DMA read descriptor
  • the network card is also used to After the first data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, they are generated according to the first DMA read descriptor and the second DMA read descriptor
  • the first DMA read command and the second DMA read command the network card is used to send the first DMA read command and the second DMA read command to the queue expansion device in the forwarding device
  • the queue expansion device is used for The first DMA read command obtains first data to be read from the computing device, and obtains second data to be read from the computing device according to the second DMA read command
  • the queue expansion device is used to The first data to be read and the second data to be read are forwarded to the network card in the forwarding device.
  • the first data to be sent is a first DMA write descriptor
  • the second data to be sent is a second DMA write descriptor, wherein the first DMA write descriptor is used to transfer the first DMA write descriptor.
  • a data to be written is written from the queue expansion device to the computing device
  • the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device
  • the queue The expansion device is used to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor, wherein the first DMA write descriptor
  • the descriptor is used to write the first data to be written from the network card into the queue expansion device
  • the second DMA descriptor is used to write the second data to be written from the network card into the queue expansion device
  • the queue expansion device is used to store the first network card DMA write descriptor and the second network card DMA write descriptor into
  • the network card is configured to A network card DMA write descriptor and the first fragment data generate a first DMA write command, and a second DMA write command is generated according to the second network card DMA write descriptor and the second fragment data;
  • the network card uses Sending the first DMA write command and the second DMA write command to the queue expansion device;
  • the queue expansion device is configured to transfer all data according to the first DMA write command and the second DMA write command
  • the first fragmented data and the second fragmented data are written into the memory of the queue expansion device; the queue expansion device is used to store the first fragmented data in the memory of the queue expansion device in the forwarding device
  • a third DMA write command is generated according to the first data to be written, and when the number of the second fragmented data is m, according to the second data to be written , Generate a fourth DMA write command
  • the network card is further configured to send the first data to be sent and the second data to be sent to the network card queue corresponding to the corresponding queue expansion device queue after storing the first data to be sent and the second data to be sent to the queue
  • the expansion device sends a completion message and an interrupt message; the queue expansion device is also used to send the completion message and interrupt to the computing device, so that the computing device refreshes the first host queue and the second host according to the completion message The tail pointer of the queue.
  • a forwarding device is provided, the forwarding device is connected to a computing device, the forwarding device includes at least one forwarding queue, the computing device includes multiple host queues, and how many host queues are stored in the multiple host queues. Pieces of data to be sent, wherein the forwarding device includes:
  • a receiving unit configured to receive a first doorbell message from the computing device, wherein the first doorbell message carries information about a first host queue and a second host queue, and the first Both the host queue and the second host queue belong to the multiple host queues;
  • An acquiring unit configured to acquire information about the first host queue and information about the second host queue from the first doorbell message, and acquire first data to be sent from the first host queue , Acquiring second data to be sent from the second host queue;
  • a storage unit configured to store the first data to be sent and the second data to be sent in the first host respectively according to the queue correspondence between the forwarding queue and the host queue
  • the queue and the forwarding queue corresponding to the second host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  • the forwarding device further includes a response unit, and the receiving unit is further configured to receive a device query message from the computing device before the receiving unit receives the first doorbell message from the computing device
  • the response unit is used to respond to the device query message, and the forwarding device reports the number of the extended forwarding queues to the computing device, wherein the number of the extended forwarding queues is determined by the at least one The number of forwarding queues and the expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence.
  • the forwarding device includes an attribute register, the number of the expanded forwarding queues is stored in the attribute register, and the response unit is used to query the attribute register and obtain it from the attribute register. The number of the extended forwarding queues is reported to the computing device.
  • the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so
  • the second head pointer indicates the second data to be sent, and multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple queues of the computing device
  • the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one queue;
  • the forwarding device further includes a refreshing unit, and the acquiring unit Is used to obtain the first head pointer and the second head pointer from the first doorbell message;
  • the refresh unit is used to refresh the first head pointer in the plurality of sets of head pointers according to the first head pointer
  • the acquiring unit is used to obtain the head pointer corresponding to the first host queue after being refreshed, and the tail pointer
  • the first data to be sent is acquired from a host queue; the refresh unit is configured to refresh the head pointer corresponding to the second host queue in the plurality of sets of head pointers according to the second head pointer; the acquisition unit uses According to the head pointer corresponding to the second host queue after being refreshed, and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers, the second data to be sent is acquired from the second host queue
  • the refresh unit is used to refresh the first host queue after storing the first data to be sent and the second data to be sent in the corresponding forwarding queues of the first host queue and the second host queue respectively The tail pointer and the tail pointer of the second host queue; the refresh unit is used to refresh the head pointer of the corresponding forwarding queue; the refresh unit is used to refresh the tail pointer of the first host queue and The refreshed tail pointer of the second host queue is sent to the computing device.
  • a queue expansion device is provided.
  • the queue expansion device is connected to a computing device and connected to a network card, the queue expansion device is connected to a computing device, the network card is connected to the computing device, and the queue expands
  • the device includes at least one queue expansion device queue, the network card includes at least one network card queue, the computing device includes a plurality of host queues, a plurality of data to be sent are stored in the plurality of host queues, and the queue expansion device includes:
  • a receiving unit configured to receive a first doorbell message from the computing device, wherein the first doorbell message carries information about a first host queue and a second host queue, and the first Both the host queue and the second host queue belong to the multiple host queues;
  • An acquiring unit configured to acquire information about the first host queue and information about the second host queue from the first doorbell message, and acquire first data to be sent from the first host queue , Acquiring second data to be sent from the second host queue;
  • a storage unit which is configured to store the first data to be sent and the second data to be sent in the storage unit according to the first queue correspondence between the queue expansion device queue and the host queue.
  • a sending unit the sending unit is configured to send a second doorbell message to the network card, the second doorbell message carrying the corresponding queue expansion device queue information, so that the network card according to the second doorbell message , Acquiring the first data to be sent and the second data to be sent from the corresponding queue expansion device queue, and according to the second queue correspondence between the network card queue and the queue expansion device queue,
  • the first data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, where the corresponding queue expansion device queue belongs to the queue expansion device queue, and the The first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue, and the corresponding network card queue belongs to the network card queue.
  • the device further includes a response unit, and the receiving unit is further configured to receive a first device query message from the computing device before receiving the first doorbell message from the computing device;
  • the sending unit is used to send a second device query message to the network card;
  • the response unit is used to receive the number of network card queues sent by the network card, wherein the number of network card queues is used to establish the second queue correspondence
  • the response unit is configured to report the number of expanded queue expansion device queues to the computing device in response to the first device query message, wherein the number of expanded queue expansion device queues is determined by the The number of network card queues and the expansion coefficient are determined, and the expanded number of queue expansion device queues is used to establish the first queue correspondence relationship.
  • the device includes an attribute register, and the number of the expanded forwarding queues is stored in the attribute register; the response unit is also used to query the attribute register and obtain it from the attribute register The number of queues of the expanded queue expansion device is reported to the computing device.
  • the information of the first host queue includes a first head pointer
  • the first head pointer indicates the first to-be-sent data
  • the information about the second host queue includes a second head pointer
  • the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, and each set of head pointers and each set of tail pointers respectively correspond to the multiple host queues
  • the head pointer and the tail pointer of a host queue in, the queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tail pointers, and at least one set of network cards is stored in the network card
  • the at least one set of queue extension device head pointers correspond to the at least one set of network card head pointers
  • the at least one set of queue extension device tail pointers corresponds to the at least one There is a one-to-one correspondence between the tail pointers of the network card
  • the queue expansion device further includes
  • the storage unit is used to obtain the second data to be sent according to In the first queue correspondence, the first data to be sent and the second data to be sent are stored in the first host queue and the queue expansion device queue corresponding to the second host queue, wherein the corresponding The queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue;
  • the refresh unit is used for refreshing The head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail pointer of the second host queue;
  • the sending unit is further configured to send the second doorbell message to the network card, wherein The second doorbell message carries the head pointer of the corresponding queue expansion device queue, so that the network card refreshes the at least one queue according to the head pointer of
  • the data and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue according to the corresponding relationship of the second queue.
  • the first data to be sent is a first direct memory access DMA read descriptor
  • the second data to be sent is a second DMA read descriptor
  • the receiving unit is further configured to receive the The first DMA read command and the second DMA read command sent by the network card, wherein the first DMA read command is generated by the network card according to the first DMA descriptor, and the second DMA read command is The network card is generated according to the second DMA descriptor
  • the obtaining unit is further configured to obtain the first data to be read from the computing device according to the first DMA read command, and from the computing device according to the second DMA read command Obtain second data to be read
  • the sending unit is further configured to forward the first data to be read and the second data to be read to the network card.
  • the first data to be sent is a first DMA write descriptor
  • the second data to be sent is a second DMA write descriptor
  • the first DMA write descriptor is used to transfer the first DMA write descriptor.
  • a data to be written is written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device, and the device It also includes a conversion unit configured to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor, wherein ,
  • the first DMA write descriptor is used to write the first data to be written from the network card to the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card Write to the queue expansion device;
  • the storage unit is used to store the first network card DMA write descriptor and the second network card DMA write descriptor
  • the storage unit is used to write the first fragmented data and the second fragmented data into the memory of the queue expansion device according to the first DMA write command and the second DMA write command
  • the conversion unit is used to generate a third DMA write command based on the first data to be written when the number of first fragmented data is n in the memory of the queue expansion device In the case where the number of the second fragmented data is m, a fourth DMA write command is generated according to the second data to be written, where the third DMA write command is used for the computing device to execute and Writing the first data to be written into the computing device, and the fourth DMA write command is used for execution by the computing device and writing the first data to be written into the computing device;
  • the sending unit is configured to send the third DMA write command and the fourth DMA write command to the computing device, so that the computing device transfers all data according to the third DMA write command and the fourth DMA write command.
  • the first data to be written and the second data to be written are written into the computing device.
  • the receiving unit is further configured to receive a completion message and an interrupt sent by the network card, wherein, the completion message and the interrupt indicate that the network card is sending the first data to be sent and the second The data to be sent is generated after being stored in the network card queue corresponding to the corresponding queue expansion device queue; the sending unit is also used to send a completion message and an interrupt to the computing device, so that the computing device according to the completion message Refresh the tail pointers of the first host queue and the second host queue.
  • a forwarding device in a fifth aspect, includes a processor and a memory, and the processor executes the code in the memory to implement the method described in the first aspect.
  • a computer program product is provided.
  • the computer program product is read and executed by a computing device, the method described in the first aspect is implemented.
  • a computer non-transitory storage medium including instructions, which when run on a computing device, cause the computing device to implement the method described in the first aspect.
  • a forwarding device in an eighth aspect, the device includes a logic circuit, and the forwarding device implements the method described in the first aspect through the logic circuit.
  • a queue expansion device in a ninth aspect, includes a processor and a memory, and the processor executes the code in the memory to implement the queue expansion device described in the fourth aspect.
  • a computer program product is provided, which is characterized in that, when the computer program product is read and executed by a computing device, the queue expansion device described in the fourth aspect is implemented.
  • a computer non-transitory storage medium which is characterized in that it includes an instruction that, when the instruction runs on a computing device, causes the computing device to implement the queue expansion device described in the fourth aspect.
  • a transfer queue expansion device in a twelfth aspect, the device includes a logic circuit, and the forwarding device implements the queue expansion device described in the fourth aspect through the logic circuit.
  • Figure 1 is a schematic diagram of the logical structure of a network system to which the solution provided in this application is applicable;
  • FIG. 2 is a schematic diagram of the logical structure of a forwarding device for queue communication in a network system provided by this application;
  • FIG. 3 is a schematic diagram of the logical structure of a queue expansion device for queue communication in a network system provided by the present application;
  • Figure 4 is a flow chart of the steps of a queue communication method provided by the present application.
  • 5A-5C are schematic diagrams of a queue structure
  • Figure 6 is a flow chart of the steps of another queue communication method provided by the present application.
  • FIG. 7 is a flowchart of the steps of obtaining the first data to be sent and the second data to be sent according to the doorbell message in a queue communication method provided by the present application;
  • FIG. 8 is a flow chart of the steps of a queue communication method provided by the present application in an application scenario
  • FIG. 9 is a flow chart of the steps of a queue communication method provided by the present application in another application scenario.
  • FIG. 10 is a schematic structural diagram of a forwarding device provided by this application.
  • FIG. 11 is a schematic structural diagram of a queue expansion device provided by the present application.
  • FIG. 12 is a schematic diagram of the hardware structure of a forwarding device provided by the present application.
  • FIG. 13 is a schematic diagram of the hardware structure of a queue expansion device provided by the present application.
  • FIG. 1 is a schematic diagram of the logical structure of a network system applicable to this application.
  • the network system includes: a computing device 110 and a computing device 120, a forwarding device 210 and a forwarding device 220, and a network 300, wherein, The computing device 110 and the forwarding device 210 are connected and communicated, the forwarding device 210 is connected and communicated with the network 300, the computing device 120 is connected and communicated with the forwarding device 220, and the forwarding device 220 is connected and communicated with the network 300.
  • FIG. 1 is a schematic diagram of the logical structure of a network system applicable to this application.
  • the network system includes: a computing device 110 and a computing device 120, a forwarding device 210 and a forwarding device 220, and a network 300, wherein, The computing device 110 and the forwarding device 210 are connected and communicated, the forwarding device 210 is connected and communicated with the network 300, the computing device 120 is connected and communicated with the forwarding device 220, and
  • Figure 1 only shows two computing devices and two forwarding devices, and each computing device is connected to only one forwarding device.
  • the network system may include one or more computing devices and The number of one or more forwarding devices, computing devices, and forwarding devices is not a limitation to the embodiments of this application.
  • Each computing device can also be connected to multiple forwarding devices.
  • the system can make adjustments according to user needs as described above. This application does not Make specific restrictions.
  • Figure 1 is only for the convenience of description and only shows part of the resources.
  • the computing device shown in Figure 1 may also include hardware resources such as memory and hard disk, as well as software resources such as operating systems and applications that need to be run. Go into details again.
  • the data to be sent on the computing device 110 side can be sent to the forwarding device 210, and the network card 210 sends to the network card 220 through the network 300 connected to it.
  • the forwarding device 220 may receive the data to be sent through the network 300 and send the data to be sent to the computing device 120, so that the computing device 110 sends the data to be sent to the computing device 120.
  • This application mainly focuses on the communication process between the computing device and the forwarding device, so the process of data transmission by the forwarding device through the network will not be repeated. The process of implementing the communication between the computing device and the forwarding device in this application will be explained in detail below.
  • the forwarding device may be a network card.
  • the communication system shown in FIG. 1 may be as shown in FIG. 2, where the computing device 110 includes a plurality of host queues 111 (shown in the figure 4 host queues Q00-Q03), the forwarding device 210 includes at least one forwarding queue 211 (only two forwarding queues Q10 and Q11 are drawn in the figure), and the at least one forwarding queue 211 and the multiple hosts There is a queue correspondence between the queues 111.
  • one forwarding queue 211 may have a queue correspondence with multiple host queues 211. For example, there is a queue between the host queues Q00-Q01 and the forwarding queue Q10 shown in FIG.
  • FIG. 1 only shows the computing device 110 and the forwarding device for ease of understanding. 210, I won't repeat it here.
  • the computing device 110 when it needs to transmit the data to be sent to the forwarding device 210, it can first put the data to be sent into the host queue, such as in the host queues Q00 and Q01 in FIG. 2, and then according to the queue correspondence, The forwarding queue Q10 corresponding to the host queues Q00 and Q01 is determined, and the data to be sent is transferred from the host queues Q00 and Q01 to the forwarding queue Q10, so as to transmit the data to be sent from the computing device 110 to the forwarding device 210.
  • the host queue such as in the host queues Q00 and Q01 in FIG. 2
  • the forwarding queue Q10 corresponding to the host queues Q00 and Q01 is determined, and the data to be sent is transferred from the host queues Q00 and Q01 to the forwarding queue Q10, so as to transmit the data to be sent from the computing device 110 to the forwarding device 210.
  • each forwarding queue can generate a queue correspondence with multiple host queues, thereby avoiding the problem that the forwarding ability of the host queue is weaker than the forwarding ability of the network card queue.
  • the communication efficiency is low, so that the forwarding performance of the network card queue can be brought into full play.
  • the forwarding device may also include a queue expansion device and a network card.
  • the communication system shown in FIG. 1 may be as shown in FIG. 3, where the computing device 110 includes multiple host queues 111 ( 4 host queues Q00-Q03 are drawn in the figure), the forwarding device 210 includes a queue expansion device 2101 and a network card 2102, wherein the queue expansion device 2010 includes at least one queue expansion device Queue 2111 (only 2 queues are drawn in the figure Expanded device queues Q10 and Q11), the network card 2102 includes at least one network card queue 2112 (only two network card queues Q20 and Q21 are drawn in the figure), and the at least one queue expands the device queue 2111 and the multiple host queues 111 There is a first queue correspondence between them, and there is a second queue correspondence between the at least one network card queue 2112 and the at least one queue expansion device queue 2111.
  • one queue expansion device queue 2111 may have a first queue correspondence relationship with multiple host queues 211, for example, there is a queue correspondence relationship between the host queues Q00-Q01 and the queue expansion device queue Q10 shown in FIG. 3;
  • One queue expansion device queue 2111 may have a second queue correspondence relationship with one network card queue 2112. For example, there is a queue correspondence relationship between the queue expansion device queue Q10 and the network card queue Q20 shown in FIG. 3.
  • the computing device 110 when it needs to transmit the data to be sent to the network card 2112, it can first put the data to be sent into the host queue, for example, into the host queues Q00 and Q01 in FIG. 3, and then correspond to the first queue Relationship, determine the queue expansion device queue Q10 corresponding to the host queues Q00 and Q01, so as to transfer the data to be sent from the host queues Q00 and Q01 to the queue expansion device queue Q00; then determine the queue expansion according to the second queue correspondence relationship
  • the network card queue Q20 corresponding to the device queue Q10 transfers the data to be sent from the queue expansion device queue Q10 to the network card queue Q20, thereby transmitting the data to be sent from the computing device 110 to the network card 2112.
  • each queue expansion device queue can generate a queue correspondence with multiple host queues, and the expansion device queue and the network card queue have a one-to-one correspondence, so that Without any upgrade of the network card and computing device, the inefficiency of communication caused by the forwarding capacity of the host queue being weaker than the forwarding capacity of the network card queue is avoided, so that the forwarding performance of the network card queue can be fully utilized.
  • the network system shown in FIG. 1 may also be a data center virtualization scenario.
  • the computing device 110 and the computing device 120 may be physical machines including multiple virtual machines, or may be located in The two virtual machines in the same physical machine may also be two virtual machines located in different physical machines, which are not specifically limited in this application.
  • the following describes the method for queue communication based on the forwarding device provided by the present application based on the network architecture shown in FIG. 1 to FIG. 2.
  • the present application provides a method for queue communication.
  • the forwarding device is connected to a computing device, the forwarding device includes at least one forwarding queue, the computing device 400 includes multiple host queues, and multiple host queues of the computing device store multiple data to be sent, In simple terms, the data to be sent in the multiple host queues of the computing device will be sent to at least one forwarding queue of the forwarding device.
  • the computing device 400 in FIG. 4 may be the computing device 110 and the computing device 120 in FIGS. 1-2, and the method of queue communication includes the following steps:
  • the forwarding device receives a device query message from the computing device.
  • the forwarding device may be a PCIe device. After the forwarding device is connected to the computing device, the computing device needs to identify the forwarding device connected to it through PCIe device enumeration, and then can communicate with the forwarding device.
  • the forwarding device In response to the device query message, the forwarding device reports the expanded number of forwarding queues to the computing device, thereby establishing a queue correspondence between the forwarding queue and the host queue.
  • the number of the extended forwarding queues is determined by the number of the at least one forwarding queue and the expansion coefficient, and the number of the extended forwarding queues is used to establish a queue correspondence relationship.
  • the forwarding device includes an attribute register, and the number of the extended forwarding queues is stored in the attribute register; the forwarding device reporting the number of extended forwarding queues to the computing device includes: The forwarding device queries the attribute register, obtains the expanded number of forwarding queues from the attribute register, and reports the expanded number of forwarding queues to the computing device.
  • the expansion factor n may be determined according to the queue processing capability of the forwarding device and the single thread processing capability of the processor of the computing device.
  • the forwarding device receives a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue and The second host queues all belong to the multiple queues.
  • the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, obtains the first to-be-sent data from the first host queue, and obtains the The second data to be sent is acquired from the second host queue.
  • the forwarding device stores the first data to be sent and the second data to be sent into the first host queue and the first host queue, respectively, according to the queue correspondence between the forwarding queue and the host queue. Two forwarding queues corresponding to the host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  • the host queue and the forwarding queue can be understood as a section of memory.
  • This section of memory will be divided into several memory blocks of equal length, corresponding to a unit of work.
  • Each unit of work is used to store a fixed-length message, such as computing.
  • the data request (read request or write request) initiated by the device to the forwarding device. Therefore, similar to other storage mechanisms, each queue maintained by the computing device and the forwarding device also includes a head pointer (Head) and a tail pointer (Tail). By comparing the positions of the two pointers, the storage status of the queue can be obtained.
  • Head head pointer
  • Tiil tail pointer
  • the refresh rule of the head pointer is: point to the next empty position in the queue
  • the refresh rule of the tail pointer point to the location of the next command to be executed.
  • the queue can be logically understood as shown in Figure 5A
  • the actual state of the memory in the queue is a long strip of storage space, as shown in Figure 5B.
  • the head and tail pointers point to the same position, it means that the queue is currently empty, as shown in Figure 5C.
  • each host queue in the computing device 400 includes a head and tail pointer. Therefore, the information of the first host queue includes a first head pointer, and the information of the second host queue includes a second head pointer. Wherein, the first head pointer indicates the first data to be sent, and the second head pointer indicates the second data to be sent.
  • the first data to be sent is located in 4 units A0-A3 in the first host queue, then the first head pointer can point to A3, and the second data to be sent is located in 3 in the second host queue.
  • the second head pointer can point to B2. Therefore, the first doorbell message sent by the computing device 400 to the forwarding device 300 in step S103 will include the first head pointer A3 and the second head pointer B2.
  • the forwarding device 300 also stores multiple sets of head pointers and multiple sets of tail pointers, and each set of head pointers and each set of tail pointers respectively correspond to the head pointers of one of the multiple host queues of the computing device. And tail pointers, the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue.
  • the forwarding device 300 further includes a doorbell register for storing the head and tail pointer values of the first host queue and the second host queue in the computing device 400, and the value of the forwarding queue in the forwarding device. The value of the head pointer and tail pointer.
  • step S104 may be as follows:
  • the forwarding device obtains the first head pointer and the second head pointer from the first doorbell message.
  • the forwarding device refreshes the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer.
  • the forwarding device refreshes the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer.
  • the forwarding device obtains the first host queue from the first host queue according to the head pointer corresponding to the first host queue after refreshing and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent.
  • the forwarding device obtains the second host queue from the second host queue according to the head pointer corresponding to the second host queue after the refresh and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers.
  • the second data to be sent The second data to be sent.
  • step S1041 may obtain the first head pointer A3 and the second head pointer A3 from the first doorbell message. Head pointer B2.
  • the value of the first head pointer stored in the doorbell register can also be refreshed to A3 according to the first head pointer A3 acquired in the first doorbell message.
  • the value of the first head pointer stored in the doorbell register can be updated to A3.
  • the second head pointer B2 obtained in the message also refreshes the value of the second head pointer stored in the memory in the doorbell register to B2.
  • the forwarding device obtains the first data to be sent A0-A3 from the first host queue by comparing the refreshed first head pointer A3 and the first tail pointer A0 in the doorbell register, and according to the second head pointer B2 and The value of the second tail pointer B0 obtains the second to-be-sent data B0-B2 from the second host queue.
  • the forwarding device may first obtain the forwarding corresponding to the first host queue and the second host queue according to the queue correspondence established in step S102. queue. Then, the first data to be sent and the second data to be sent are stored in the forwarding queue to complete a data communication.
  • the method further includes : Refresh the tail pointer of the first host queue and the tail pointer of the second host queue; refresh the head pointer of the corresponding forwarding queue; refresh the tail pointer of the first host queue and the refreshed tail pointer
  • the tail pointer of the second host queue is sent to the computing device. For example, as shown in FIG. 6, after the forwarding device stores the first data to be sent and the second data to be sent in the forwarding queue C corresponding to the first host queue and the second host queue, the forwarding device may forward the doorbell register The tail pointer of the queue C is refreshed to C7.
  • the first tail pointer of the first host queue is refreshed to A3
  • the second host queue is the second
  • the values of the first tail pointer and the second tail pointer are sent to the computing device, so as to inform the computing device that the first data to be sent and the second data to be sent have been removed by the forwarding device.
  • the forwarding device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully exploited, and the thread message forwarding rate of the computing device no longer becomes the network card Dealing with the bottleneck of message forwarding, further avoiding resource waste.
  • the forwarding device 300 at this time includes the queue expansion device 500 and the network card 600, and at least one of the forwarding devices 300
  • the forwarding queue includes at least one queue expansion device queue and at least one network card queue, the at least one queue expansion device queue is located in the queue expansion device 500, and the at least one network card queue is located in the network card 600.
  • the queue correspondence relationship includes a first queue correspondence relationship and a second queue correspondence relationship.
  • the first queue correspondence relationship is a correspondence relationship between the plurality of host queues and the at least one queue extension device queue
  • the second queue The correspondence relationship is the correspondence relationship between the at least one network card queue and the at least one queue expansion device queue, and the at least one network card queue corresponds to the at least one queue expansion device queue in a one-to-one correspondence.
  • the queue communication method includes the following steps:
  • the computing device 400 sends a device query message to the queue expansion device 500.
  • the queue expansion device 500 sends a device query message to the network card 600.
  • the network card 600 reports the number of network card queues to the queue expansion device 500, thereby establishing a second queue correspondence relationship between the queue expansion device and the network card queue.
  • the network card queue and the queue expansion device queue have a one-to-one correspondence.
  • the queue expansion device 500 includes an attribute register, and the queue expansion device 500 stores the number of network card queues in the attribute register after receiving the number of network card queues of the network card 600.
  • the queue expansion device 500 reports the number of expanded queues to the computing device 400, so as to establish a first queue correspondence between the queue expansion device queue and the host queue.
  • the number of queues after expansion is determined by the number of queues of the network card and the expansion coefficient.
  • the number of the expanded queues is stored in the attribute register.
  • the queue expansion device 500 may query the attribute register to obtain the number of network card queues from the attribute register, calculate the number of expanded queues according to the expansion coefficient k, and calculate the number of expanded queues. The number is reported to the computing device.
  • the expansion coefficient k may be determined according to the message forwarding rate a of the network card and the message forwarding rate b of a single thread of the processor of the computing device. specifically,
  • the queue expansion device 500 receives a first doorbell message from the computing device 400, where the first doorbell message carries information about the first host queue and information about the second host queue, and the first Both the host queue and the second host queue belong to the multiple host queues.
  • the queue expansion device 500 obtains the information of the first host queue and the information of the second host queue from the first doorbell message, and obtains the first data to be sent from the first host queue. Obtain the second to-be-sent data from the second host queue.
  • the queue expansion device 500 stores the first to-be-sent data and the second to-be-sent data into the queue of the queue expansion device respectively according to the correspondence between the first queue and the first host queue and the second queue.
  • the network card 600 receives a second doorbell message from the queue expansion device 500, where the second doorbell message carries information about a corresponding queue expansion device queue, and the corresponding queue expansion device queue belongs to the description.
  • the queue expands the device queue.
  • the network card 600 obtains the information of the corresponding queue expansion device queue from the second doorbell message, and obtains the first data to be sent and the second data to be sent from the corresponding queue expansion device queue .
  • the network card 600 stores the first to-be-sent data and the second to-be-sent data into the network card corresponding to the corresponding queue expansion device queue in the network card queue according to the second queue correspondence Queue, so as to store the data to be sent in the host queue in the computing device into the network card queue in the network card 600.
  • each host queue in the computing device 400 includes a head and tail pointer
  • each network card queue in the network card 600 includes a head and tail pointer. Therefore, correspondingly, the at least one set of The head pointer and the at least one set of tail pointers are stored in the queue expansion device 500, the network card stores at least one set of network card head pointers and at least one set of network card tail pointers, and the at least one set of queue expansion device head pointers 500 corresponds to the at least one set of network card head pointers, and the at least one set of queue expansion device tail pointers corresponds to the at least one set of network card tail pointers.
  • the queue expansion device 500 includes a first doorbell register for storing the head and tail pointer values of the first host queue and the second host queue in the computing device 400, and the queue expansion device The value of the head pointer and tail pointer of the forwarding queue in 500.
  • the network card 600 includes a second doorbell register for storing the head pointer and tail pointer values of the corresponding queue expansion device queue in the queue expansion device 500, and the head pointer and tail pointer values of the network card queue in the network card 600.
  • the queue expansion device obtains the first data to be sent from the first doorbell information and
  • the specific steps of the second data to be sent may be:
  • the queue expansion device obtains the first head pointer and the second head pointer from the first doorbell message
  • the queue expansion device refreshes the head pointer of the queue expansion queue corresponding to the first host queue among the sets of head pointers according to the first head pointer and the corresponding relationship of the first queue;
  • the queue expansion device obtains all data from the first host queue according to the head pointer corresponding to the first host queue after refreshing and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers.
  • the queue expansion device refreshes the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue;
  • the queue expansion device obtains all data from the second host queue according to the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent.
  • the queue expansion device After the queue expansion device obtains the first data to be sent and the second data to be sent in step S206, it will determine the queue expansion device queues corresponding to the first host queue and the second host queue according to the corresponding relationship of the first queue. , That is, the corresponding queue expansion device queue, and then the first data to be sent and the second data to be sent are stored in the corresponding queue expansion device queue, and the head pointer of the corresponding queue expansion device queue is refreshed and sent to the network card 600
  • the second doorbell information including the third head pointer causes the network card to repeat the above steps.
  • the network card queue corresponding to the corresponding queue expansion device queue is determined, that is, the corresponding network card queue, and the first data to be sent and the second data to be sent are stored in the corresponding network card queue. That is to say, that the forwarding device acquires the information of the first host queue and the information of the second host queue from the first doorbell message includes: the queue expansion device in the forwarding device obtains information from the first host queue.
  • the forwarding device obtaining the first to-be-sent data from the first host queue includes: the queue expansion device in the forwarding device according to The first head pointer and the first queue correspondence relationship, refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers; the queue expansion device in the forwarding device is based on the refreshed first A head pointer corresponding to a host queue, and a tail pointer corresponding to the first host queue in the multiple sets of tail pointers, acquire the first data to be sent in the first host queue; the forwarding device obtains the first data to be sent from the first host queue; Obtaining the second data to be sent from the second host queue includes: the queue expansion device in the forwarding device refreshes the data in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue.
  • the head pointer corresponding to the second host queue; the queue expansion device in the forwarding device is based on the head pointer corresponding to the second host queue after being refreshed, and the tail corresponding to the second host queue in the multiple sets of tail pointers Pointer to obtain the second data to be sent in the second host queue; the forwarding device stores the first data to be sent and the second data to be sent into the first host queue and the first host queue respectively
  • the forwarding queue corresponding to the second host queue includes: the queue expansion device in the forwarding device stores the first to-be-sent data and the second to-be-sent data in the first host according to the first queue correspondence relationship
  • the queue and the queue expansion device queue corresponding to the second host queue wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the at least one queue
  • the same queue in the expansion device queue expands the device queue; the queue expansion device in the forwarding device refreshes the head pointer of the corresponding queue expansion device queue, the tail pointer of the
  • the first data to be sent may be a first Direct Memory Access (DMA) read descriptor, which is used to send the first data to be read at the computing device to the Network card
  • the second data to be sent may be a second DMA read descriptor, which is used to send the second data to be read from the computing device to the network card.
  • DMA Direct Memory Access
  • the DMA read descriptor of the first data to be read can be used as the data to be sent and placed in the host queue.
  • the DMA read descriptor may include the read address of the first data to be read, the length of the data packet, and description information, etc., and after steps S201-S210, the network card may receive the DMA descriptor sent by the computing device. Generate a DMA read command that directly reads the first data to be read from the computing device.
  • the first data to be sent is a first direct memory access DMA read descriptor
  • the second data to be sent is a second DMA read descriptor
  • the first data to be sent is combined with the first data to be sent.
  • the method further includes: the network card in the forwarding device reads the descriptor according to the first DMA read descriptor and the second DMA read Descriptor, generating a first DMA read command and a second DMA read command; the network card in the forwarding device sends the first DMA read command and the second DMA read command to the queue expansion device in the forwarding device;
  • the queue expansion device in the forwarding device obtains the first data to be read from the computing device according to the first DMA read command, and obtains the second data to be read from the computing device according to the second DMA read command;
  • the queue expansion device in the forwarding device forwards the first data to be read and the second data to be read to the network
  • the first data to be sent is a first DMA write descriptor
  • the second data to be sent is a second DMA Write descriptor, wherein the first DMA write descriptor is used to write the first data to be written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written to the computing device.
  • Incoming data is written from the queue expansion device to the computing device.
  • the difference between the second data to be written and the above-mentioned DMA read descriptor is that the data received by the network card is usually fragmented data.
  • the first data to be written can be transferred to n first fragmented data.
  • the queue expansion device also includes memory, such as Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM).
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • the queue expansion device can store the first fragment data received from the network card in the DDR, and when all n fragments of the first data to be written are collected, then the first data to be written Incoming data is sent to the computing device. Therefore, at step S207, the queue expansion device needs to convert the received DMA write descriptor used for writing to the computing device into a network card DMA write descriptor written to the queue expansion device.
  • the first data to be sent is a first DMA write descriptor
  • the second data to be sent is a second DMA write descriptor
  • the first DMA write descriptor is used to transfer the first DMA write descriptor.
  • the write data is written from the queue expansion device to the computing device
  • the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device
  • the The storage of the first data to be sent and the second data to be sent in the first host queue and the queue expansion device queue corresponding to the second host queue includes: the queue expansion device in the forwarding device writes the first DMA
  • the descriptor is converted into a first network card DMA write descriptor
  • the second DMA write descriptor is converted into a second network card DMA write descriptor, where the first DMA write descriptor is used to transfer the first data to be written
  • the queue expansion device is written from the network card
  • the second DMA descriptor is used to write the second data to be written from the network card into
  • DMA write command wherein the third DMA write command is used for the computing device to execute and write the first data to be written into the computing device, and the fourth DMA write command is used for the computing device
  • the computing device executes and writes the first data to be written into the computing device; the queue expansion device in the forwarding device sends the The computing device sends the third DMA write command and the fourth DMA write command, so that the computing device writes the first to-be-written command according to the third DMA write command and the fourth DMA write command
  • the data and the second data to be written are written into the computing device.
  • the method further includes: the network card in the forwarding device sends a completion message and an interrupt message to the queue expansion device; the queue in the forwarding device The extension device sends the completion message and interrupt to the computing device, so that the computing device refreshes the tail pointers of the first host queue and the second host queue according to the completion message.
  • the forwarding device or the network card after the forwarding device or the network card has processed the read command or the write command, it will also write the command completion information in the network card queue, and send it to the queue expansion device together with the interrupt message, and the queue expansion device will then add the interrupt message to the queue expansion device.
  • the command completion information is sent to the computing device, thereby completely completing a data communication process.
  • the queue expansion device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully explored.
  • the thread message forwarding rate of the virtual machine no longer becomes a bottleneck for the network card to process message forwarding, further avoiding resource waste.
  • the following takes the application scenario where the first data to be sent and the second data to be sent are DMA read descriptors as an example (the computing device sends the first data to be read and the second data to be read to the network card) , Give an example of the queue communication method described in FIG. 7.
  • the queue expansion device has generated the second queue correspondence with the network card, and the first queue correspondence with the computing device, and stored the two queue correspondences in the queue. Mapping table. There is a first queue correspondence between the first host queue A and the second host queue B and the corresponding queue expansion device queue C, and there is a second queue correspondence between the corresponding queue expansion device queue C and the corresponding network card queue D relationship.
  • the computing device needs to send the first data to be read and the second data to be read to the network card 600, so the specific communication process may be as follows:
  • the computing device 400 puts the DMA read descriptor of the first data to be read, that is, the first data to be sent, into the 4 queue units of the first host queue A, and reads the DMA of the second data to be read
  • the descriptor that is, the second data to be sent, is put into the 3 queue units of the second host queue B.
  • the computing device 400 refreshes the value of the first head pointer of the first host queue to A3, and refreshes the value of the second head pointer of the second host queue to B3.
  • the computing device 400 sends the first doorbell message to the queue expansion device 500.
  • the queue expansion device 500 obtains the first head pointer A3 and the second head pointer B3 from the first doorbell message.
  • the queue expansion device 500 refreshes the first head pointer in the first doorbell register as A3, and the second head pointer as B2.
  • the queue expansion device 500 obtains the data of the four queue units A0-A3 from the computing device according to the refreshed first doorbell register, the head and tail pointers of the first host queue are A3 and A0, that is, the first to be sent Data, similarly, obtain the second to-be-sent data from the computing device.
  • the queue expansion device 500 determines the queue expansion device queue C corresponding to the first host queue A and the second host queue B according to the first mapping relationship, and combines the first to-be-sent data (4 queue units) and the second to-be-sent data The sending data (3 queue units) is put into the corresponding queue expansion device queue C.
  • the queue expansion device 500 refreshes the value of the third head pointer of the corresponding queue expansion device queue C to C7.
  • the queue expansion device 500 sends the second doorbell message to the network card 600.
  • the network card 600 obtains the value C7 of the third head pointer from the second doorbell message.
  • the network card 600 refreshes the value C7 of the third head pointer in the second doorbell register.
  • the network card 600 obtains the data of the 7 queue units C0-C7 from the queue expansion device 500 according to the refreshed second doorbell register, the head and tail pointers of the corresponding queue expansion device queue are C7 and C0, that is, the first The data to be sent and the second data to be sent.
  • the network card 600 determines the network card queue D corresponding to the corresponding queue expansion device queue C according to the second mapping relationship, and puts a total of 7 queue units of the first data to be sent and the second data to be sent into the corresponding network card Queue D.
  • the network card 600 refreshes the value of the fourth head pointer of the corresponding network card queue D to D7.
  • the network card 600 generates a first DMA read command and a second DMA read command according to the DMA descriptors in the 7 queue units, and sends them to the queue expansion device 500.
  • the queue expansion device 500 transparently transmits the first DMA read command and the second DMA read command to the computing device.
  • the computing device 400 obtains the first to-be-read data stored in the computing device 400 corresponding to the first DMA read command and the second DMA read command according to the first DMA read command and the second DMA read command And the second data to be read.
  • the computing device 400 sends the first data to be read and the second data to be read to the queue expansion device 500.
  • the queue expansion device 500 sends the first data to be read and the second data to be read to the network card 600.
  • the network card 600 updates the tail pointer of the corresponding queue expansion device queue C to C7.
  • the network card 600 sends the completion queue unit and interrupt to the queue expansion device, and carries the value of the third tail pointer C7 to the queue expansion device 500, so that the queue expansion device 500 refreshes the value of the third tail pointer in the first doorbell register .
  • the queue expansion device 500 parses and completes the queue unit and interrupt, refreshes the value of the first tail pointer of the first host queue in the first doorbell register as A3, and the value of the second tail pointer of the second host queue is B2, and generates a new
  • the completion queue unit and interrupt are sent to the computing device, so that the computing device can refresh the tail pointer of the first host queue and the tail pointer of the second host queue maintained by itself, and complete the first data to be read and the second data to be read. send.
  • the queue expansion device after obtaining the number of network card queues in the network card, the queue expansion device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully exploited , The thread message forwarding rate of the virtual machine no longer becomes the bottleneck of the network card processing message forwarding, further avoiding the waste of resources.
  • the following takes the application scenario where the first data to be sent and the second data to be sent are DMA write descriptors as an example (the network card sends the first data to be written and the second data to be written to the computing device),
  • the queue communication method described in FIG. 7 is illustrated by an example.
  • the queue expansion device has generated the second queue correspondence with the network card, and the first queue correspondence with the computing device, and stored the two queue correspondences in the queue. Mapping table. There is a first queue correspondence between the first host queue A and the second host queue B and the corresponding queue expansion device queue C, and there is a second queue correspondence between the corresponding queue expansion device queue C and the corresponding network card queue D relationship.
  • the network card 600 needs to send the first data to be written and the second data to be written to the computing device 500, so the specific communication process may be as follows:
  • the computing device 400 puts the first DMA write descriptor of the first data to be written, that is, the first data to be sent into the 4 queue units of the first host queue A, and transfers the second data to be written
  • the second DMA write descriptor that is, the second data to be sent, is put into the 3 queue units of the second host queue B.
  • the first DMA write descriptor is used to write first data to be written into the computing device
  • the second DMA descriptor is used to write second data to be written into the computing device.
  • the computing device 400 refreshes the first host queue with a first head pointer value of A3, and refreshes the second host queue with a second head pointer value of B2.
  • the computing device 400 sends the first doorbell message to the queue expansion device 500.
  • the queue expansion device 500 obtains the first head pointer A3 and the second head pointer B2 from the first doorbell message.
  • the queue expansion device 500 refreshes the first head pointer in the first doorbell register as A3, and the second head pointer as B2.
  • the queue expansion device 500 obtains the data of the four queue units A0-A3 from the computing device according to the refreshed first doorbell register, the head and tail pointers of the first host queue are A3 and A0, that is, the first DMA write
  • the descriptor in the same way, obtains the second DMA write descriptor from the computing device.
  • the queue expansion device 500 converts the first DMA write descriptor into a first network card DMA write descriptor, and converts the second DMA write descriptor into a second network card DMA write descriptor, where the first The DMA write descriptor is used to write the first data to be written into the queue expansion device, and the first DMA write descriptor is used to write the second data to be written into the queue expansion device.
  • the queue expansion device 500 determines the queue expansion device queue C corresponding to the first host queue A and the second host queue B according to the first mapping relationship, and writes the converted first DMA descriptor (4 queue units) And the second DMA write descriptor (3 queue units) is put into the corresponding queue expansion device queue C.
  • the queue expansion device 500 refreshes the value of the third head pointer of the corresponding queue expansion device queue C to C7.
  • the queue expansion device 500 sends the second doorbell message to the network card 600.
  • the network card 600 obtains the value C7 of the third head pointer from the second doorbell message.
  • the network card 600 refreshes the value C7 of the third head pointer in the second doorbell register.
  • the network card 600 obtains the data of the 7 queue units C0-C7 from the queue expansion device 500 according to the head and tail pointers of the corresponding queue expansion device queue as C7 and C0, that is, after conversion The first DMA write descriptor and the second DMA write descriptor.
  • the network card 600 determines the network card queue D corresponding to the corresponding queue expansion device queue C according to the second mapping relationship, and puts a total of 7 queue units of the first data to be sent and the second data to be sent into the corresponding network card Queue D.
  • the network card 600 refreshes the value of the fourth head pointer of the corresponding network card queue D to D7.
  • the network card 600 obtains, according to the first network card DMA write descriptor, the first fragmented data stored in the network card and corresponds to the first network card DMA write descriptor, and writes according to the second network card DMA write descriptor.
  • Descriptor acquiring the second fragmented data stored in the network card and corresponding to the DMA write descriptor of the second network card, wherein the first data to be written includes n pieces of first fragmented data, so The second data to be written includes m pieces of second data.
  • the network card 600 generates a first DMA write command according to the first network card DMA write descriptor and the first fragment data, and generates a second DMA write command according to the second network card DMA write descriptor and the second fragment data. DMA write command.
  • the network card 600 updates the tail pointer of the corresponding queue expansion device queue C to C7, and sends the first DMA write command and the second DMA write command to the queue expansion device, as well as the sending completion queue unit and interrupt,
  • the value of the third tail pointer C7 is carried to the queue expansion device 500, so that the queue expansion device 500 refreshes the value of the third tail pointer in the first doorbell register.
  • the queue expansion device writes the first fragmented data and the second fragmented data into the memory of the queue expansion device according to the first DMA write command and the second DMA write command, and refreshes all Describe the value of the third tail pointer in the first doorbell register.
  • the queue expansion device 500 parses the completion queue unit and the interrupt, and according to the address information of the queue completion unit, determines the write addresses of the first data to be written and the second data to be written to the computing device, so that the first When the number of fragmented data is n, a third DMA write command is generated according to the above write address and the first data to be written, and when the number of second fragmented data is m, according to the above write
  • the address and the second data to be written generate the fourth DMA write command, the value of the first tail pointer of the first host queue in the first doorbell register is refreshed is A3, and the value of the second tail pointer of the second host queue is B2.
  • the queue expansion device sends the third DMA write command, the fourth DMA write command, the new completion queue unit and the interrupt to the computing device, so that the computing device can refresh the tail pointer of the first host queue maintained by itself and The second host queue tail pointer completes the sending of the first data to be read and the second data to be read this time.
  • the computing device writes the first data to be written and the second data to be written into the computing device according to the third DMA write command and the fourth DMA write command. Complete the process of this queue communication.
  • the queue expansion device after obtaining the number of network card queues in the network card, the queue expansion device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully exploited , The thread message forwarding rate of the virtual machine no longer becomes the bottleneck of the network card processing message forwarding, further avoiding the waste of resources.
  • FIG. 10 is a schematic structural diagram of a forwarding device provided by the present application.
  • the forwarding device 300 is connected to a computing device, the forwarding device includes at least one forwarding queue, the computing device includes a plurality of host queues, and a plurality of data to be sent are stored in the plurality of host queues, wherein the forwarding device
  • the device includes a receiving unit 310, an acquiring unit 320, a storage unit 330, a response unit 340, and a refresh unit 350.
  • the receiving unit 310 is configured to receive a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue And the second host queue both belong to the multiple host queues;
  • the acquiring unit 320 is configured to acquire the information of the first host queue and the information of the second host queue from the first doorbell message, acquire the first to-be-sent data from the first host queue, and from Acquiring second data to be sent from the second host queue;
  • the storage unit 330 is configured to store the first data to be sent and the second data to be sent into the first host queue respectively according to the queue correspondence between the forwarding queue and the host queue.
  • a forwarding queue corresponding to the second host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  • the forwarding device further includes a response unit 340
  • the receiving unit 310 is further configured to receive the device from the computing device before the receiving unit receives the first doorbell message from the computing device Query message;
  • the response unit 340 is configured to report the number of extended forwarding queues to the computing device in response to the device query message, wherein the number of extended forwarding queues is forwarded by the at least one The number of queues and the expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence.
  • the forwarding device includes an attribute register
  • the number of the expanded forwarding queues is stored in the attribute register
  • the response unit 340 is configured to query the attribute register and obtain the information from the attribute register.
  • the number of the extended forwarding queues is acquired, and the number of the extended forwarding queues is reported to the computing device.
  • the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so
  • the second head pointer indicates the second data to be sent, and multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple queues of the computing device
  • the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one queue; the forwarding device further includes a refresh unit 350, and the acquiring
  • the unit 320 is configured to obtain the first head pointer and the second head pointer from the first doorbell message;
  • the refresh unit 350 is configured to refresh all the groups of head pointers according to the first head pointer.
  • the head pointer corresponding to the first host queue; the obtaining unit 320 is configured to use the head pointer corresponding to the first host queue after refreshing and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers, Acquiring the first data to be sent in the first host queue; the refresh unit 350 is configured to refresh the head pointer corresponding to the second host queue in the plurality of sets of head pointers according to the second head pointer; The acquiring unit 320 is used to acquire all the data from the second host queue according to the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers.
  • the second data to be sent; the refresh unit 350 is configured to store the first data to be sent and the second data to be sent into the forwarding queues corresponding to the first host queue and the second host queue respectively, and then refresh The tail pointer of the first host queue and the tail pointer of the second host queue; the refresh unit 350 is used to refresh the head pointer of the corresponding forwarding queue; the refresh unit 350 is used to refresh all the The tail pointer of the first host queue and the refreshed tail pointer of the second host queue are sent to the computing device.
  • FIG. 10 is only an implementation of the embodiment of the present application.
  • the functions of the foregoing multiple modules or units can be split into More sub-modules or sub-units can also be combined into fewer modules or units to achieve the same technical effect, so they should all fall into the protection scope of the embodiments of this application
  • Fig. 11 is a schematic structural diagram of a queue expansion device provided by the present application.
  • the queue expansion device is connected to a computing device, the network card is connected to the computing device, the queue expansion device includes at least one queue expansion device queue, the network card includes at least one network card queue, and the computing device includes multiple hosts A queue, a plurality of data to be sent are stored in the plurality of host queues.
  • the queue expansion device 500 includes a receiving unit 510, an acquiring unit 520, a storage unit 530, a sending unit 540, a response unit 550, and a refresh unit 560.
  • the receiving unit 510 is configured to receive a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue And the second host queue both belong to the multiple host queues;
  • the obtaining unit 520 is configured to obtain the information of the first host queue and the information of the second host queue from the first doorbell message, obtain the first to-be-sent data from the first host queue, and from Acquiring second data to be sent from the second host queue;
  • the storage unit 530 is configured to store the first data to be sent and the second data to be sent into the first queue respectively according to the first queue correspondence between the queue expansion device queue and the host queue.
  • the sending unit 540 is configured to send a second doorbell message to the network card, and the second doorbell message carries the information of the corresponding queue expansion device queue, so that the network card receives information from the network card according to the second doorbell message.
  • the first data to be sent and the second data to be sent are acquired from the corresponding queue expansion device queue, and according to the second queue correspondence between the network card queue and the queue expansion device queue, the second queue A data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first The host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue, and the corresponding network card queue belongs to the network card queue.
  • the device further includes a response unit 550, and the receiving unit 510 is further configured to receive a first device query message from the computing device before receiving the first doorbell message from the computing device;
  • the sending unit 540 is configured to send a second device query message to the network card;
  • the response unit 550 is configured to receive the number of network card queues sent by the network card, wherein the number of network card queues is used to establish the first Correspondence between two queues;
  • the response unit 550 is configured to report the number of expanded queue expansion device queues to the computing device in response to the first device query message, wherein the expanded queue expansion device queue The number is determined by the number of network card queues and an expansion coefficient, and the expanded number of queue expansion device queues is used to establish the first queue correspondence relationship.
  • the device includes an attribute register, and the number of the expanded forwarding queues is stored in the attribute register; the response unit 550 is further configured to query the attribute register, and obtain information from the attribute register. The number of queues of the expanded queue expansion device is acquired, and the number of queues of the expanded queue expansion device is reported to the computing device.
  • the information of the first host queue includes a first head pointer
  • the first head pointer indicates the first to-be-sent data
  • the information about the second host queue includes a second head pointer
  • the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, and each set of head pointers and each set of tail pointers respectively correspond to the multiple host queues
  • the head pointer and the tail pointer of a host queue in, the queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tail pointers, and at least one set of network cards is stored in the network card A head pointer and at least one set of network card tail pointers, the at least one set of queue extension device head pointers correspond to the at least one set of network card head pointers, and the at least one set of queue extension device tail pointers corresponds to the at least one set of network card head pointers.
  • the queue expansion device further includes a refresh unit 560, and the acquisition unit 520 is configured to acquire the first head pointer and the second head pointer from the first doorbell message;
  • the refreshing unit 560 is configured to refresh the head pointers corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer and the first queue correspondence;
  • the acquiring unit 520 is configured to refresh according to After refreshing, the head pointer corresponding to the first host queue, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers, acquire the first data to be sent in the first host queue;
  • the refresh unit 560 is configured to refresh the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue;
  • the acquiring unit 520 is configured to refresh according to After refreshing, the head pointer corresponding to the second host queue, and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers
  • the first data to be sent is a first direct memory access DMA read descriptor
  • the second data to be sent is a second DMA read descriptor
  • the receiving unit 510 is further configured to receive The first DMA read command and the second DMA read command sent by the network card, wherein, the first DMA read command is generated by the network card according to the first DMA descriptor, and the second DMA read command is The network card is generated according to the second DMA descriptor
  • the obtaining unit 520 is further configured to obtain the first data to be read from the computing device according to the first DMA read command, and obtain the first data to be read from the computing device according to the second DMA read command.
  • the computing device obtains the second data to be read
  • the sending unit 540 is further configured to forward the first data to be read and the second data to be read to the network card.
  • the first data to be sent is a first DMA write descriptor
  • the second data to be sent is a second DMA write descriptor
  • the first DMA write descriptor is used to transfer the first DMA write descriptor.
  • a data to be written is written from the queue expansion device to the computing device
  • the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device
  • the device It also includes a conversion unit 570, which is configured to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor , Wherein the first DMA write descriptor is used to write the first data to be written from the network card to the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card to the queue expansion device.
  • the network card is written into the queue expansion device;
  • the storage unit 530 is configured to store the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion device queue;
  • the receiving unit 510 is configured to receive a first DMA write command and the second DMA write command, where the first DMA write command is obtained by the network card according to the first network card DMA write descriptor and stored in the network card In the first segment data corresponding to the first network card DMA write descriptor, the first DMA write command generated according to the first network card DMA write descriptor and the first segment data, the first The second DMA write command is that after the network card obtains the second fragment data stored in the network card corresponding to the second network card DMA write descriptor according to the second network card DMA write descriptor, according to the first The second network card DMA write descriptor and the second DMA write command generated by the second fragmented data, wherein the first to-be-written data includes n pieces of first fragmented data
  • a fourth DMA write command is generated according to the second data to be written, wherein the third DMA write command is used for
  • the computing device executes and writes the first data to be written into the computing device, and the fourth DMA write command is used for the computing device to execute and write the first data to be written into the computing device.
  • the computing device; the sending unit 540 is configured to send the third DMA write command and the fourth DMA write command to the computing device, so that the computing device according to the third DMA write command and the first Four DMA write commands to write the first data to be written and the second data to be written into the computing device.
  • the receiving unit 510 is further configured to receive a completion message and an interrupt sent by the network card, where the completion message and the interrupt are when the network card is sending the first data to be sent and the first data to be sent. 2.
  • the data to be sent is generated after being stored in the network card queue corresponding to the corresponding queue expansion device queue; the sending unit 540 is also configured to send a completion message and an interrupt to the computing device, so that the computing device according to the The completion message refreshes the tail pointers of the first host queue and the second host queue.
  • FIG. 11 is only an implementation of the embodiment of the present application.
  • the functions of the foregoing multiple modules or units can be split into More sub-modules or sub-units can also be combined into fewer modules or units to achieve the same technical effect, and therefore all should fall within the protection scope of the embodiments of the present application.
  • FIG. 12 is a schematic structural diagram of a forwarding device provided by an embodiment of the present application.
  • the forwarding device 700 includes one or more processors 701, a communication interface 702, and a memory 703.
  • the processor 801, the communication interface 702, and the memory 703 may be connected through a bus 704.
  • the bus 704 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc.
  • the bus 704 can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 12 to represent it, but it does not mean that there is only one bus or one type of bus.
  • the processor 701 includes one or more general-purpose processors, where the general-purpose processor may be any type of device capable of processing electronic instructions, including a CPU, a microprocessor, a microcontroller, a main processor, and a controller. And ASIC and so on.
  • the processor 701 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 703, which enables the computing device to provide a wide variety of services.
  • the processor 701 executes the program instructions in the memory 703 to implement the aforementioned methods in FIG. 4 and FIG. 6.
  • the processor 701 may include a queue expansion module, a mapping module, a queue forwarding module, etc., where the queue expansion module may implement processing functions by calling program codes in the memory 703, such as calculating the number of expanded queues;
  • the mapping module can realize the processing function by calling the program code in the memory 304, and generate the queue correspondence between the host queue and the forwarding queue;
  • the queue forwarding module can realize the processing function by calling the program code in the memory 703, and realize the connection with the computing device. Queue communication.
  • the processor 701 may also include other modules for executing other steps described in the embodiment of FIG. 4 and FIG. 6, which will not be repeated here.
  • the communication interface 702 may be a wired interface (for example, an Ethernet interface) for communicating with other devices or modules.
  • the memory 703 may include a volatile memory (Volatile Memory), such as a random access memory (Random Access Memory, RAM); the memory may also include a non-volatile memory (Non-Volatile Memory), such as a read-only memory (Read-Only Memory). Memory, ROM, Flash Memory, Hard Disk Drive (HDD), or Solid-State Drive (SSD) memory may also include a combination of the foregoing types of memories.
  • the memory 703 may include a doorbell register, an attribute register, and a forwarding queue.
  • the doorbell register is used to store the head and tail pointers of at least one set of queues
  • the attribute register is used to store the number of expanded queues
  • the forwarding queue is used to store 400 The data to be sent sent.
  • the memory 703 may also include a mapping relationship table, which is used to store queue correspondences, and may also be used to store other program codes or program data for the processor to implement FIG. 4 And the other steps described in the embodiment of FIG. 6 to FIG. 9, which will not be repeated here.
  • a mapping relationship table which is used to store queue correspondences, and may also be used to store other program codes or program data for the processor to implement FIG. 4 And the other steps described in the embodiment of FIG. 6 to FIG. 9, which will not be repeated here.
  • FIG. 13 is a schematic structural diagram of a queue expansion device 800 provided by the present application.
  • the queue expansion device 800 includes a processor 802, a memory 504, an endpoint port 501, and a root port 503. Among them, the port endpoint 501, the root port 505, and the memory 504 are all connected to the processor 502 through a bus 505.
  • the queue expansion device 800 includes one or more processors 801, a communication interface 802, and a memory 803. Wherein, the processor 801, the communication interface 802, and the memory 803 may be connected through a bus 804.
  • the bus 804 may be a PCI bus, an EISA bus, or the like.
  • the bus 704 can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 13, but it does not mean that there is only one bus or one type of bus.
  • the processor 802 includes one or more general-purpose processors, where the general-purpose processor may be any type of device capable of processing electronic instructions, including a CPU, a microprocessor, a microcontroller, a main processor, and a controller. And ASIC and so on.
  • the processor 802 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 804, which enables the computing device to provide a wide variety of services.
  • the processor 801 executes the program instructions in the memory 803 to implement the aforementioned methods in FIG. 7, FIG. 8, and FIG. 9.
  • the processor 802 may include a queue expansion module, a mapping module, a queue forwarding module, etc., where the queue expansion module may implement processing functions by calling program codes in the memory 804, such as calculating the number of expanded queues;
  • the mapping module can realize the processing function by calling the program code in the memory 804, generate the first queue correspondence between the host queue and the queue expansion queue, or generate the second queue correspondence between the queue expansion queue and the network card queue, etc.
  • the queue forwarding module can realize the processing function by calling the program code in the memory 804, and complete the forwarding between the extended queue device and the network card for the received data to be sent from the computing device.
  • the processor may also include other modules for executing other steps described in the embodiments in FIG. 5 to FIG. 9, and details are not described herein again.
  • the communication interface 802 may be a wired interface (for example, an Ethernet interface) for communicating with other devices or modules.
  • the memory 804 may include volatile memory, such as RAM; the memory may also include non-volatile memory, such as ROM, flash memory, HDD, or SSD. The memory may also include a combination of the above-mentioned types of memories.
  • the memory 804 may include a first doorbell register, an attribute register, and a queue expansion device queue.
  • the first doorbell register is used to store the head and tail pointers of at least one set of queues, and the attribute register is used to store the number of expanded queues.
  • the device queue is used to store the to-be-sent data sent by the computing device. It should be understood that the above example is only for illustration, and the memory 804 may also include a mapping relationship table for storing the correspondence between the first queue and the second queue.
  • the memory 804 can also be used to store the first segment data and the second segment data, etc., and can also be used to store other program codes or program data for the processor to implement the description of the embodiments in FIGS. 7-9 The other steps are not repeated here.
  • FIG. 12 and FIG. 13 are only a possible implementation manner of the embodiment of the present application.
  • the forwarding device 700 and the queue expansion device 800 may also include more or fewer components, which are not limited here.
  • the content that is not shown or described in the embodiments of the present application please refer to the relevant descriptions in the embodiments described in FIG. 1 to FIG. 9, which will not be repeated here.
  • the queue expansion device 500 shown in FIG. 11 can be implemented by a logic circuit, specifically, it can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (Programmable Logic Device, PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a Complex Programmable Logical Device (CPLD), a Field-Programmable Gate Array (FPGA), a Generic Array Logic (GAL), or any combination thereof. This application does not Specific restrictions.
  • the embodiment of the present invention also provides a computer non-transitory storage medium, the computer non-transitory storage medium stores instructions, when it runs on the processor, any of the descriptions in FIGS. 4, 6 and 9 A method flow is realized.
  • the embodiment of the present invention also provides a computer program product.
  • the computer program product runs on a processor, the process of any method described in FIGS. 4 and 6 to 9 can be realized.
  • the steps of the method or algorithm described in combination with the disclosure of the embodiment of the present invention may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, which can be stored in RAM, flash memory, ROM, erasable programmable read-only memory (Erasable Programmable ROM, EPROM), and electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), registers, hard disk, mobile hard disk, CD-ROM or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in the computing device.
  • the processor and the storage medium may also exist as discrete components in the computing device.
  • the program can be stored in a computer readable storage medium, and the program can be stored in a computer readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments.
  • the aforementioned storage media include: ROM, RAM, magnetic disks or optical disks and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application provides a queue communication method. The method comprises: a forwarding device receives a first doorbell message from a computing device; the forwarding device obtains information about a first host queue and information about a second host queue from the first doorbell message, obtains, from the first host queue, first data to be sent, and obtains, from the second host queue, second data to be sent; the forwarding device respectively stores, according to the queue correspondence between forwarding queues and the host queues, said first data and said second data into the forwarding queue corresponding to the first host queue and the second host queue, the first host queue and the second host queue corresponding to the same forwarding queue in the at least one forwarding queue.

Description

一种队列通信的方法、系统及相关设备Method, system and related equipment for queue communication
本申请要求于2019年9月30日提交中国专利局、申请号为201910944642.X、发明名称为“一种队列通信的方法、系统及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910944642.X, and the invention title is "a method, system and related equipment for queue communication" on September 30, 2019. The entire content of the application is approved. The reference is incorporated in this application.
技术领域Technical field
本申请涉及计算机领域,尤其涉及一种队列通信的方法、系统及相关设备。This application relates to the field of computers, and in particular to a method, system and related equipment for queue communication.
背景技术Background technique
多核处理器、虚拟化技术、分布式存储等技术的兴起,促使了一种新型的计算模式的产生,即云计算。云计算基于可配置的共享计算资源池为用户提供方便的、随需访问的服务。一般情况下,云计算服务供应商会提供多种虚拟机的规格,根据用户需求灵活地发放不同规格的虚拟机。比如当用户对网络的需求较大时,可为用户分一台具有64位的虚拟中央处理器(Virtual Central Processing Unit,vCPU)和128GB的存储空间的大规格虚拟机。The rise of technologies such as multi-core processors, virtualization technology, and distributed storage has prompted the emergence of a new type of computing model, namely cloud computing. Cloud computing is based on a configurable shared computing resource pool to provide users with convenient, on-demand access services. In general, cloud computing service providers will provide a variety of virtual machine specifications, and flexibly distribute virtual machines of different specifications according to user needs. For example, when users have greater demands on the network, users can be divided into a large-format virtual machine with a 64-bit Virtual Central Processing Unit (vCPU) and 128GB of storage space.
虚拟机运行在计算设备上,配置虚拟机还包括将计算设备上的多个主机队列分配给虚拟机。虚拟机与其所在计算设备之外的其他设备进行通信时,需要将数据发送至网卡。对于配置好网卡队列的虚拟机来说,需要向网卡发送数据时,可以直接将待发送数据发送到分配给虚拟机的主机队列,随后,分配给虚拟机的主机队列和网卡上的网卡队列通过队列通信机制,将分配给虚拟机的主机队列中的待发送数据复制到网卡的网卡队列中,即可完成一次虚拟机与网卡之间的数据通信。The virtual machine runs on the computing device, and configuring the virtual machine also includes allocating multiple host queues on the computing device to the virtual machine. When a virtual machine communicates with a device other than the computing device where it is located, it needs to send data to the network card. For a virtual machine with a configured network card queue, when you need to send data to the network card, you can directly send the data to be sent to the host queue assigned to the virtual machine, and then the host queue assigned to the virtual machine and the network card queue on the network card pass The queue communication mechanism copies the to-be-sent data in the host queue allocated to the virtual machine to the network card queue of the network card to complete a data communication between the virtual machine and the network card.
相关技术的队列通信机制中,计算设备上的主机队列与网卡的网卡队列是一一映射,换句话说,来自虚拟机的存储在计算设备的一个主机队列中的待发送数据只能发送至网卡上的一个网卡队列。通常情况下,队列通信的性能受制于计算设备上主机队列的转发能力和网卡上网卡队列的转发能力。而在虚拟机向网卡发送数据时,受制于虚拟机vCPU的转发能力,主机上分配给虚拟机的队列的转发能力通常弱于网卡上队列的转发能力,导致网卡上队列的转发性能无法充分发挥,影响通信的效率。In the queue communication mechanism of related technologies, the host queue on the computing device and the network card queue of the network card are one-to-one mapping. In other words, the data to be sent from the virtual machine stored in a host queue of the computing device can only be sent to the network card A network card queue on the. Normally, the performance of queue communication is restricted by the forwarding ability of the host queue on the computing device and the forwarding ability of the network card queue of the network card. When the virtual machine sends data to the network card, it is subject to the forwarding ability of the virtual machine vCPU. The forwarding ability of the queue assigned to the virtual machine on the host is usually weaker than the forwarding ability of the queue on the network card, which causes the forwarding performance of the queue on the network card to not be fully utilized. , Affect the efficiency of communication.
发明内容Summary of the invention
本申请提供了一种队列通信的方法、系统及相关设备,用于解决网卡上队列转发性能无法充分发挥,导致通信效率受到影响的问题。The present application provides a queue communication method, system and related equipment, which are used to solve the problem that the queue forwarding performance on the network card cannot be fully utilized, which causes the communication efficiency to be affected.
第一方面,提供了一种队列通信的方法,所述方法应用于转发设备,所述转发设备与计算设备连接,所述转发设备包括至少一个转发队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,所述方法包括:In a first aspect, a method for queue communication is provided, the method is applied to a forwarding device, the forwarding device is connected to a computing device, the forwarding device includes at least one forwarding queue, and the computing device includes multiple host queues, A plurality of data to be sent are stored in the plurality of host queues, and the method includes:
所述转发设备接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;The forwarding device receives a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue and the The second host queues all belong to the multiple host queues;
所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待 发送数据;The forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, obtains the first data to be sent from the first host queue, and obtains the first data to be sent from the first host queue. 2. Obtain the second data to be sent from the host queue;
所述转发设备根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。The forwarding device stores the first to-be-sent data and the second to-be-sent data into the first host queue and the second host respectively according to the queue correspondence between the forwarding queue and the host queue A forwarding queue corresponding to the queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
实施第一方面描述的方法,通过将多个主机队列与同一个转发队列产生队列对应关系,使得多个转发性能低的主机队列,可以共用一个转发能力高的转发队列进行队列通信,从而解决了由于主机队列转发性能低于网卡队列导致网卡上队列转发性能无法充分发挥的问题,进而提高了通信效率。Implement the method described in the first aspect, by generating a queue correspondence between multiple host queues and the same forwarding queue, so that multiple host queues with low forwarding performance can share a high forwarding queue for queue communication, thereby solving the problem. Since the host queue forwarding performance is lower than the network card queue, the queue forwarding performance on the network card cannot be fully utilized, thereby improving the communication efficiency.
在一实施方式中,所述转发设备接收来自所述计算设备的第一门铃消息之前,所述方法还包括:所述转发设备接收来自所述计算设备的设备查询消息;响应于所述设备查询消息,所述转发设备将扩展后的转发队列个数上报至所述计算设备,其中,所述扩展后的转发队列个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立所述队列对应关系。In an embodiment, before the forwarding device receives the first doorbell message from the computing device, the method further includes: the forwarding device receives a device query message from the computing device; responding to the device query Message, the forwarding device reports the number of extended forwarding queues to the computing device, where the number of extended forwarding queues is determined by the number of the at least one forwarding queue and the expansion coefficient, and the extended The subsequent number of forwarding queues is used to establish the queue correspondence.
在一实施方式中,所述转发设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;所述转发设备将扩展后的转发队列个数上报至所述计算设备包括:所述转发设备查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。In an embodiment, the forwarding device includes an attribute register, and the number of the extended forwarding queues is stored in the attribute register; the forwarding device reporting the number of extended forwarding queues to the computing device includes : The forwarding device queries the attribute register, obtains the number of the extended forwarding queues from the attribute register, and reports the number of the extended forwarding queues to the computing device.
上述实施方式中,所述转发设备通过将扩展后的转发队列个数发送至计算设备,使得计算设备可以分配多个主机队列与一个转发队列之间产生队列对应关系,无需对计算设备进行任何升级,即可解决由于主机队列转发性能低于网卡队列导致网卡上队列转发性能无法充分发挥的问题,提高了通信效率。In the foregoing embodiment, the forwarding device sends the expanded number of forwarding queues to the computing device, so that the computing device can allocate multiple host queues to one forwarding queue to generate a queue correspondence relationship, without any upgrade of the computing device. , It can solve the problem that the queue forwarding performance on the network card cannot be fully exerted because the host queue forwarding performance is lower than the network card queue, and the communication efficiency is improved.
在一实施方式中,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述转发设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个主机队列中的一个主机队列的头指针和尾指针,所述转发设备中还存储有所述至少一个转发队列的至少一组头指针和至少一组尾指针;所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,包括:所述转发设备从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述转发队列从所述第一主机队列中获取第一待发送数据,包括:所述转发设备根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头指针;所述转发设备根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述转发队列从所述第二主机队列中获取第二待发送数据,包括:所述转发设备根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针;所述转发设备根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述转发设备将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应转发队列之后,所述方法还包括:刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;刷新所述对应的转发队列的头指针;将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。In an embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so The second head pointer indicates the second data to be sent, and multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple hosts of the computing device The head pointer and the tail pointer of a host queue in the queue, the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue; Obtaining the information of the first host queue and the information of the second host queue in the message includes: the forwarding device obtains the first head pointer and the second head pointer from the first doorbell message; The forwarding queue acquiring the first to-be-sent data from the first host queue includes: the forwarding device refreshes the head pointer corresponding to the first host queue in the plurality of sets of head pointers according to the first head pointer The forwarding device obtains the first host queue from the first host queue according to the head pointer corresponding to the first host queue after the refresh and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers A data to be sent; the forwarding queue obtains the second data to be sent from the second host queue, including: the forwarding device refreshes the second host in the multiple sets of head pointers according to the second head pointer The head pointer corresponding to the queue; the forwarding device, according to the head pointer corresponding to the second host queue after being refreshed, and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers, in the second host queue The second data to be sent is obtained in the forwarding device; after the forwarding device stores the first data to be sent and the second data to be sent into the forwarding queues corresponding to the first host queue and the second host queue, respectively The method further includes: refreshing the tail pointer of the first host queue and the tail pointer of the second host queue; refreshing the head pointer of the corresponding forwarding queue; and refreshing the tail pointer of the first host queue after refreshing And sending the refreshed tail pointer of the second host queue to the computing device.
在一实施方式中,所述转发设备包括队列扩展设备和网卡,所述至少一个转发队列包括至少一个队列扩展设备队列和至少一个网卡队列,所述至少一个队列扩展设备队列位于所述队列扩展设备,所述至少一个网卡队列位于所述网卡,所述至少一组头指针和所述至少一组尾指针存储于所述队列扩展设备,所述队列对应关系包括第一队列对应关系和第二队列对应关系,所述第一队列对应关系为所述多个主机队列与所述至少一个队列扩展设备队列的对应关系,所述第二队列对应关系为所述至少一个网卡队列与所述至少一个队列扩展设备队列的对应关系,所述至少一个网卡队列与所述至少一个队列扩展设备队列一一对应,所述队列扩展设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述多个主机队列中的一个主机队列的头指针和尾指针,所述队列扩展设备中还存储有至少一组队列扩展设备头指针和至少一组队列扩展设备尾指针,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应;所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,包括:所述转发设备中的队列扩展设备从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述转发设备从所述第一主机队列中获取第一待发送数据,包括:所述转发设备中的队列扩展设备根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;所述转发设备中的队列扩展设备根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述转发设备从所述第二主机队列中获取第二待发送数据,包括:所述转发设备中的队列扩展设备根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;所述转发设备中的队列扩展设备根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述转发设备将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列包括:所述转发设备中的队列扩展设备根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;所述转发设备中的队列扩展设备刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;所述转发设备中的网卡接收来自所述队列扩展设备的第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针;所述转发设备中的网卡从所述第二门铃消息中获取所述对应的队列扩展设备队列的头指针;所述转发设备中的网卡根据所述对应的队列扩展设备队列的头指针,以及所述第二队列对应关系,刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针;所述转发设备中的网卡根据刷新后所述对应的网卡头指针,和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据;所述转发设备中的网卡根据所述第二队列对应关系,将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列,其中,所述对应的网卡队列属于所述网卡队列。In an embodiment, the forwarding device includes a queue expansion device and a network card, the at least one forwarding queue includes at least one queue expansion device queue and at least one network card queue, and the at least one queue expansion device queue is located in the queue expansion device. The at least one network card queue is located in the network card, the at least one set of head pointers and the at least one set of tail pointers are stored in the queue expansion device, and the queue correspondence relationship includes a first queue correspondence relationship and a second queue Correspondence, the first queue correspondence is the correspondence between the multiple host queues and the at least one queue expansion device queue, and the second queue correspondence is the at least one network card queue and the at least one queue The corresponding relationship between the expansion device queues, the at least one network card queue corresponds to the at least one queue expansion device queue, and the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers The group tail pointers respectively correspond to the head pointer and the tail pointer of a host queue in the plurality of host queues. The queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tails. Pointers, the network card stores at least one set of network card head pointers and at least one set of network card tail pointers, the at least one set of queue expansion device head pointers corresponds to the at least one set of network card head pointers, and the at least one The tail pointer of the group queue expansion device corresponds to the tail pointer of the at least one group of network cards in a one-to-one correspondence; the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message , Including: the queue expansion device in the forwarding device obtains the first head pointer and the second head pointer from the first doorbell message; the forwarding device obtains the first head pointer from the first host queue The data to be sent includes: the queue expansion device in the forwarding device refreshes the head pointer corresponding to the first host queue among the multiple sets of head pointers according to the first head pointer and the first queue correspondence relationship The queue expansion device in the forwarding device is based on the head pointer corresponding to the first host queue after refreshing, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers, in the first host queue Acquiring the first data to be sent in the forwarding device; acquiring the second data to be sent from the second host queue by the forwarding device includes: a queue expansion device in the forwarding device according to the second head pointer, and The first queue correspondence relationship, refreshing the head pointer corresponding to the second host queue in the multiple sets of head pointers; the queue expansion device in the forwarding device according to the refreshed head pointer corresponding to the second host queue, and The tail pointer corresponding to the second host queue in the multiple sets of tail pointers acquires the second data to be sent in the second host queue; the forwarding device combines the first data to be sent with the Respectively storing the second data to be sent in the first host queue and the forwarding queue corresponding to the second host queue includes: the queue expansion device in the forwarding device transfers the first data to be sent according to the corresponding relationship of the first queue Data and the second pending Send data to the first host queue and the queue expansion device queue corresponding to the second host queue, wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue The two host queues correspond to the same queue expansion device queue in the at least one queue expansion device queue; the queue expansion device in the forwarding device refreshes the head pointer of the corresponding queue expansion device queue, and the first host queue The tail pointer and the tail pointer of the second host queue; the network card in the forwarding device receives the second doorbell message from the queue expansion device, wherein the second doorbell message carries the corresponding queue expansion device queue Head pointer; the network card in the forwarding device obtains the head pointer of the corresponding queue expansion device queue from the second doorbell message; the network card in the forwarding device expands the head pointer of the device queue according to the corresponding queue , And the second queue correspondence relationship, refreshing the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one set of network card head pointers; the network card in the forwarding device is based on the corresponding The head pointer of the network card, and the tail pointer corresponding to the corresponding queue expansion device queue in the at least one set of network card tail pointers, and the first data to be sent and the second data to be sent are acquired in the corresponding queue expansion device queue Send data; the network card in the forwarding device stores the first to-be-sent data and the second to-be-sent data in the network card queue corresponding to the corresponding queue expansion device queue according to the second queue correspondence, wherein , The corresponding network card queue belongs to the network card queue.
上述实施方式中,计算设备中的多个主机队列与队列扩展设备中的一个队列扩展设备队 列产生第一队列对应关系,队列扩展设备中的一个队列扩展设备队列与一个网卡中的网卡队列产生第二队列对应关系,这样,在不需要对计算设备和网卡均进行升级的情况下,通过队列扩展设备将来自计算设备发送的第一待发送数据以及第二待发送数据转发给网卡,可解决由于主机队列转发性能低于网卡队列导致网卡上队列转发性能无法充分发挥的问题,提高了通信效率。In the foregoing embodiment, a plurality of host queues in the computing device and a queue expansion device queue in the queue expansion device generate a first queue correspondence, and a queue expansion device queue in the queue expansion device and a network card queue in a network card generate a first queue correspondence relationship. The corresponding relationship between the two queues. In this way, without the need to upgrade both the computing device and the network card, the first data to be sent and the second data to be sent from the computing device are forwarded to the network card through the queue expansion device, which can solve the problem The host queue forwarding performance is lower than the network card queue, which leads to the problem that the queue forwarding performance on the network card cannot be fully utilized, and the communication efficiency is improved.
在一实施方式中,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:所述转发设备中的网卡根据所述第一DMA读描述符以及所述第二DMA读描述符,生成第一DMA读命令以及第二DMA读命令;所述转发设备中的网卡向所述转发设备中的队列扩展设备发送所述第一DMA读命令以及第二DMA读命令;所述转发设备中的队列扩展设备根据所述第一DMA读命令从所述计算设备获取第一待读取数据,根据所述第二DMA读命令从所述计算设备获取第二待读取数据;所述转发设备中的队列扩展设备将所述第一待读取数据和所述第二待读取数据转发至所述转发设备中的网卡。In an embodiment, the first data to be sent is a first direct memory access DMA read descriptor, the second data to be sent is a second DMA read descriptor, and the first data to be sent is And after the second data to be sent is stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: the network card in the forwarding device reads the descriptor according to the first DMA and the second DMA read descriptor to generate a first DMA read command and a second DMA read command; the network card in the forwarding device sends the first DMA read command and the second DMA read command to the queue expansion device in the forwarding device; The queue expansion device in the forwarding device obtains first data to be read from the computing device according to the first DMA read command, and obtains second data to be read from the computing device according to the second DMA read command The queue expansion device in the forwarding device forwards the first data to be read and the second data to be read to the network card in the forwarding device.
在一实施方式中,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,所述将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列包括:所述转发设备中的队列扩展设备将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;所述转发设备中的队列扩展设备将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:所述转发设备中的网卡根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第二网卡DMA写描述符,获取存储于所述网卡中的,与所述第二网卡DMA写描述符对应的第二分片数据,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;所述转发设备中的网卡根据所述第一网卡DMA写描述符以及所述第一分片数据生成第一DMA写命令,根据所述第二网卡DMA写描述符以及所述第二分片数据生成第二DMA写命令;所述转发设备中的网卡向所述队列扩展设备发送所述第一DMA写命令以及所述第二DMA写命令;所述转发设备中的队列扩展设备根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;在所述转发设备中的队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;所述转发设备中的所述队列扩展设备向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令,使得所述计算设备根据所述第三DMA写命令以及所述第四DMA写命令,将所述第一 待写入数据以及所述第二待写入数据写入所述计算设备中。In an embodiment, the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA write descriptor, wherein the first DMA write descriptor is used to transfer the first DMA write descriptor. A data to be written is written from the queue expansion device to the computing device, the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device. The storing of the first data to be sent and the second data to be sent in the first host queue and the queue expansion device queue corresponding to the second host queue includes: the queue expansion device in the forwarding device transfers the first The DMA write descriptor is converted into a first network card DMA write descriptor, and the second DMA write descriptor is converted into a second network card DMA write descriptor, where the first DMA write descriptor is used to transfer the first to be written Incoming data is written from the network card to the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card to the queue expansion device; the queue expansion in the forwarding device The device stores the first network card DMA write descriptor and the second network card DMA write descriptor in the corresponding queue expansion device queue; the storing the first data to be sent and the second data to be sent in After the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: the network card in the forwarding device obtains the data stored in the network card according to the DMA write descriptor of the first network card. According to the first fragment data corresponding to the DMA write descriptor of the first network card, according to the DMA write descriptor of the second network card, obtain the second piece of data stored in the network card and corresponding to the DMA write descriptor of the second network card. Fragmented data, wherein the first to-be-written data includes n first fragmented data, and the second to-be-written data includes m second fragmented data; the network card in the forwarding device is based on the The first network card DMA write descriptor and the first fragmented data generate a first DMA write command, and the second network card DMA write descriptor and the second fragmented data generate a second DMA write command; the forwarding The network card in the device sends the first DMA write command and the second DMA write command to the queue expansion device; the queue expansion device in the forwarding device according to the first DMA write command and the second DMA Write command to write the first fragmented data and the second fragmented data into the memory of the queue expansion device; in the memory of the queue expansion device in the forwarding device, the amount of the first fragmented data is In the case of n, a third DMA write command is generated according to the first data to be written, and in the case that the number of the second fragmented data is m, according to the second data to be written, a third DMA write command is generated The fourth DMA write command, wherein the third DMA write command is used for the computing device to execute and write the first data to be written into the computing device, and the fourth DMA write command is used for The computing device executes and writes the first data to be written into the computing device; the queue expansion device in the forwarding device The third DMA write command and the fourth DMA write command are sent to the computing device, so that the computing device will transfer the first standby command according to the third DMA write command and the fourth DMA write command. The write data and the second data to be written are written into the computing device.
上述实施方式中,队列扩展设备通过将网卡发送的第一分片数据存储在存储器中,当第一待写入数据的n个分片数据全部集齐后,再将第一待写入数据发送给计算设备由于网卡接收到的数据通常为分片数据,从而避免了计算设备接收乱序的第一分片数据导致计算设备的处理压力大的问题,进而提高队列通信的效率。In the above embodiment, the queue expansion device stores the first piece of data sent by the network card in the memory, and when all n pieces of data of the first data to be written are collected, the first data to be written is sent For the computing device, the data received by the network card is usually fragmented data, thereby avoiding the problem that the computing device receives out-of-sequence of the first fragmented data and causing the computing device to deal with the problem of heavy processing pressure, thereby improving the efficiency of queue communication.
在一实施方式中,所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:所述转发设备中网卡向所述队列扩展设备发送完成消息和中断消息;所述转发设备中队列扩展设备向所述计算设备发送所述完成消息和中断,使得所述计算设备根据所述完成消息,刷新第一主机队列以及第二主机队列的尾指针。In an embodiment, after storing the first data to be sent and the second data to be sent in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: in the forwarding device The network card sends a completion message and an interrupt message to the queue expansion device; the queue expansion device in the forwarding device sends the completion message and interrupt message to the computing device, so that the computing device refreshes the first host according to the completion message The tail pointer of the queue and the second host queue.
第二方面,提供了一种队列通信系统,所述系统包括转发设备和计算设备,所述转发设备与计算设备连接,所述转发设备包括至少一个转发队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,其中,In a second aspect, a queue communication system is provided, the system includes a forwarding device and a computing device, the forwarding device is connected to the computing device, the forwarding device includes at least one forwarding queue, and the computing device includes multiple host queues , Multiple data to be sent are stored in the multiple host queues, where:
所述计算设备用于向所述转发设备发送第一命令消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;The computing device is configured to send a first command message to the forwarding device, where the first doorbell message carries information about the first host queue and the second host queue, and the first host queue and the all The second host queues all belong to the multiple host queues;
所述转发设备用于接收来自所述计算设备的第一门铃消息;The forwarding device is used to receive the first doorbell message from the computing device;
所述转发设备用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;The forwarding device is configured to obtain the information of the first host queue and the information of the second host queue from the first doorbell message, obtain the first data to be sent from the first host queue, and obtain the first data to be sent from the first host queue. Acquiring the second to-be-sent data from the second host queue;
所述转发设备用于根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。The forwarding device is configured to store the first data to be sent and the second data to be sent into the first host queue and the first host queue according to the queue correspondence between the forwarding queue and the host queue. Two forwarding queues corresponding to the host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
在一实施方式中,所述计算设备用于在向所述转发设备发送第一门铃消息之前,向所述转发设备发送设备查询消息;所述转发设备用于接收来自所述计算设备的设备查询消息;所述转发设备用于响应于所述设备查询消息,将扩展后的转发队列个数上报至所述计算设备,其中,所述扩展后的转发队列个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立所述队列对应关系。In an embodiment, the computing device is configured to send a device query message to the forwarding device before sending the first doorbell message to the forwarding device; the forwarding device is configured to receive a device query from the computing device Message; the forwarding device is used to report the number of extended forwarding queues to the computing device in response to the device query message, wherein the number of extended forwarding queues is determined by the number of the at least one forwarding queue The number and expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence relationship.
在一实施方式中,所述转发设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;所述转发设备用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。In one embodiment, the forwarding device includes an attribute register, and the number of the expanded forwarding queues is stored in the attribute register; the forwarding device is used to query the attribute register and obtain it from the attribute register The number of the extended forwarding queues is reported to the computing device.
在一实施方式中,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述转发设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个主机队列中的一个主机队列的头指针和尾指针,所述转发设备中还存储有所述至少一个转发队列的至少一组头指针和至少一组尾指针;所述转发设备用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述转发设备用于根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头指针;所述转发设备用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指 针,在所述第一主机队列中获取所述第一待发送数据;所述转发设备用于根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针;所述转发设备用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述转发设备用于在将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应转发队列之后,刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;所述转发设备用于刷新所述对应的转发队列的头指针;所述转发设备用于将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。In an embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so The second head pointer indicates the second data to be sent, and multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple hosts of the computing device The head pointer and the tail pointer of a host queue in the queue, the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue; Acquire the first head pointer and the second head pointer in a doorbell message; the forwarding device is configured to refresh the head pointers corresponding to the first host queue in the multiple sets of head pointers according to the first head pointers The forwarding device is used to obtain the first host queue from the first host queue according to the head pointer corresponding to the first host queue after being refreshed, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers The first data to be sent; the forwarding device is used to refresh the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer; the forwarding device is used to refresh the head pointer according to the refreshed The head pointer corresponding to the second host queue, and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers, acquire the second data to be sent in the second host queue; the forwarding device uses After the first data to be sent and the second data to be sent are respectively stored in the first host queue and the corresponding forwarding queue of the second host queue, the tail pointer of the first host queue and the The tail pointer of the second host queue; the forwarding device is used to refresh the head pointer of the corresponding forwarding queue; the forwarding device is used to combine the refreshed tail pointer of the first host queue and the refreshed The tail pointer of the second host queue is sent to the computing device.
在一实施方式中,所述转发设备包括队列扩展设备和网卡,所述至少一个转发队列包括至少一个队列扩展设备队列和至少一个网卡队列,所述至少一个队列扩展设备队列位于所述队列扩展设备,所述至少一个网卡队列位于所述网卡,所述至少一组头指针和所述至少一组尾指针存储于所述队列扩展设备,所述队列对应关系包括第一队列对应关系和第二队列对应关系,所述第一队列对应关系为所述多个主机队列与所述至少一个队列扩展设备队列的对应关系,所述第二队列对应关系为所述至少一个网卡队列与所述至少一个队列扩展设备队列的对应关系,所述至少一个网卡队列与所述至少一个队列扩展设备队列一一对应,所述队列扩展设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述多个主机队列中的一个主机队列的头指针和尾指针,所述队列扩展设备中还存储有至少一组队列扩展设备头指针和至少一组队列扩展设备尾指针,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应;所述队列扩展设备用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述队列扩展设备用于根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;所述队列扩展设备用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述队列扩展设备用于根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;所述队列扩展设备用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述队列扩展设备用于根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;所述队列扩展设备用于刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;所述网卡用于接收来自所述队列扩展设备的第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针;所述网卡用于从所述第二门铃消息中获取所述对应的队列扩展设备队列的头指针;所述转发设备中的网卡根据所述对应的队列扩展设备队列的头指针,以及所述第二队列对应关系,刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针;所述网卡用于根据刷新后所述对应的网卡头指针,和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据;所述网卡用于根据所述第二队列对应关系,将所述第一待发送 数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列。In an embodiment, the forwarding device includes a queue expansion device and a network card, the at least one forwarding queue includes at least one queue expansion device queue and at least one network card queue, and the at least one queue expansion device queue is located in the queue expansion device. The at least one network card queue is located in the network card, the at least one set of head pointers and the at least one set of tail pointers are stored in the queue expansion device, and the queue correspondence relationship includes a first queue correspondence relationship and a second queue Correspondence, the first queue correspondence is the correspondence between the multiple host queues and the at least one queue expansion device queue, and the second queue correspondence is the at least one network card queue and the at least one queue The corresponding relationship between the expansion device queues, the at least one network card queue corresponds to the at least one queue expansion device queue, and the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers The group tail pointers respectively correspond to the head pointer and the tail pointer of a host queue in the plurality of host queues. The queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tails. Pointers, the network card stores at least one set of network card head pointers and at least one set of network card tail pointers, the at least one set of queue expansion device head pointers corresponds to the at least one set of network card head pointers, and the at least one The tail pointer of the group queue expansion device corresponds to the at least one group of network card tail pointers one-to-one; the queue expansion device is configured to obtain the first head pointer and the second head pointer from the first doorbell message; The queue expansion device is configured to refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer and the first queue correspondence; the queue expansion device is configured to Acquiring the first data to be sent from the first host queue according to the head pointer corresponding to the first host queue after the refresh and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers; The queue expansion device is configured to refresh the head pointer corresponding to the second host queue in the plurality of sets of head pointers according to the second head pointer and the corresponding relationship of the first queue; the queue expansion device is configured to Acquiring the second data to be sent from the second host queue according to the head pointer corresponding to the second host queue after the refresh and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers; The queue expansion device is configured to store the first data to be sent and the second data to be sent in the queue expansion device corresponding to the first host queue and the second host queue according to the corresponding relationship of the first queue Queue, wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue The queue expansion device is used to refresh the head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail pointer of the second host queue; the network card is used to receive from the queue extension equipment The second doorbell message, wherein the second doorbell message carries the head pointer of the corresponding queue expansion device queue; the network card is used to obtain the corresponding queue expansion device queue information from the second doorbell message Head pointer; the network card in the forwarding device refreshes the corresponding queue expansion device queue in the at least one set of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the second queue correspondence The head pointer of the network card corresponds to the head pointer of the network card; the network card is used for refreshing the corresponding head pointer of the network card, and the tail pointer corresponding to the corresponding queue expansion device queue in the at least one set of network card tail pointers, in all The first data to be sent and the second data to be sent are acquired from the corresponding queue expansion device queue; the network card is used to combine the first data to be sent and the second data to be sent according to the correspondence between the second queues The data is stored in the network card queue corresponding to the corresponding queue expansion device queue.
在一实施方式中,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,所述网卡还用于在所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,根据所述第一DMA读描述符以及所述第二DMA读描述符,生成第一DMA读命令以及第二DMA读命令;所述网卡用于向所述转发设备中的队列扩展设备发送所述第一DMA读命令以及第二DMA读命令;所述队列扩展设备用于根据所述第一DMA读命令从所述计算设备获取第一待读取数据,根据所述第二DMA读命令从所述计算设备获取第二待读取数据;所述队列扩展设备用于将所述第一待读取数据和所述第二待读取数据转发至所述转发设备中的网卡。In one embodiment, the first data to be sent is a first direct memory access DMA read descriptor, the second data to be sent is a second DMA read descriptor, and the network card is also used to After the first data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, they are generated according to the first DMA read descriptor and the second DMA read descriptor The first DMA read command and the second DMA read command; the network card is used to send the first DMA read command and the second DMA read command to the queue expansion device in the forwarding device; the queue expansion device is used for The first DMA read command obtains first data to be read from the computing device, and obtains second data to be read from the computing device according to the second DMA read command; the queue expansion device is used to The first data to be read and the second data to be read are forwarded to the network card in the forwarding device.
在一实施方式中,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,所述队列扩展设备用于将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;所述队列扩展设备用于将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;所述网卡还用于在所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第二网卡DMA写描述符,获取存储于所述网卡中的,与所述第二网卡DMA写描述符对应的第二分片数据,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;所述网卡用于根据所述第一网卡DMA写描述符以及所述第一分片数据生成第一DMA写命令,根据所述第二网卡DMA写描述符以及所述第二分片数据生成第二DMA写命令;所述网卡用于向所述队列扩展设备发送所述第一DMA写命令以及所述第二DMA写命令;所述队列扩展设备用于根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;所述队列扩展设备用于在所述转发设备中的队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;所述队列扩展设备用于向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令;所述计算设备用于据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。In an embodiment, the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA write descriptor, wherein the first DMA write descriptor is used to transfer the first DMA write descriptor. A data to be written is written from the queue expansion device to the computing device, the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device, the queue The expansion device is used to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor, wherein the first DMA write descriptor The descriptor is used to write the first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card into the queue expansion device The queue expansion device is used to store the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion device queue; the network card is also used in the After the first data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, the data stored in the network card is obtained according to the DMA write descriptor of the first network card, and According to the first fragment data corresponding to the DMA write descriptor of the first network card, according to the DMA write descriptor of the second network card, obtain the first fragment data stored in the network card and corresponding to the DMA write descriptor of the second network card. Two pieces of data, wherein the first data to be written includes n pieces of first piece data, and the second data to be written includes m pieces of second piece data; the network card is configured to A network card DMA write descriptor and the first fragment data generate a first DMA write command, and a second DMA write command is generated according to the second network card DMA write descriptor and the second fragment data; the network card uses Sending the first DMA write command and the second DMA write command to the queue expansion device; the queue expansion device is configured to transfer all data according to the first DMA write command and the second DMA write command The first fragmented data and the second fragmented data are written into the memory of the queue expansion device; the queue expansion device is used to store the first fragmented data in the memory of the queue expansion device in the forwarding device When the number is n, a third DMA write command is generated according to the first data to be written, and when the number of the second fragmented data is m, according to the second data to be written , Generate a fourth DMA write command, where the third DMA write command is used for the computing device to execute and write the first data to be written into the computing device, and the fourth DMA write command is used for For the computing device to execute and write the first data to be written into the computing device; the queue expansion device is used to send the third DMA write command and the fourth DMA to the computing device Write command; the computing device is used to write the first data to be written and the second to be written according to the third DMA write command and the fourth DMA write command Write data into the computing device.
在一实施方式中,所述网卡还用于在所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,向所述队列扩展设备发送完成消息和中断消息;所述队列扩展设备还用于向所述计算设备发送所述完成消息和中断,使得所述计算设备根据所述完成消息,刷新第一主机队列以及第二主机队列的尾指针。In one embodiment, the network card is further configured to send the first data to be sent and the second data to be sent to the network card queue corresponding to the corresponding queue expansion device queue after storing the first data to be sent and the second data to be sent to the queue The expansion device sends a completion message and an interrupt message; the queue expansion device is also used to send the completion message and interrupt to the computing device, so that the computing device refreshes the first host queue and the second host according to the completion message The tail pointer of the queue.
第三方面,提供了一种转发设备,所述转发设备与计算设备连接,所述转发设备包括至少一个转发队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送 数据,其中,所述转发设备包括:In a third aspect, a forwarding device is provided, the forwarding device is connected to a computing device, the forwarding device includes at least one forwarding queue, the computing device includes multiple host queues, and how many host queues are stored in the multiple host queues. Pieces of data to be sent, wherein the forwarding device includes:
接收单元,所述接收单元用于接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;A receiving unit, the receiving unit is configured to receive a first doorbell message from the computing device, wherein the first doorbell message carries information about a first host queue and a second host queue, and the first Both the host queue and the second host queue belong to the multiple host queues;
获取单元,所述获取单元用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;An acquiring unit configured to acquire information about the first host queue and information about the second host queue from the first doorbell message, and acquire first data to be sent from the first host queue , Acquiring second data to be sent from the second host queue;
存储单元,所述存储单元用于根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。A storage unit, configured to store the first data to be sent and the second data to be sent in the first host respectively according to the queue correspondence between the forwarding queue and the host queue The queue and the forwarding queue corresponding to the second host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
在一实施方式中,所述转发设备还包括响应单元,所述接收单元还用于在所述接收单元接收来自所述计算设备的第一门铃消息之前,接收来自所述计算设备的设备查询消息;所述响应单元用于响应于所述设备查询消息,所述转发设备将扩展后的转发队列个数上报至所述计算设备,其中,所述扩展后的转发队列个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立所述队列对应关系。In an embodiment, the forwarding device further includes a response unit, and the receiving unit is further configured to receive a device query message from the computing device before the receiving unit receives the first doorbell message from the computing device The response unit is used to respond to the device query message, and the forwarding device reports the number of the extended forwarding queues to the computing device, wherein the number of the extended forwarding queues is determined by the at least one The number of forwarding queues and the expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence.
在一实施方式中,所述转发设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中,所述响应单元用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。In one embodiment, the forwarding device includes an attribute register, the number of the expanded forwarding queues is stored in the attribute register, and the response unit is used to query the attribute register and obtain it from the attribute register. The number of the extended forwarding queues is reported to the computing device.
在一实施方式中,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述转发设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个队列中的一个队列的头指针和尾指针,所述转发设备中还存储有所述至少一个队列的至少一组头指针和至少一组尾指针;所述转发设备还包括刷新单元,所述获取单元用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述刷新单元用于根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头指针;所述获取单元用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述刷新单元用于根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针;所述获取单元用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述刷新单元用于将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应转发队列之后,刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;所述刷新单元用于刷新所述对应的转发队列的头指针;所述刷新单元用于将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。In an embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so The second head pointer indicates the second data to be sent, and multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple queues of the computing device The forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one queue; the forwarding device further includes a refreshing unit, and the acquiring unit Is used to obtain the first head pointer and the second head pointer from the first doorbell message; the refresh unit is used to refresh the first head pointer in the plurality of sets of head pointers according to the first head pointer The head pointer corresponding to the host queue; the acquiring unit is used to obtain the head pointer corresponding to the first host queue after being refreshed, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent is acquired from a host queue; the refresh unit is configured to refresh the head pointer corresponding to the second host queue in the plurality of sets of head pointers according to the second head pointer; the acquisition unit uses According to the head pointer corresponding to the second host queue after being refreshed, and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers, the second data to be sent is acquired from the second host queue The refresh unit is used to refresh the first host queue after storing the first data to be sent and the second data to be sent in the corresponding forwarding queues of the first host queue and the second host queue respectively The tail pointer and the tail pointer of the second host queue; the refresh unit is used to refresh the head pointer of the corresponding forwarding queue; the refresh unit is used to refresh the tail pointer of the first host queue and The refreshed tail pointer of the second host queue is sent to the computing device.
第四方面,提供了一种队列扩展设备,所述队列扩展设备队列与计算设备连接和网卡连接,所述队列扩展设备和计算设备连接,所述网卡和所述计算设备连接,所述队列扩展设备包括至少一个队列扩展设备队列,所述网卡包括至少一个网卡队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,所述队列扩展设备包括:In a fourth aspect, a queue expansion device is provided. The queue expansion device is connected to a computing device and connected to a network card, the queue expansion device is connected to a computing device, the network card is connected to the computing device, and the queue expands The device includes at least one queue expansion device queue, the network card includes at least one network card queue, the computing device includes a plurality of host queues, a plurality of data to be sent are stored in the plurality of host queues, and the queue expansion device includes:
接收单元,所述接收单元用于接收来自所述计算设备的第一门铃消息,其中,所述第一 门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;A receiving unit, the receiving unit is configured to receive a first doorbell message from the computing device, wherein the first doorbell message carries information about a first host queue and a second host queue, and the first Both the host queue and the second host queue belong to the multiple host queues;
获取单元,所述获取单元用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;An acquiring unit configured to acquire information about the first host queue and information about the second host queue from the first doorbell message, and acquire first data to be sent from the first host queue , Acquiring second data to be sent from the second host queue;
存储单元,所述存储单元用于根据所述队列扩展设备队列和所述主机队列之间的第一队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列;A storage unit, which is configured to store the first data to be sent and the second data to be sent in the storage unit according to the first queue correspondence between the queue expansion device queue and the host queue. The first host queue and the queue expansion device queue corresponding to the second host queue;
发送单元,所述发送单元用于向所述网卡发送第二门铃消息,所述第二门铃消息中携带有所述对应的队列扩展设备队列的信息,使得所述网卡根据所述第二门铃消息,从所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据,并根据所述网卡队列和所述队列扩展设备队列之间的第二队列对应关系,将所述第一待发送数据和所述第二待发送数据存入所述对应的队列扩展设备队列对应的网卡队列中,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列,所述对应的网卡队列属于所述网卡队列。A sending unit, the sending unit is configured to send a second doorbell message to the network card, the second doorbell message carrying the corresponding queue expansion device queue information, so that the network card according to the second doorbell message , Acquiring the first data to be sent and the second data to be sent from the corresponding queue expansion device queue, and according to the second queue correspondence between the network card queue and the queue expansion device queue, The first data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, where the corresponding queue expansion device queue belongs to the queue expansion device queue, and the The first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue, and the corresponding network card queue belongs to the network card queue.
在一实施方式中,所述设备还包括响应单元,所述接收单元还用于在接收来自所述计算设备的第一门铃消息之前,接收来自所述计算设备的第一设备查询消息;所述发送单元用于向所述网卡送第二设备查询消息;所述响应单元用于接收所述网卡发送的网卡队列个数,其中,所述网卡队列个数用于建立所述第二队列对应关系;所述响应单元用于响应于所述第一设备查询消息,将扩展后的队列扩展设备队列个数上报至所述计算设备,其中,所述扩展后的队列扩展设备队列个数由所述网卡队列个数和扩展系数确定,所述扩展后的队列扩展设备队列个数用于建立所述第一队列对应关系。In an embodiment, the device further includes a response unit, and the receiving unit is further configured to receive a first device query message from the computing device before receiving the first doorbell message from the computing device; The sending unit is used to send a second device query message to the network card; the response unit is used to receive the number of network card queues sent by the network card, wherein the number of network card queues is used to establish the second queue correspondence The response unit is configured to report the number of expanded queue expansion device queues to the computing device in response to the first device query message, wherein the number of expanded queue expansion device queues is determined by the The number of network card queues and the expansion coefficient are determined, and the expanded number of queue expansion device queues is used to establish the first queue correspondence relationship.
在一实施方式中,所述设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;所述响应单元还用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的队列扩展设备队列个数,将所述扩展后的队列扩展设备队列个数上报至所述计算设备。In an embodiment, the device includes an attribute register, and the number of the expanded forwarding queues is stored in the attribute register; the response unit is also used to query the attribute register and obtain it from the attribute register The number of queues of the expanded queue expansion device is reported to the computing device.
在一实施方式中,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述队列扩展设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述多个主机队列中的一个主机队列的头指针和尾指针,所述队列扩展设备中还存储有至少一组队列扩展设备头指针和至少一组队列扩展设备尾指针,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应,所述队列扩展设备还包括刷新单元,所述获取单元用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述刷新单元用于根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;所述获取单元用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述刷新单元用于根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;所述获取单元用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第 二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述存储单元用于根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;所述刷新单元用于刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;所述发送单元还用于向所述网卡发送所述第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针,使得所述网卡根据所述对应的队列扩展设备队列的头指针以及所述第二队列对应关系刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针,并刷新后所述对应的网卡头指针和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据,从而根据所述第二队列对应关系,将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列。In an embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so The second head pointer indicates the second data to be sent, and the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, and each set of head pointers and each set of tail pointers respectively correspond to the multiple host queues The head pointer and the tail pointer of a host queue in, the queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tail pointers, and at least one set of network cards is stored in the network card A head pointer and at least one set of network card tail pointers, the at least one set of queue extension device head pointers correspond to the at least one set of network card head pointers, and the at least one set of queue extension device tail pointers corresponds to the at least one There is a one-to-one correspondence between the tail pointers of the network card, and the queue expansion device further includes a refreshing unit, and the acquiring unit is configured to acquire the first head pointer and the second head pointer from the first doorbell message; the refreshing The unit is used to refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer and the corresponding relationship of the first queue; the acquisition unit is used to refresh the head pointer corresponding to the first host queue according to the refresh The head pointer corresponding to the first host queue, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers, acquire the first data to be sent in the first host queue; the refresh unit uses According to the second head pointer and the corresponding relationship of the first queue, the head pointer corresponding to the second host queue among the multiple sets of head pointers is refreshed; the acquiring unit is configured to refresh the second head pointer according to the refreshed second head pointer. The head pointer corresponding to the host queue, and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers, acquire the second to-be-sent data in the second host queue; the storage unit is used to obtain the second data to be sent according to In the first queue correspondence, the first data to be sent and the second data to be sent are stored in the first host queue and the queue expansion device queue corresponding to the second host queue, wherein the corresponding The queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue; the refresh unit is used for refreshing The head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail pointer of the second host queue; the sending unit is further configured to send the second doorbell message to the network card, wherein The second doorbell message carries the head pointer of the corresponding queue expansion device queue, so that the network card refreshes the at least one queue according to the head pointer of the corresponding queue expansion device queue and the second queue correspondence relationship. The network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the network card head pointer, and the corresponding queue expansion device queue in the corresponding network card head pointer and the at least one set of network card tail pointers after refreshing Corresponding tail pointer, obtain the first to-be-sent in the corresponding queue expansion device queue The data and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue according to the corresponding relationship of the second queue.
在一实施方式中,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,所述接收单元还用于接收所述网卡发送的第一DMA读命令以及第二DMA读命令,其中,其中,所述第一DMA读命令是所述网卡根据所述第一DMA描述符生成的,所述第二DMA读命令是所述网卡根据所述第二DMA描述符生成的;所述获取单元还用于根据第一DMA读命令从所述计算设备获取第一待读取数据,根据第二DMA读命令从所述计算设备获取第二待读取数据;所述发送单元还用于将所述第一待读取数据和所述第二待读取数据转发至所述网卡。In an embodiment, the first data to be sent is a first direct memory access DMA read descriptor, the second data to be sent is a second DMA read descriptor, and the receiving unit is further configured to receive the The first DMA read command and the second DMA read command sent by the network card, wherein the first DMA read command is generated by the network card according to the first DMA descriptor, and the second DMA read command is The network card is generated according to the second DMA descriptor; the obtaining unit is further configured to obtain the first data to be read from the computing device according to the first DMA read command, and from the computing device according to the second DMA read command Obtain second data to be read; the sending unit is further configured to forward the first data to be read and the second data to be read to the network card.
在一实施方式中,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,所述设备还包括转换单元,所述转换单元用于将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;所述存储单元用于将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;所述接收单元用于接收第一DMA写命令以及所述第二DMA写命令,其中,所述第一DMA写命令是所述网卡根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第一网卡DMA写描述符以及所述第一分片数据生成的第一DMA写命令,所述第二DMA写命令是所述网卡根据所述第二网卡DMA写描述符,获取存储于所述网卡中的与所述第二网卡DMA写描述符对应的第二分片数据之后,根据所述第二网卡DMA写描述符以及所述第二分片数据生成的第二DMA写命令,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;所述存储单元用于根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;所述转换单元用于在所述队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述 计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;所述发送单元用于向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令,使得所述计算设备根据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。In an embodiment, the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA write descriptor, wherein the first DMA write descriptor is used to transfer the first DMA write descriptor. A data to be written is written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device, and the device It also includes a conversion unit configured to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor, wherein , The first DMA write descriptor is used to write the first data to be written from the network card to the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card Write to the queue expansion device; the storage unit is used to store the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion device queue; the receiving unit uses When receiving the first DMA write command and the second DMA write command, the first DMA write command is the network card obtained by the network card according to the first network card DMA write descriptor and stored in the network card, and The first fragmented data corresponding to the first network card DMA write descriptor, the first DMA write command generated according to the first network card DMA write descriptor and the first fragmented data, the second DMA write command After the network card obtains the second fragmented data corresponding to the second network card DMA write descriptor stored in the network card according to the second network card DMA write descriptor, and then writes according to the second network card DMA write descriptor Descriptor and the second DMA write command generated by the second fragmented data, wherein the first to-be-written data includes n first fragmented data, and the second to-be-written data includes m second fragments. Fragmented data; the storage unit is used to write the first fragmented data and the second fragmented data into the memory of the queue expansion device according to the first DMA write command and the second DMA write command The conversion unit is used to generate a third DMA write command based on the first data to be written when the number of first fragmented data is n in the memory of the queue expansion device In the case where the number of the second fragmented data is m, a fourth DMA write command is generated according to the second data to be written, where the third DMA write command is used for the computing device to execute and Writing the first data to be written into the computing device, and the fourth DMA write command is used for execution by the computing device and writing the first data to be written into the computing device; The sending unit is configured to send the third DMA write command and the fourth DMA write command to the computing device, so that the computing device transfers all data according to the third DMA write command and the fourth DMA write command. The first data to be written and the second data to be written are written into the computing device.
在一实施方式中,所述接收单元还用于接收所述网卡发送的完成消息和中断,其中,其中,所述完成消息和中断是所述网卡在将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后生成的;所述发送单元还用于向所述计算设备发送完成消息和中断,使得所述计算设备根据所述完成消息刷新第一主机队列以及第二主机队列的尾指针。In an embodiment, the receiving unit is further configured to receive a completion message and an interrupt sent by the network card, wherein, the completion message and the interrupt indicate that the network card is sending the first data to be sent and the second The data to be sent is generated after being stored in the network card queue corresponding to the corresponding queue expansion device queue; the sending unit is also used to send a completion message and an interrupt to the computing device, so that the computing device according to the completion message Refresh the tail pointers of the first host queue and the second host queue.
第五方面,提供了一种转发设备,所述设备包括处理器和存储器,,所述处理器执行所述存储器中的代码实现第一方面描述的方法。In a fifth aspect, a forwarding device is provided, the device includes a processor and a memory, and the processor executes the code in the memory to implement the method described in the first aspect.
第六方面,提供了一种计算机程序产品,当所述计算机程序产品被计算设备读取并执行时,实现第一方面描述的方法。In a sixth aspect, a computer program product is provided. When the computer program product is read and executed by a computing device, the method described in the first aspect is implemented.
第七方面,提供了一种计算机非瞬态存储介质,包括指令,当所述指令在计算设备上运行时,使得所述计算设备实现第一方面描述的方法。In a seventh aspect, a computer non-transitory storage medium is provided, including instructions, which when run on a computing device, cause the computing device to implement the method described in the first aspect.
第八方面,提供了一种转发设备,所述设备包括逻辑电路,所述转发设备通过所述逻辑电路实现第一方面描述的方法。In an eighth aspect, a forwarding device is provided, the device includes a logic circuit, and the forwarding device implements the method described in the first aspect through the logic circuit.
第九方面,提供了一种队列扩展设备,所述设备包括处理器和存储器,所述处理器执行所述存储器中的代码实现第四方面描述的队列扩展设备。In a ninth aspect, a queue expansion device is provided, the device includes a processor and a memory, and the processor executes the code in the memory to implement the queue expansion device described in the fourth aspect.
第十方面,提供了一种计算机程序产品,其特征在于,当所述计算机程序产品被计算设备读取并执行时,实现第四方面描述的队列扩展设备。In a tenth aspect, a computer program product is provided, which is characterized in that, when the computer program product is read and executed by a computing device, the queue expansion device described in the fourth aspect is implemented.
第十一方面,提供了一种计算机非瞬态存储介质,其特征在于,包括指令,当所述指令在计算设备上运行时,使得所述计算设备实现第四方面描述的队列扩展设备。In an eleventh aspect, a computer non-transitory storage medium is provided, which is characterized in that it includes an instruction that, when the instruction runs on a computing device, causes the computing device to implement the queue expansion device described in the fourth aspect.
第十二方面,提供了一种转队列扩展设备,所述设备包括逻辑电路,所述转发设备通过所述逻辑电路实现第四方面描述的队列扩展设备。In a twelfth aspect, a transfer queue expansion device is provided, the device includes a logic circuit, and the forwarding device implements the queue expansion device described in the fourth aspect through the logic circuit.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。In order to more clearly describe the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art.
图1是本申请提供方案适用的一种网络系统的逻辑结构示意图;Figure 1 is a schematic diagram of the logical structure of a network system to which the solution provided in this application is applicable;
图2是本申请他提供的一种转发设备在一网络系统中进行队列通信的逻辑结构示意图;FIG. 2 is a schematic diagram of the logical structure of a forwarding device for queue communication in a network system provided by this application;
图3是本申请提供的一种队列扩展设备在一网络系统中进行队列通信的逻辑结构示意图;3 is a schematic diagram of the logical structure of a queue expansion device for queue communication in a network system provided by the present application;
图4是本申请提供的一种队列通信方法的步骤流程图;Figure 4 is a flow chart of the steps of a queue communication method provided by the present application;
图5A-图5C是一种队列结构的示意图;5A-5C are schematic diagrams of a queue structure;
图6是本申请提供的另一种队列通信方法的步骤流程图;Figure 6 is a flow chart of the steps of another queue communication method provided by the present application;
图7是本申请提供的一种队列通信方法中根据门铃消息获得第一待发送数据以及第二待发送数据的步骤流程图;FIG. 7 is a flowchart of the steps of obtaining the first data to be sent and the second data to be sent according to the doorbell message in a queue communication method provided by the present application;
图8是本申请提供的一种队列通信方法在一应用场景下的步骤流程图;FIG. 8 is a flow chart of the steps of a queue communication method provided by the present application in an application scenario;
图9是本申请提供的一种队列通信方法在一另应用场景下的步骤流程图;FIG. 9 is a flow chart of the steps of a queue communication method provided by the present application in another application scenario;
图10是本申请提供的一种转发设备的结构示意图;FIG. 10 is a schematic structural diagram of a forwarding device provided by this application;
图11是本申请提供的一种队列扩展装置的结构示意图;FIG. 11 is a schematic structural diagram of a queue expansion device provided by the present application;
图12是本申请提供的一种转发设备的硬件结构示意图;FIG. 12 is a schematic diagram of the hardware structure of a forwarding device provided by the present application;
图13是本申请提供的一种队列扩展装置的硬件结构示意图。FIG. 13 is a schematic diagram of the hardware structure of a queue expansion device provided by the present application.
具体实施方式Detailed ways
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。The terminology used in the implementation mode part of this application is only used to explain the specific embodiments of this application, and is not intended to limit this application.
本申请提供的方案适用于一网络系统,该网络系统可以实现计算设备之间的数据通信。如图1所示,图1是本申请适用的一种网络系统的逻辑结构示意图,所述网络系统包括:计算设备110以及计算设备120,转发设备210和转发设备220,以及网络300,其中,计算设备110和转发设备210连接并通信,转发设备210与网络300连接并通信,计算设备120与转发设备220连接并通信,转发设备220与网络300连接并通信。需要说明的,图1为了便于理解只绘制了两个计算设备和两个转发设备,每个计算设备只连接了一个转发设备,实际情况中,所述网络系统可包括一个或者多个计算设备以及一个或者多个转发设备,计算设备以及转发设备的数量不作为对本申请实施例的限制,每个计算设备也可以连接多个转发设备,系统可以所述根据用户需求做出调整,本申请不对此进行具体限定。并且,图1只是为描述方便,只显示了部分资源,具体实现中,图1所示的计算设备还可以包括内存、硬盘等硬件资源,以及需要运行的操作系统、应用程序等软件资源,不再赘述。The solution provided in this application is applicable to a network system that can implement data communication between computing devices. As shown in FIG. 1, FIG. 1 is a schematic diagram of the logical structure of a network system applicable to this application. The network system includes: a computing device 110 and a computing device 120, a forwarding device 210 and a forwarding device 220, and a network 300, wherein, The computing device 110 and the forwarding device 210 are connected and communicated, the forwarding device 210 is connected and communicated with the network 300, the computing device 120 is connected and communicated with the forwarding device 220, and the forwarding device 220 is connected and communicated with the network 300. It should be noted that for ease of understanding, FIG. 1 only shows two computing devices and two forwarding devices, and each computing device is connected to only one forwarding device. In actual situations, the network system may include one or more computing devices and The number of one or more forwarding devices, computing devices, and forwarding devices is not a limitation to the embodiments of this application. Each computing device can also be connected to multiple forwarding devices. The system can make adjustments according to user needs as described above. This application does not Make specific restrictions. Moreover, Figure 1 is only for the convenience of description and only shows part of the resources. In specific implementation, the computing device shown in Figure 1 may also include hardware resources such as memory and hard disk, as well as software resources such as operating systems and applications that need to be run. Go into details again.
其中,当计算设备110中需要将待发送数据传输至计算设备120处时,可以将计算设备110侧的待发送数据发送至转发设备210处,网卡210通过与其相连的网络300,向网卡220发送该待发送数据,转发设备220可以通过网络300接收待发送数据,并将待发送数据发送至计算设备120处,从而达到计算设备110向计算设备120发送待发送数据的目的。本申请主要针对计算设备与转发设备之间的通信过程,因此对于转发设备通过网络进行数据传输的过程不再进行赘述。下面对本申请实现计算设备与转发设备之间的通信过程进行详细解释。Wherein, when the computing device 110 needs to transmit data to be sent to the computing device 120, the data to be sent on the computing device 110 side can be sent to the forwarding device 210, and the network card 210 sends to the network card 220 through the network 300 connected to it. For the data to be sent, the forwarding device 220 may receive the data to be sent through the network 300 and send the data to be sent to the computing device 120, so that the computing device 110 sends the data to be sent to the computing device 120. This application mainly focuses on the communication process between the computing device and the forwarding device, so the process of data transmission by the forwarding device through the network will not be repeated. The process of implementing the communication between the computing device and the forwarding device in this application will be explained in detail below.
在本申请实施例中,所述转发设备可以是网卡,具体实现中,图1中所示的通信系统可以如图2所示,其中,计算设备110包括多个主机队列111(图中绘制了4个主机队列Q00-Q03),所述转发设备210包括至少一个转发队列211(图中仅绘制了2个转发队列Q10和Q11),并且,所述至少一个转发队列211与所述多个主机队列111之间存在队列对应关系,其中,1个转发队列211可以与多个主机队列211之间存在队列对应关系,例如图2中所示的主机队列Q00-Q01与转发队列Q10之间存在队列对应关系,主机队列Q02-Q03与转发队列Q11之间存在队列对应关系。需要说明的,由于转发设备220与计算设备120之间的队列通信过程与计算设备110与转发设备210之间的队列通信过程类似,因此,图1为了便于理解只绘制了计算设备110和转发设备210,不再赘述。In the embodiment of the present application, the forwarding device may be a network card. In a specific implementation, the communication system shown in FIG. 1 may be as shown in FIG. 2, where the computing device 110 includes a plurality of host queues 111 (shown in the figure 4 host queues Q00-Q03), the forwarding device 210 includes at least one forwarding queue 211 (only two forwarding queues Q10 and Q11 are drawn in the figure), and the at least one forwarding queue 211 and the multiple hosts There is a queue correspondence between the queues 111. Among them, one forwarding queue 211 may have a queue correspondence with multiple host queues 211. For example, there is a queue between the host queues Q00-Q01 and the forwarding queue Q10 shown in FIG. 2 Correspondence, there is a queue correspondence between the host queues Q02-Q03 and the forwarding queue Q11. It should be noted that since the queue communication process between the forwarding device 220 and the computing device 120 is similar to the queue communication process between the computing device 110 and the forwarding device 210, FIG. 1 only shows the computing device 110 and the forwarding device for ease of understanding. 210, I won't repeat it here.
那么,当计算设备110需要将待发送数据传输至转发设备210处时,可以先将待发送数据放入主机队列中,比如放图2中的主机队列Q00与Q01中,然后根据队列对应关系,确定主机队列Q00与Q01对应的转发队列Q10,从而将待发送数据从主机队列Q00与Q01中,转存入转发队列Q10中,从而将待发送是够从计算设备110传输至转发设备210。可以理解的,由于本申请提供的转发设备中的转发队列中,每个转发队列可以与多个主机队列产生队列对 应关系,从而避免了由于主机队列的转发能力弱于网卡队列的转发能力导致的通信效率低下,使得网卡队列的转发性能得以充分发挥。Then, when the computing device 110 needs to transmit the data to be sent to the forwarding device 210, it can first put the data to be sent into the host queue, such as in the host queues Q00 and Q01 in FIG. 2, and then according to the queue correspondence, The forwarding queue Q10 corresponding to the host queues Q00 and Q01 is determined, and the data to be sent is transferred from the host queues Q00 and Q01 to the forwarding queue Q10, so as to transmit the data to be sent from the computing device 110 to the forwarding device 210. It is understandable that, in the forwarding queue in the forwarding device provided in this application, each forwarding queue can generate a queue correspondence with multiple host queues, thereby avoiding the problem that the forwarding ability of the host queue is weaker than the forwarding ability of the network card queue. The communication efficiency is low, so that the forwarding performance of the network card queue can be brought into full play.
在本申请实施例中,所述转发设备还可以包括队列扩展设备和网卡,具体实现中,图1所示的通信系统可以如图3所示,其中,计算设备110包括多个主机队列111(图中绘制了4个主机队列Q00-Q03),所述转发设备210包括队列扩展设备2101和网卡2102,其中,队列扩展设备2010包括至少一个队列扩展设备队列2111(图中仅绘制了2个队列扩展设备队列Q10和Q11),网卡2102包括至少一个网卡队列2112(图中仅绘制了2个网卡队列Q20和Q21),并且,所述至少一个队列扩展设备队列2111与所述多个主机队列111之间存在第一队列对应关系,所述至少一个网卡队列2112与所述至少一个队列扩展设备队列2111之间存在第二队列对应关系。其中,1个队列扩展设备队列2111可以与多个主机队列211之间存在第一队列对应关系,例如图3中所示的主机队列Q00-Q01与队列扩展设备队列Q10之间存在队列对应关系;1个队列扩展设备队列2111可以与1个网卡队列2112之间存在第二队列对应关系,例如图3中所示的队列扩展设备队列Q10与网卡队列Q20之间存在队列对应关系。In the embodiment of the present application, the forwarding device may also include a queue expansion device and a network card. In a specific implementation, the communication system shown in FIG. 1 may be as shown in FIG. 3, where the computing device 110 includes multiple host queues 111 ( 4 host queues Q00-Q03 are drawn in the figure), the forwarding device 210 includes a queue expansion device 2101 and a network card 2102, wherein the queue expansion device 2010 includes at least one queue expansion device Queue 2111 (only 2 queues are drawn in the figure Expanded device queues Q10 and Q11), the network card 2102 includes at least one network card queue 2112 (only two network card queues Q20 and Q21 are drawn in the figure), and the at least one queue expands the device queue 2111 and the multiple host queues 111 There is a first queue correspondence between them, and there is a second queue correspondence between the at least one network card queue 2112 and the at least one queue expansion device queue 2111. Wherein, one queue expansion device queue 2111 may have a first queue correspondence relationship with multiple host queues 211, for example, there is a queue correspondence relationship between the host queues Q00-Q01 and the queue expansion device queue Q10 shown in FIG. 3; One queue expansion device queue 2111 may have a second queue correspondence relationship with one network card queue 2112. For example, there is a queue correspondence relationship between the queue expansion device queue Q10 and the network card queue Q20 shown in FIG. 3.
那么,当计算设备110需要将待发送数据传输至网卡2112处时,可以先将待发送数据放入主机队列中,比如放入图3中的主机队列Q00与Q01中,然后根据第一队列对应关系,确定主机队列Q00与Q01对应的队列扩展设备队列Q10,从而将待发送数据从主机队列Q00与Q01中,转存入队列扩展设备队列Q00中;再根据第二队列对应关系,确定队列扩展设备队列Q10对应的网卡队列Q20,从而将待发送数据再从队列扩展设备队列Q10中,转存入所述网卡队列Q20中,从而将待发送数据从计算设备110处传输至网卡2112。可以理解的,由于本申请提供的队列扩展设备中,每个队列扩展设备队列可以与多个主机队列产生队列对应关系,而对了扩展设备队列与网卡队列又是一一对应的关系,从而再无需对网卡和计算设备进行任何升级的情况下,避免了由于主机队列的转发能力弱于网卡队列的转发能力导致的通信效率低下,使得网卡队列的转发性能得以充分发挥。Then, when the computing device 110 needs to transmit the data to be sent to the network card 2112, it can first put the data to be sent into the host queue, for example, into the host queues Q00 and Q01 in FIG. 3, and then correspond to the first queue Relationship, determine the queue expansion device queue Q10 corresponding to the host queues Q00 and Q01, so as to transfer the data to be sent from the host queues Q00 and Q01 to the queue expansion device queue Q00; then determine the queue expansion according to the second queue correspondence relationship The network card queue Q20 corresponding to the device queue Q10 transfers the data to be sent from the queue expansion device queue Q10 to the network card queue Q20, thereby transmitting the data to be sent from the computing device 110 to the network card 2112. It is understandable that in the queue expansion device provided in this application, each queue expansion device queue can generate a queue correspondence with multiple host queues, and the expansion device queue and the network card queue have a one-to-one correspondence, so that Without any upgrade of the network card and computing device, the inefficiency of communication caused by the forwarding capacity of the host queue being weaker than the forwarding capacity of the network card queue is avoided, so that the forwarding performance of the network card queue can be fully utilized.
在本申请实施例中,图1所示的网络系统还可以是数据中心虚拟化的场景,换句话说,计算设备110以及计算设备120可以是包括多个虚拟机的物理机,还可以是位于同一个物理机中的两个虚拟机,还可以是位于不同物理机中的两个虚拟机,本申请不做具体限定。In the embodiment of the present application, the network system shown in FIG. 1 may also be a data center virtualization scenario. In other words, the computing device 110 and the computing device 120 may be physical machines including multiple virtual machines, or may be located in The two virtual machines in the same physical machine may also be two virtual machines located in different physical machines, which are not specifically limited in this application.
下面基于图1-图2所示的网络架构,描述本申请提供的基于转发设备的队列通信的方法。The following describes the method for queue communication based on the forwarding device provided by the present application based on the network architecture shown in FIG. 1 to FIG. 2.
如图4所示,本申请提供了一种队列通信的方法。其中,所述转发设备与计算设备连接,所述转发设备包括至少一个转发队列,所述计算设备400包括多个主机队列,所述计算设备的多个主机队列中存储有多个待发送数据,简单来说,所述计算设备的多个主机队列中的待发送数据,将要发送至转发设备的至少一个转发队列中去。图4中的计算设备400可以是图1-图2中的计算设备110和计算设备120,所述队列通信的方法包括以下步骤:As shown in Figure 4, the present application provides a method for queue communication. The forwarding device is connected to a computing device, the forwarding device includes at least one forwarding queue, the computing device 400 includes multiple host queues, and multiple host queues of the computing device store multiple data to be sent, In simple terms, the data to be sent in the multiple host queues of the computing device will be sent to at least one forwarding queue of the forwarding device. The computing device 400 in FIG. 4 may be the computing device 110 and the computing device 120 in FIGS. 1-2, and the method of queue communication includes the following steps:
S101:所述转发设备接收来自所述计算设备的设备查询消息。S101: The forwarding device receives a device query message from the computing device.
在一实施例中,所述转发设备可以是PCIe设备。当转发设备与计算设备连接后,计算设备需要通过PCIe设备枚举,来识别与其相连的转发设备,然后才能与所述转发设备进行通信。In an embodiment, the forwarding device may be a PCIe device. After the forwarding device is connected to the computing device, the computing device needs to identify the forwarding device connected to it through PCIe device enumeration, and then can communicate with the forwarding device.
S102:响应于所述设备查询消息,所述转发设备将扩展后的转发队列个数上报至所述计算设备,从而建立转发队列与主机队列之间的队列对应关系。其中,所述扩展后的转发队列 个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立队列对应关系。S102: In response to the device query message, the forwarding device reports the expanded number of forwarding queues to the computing device, thereby establishing a queue correspondence between the forwarding queue and the host queue. Wherein, the number of the extended forwarding queues is determined by the number of the at least one forwarding queue and the expansion coefficient, and the number of the extended forwarding queues is used to establish a queue correspondence relationship.
具体实现中,所述转发设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;所述转发设备将扩展后的转发队列个数上报至所述计算设备,包括:所述转发设备查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。其中,所述扩展系数n可以根据转发设备的队列处理能力和计算设备的处理器的单个线程处理能力确定。In a specific implementation, the forwarding device includes an attribute register, and the number of the extended forwarding queues is stored in the attribute register; the forwarding device reporting the number of extended forwarding queues to the computing device includes: The forwarding device queries the attribute register, obtains the expanded number of forwarding queues from the attribute register, and reports the expanded number of forwarding queues to the computing device. Wherein, the expansion factor n may be determined according to the queue processing capability of the forwarding device and the single thread processing capability of the processor of the computing device.
S103:所述转发设备接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个队列。S103: The forwarding device receives a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue and The second host queues all belong to the multiple queues.
S104:所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据。S104: The forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, obtains the first to-be-sent data from the first host queue, and obtains the The second data to be sent is acquired from the second host queue.
S105:所述转发设备根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。S105: The forwarding device stores the first data to be sent and the second data to be sent into the first host queue and the first host queue, respectively, according to the queue correspondence between the forwarding queue and the host queue. Two forwarding queues corresponding to the host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
具体实现中,主机队列和转发队列可以理解为是一段内存,这段内存将被划分成若干等长的内存块,对应一个工作单元,每一个工作单元用于存储一个定长的消息,比如计算设备向转发设备发起的数据请求(读取请求或写入请求)。因此,与其他存储机制类似的,计算设备以及转发设备维护的每队列还包括头指针(Head)和尾指针(Tail),通过比较两个指针的位置,可以获取队列的存储情况。具体地,头指针的刷新规则为:指向队列中的下一个空位,尾指针的刷新规则为:指向下一个将要被执行的命令所在的位置。随着新的命令加入到队列中来,尾指针不停向前移动,随着命令不断被取出消费,头指针也在不停向前移动,因此该队列在逻辑上可以理解为一个如图5A所示的圆形循环队列。但是,应理解,队列中内存的实际状态是一个长条状的存储空间,如图5B所示,当头尾指针指向相同的位置时,意味着该队列当前为空队列,如图5C所示,而当尾指针的下一个指针就是头指针的时候,即head=Tail+1时,这个队列为满队列,不能再接收新的消息。应理解,上述举例仅用于说明,并不能构成具体限定。可以理解的,计算设备400中的每一个主机队列均包括头尾指针,因此,所述第一主机队列的信息包括第一头指针,所述第二主机队列的信息包括第二头指针。其中,所述第一头指针指示所述第一待发送数据,所述第二头指针指示所述第二待发送数据。比如,如图6所示,第一待发送数据位于第一主机队列中的4个单元A0-A3中,那么第一头指针可以指向A3,第二待发送数据位于第二主机队列中的3个单元B0-B2中,那么第二头指针可以指向B2,因此,计算设备400在步骤S103向转发设备300发送的第一门铃消息将包含第一头指针A3以及第二头指针B2。In specific implementation, the host queue and the forwarding queue can be understood as a section of memory. This section of memory will be divided into several memory blocks of equal length, corresponding to a unit of work. Each unit of work is used to store a fixed-length message, such as computing. The data request (read request or write request) initiated by the device to the forwarding device. Therefore, similar to other storage mechanisms, each queue maintained by the computing device and the forwarding device also includes a head pointer (Head) and a tail pointer (Tail). By comparing the positions of the two pointers, the storage status of the queue can be obtained. Specifically, the refresh rule of the head pointer is: point to the next empty position in the queue, and the refresh rule of the tail pointer: point to the location of the next command to be executed. As new commands are added to the queue, the tail pointer keeps moving forward. As the commands are continuously taken out for consumption, the head pointer also keeps moving forward. Therefore, the queue can be logically understood as shown in Figure 5A The circular circular queue shown. However, it should be understood that the actual state of the memory in the queue is a long strip of storage space, as shown in Figure 5B. When the head and tail pointers point to the same position, it means that the queue is currently empty, as shown in Figure 5C. When the next pointer of the tail pointer is the head pointer, that is, when head=Tail+1, the queue is full and no new messages can be received. It should be understood that the above examples are only for illustration and cannot constitute a specific limitation. It can be understood that each host queue in the computing device 400 includes a head and tail pointer. Therefore, the information of the first host queue includes a first head pointer, and the information of the second host queue includes a second head pointer. Wherein, the first head pointer indicates the first data to be sent, and the second head pointer indicates the second data to be sent. For example, as shown in Figure 6, the first data to be sent is located in 4 units A0-A3 in the first host queue, then the first head pointer can point to A3, and the second data to be sent is located in 3 in the second host queue. In each unit B0-B2, the second head pointer can point to B2. Therefore, the first doorbell message sent by the computing device 400 to the forwarding device 300 in step S103 will include the first head pointer A3 and the second head pointer B2.
相应地,所述转发设备300中也存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个主机队列中的一个主机队列的头指针和尾指针,所述转发设备中还存储有所述至少一个转发队列的至少一组头指针和至少一组尾指针。具体实现中,如图6所示,转发设备300还包括门铃寄存器,用于存储计算设备400中的第一主机队列和第二主机队列的头尾指针的值,以及转发设备中的转发队列的头指针和尾指针的值。Correspondingly, the forwarding device 300 also stores multiple sets of head pointers and multiple sets of tail pointers, and each set of head pointers and each set of tail pointers respectively correspond to the head pointers of one of the multiple host queues of the computing device. And tail pointers, the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue. In specific implementation, as shown in FIG. 6, the forwarding device 300 further includes a doorbell register for storing the head and tail pointer values of the first host queue and the second host queue in the computing device 400, and the value of the forwarding queue in the forwarding device. The value of the head pointer and tail pointer.
因此,步骤S104的具体步骤可以如下:Therefore, the specific steps of step S104 may be as follows:
S1041:所述转发设备从所述第一门铃消息中获取所述第一头指针和所述第二头指针。S1041: The forwarding device obtains the first head pointer and the second head pointer from the first doorbell message.
S1042:所述转发设备根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头指针。S1042: The forwarding device refreshes the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer.
S1043:所述转发设备根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针。S1043: The forwarding device refreshes the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer.
S1044:所述转发设备根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据。S1044: The forwarding device obtains the first host queue from the first host queue according to the head pointer corresponding to the first host queue after refreshing and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent.
S1045:所述转发设备根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据。S1045: The forwarding device obtains the second host queue from the second host queue according to the head pointer corresponding to the second host queue after the refresh and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent.
举例来说,如图6所示,当转发设备300接收到所述计算设备400发送的第一门铃消息后,首先,步骤S1041可以从该第一门铃消息中获取第一头指针A3以及第二头指针B2,步骤S1042可以根据第一门铃消息中获取的第一头指针A3,将门铃寄存器中存储的第一头指针的值也刷新为A3,同理,在步骤S1043,可以根据第一门铃消息中获取的第二头指针B2,将门铃寄存器中存储器中存储的第二头指针的值也刷新为B2。最后,转发设备通过比对门铃寄存器中刷新后的第一头指针A3与第一尾指针A0的值,从第一主机队列中获取第一待发送数据A0-A3,根据第二头指针B2与第二尾指针B0的值,从第二主机队列中获取第二待发送数据B0-B2。For example, as shown in FIG. 6, after the forwarding device 300 receives the first doorbell message sent by the computing device 400, first, step S1041 may obtain the first head pointer A3 and the second head pointer A3 from the first doorbell message. Head pointer B2. In step S1042, the value of the first head pointer stored in the doorbell register can also be refreshed to A3 according to the first head pointer A3 acquired in the first doorbell message. Similarly, in step S1043, the value of the first head pointer stored in the doorbell register can be updated to A3. The second head pointer B2 obtained in the message also refreshes the value of the second head pointer stored in the memory in the doorbell register to B2. Finally, the forwarding device obtains the first data to be sent A0-A3 from the first host queue by comparing the refreshed first head pointer A3 and the first tail pointer A0 in the doorbell register, and according to the second head pointer B2 and The value of the second tail pointer B0 obtains the second to-be-sent data B0-B2 from the second host queue.
可以理解的,转发设备在获取第一待发送数据以及第二待发送数据之后,在步骤S105,可以先根据步骤S102建立的队列对应关系,获取与第一主机队列以及第二主机队列对应的转发队列。然后将第一待发送数据以及第二待发送数据存入该转发队列中,完成一次数据通信。It is understandable that after the forwarding device obtains the first data to be sent and the second data to be sent, in step S105, it may first obtain the forwarding corresponding to the first host queue and the second host queue according to the queue correspondence established in step S102. queue. Then, the first data to be sent and the second data to be sent are stored in the forwarding queue to complete a data communication.
在一实施例中,所述转发设备将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应转发队列之后,所述方法还包括:刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;刷新所述对应的转发队列的头指针;将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。例如,如图6所示,转发设备在将第一待发送数据以及第二待发送数据存入与第一主机队列以及第二主机队列对应的转发队列C后,转发设备可以将门铃寄存器中转发队列C的尾指针刷新为C7,由于第一主机队列以及第二主机队列中的数据已经移入了转发队列C,因此第一主机队列的第一尾指针刷新为A3,第二主机队列的第二尾指针刷新为B3,并向计算设备发送第一尾指针以及第二尾指针的值,从而达到通知计算设备第一待发送数据以及第二待发送数据已被转发设备移走的目的。In an embodiment, after the forwarding device stores the first to-be-sent data and the second to-be-sent data into the forwarding queues corresponding to the first host queue and the second host queue, respectively, the method further includes : Refresh the tail pointer of the first host queue and the tail pointer of the second host queue; refresh the head pointer of the corresponding forwarding queue; refresh the tail pointer of the first host queue and the refreshed tail pointer The tail pointer of the second host queue is sent to the computing device. For example, as shown in FIG. 6, after the forwarding device stores the first data to be sent and the second data to be sent in the forwarding queue C corresponding to the first host queue and the second host queue, the forwarding device may forward the doorbell register The tail pointer of the queue C is refreshed to C7. Since the data in the first host queue and the second host queue have been moved into the forwarding queue C, the first tail pointer of the first host queue is refreshed to A3, and the second host queue is the second The tail pointer is refreshed to B3, and the values of the first tail pointer and the second tail pointer are sent to the computing device, so as to inform the computing device that the first data to be sent and the second data to be sent have been removed by the forwarding device.
综上,使用本申请提供的队列通信方法,转发设备通过向计算设备发送扩展后网卡队列数量的方式,使得将网卡硬件的使用性能得到充分挖掘,计算设备的线程报文转发率不再成为网卡处理报文转发的瓶颈,进一步避免了资源浪费。In summary, using the queue communication method provided in this application, the forwarding device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully exploited, and the thread message forwarding rate of the computing device no longer becomes the network card Dealing with the bottleneck of message forwarding, further avoiding resource waste.
下面基于图3所示的系统架构,描述本申请提供的队列扩展设备的队列通信方法,可以理解的,此时的转发设备300包括队列扩展设备500以及网卡600,所述转发设备300的至少一个转发队列包括至少一个队列扩展设备队列和至少一个网卡队列,所述至少一个队列扩展设备队列位于所述队列扩展设备500,所述至少一个网卡队列位于所述网卡600。所述队 列对应关系包括第一队列对应关系和第二队列对应关系,所述第一队列对应关系为所述多个主机队列与所述至少一个队列扩展设备队列的对应关系,所述第二队列对应关系为所述至少一个网卡队列与所述至少一个队列扩展设备队列的对应关系,所述至少一个网卡队列与所述至少一个队列扩展设备队列一一对应。如图7所示,所述队列通信的方法包括以下步骤:The following describes the queue communication method of the queue expansion device provided by the present application based on the system architecture shown in FIG. 3. It can be understood that the forwarding device 300 at this time includes the queue expansion device 500 and the network card 600, and at least one of the forwarding devices 300 The forwarding queue includes at least one queue expansion device queue and at least one network card queue, the at least one queue expansion device queue is located in the queue expansion device 500, and the at least one network card queue is located in the network card 600. The queue correspondence relationship includes a first queue correspondence relationship and a second queue correspondence relationship. The first queue correspondence relationship is a correspondence relationship between the plurality of host queues and the at least one queue extension device queue, and the second queue The correspondence relationship is the correspondence relationship between the at least one network card queue and the at least one queue expansion device queue, and the at least one network card queue corresponds to the at least one queue expansion device queue in a one-to-one correspondence. As shown in Figure 7, the queue communication method includes the following steps:
S201:所述计算设备400向所述队列扩展设备500发送设备查询消息。S201: The computing device 400 sends a device query message to the queue expansion device 500.
S202:所述队列扩展设备500向所述网卡600发送设备查询消息。S202: The queue expansion device 500 sends a device query message to the network card 600.
S203:所述网卡600将网卡队列个数上报至所述队列扩展设备500,从而建立队列扩展设备与网卡队列之间的第二队列对应关系。其中,所述网卡队列与队列扩展设备队列是一一对应的关系。具体实现中,所述队列扩展设备500包括属性寄存器,队列扩展设备500在接收到所述网卡600的网卡队列个数后,将网卡队列个数存入该属性寄存器中。S203: The network card 600 reports the number of network card queues to the queue expansion device 500, thereby establishing a second queue correspondence relationship between the queue expansion device and the network card queue. Wherein, the network card queue and the queue expansion device queue have a one-to-one correspondence. In a specific implementation, the queue expansion device 500 includes an attribute register, and the queue expansion device 500 stores the number of network card queues in the attribute register after receiving the number of network card queues of the network card 600.
S204:所述队列扩展设备500将扩展后的队列个数上报至所述计算设备400,从而建立队列扩展设备队列与主机队列之间的第一队列对应关系。其中,所述扩展后的队列个数由所述网卡队列个数和扩展系数确定。S204: The queue expansion device 500 reports the number of expanded queues to the computing device 400, so as to establish a first queue correspondence between the queue expansion device queue and the host queue. Wherein, the number of queues after expansion is determined by the number of queues of the network card and the expansion coefficient.
具体实现中,所述扩展后的队列个数存储在所述属性寄存器中。其中,所述队列扩展设备500可以通过查询所述属性寄存器,从所述属性寄存器中获取网卡队列个数后,根据扩展系数k计算获得扩展后的队列个数,并将所述扩展后的队列个数上报至所述计算设备。其中,扩展系数k可以是根据网卡的报文转发率a和计算设备的处理器单个线程的报文转发率b确定的。具体地,In specific implementation, the number of the expanded queues is stored in the attribute register. Wherein, the queue expansion device 500 may query the attribute register to obtain the number of network card queues from the attribute register, calculate the number of expanded queues according to the expansion coefficient k, and calculate the number of expanded queues. The number is reported to the computing device. The expansion coefficient k may be determined according to the message forwarding rate a of the network card and the message forwarding rate b of a single thread of the processor of the computing device. specifically,
Figure PCTCN2020113497-appb-000001
Figure PCTCN2020113497-appb-000001
举例来说,假设网卡的报文转发率为a=2Mpps,计算设备的处理器单个线程的报文转发率为b=0.5Mpps,那么此时的扩展比例k≤4。For example, suppose that the message forwarding rate of the network card is a=2Mpps, and the message forwarding rate of a single thread of the processor of the computing device is b=0.5Mpps, then the expansion ratio k≤4 at this time.
S205:所述队列扩展设备500接收来自所述计算设备400的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列。S205: The queue expansion device 500 receives a first doorbell message from the computing device 400, where the first doorbell message carries information about the first host queue and information about the second host queue, and the first Both the host queue and the second host queue belong to the multiple host queues.
S206:所述队列扩展设备500从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据。S206: The queue expansion device 500 obtains the information of the first host queue and the information of the second host queue from the first doorbell message, and obtains the first data to be sent from the first host queue. Obtain the second to-be-sent data from the second host queue.
S207:所述队列扩展设备500根据所述第一队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述队列扩展设备队列中与第一主机队列和第二主机队列对应的队列扩展设备队列,从而将计算设备中的第一主机队列以及第二主机队列中的待发送数据存入所述队列扩展设备500中的队列扩展设备队列中。S207: The queue expansion device 500 stores the first to-be-sent data and the second to-be-sent data into the queue of the queue expansion device respectively according to the correspondence between the first queue and the first host queue and the second queue. The queue expansion device queue corresponding to the second host queue, so that the data to be sent in the first host queue and the second host queue in the computing device are stored in the queue expansion device queue in the queue expansion device 500.
S208:所述网卡600接收来自所述队列扩展设备500的第二门铃消息,其中,所述第二门铃消息中携带有对应的队列扩展设备队列的信息,所述对应的队列扩展设备队列属于述所队列扩展设备队列。S208: The network card 600 receives a second doorbell message from the queue expansion device 500, where the second doorbell message carries information about a corresponding queue expansion device queue, and the corresponding queue expansion device queue belongs to the description. The queue expands the device queue.
S209:所述所述网卡600从所述第二门铃消息中获取所述对应的队列扩展设备队列的信息,从所述对应的队列扩展设备队列中获取第一待发送数据以及第二待发送数据。S209: The network card 600 obtains the information of the corresponding queue expansion device queue from the second doorbell message, and obtains the first data to be sent and the second data to be sent from the corresponding queue expansion device queue .
S210:所述所述网卡600根据所述第二队列对应关系,将所述第一待发送数据和所述第二待发送数据存入所述网卡队列中与对应的队列扩展设备队列对应的网卡队列,从而将计算设备中的主机队列中的待发送数据存入所述网卡600中的网卡队列中。S210: The network card 600 stores the first to-be-sent data and the second to-be-sent data into the network card corresponding to the corresponding queue expansion device queue in the network card queue according to the second queue correspondence Queue, so as to store the data to be sent in the host queue in the computing device into the network card queue in the network card 600.
参考前述图5A-图5C的内容可知,计算设备400中的每一个主机队列均包括头尾指针, 网卡600中的每一个网卡队列均包括头尾指针,因此,相应的,所述至少一组头指针和所述至少一组尾指针存储于所述队列扩展设备500,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针500与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应。具体实现中,如图8所示,所述队列扩展设备500包括第一门铃寄存器,用于存储计算设备400中的第一主机队列和第二主机队列的头尾指针的值,以及队列扩展设备500中的转发队列的头指针和尾指针的值。网卡600包括第二门铃寄存器,用于存储队列扩展设备500中的对应的队列扩展设备队列的头指针和尾指针的值,以及网卡600中的网卡队列的头指针和尾指针的值。With reference to the content of FIGS. 5A-5C, it can be seen that each host queue in the computing device 400 includes a head and tail pointer, and each network card queue in the network card 600 includes a head and tail pointer. Therefore, correspondingly, the at least one set of The head pointer and the at least one set of tail pointers are stored in the queue expansion device 500, the network card stores at least one set of network card head pointers and at least one set of network card tail pointers, and the at least one set of queue expansion device head pointers 500 corresponds to the at least one set of network card head pointers, and the at least one set of queue expansion device tail pointers corresponds to the at least one set of network card tail pointers. In a specific implementation, as shown in FIG. 8, the queue expansion device 500 includes a first doorbell register for storing the head and tail pointer values of the first host queue and the second host queue in the computing device 400, and the queue expansion device The value of the head pointer and tail pointer of the forwarding queue in 500. The network card 600 includes a second doorbell register for storing the head pointer and tail pointer values of the corresponding queue expansion device queue in the queue expansion device 500, and the head pointer and tail pointer values of the network card queue in the network card 600.
因此,参考图4实施例中从第一门铃信息获取第一待发送数据以及第二待发送数据的具体流程可知,步骤S206中,队列扩展设备从第一门铃信息中获取第一待发送数据以及第二待发送数据的具体步骤可以是:Therefore, referring to the specific process of obtaining the first data to be sent and the second data to be sent from the first doorbell information in the embodiment of FIG. 4, in step S206, the queue expansion device obtains the first data to be sent from the first doorbell information and The specific steps of the second data to be sent may be:
S2061:所述队列扩展设备从所述第一门铃消息中获取所述第一头指针和所述第二头指针;S2061: The queue expansion device obtains the first head pointer and the second head pointer from the first doorbell message;
S2062:所述队列扩展设备根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的队列扩展队列的头指针;S2062: The queue expansion device refreshes the head pointer of the queue expansion queue corresponding to the first host queue among the sets of head pointers according to the first head pointer and the corresponding relationship of the first queue;
S2063:所述队列扩展设备根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;S2063: The queue expansion device obtains all data from the first host queue according to the head pointer corresponding to the first host queue after refreshing and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent;
S2064:所述队列扩展设备根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;S2064: The queue expansion device refreshes the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue;
S2065:所述队列扩展设备根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据。S2065: The queue expansion device obtains all data from the second host queue according to the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent.
上述步骤S2061-S2065中的具体细节可以参考图6实施例中,转发设备从第一门铃信息获得第一待发送数据以及第二待发送数据的过程,这里不再进行赘述。For the specific details of the above steps S2061-S2065, reference may be made to the process in which the forwarding device obtains the first data to be sent and the second data to be sent from the first doorbell information in the embodiment of FIG. 6, which will not be repeated here.
可以理解的,当队列扩展设备在步骤S206获取第一待发送数据以及第二待发送数据后,将会根据第一队列对应关系,确定第一主机队列以及第二主机队列对应的队列扩展设备队列,即对应的队列扩展设备队列,然后将第一待发送数据以及第二待发送数据存入对应的队列扩展设备队列中,并刷新所述对应的队列扩展设备队列的头指针,向网卡600发送包含第三头指针的第二门铃信息,使得网卡重复上述步骤,根据第二门铃信息中的第三头指针,从对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据,并根据第二队列对应关系,确定对应的队列扩展设备队列对应的网卡队列,即对应的网卡队列,将将第一待发送数据以及第二待发送数据存入对应的网卡队列中去。也就是说,所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,包括:所述转发设备中的队列扩展设备从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述转发设备从所述第一主机队列中获取第一待发送数据,包括:所述转发设备中的队列扩展设备根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;所述转发设备中的队列扩展设备根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述转发设备从所述第二主机队列中获取第二待发送数据,包括:所述转发设备中的队列扩展设备根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;所述转发设备中的队列扩展设备根据刷新后所述 第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述转发设备将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列包括:所述转发设备中的队列扩展设备根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;所述转发设备中的队列扩展设备刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;所述转发设备中的网卡接收来自所述队列扩展设备的第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针;所述转发设备中的网卡从所述第二门铃消息中获取所述对应的队列扩展设备队列的头指针;所述转发设备中的网卡根据所述对应的队列扩展设备队列的头指针,以及所述第二队列对应关系,刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针;所述转发设备中的网卡根据刷新后所述对应的网卡头指针,和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据;所述转发设备中的网卡根据所述第二队列对应关系,将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列,其中,所述对应的网卡队列属于所述网卡队列。应理解,上述过程的具体细节可以参考前述图4以及图6实施例,这里不再进行赘述。It is understandable that after the queue expansion device obtains the first data to be sent and the second data to be sent in step S206, it will determine the queue expansion device queues corresponding to the first host queue and the second host queue according to the corresponding relationship of the first queue. , That is, the corresponding queue expansion device queue, and then the first data to be sent and the second data to be sent are stored in the corresponding queue expansion device queue, and the head pointer of the corresponding queue expansion device queue is refreshed and sent to the network card 600 The second doorbell information including the third head pointer causes the network card to repeat the above steps. According to the third head pointer in the second doorbell information, obtain the first data to be sent and the second data to be sent from the corresponding queue expansion device queue According to the corresponding relationship of the second queue, the network card queue corresponding to the corresponding queue expansion device queue is determined, that is, the corresponding network card queue, and the first data to be sent and the second data to be sent are stored in the corresponding network card queue. That is to say, that the forwarding device acquires the information of the first host queue and the information of the second host queue from the first doorbell message includes: the queue expansion device in the forwarding device obtains information from the first host queue. Obtaining the first head pointer and the second head pointer from a doorbell message; the forwarding device obtaining the first to-be-sent data from the first host queue includes: the queue expansion device in the forwarding device according to The first head pointer and the first queue correspondence relationship, refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers; the queue expansion device in the forwarding device is based on the refreshed first A head pointer corresponding to a host queue, and a tail pointer corresponding to the first host queue in the multiple sets of tail pointers, acquire the first data to be sent in the first host queue; the forwarding device obtains the first data to be sent from the first host queue; Obtaining the second data to be sent from the second host queue includes: the queue expansion device in the forwarding device refreshes the data in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue. The head pointer corresponding to the second host queue; the queue expansion device in the forwarding device is based on the head pointer corresponding to the second host queue after being refreshed, and the tail corresponding to the second host queue in the multiple sets of tail pointers Pointer to obtain the second data to be sent in the second host queue; the forwarding device stores the first data to be sent and the second data to be sent into the first host queue and the first host queue respectively The forwarding queue corresponding to the second host queue includes: the queue expansion device in the forwarding device stores the first to-be-sent data and the second to-be-sent data in the first host according to the first queue correspondence relationship The queue and the queue expansion device queue corresponding to the second host queue, wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the at least one queue The same queue in the expansion device queue expands the device queue; the queue expansion device in the forwarding device refreshes the head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail of the second host queue Pointer; the network card in the forwarding device receives a second doorbell message from the queue expansion device, wherein the second doorbell message carries the head pointer of the corresponding queue expansion device queue; in the forwarding device The network card obtains the head pointer of the corresponding queue expansion device queue from the second doorbell message; the network card in the forwarding device expands the device queue head pointer according to the corresponding queue and the second queue correspondence relationship , Refresh the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one set of network card head pointers; the network card in the forwarding device is refreshed according to the corresponding network card head pointer, and the at least The tail pointer corresponding to the corresponding queue expansion device queue in a set of network card tail pointers, and the first data to be sent and the second data to be sent are acquired in the corresponding queue expansion device queue; in the forwarding device According to the second Queue correspondence relationship, storing the first to-be-sent data and the second to-be-sent data in a network card queue corresponding to the corresponding queue expansion device queue, wherein the corresponding network card queue belongs to the network card queue. It should be understood that, for the specific details of the foregoing process, reference may be made to the foregoing embodiments in FIG. 4 and FIG. 6, and details are not described herein again.
在一实施例中,所述第一待发送数据可以是第一直接内存存取(Direct Memory Access,DMA)读描述符,用于将计算设备处的第一待读取数据,发送至所述网卡,所述第二待发送数据可以是第二DMA读描述符,用于将计算设备处的第二待读取数据,发送至所述网卡。参考前述内容可知,一个队列的实际形态其实是一段被划分成若干等长的内存块,对应一个工作单元,每一个工作单元用于存储一个定长的消息,也就是说,每个工作单元的存储容量非常小,假如计算设备当前需要向网卡发送第一待读取数据,此时可以将第一待读取数据的DMA读描述符作为待发送数据,放入主机队列中。其中,DMA读描述符可以包括第一待读取数据的读取地址、数据包长度以及描述信息等等,而经过步骤S201-S210,网卡可以在接收到计算设备发送的DMA描述符后,可以生成直接从计算设备读取第一待读取数据的DMA读命令。In an embodiment, the first data to be sent may be a first Direct Memory Access (DMA) read descriptor, which is used to send the first data to be read at the computing device to the Network card, the second data to be sent may be a second DMA read descriptor, which is used to send the second data to be read from the computing device to the network card. With reference to the foregoing content, we can see that the actual form of a queue is actually a segment divided into several equal-length memory blocks, corresponding to a unit of work, and each unit of work is used to store a fixed-length message, that is, the size of each unit of work The storage capacity is very small. If the computing device currently needs to send the first data to be read to the network card, the DMA read descriptor of the first data to be read can be used as the data to be sent and placed in the host queue. Among them, the DMA read descriptor may include the read address of the first data to be read, the length of the data packet, and description information, etc., and after steps S201-S210, the network card may receive the DMA descriptor sent by the computing device. Generate a DMA read command that directly reads the first data to be read from the computing device.
具体实现中,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:所述转发设备中的网卡根据所述第一DMA读描述符以及所述第二DMA读描述符,生成第一DMA读命令以及第二DMA读命令;所述转发设备中的网卡向所述转发设备中的队列扩展设备发送所述第一DMA读命令以及第二DMA读命令;所述转发设备中的队列扩展设备根据所述第一DMA读命令从所述计算设备获取第一待读取数据,根据所述第二DMA读命令从所述计算设备获取第二待读取数据;所述转发设备中的队列扩展设备将所述第一待读取数据和所述第二待读取数据转发至所述转发设备中的网卡。In a specific implementation, the first data to be sent is a first direct memory access DMA read descriptor, the second data to be sent is a second DMA read descriptor, and the first data to be sent is combined with the first data to be sent. 2. After the data to be sent is stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: the network card in the forwarding device reads the descriptor according to the first DMA read descriptor and the second DMA read Descriptor, generating a first DMA read command and a second DMA read command; the network card in the forwarding device sends the first DMA read command and the second DMA read command to the queue expansion device in the forwarding device; The queue expansion device in the forwarding device obtains the first data to be read from the computing device according to the first DMA read command, and obtains the second data to be read from the computing device according to the second DMA read command; The queue expansion device in the forwarding device forwards the first data to be read and the second data to be read to the network card in the forwarding device.
第二待读取数据第二待读取数据第二待读取数据在一实施例中,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于 将第二待写入数据从所述队列扩展设备写入所述计算设备。第二待写入数据与上述DMA读描述符不同之处在于,由于网卡接收到的数据通常为分片数据,比如,第一待写入数据可以以n个第一分片数据的形式传输至所述网卡,如果网卡每收到一个第一分片数据就发送给计算设备,计算设备将接收到许多乱序的第一分片数据,增加计算设备的处理压力。因此,队列扩展设备还包括存储器,比如双倍数据率同步动态随机存取存储器(Double Data Rate Synchronous Dynamic Random Access Memory,DDR SDRAM)。具体实现中,队列扩展设备可以将先将从网卡处接收的第一分片数据存储在DDR中,当第一待写入数据的n个分片数据全部集齐后,再将第一待写入数据发送给计算设备。因此,在步骤S207处,队列扩展设备需要将接收到的用于写入计算设备的DMA写描述符,转换为写入所述队列扩展设备的网卡DMA写描述符。Second data to be read second data to be read second data to be read In one embodiment, the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA Write descriptor, wherein the first DMA write descriptor is used to write the first data to be written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written to the computing device. Incoming data is written from the queue expansion device to the computing device. The difference between the second data to be written and the above-mentioned DMA read descriptor is that the data received by the network card is usually fragmented data. For example, the first data to be written can be transferred to n first fragmented data. For the network card, if the network card sends the first fragmented data to the computing device every time it receives the first fragmented data, the computing device will receive a lot of out-of-order first fragmented data, which increases the processing pressure of the computing device. Therefore, the queue expansion device also includes memory, such as Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM). In specific implementation, the queue expansion device can store the first fragment data received from the network card in the DDR, and when all n fragments of the first data to be written are collected, then the first data to be written Incoming data is sent to the computing device. Therefore, at step S207, the queue expansion device needs to convert the received DMA write descriptor used for writing to the computing device into a network card DMA write descriptor written to the queue expansion device.
具体实现中,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,所述将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列包括:所述转发设备中的队列扩展设备将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;所述转发设备中的队列扩展设备将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:所述转发设备中的网卡根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第二网卡DMA写描述符,获取存储于所述网卡中的,与所述第二网卡DMA写描述符对应的第二分片数据,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;所述转发设备中的网卡根据所述第一网卡DMA写描述符以及所述第一分片数据生成第一DMA写命令,根据所述第二网卡DMA写描述符以及所述第二分片数据生成第二DMA写命令;所述转发设备中的网卡向所述队列扩展设备发送所述第一DMA写命令以及所述第二DMA写命令;所述转发设备中的队列扩展设备根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;在所述转发设备中的队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;所述转发设备中的所述队列扩展设备向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令,使得所述计算设备根据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。第二待写入数据第二待写入数据第二待写入数据第二待写入数据第二待写入数据在一实施例中,所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:所述转发设备中网卡向所述队列扩展设备发送完成消息和中断消息;所述转发设备中队列扩展 设备向所述计算设备发送所述完成消息和中断,使得所述计算设备根据所述完成消息,刷新第一主机队列以及第二主机队列的尾指针。具体实现中,当转发设备或者网卡处理完读命令或者写命令后,还会在网卡队列中写入命令完成信息,并与中断消息一同发送至队列扩展设备,队列扩展设备再将该中断消息和命令完成信息发送给计算设备,从而彻底完成一次数据通信的流程。In a specific implementation, the first data to be sent is a first DMA write descriptor, the second data to be sent is a second DMA write descriptor, and the first DMA write descriptor is used to transfer the first DMA write descriptor. The write data is written from the queue expansion device to the computing device, the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device, and the The storage of the first data to be sent and the second data to be sent in the first host queue and the queue expansion device queue corresponding to the second host queue includes: the queue expansion device in the forwarding device writes the first DMA The descriptor is converted into a first network card DMA write descriptor, and the second DMA write descriptor is converted into a second network card DMA write descriptor, where the first DMA write descriptor is used to transfer the first data to be written The queue expansion device is written from the network card, and the second DMA descriptor is used to write the second data to be written from the network card into the queue expansion device; the queue expansion device in the forwarding device will The first network card DMA write descriptor and the second network card DMA write descriptor are stored in the corresponding queue expansion device queue; the first data to be sent and the second data to be sent are stored in the After the corresponding queue expands the network card queue corresponding to the device queue, the method further includes: the network card in the forwarding device obtains, according to the first network card DMA write descriptor, the data stored in the network card and the first network card According to the first segment data corresponding to the DMA write descriptor of a network card, obtain the second segment stored in the network card and corresponding to the second network card DMA write descriptor according to the DMA write descriptor of the second network card Data, wherein the first data to be written includes n first fragments of data, and the second data to be written includes m second fragments of data; the network card in the forwarding device is based on the first The network card DMA write descriptor and the first fragmented data generate a first DMA write command, and the second network card DMA write descriptor and the second fragmented data generate a second DMA write command; in the forwarding device The network card in the forwarding device sends the first DMA write command and the second DMA write command to the queue expansion device; the queue expansion device in the forwarding device according to the first DMA write command and the second DMA write command , Write the first fragment data and the second fragment data into the memory of the queue expansion device; in the memory of the queue expansion device in the forwarding device, the number of the first fragment data is n In this case, a third DMA write command is generated according to the first data to be written, and a fourth DMA write command is generated according to the second data to be written when the number of the second fragmented data is m. DMA write command, wherein the third DMA write command is used for the computing device to execute and write the first data to be written into the computing device, and the fourth DMA write command is used for the computing device The computing device executes and writes the first data to be written into the computing device; the queue expansion device in the forwarding device sends the The computing device sends the third DMA write command and the fourth DMA write command, so that the computing device writes the first to-be-written command according to the third DMA write command and the fourth DMA write command The data and the second data to be written are written into the computing device. The second data to be written, the second data to be written, the second data to be written, the second data to be written, and the second data to be written. After the sending data is stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: the network card in the forwarding device sends a completion message and an interrupt message to the queue expansion device; the queue in the forwarding device The extension device sends the completion message and interrupt to the computing device, so that the computing device refreshes the tail pointers of the first host queue and the second host queue according to the completion message. In specific implementation, after the forwarding device or the network card has processed the read command or the write command, it will also write the command completion information in the network card queue, and send it to the queue expansion device together with the interrupt message, and the queue expansion device will then add the interrupt message to the queue expansion device. The command completion information is sent to the computing device, thereby completely completing a data communication process.
综上,使用本申请提供的队列通信方法,队列扩展设备在获取网卡中的网卡队列个数后,通过向计算设备发送扩展后网卡队列数量的方式,使得将网卡硬件的使用性能得到充分挖掘,虚拟机的线程报文转发率不再成为网卡处理报文转发的瓶颈,进一步避免了资源浪费。In summary, using the queue communication method provided in this application, after obtaining the number of network card queues in the network card, the queue expansion device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully explored. The thread message forwarding rate of the virtual machine no longer becomes a bottleneck for the network card to process message forwarding, further avoiding resource waste.
如图8所示,下面以第一待发送数据以及第二待发送数据为DMA读描述符的应用场景为例(计算设备向网卡发送第一待读取数据以及第二待读取读数据),对图7描述的队列通信方法进行举例说明。As shown in Figure 8, the following takes the application scenario where the first data to be sent and the second data to be sent are DMA read descriptors as an example (the computing device sends the first data to be read and the second data to be read to the network card) , Give an example of the queue communication method described in FIG. 7.
如图8所示,假设队列扩展系数n=2,队列扩展设备已与网卡生成了第二队列对应关系,与计算设备生成了第一队列对应关系,并将两种队列对应关系存入了队列映射表中。其中,第一主机队列A和第二主机队列B与对应的队列扩展设备队列C之间存在第一队列对应关系,对应的队列扩展设备队列C和对应的网卡队列D之间存在第二队列对应关系。当前,计算设备需要向网卡600发送第一待读取数据以及第二待读取数据,那么具体的通信流程可以如下:As shown in Figure 8, assuming that the queue expansion coefficient n=2, the queue expansion device has generated the second queue correspondence with the network card, and the first queue correspondence with the computing device, and stored the two queue correspondences in the queue. Mapping table. There is a first queue correspondence between the first host queue A and the second host queue B and the corresponding queue expansion device queue C, and there is a second queue correspondence between the corresponding queue expansion device queue C and the corresponding network card queue D relationship. Currently, the computing device needs to send the first data to be read and the second data to be read to the network card 600, so the specific communication process may be as follows:
1、计算设备400将第一待读取数据的DMA读描述符,也就是第一待发送数据,放入第一主机队列A的4个队列单元中,将第二待读取数据的DMA读描述符,也就是第二待发送数据,放入第二主机队列B的3个队列单元中。1. The computing device 400 puts the DMA read descriptor of the first data to be read, that is, the first data to be sent, into the 4 queue units of the first host queue A, and reads the DMA of the second data to be read The descriptor, that is, the second data to be sent, is put into the 3 queue units of the second host queue B.
2、计算设备400刷新第一主机队列的第一头指针值为A3,刷新第二主机队列的第二头指针的值为B3。2. The computing device 400 refreshes the value of the first head pointer of the first host queue to A3, and refreshes the value of the second head pointer of the second host queue to B3.
3、计算设备400向队列扩展设备500发送第一门铃消息。3. The computing device 400 sends the first doorbell message to the queue expansion device 500.
4、队列扩展设备500从所述第一门铃消息中获取所述第一头指针A3和所述第二头指针B3。4. The queue expansion device 500 obtains the first head pointer A3 and the second head pointer B3 from the first doorbell message.
5、队列扩展设备500刷新第一门铃寄存器中的第一头指针为A3,第二头指针为B2。5. The queue expansion device 500 refreshes the first head pointer in the first doorbell register as A3, and the second head pointer as B2.
6、队列扩展设备500根据刷新后的第一门铃寄存器中,第一主机队列的头尾指针为A3和A0,向计算设备获取A0-A3这4个队列单元的数据,也就是第一待发送数据,同理,向计算设备获取第二待发送数据。6. The queue expansion device 500 obtains the data of the four queue units A0-A3 from the computing device according to the refreshed first doorbell register, the head and tail pointers of the first host queue are A3 and A0, that is, the first to be sent Data, similarly, obtain the second to-be-sent data from the computing device.
7、队列扩展设备500根据第一映射关系,确定与第一主机队列A以及第二主机队列B对应的队列扩展设备队列C,并将第一待发送数据(4个队列单元)以及第二待发送数据(3个队列单元)放入所述对应的队列扩展设备队列C。7. The queue expansion device 500 determines the queue expansion device queue C corresponding to the first host queue A and the second host queue B according to the first mapping relationship, and combines the first to-be-sent data (4 queue units) and the second to-be-sent data The sending data (3 queue units) is put into the corresponding queue expansion device queue C.
8、队列扩展设备500刷新对应的队列扩展设备队列C的第三头指针的值为C7。8. The queue expansion device 500 refreshes the value of the third head pointer of the corresponding queue expansion device queue C to C7.
9、队列扩展设备500向网卡600发送第二门铃消息。9. The queue expansion device 500 sends the second doorbell message to the network card 600.
10、网卡600从所述第二门铃消息中获取所述第三头指针的值C7。10. The network card 600 obtains the value C7 of the third head pointer from the second doorbell message.
11、网卡600刷新第二门铃寄存器中的第三头指针的值C7。11. The network card 600 refreshes the value C7 of the third head pointer in the second doorbell register.
12、网卡600根据刷新后的第二门铃寄存器中,对应的队列扩展设备队列的头尾指针为C7和C0,向队列扩展设备500获取C0-C7这7个队列单元的数据,也就是第一待发送数据和第二待发送数据。12. The network card 600 obtains the data of the 7 queue units C0-C7 from the queue expansion device 500 according to the refreshed second doorbell register, the head and tail pointers of the corresponding queue expansion device queue are C7 and C0, that is, the first The data to be sent and the second data to be sent.
13、网卡600根据第二映射关系,确定与对应的队列扩展设备队列C对应的网卡队列D, 并将第一待发送数据以及第二待发送数据共7个队列单元放入所述对应的网卡队列D。13. The network card 600 determines the network card queue D corresponding to the corresponding queue expansion device queue C according to the second mapping relationship, and puts a total of 7 queue units of the first data to be sent and the second data to be sent into the corresponding network card Queue D.
14、网卡600刷新对应的网卡队列D的第四头指针的值为D7。14. The network card 600 refreshes the value of the fourth head pointer of the corresponding network card queue D to D7.
15、网卡600根据7个队列单元中的DMA描述符,生成第一DMA读命令以及第二DMA读命令,并将其发送至队列扩展设备500。15. The network card 600 generates a first DMA read command and a second DMA read command according to the DMA descriptors in the 7 queue units, and sends them to the queue expansion device 500.
16、队列扩展设备500将第一DMA读命令以及第二DMA读命令透传给计算设备。16. The queue expansion device 500 transparently transmits the first DMA read command and the second DMA read command to the computing device.
17、计算设备400根据所述第一DMA读命令以及第二DMA读命令,获取与所述第一DMA读命令以及第二DMA读命令对应的,计算设备400中存储的第一待读取数据和第二待读取数据。17. The computing device 400 obtains the first to-be-read data stored in the computing device 400 corresponding to the first DMA read command and the second DMA read command according to the first DMA read command and the second DMA read command And the second data to be read.
18、计算设备400向所述队列扩展设备500发送所述第一待读取数据和第二待读取数据.18.The computing device 400 sends the first data to be read and the second data to be read to the queue expansion device 500.
19、队列扩展设备500向网卡600发送所述第一待读取数据和第二待读取数据。19. The queue expansion device 500 sends the first data to be read and the second data to be read to the network card 600.
20、网卡600更新对应的队列扩展设备队列C的尾指针为C7。20. The network card 600 updates the tail pointer of the corresponding queue expansion device queue C to C7.
21、网卡600向队列扩展设备发送完成队列单元和中断,并将第三尾指针C7的值携带给队列扩展设备500,使得队列扩展设备500刷新所述第一门铃寄存器中第三尾指针的值。21. The network card 600 sends the completion queue unit and interrupt to the queue expansion device, and carries the value of the third tail pointer C7 to the queue expansion device 500, so that the queue expansion device 500 refreshes the value of the third tail pointer in the first doorbell register .
22、队列扩展设备500解析完成队列单元和中断,刷新第一门铃寄存器中的第一主机队列的第一尾指针的值为A3,第二主机队列的第二尾指针的值为B2,产生新的完成队列单元和中断发送给计算设备,使得计算设备可以刷新自己维护的第一主机队列尾指针以及第二主机队列尾指针,完成本次第一待读取数据和第二待读取数据的发送。22. The queue expansion device 500 parses and completes the queue unit and interrupt, refreshes the value of the first tail pointer of the first host queue in the first doorbell register as A3, and the value of the second tail pointer of the second host queue is B2, and generates a new The completion queue unit and interrupt are sent to the computing device, so that the computing device can refresh the tail pointer of the first host queue and the tail pointer of the second host queue maintained by itself, and complete the first data to be read and the second data to be read. send.
可以理解的,使用本申请提供的队列通信方法,队列扩展设备在获取网卡中的网卡队列个数后,通过向计算设备发送扩展后网卡队列数量的方式,使得将网卡硬件的使用性能得到充分挖掘,虚拟机的线程报文转发率不再成为网卡处理报文转发的瓶颈,进一步避免了资源浪费。It is understandable that using the queue communication method provided in this application, after obtaining the number of network card queues in the network card, the queue expansion device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully exploited , The thread message forwarding rate of the virtual machine no longer becomes the bottleneck of the network card processing message forwarding, further avoiding the waste of resources.
如图9所示,下面以第一待发送数据以及第二待发送数据为DMA写描述符的应用场景为例(网卡向计算设备发送第一待写入数据以及第二待写入数据),对图7描述的队列通信方法进行举例说明。As shown in FIG. 9, the following takes the application scenario where the first data to be sent and the second data to be sent are DMA write descriptors as an example (the network card sends the first data to be written and the second data to be written to the computing device), The queue communication method described in FIG. 7 is illustrated by an example.
如图9所示,假设队列扩展系数n=2,队列扩展设备已与网卡生成了第二队列对应关系,与计算设备生成了第一队列对应关系,并将两种队列对应关系存入了队列映射表中。其中,第一主机队列A和第二主机队列B与对应的队列扩展设备队列C之间存在第一队列对应关系,对应的队列扩展设备队列C和对应的网卡队列D之间存在第二队列对应关系。当前,网卡600需要向计算设备500发送第一待写入数据以及第二待写入数据,那么具体的通信流程可以如下:As shown in Figure 9, assuming that the queue expansion coefficient n=2, the queue expansion device has generated the second queue correspondence with the network card, and the first queue correspondence with the computing device, and stored the two queue correspondences in the queue. Mapping table. There is a first queue correspondence between the first host queue A and the second host queue B and the corresponding queue expansion device queue C, and there is a second queue correspondence between the corresponding queue expansion device queue C and the corresponding network card queue D relationship. Currently, the network card 600 needs to send the first data to be written and the second data to be written to the computing device 500, so the specific communication process may be as follows:
1、计算设备400将第一待写入数据的第一DMA写描述符,也就是第一待发送数据,放入第一主机队列A的4个队列单元中,将第二待写入数据的第二DMA写描述符,也就是第二待发送数据,放入第二主机队列B的3个队列单元中。其中,所述第一DMA写描述符用于将第一待写入数据写入所述计算设备,所述第二DMA描述符用于将第二待写入数据写入所述计算设备。1. The computing device 400 puts the first DMA write descriptor of the first data to be written, that is, the first data to be sent into the 4 queue units of the first host queue A, and transfers the second data to be written The second DMA write descriptor, that is, the second data to be sent, is put into the 3 queue units of the second host queue B. The first DMA write descriptor is used to write first data to be written into the computing device, and the second DMA descriptor is used to write second data to be written into the computing device.
2、计算设备400刷新第一主机队列的第一头指针值为A3,刷新第二主机队列的第二头指针的值为B2。2. The computing device 400 refreshes the first host queue with a first head pointer value of A3, and refreshes the second host queue with a second head pointer value of B2.
3、计算设备400向队列扩展设备500发送第一门铃消息。3. The computing device 400 sends the first doorbell message to the queue expansion device 500.
4、队列扩展设备500从所述第一门铃消息中获取所述第一头指针A3和所述第二头指针 B2。4. The queue expansion device 500 obtains the first head pointer A3 and the second head pointer B2 from the first doorbell message.
5、队列扩展设备500刷新第一门铃寄存器中的第一头指针为A3,第二头指针为B2。5. The queue expansion device 500 refreshes the first head pointer in the first doorbell register as A3, and the second head pointer as B2.
6、队列扩展设备500根据刷新后的第一门铃寄存器中,第一主机队列的头尾指针为A3和A0,向计算设备获取A0-A3这4个队列单元的数据,也就是第一DMA写描述符,同理,向计算设备获取第二DMA写描述符。6. The queue expansion device 500 obtains the data of the four queue units A0-A3 from the computing device according to the refreshed first doorbell register, the head and tail pointers of the first host queue are A3 and A0, that is, the first DMA write The descriptor, in the same way, obtains the second DMA write descriptor from the computing device.
7、队列扩展设备500将所述第一DMA写描述符转化为第一网卡DMA写描述符,将所述第二DMA写描述符转化为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据写入所述队列扩展设备,所述第一DMA写描述符用于将第二待写入数据写入所述队列扩展设备。7. The queue expansion device 500 converts the first DMA write descriptor into a first network card DMA write descriptor, and converts the second DMA write descriptor into a second network card DMA write descriptor, where the first The DMA write descriptor is used to write the first data to be written into the queue expansion device, and the first DMA write descriptor is used to write the second data to be written into the queue expansion device.
8、队列扩展设备500根据第一映射关系,确定与第一主机队列A以及第二主机队列B对应的队列扩展设备队列C,并将转化后的第一DMA写描述符(4个队列单元)以及第二DMA写描述符(3个队列单元)放入所述对应的队列扩展设备队列C。8. The queue expansion device 500 determines the queue expansion device queue C corresponding to the first host queue A and the second host queue B according to the first mapping relationship, and writes the converted first DMA descriptor (4 queue units) And the second DMA write descriptor (3 queue units) is put into the corresponding queue expansion device queue C.
9、队列扩展设备500刷新对应的队列扩展设备队列C的第三头指针的值为C7。9. The queue expansion device 500 refreshes the value of the third head pointer of the corresponding queue expansion device queue C to C7.
10、队列扩展设备500向网卡600发送第二门铃消息。10. The queue expansion device 500 sends the second doorbell message to the network card 600.
11、网卡600从所述第二门铃消息中获取所述第三头指针的值C7。11. The network card 600 obtains the value C7 of the third head pointer from the second doorbell message.
12、网卡600刷新第二门铃寄存器中的第三头指针的值C7。12. The network card 600 refreshes the value C7 of the third head pointer in the second doorbell register.
13、网卡600根据刷新后的第二门铃寄存器中,对应的队列扩展设备队列的头尾指针为C7和C0,向队列扩展设备500获取C0-C7这7个队列单元的数据,也就是转化后的第一DMA写描述符以及第二DMA写描述符。13. According to the refreshed second doorbell register, the network card 600 obtains the data of the 7 queue units C0-C7 from the queue expansion device 500 according to the head and tail pointers of the corresponding queue expansion device queue as C7 and C0, that is, after conversion The first DMA write descriptor and the second DMA write descriptor.
14、网卡600根据第二映射关系,确定与对应的队列扩展设备队列C对应的网卡队列D,并将第一待发送数据以及第二待发送数据共7个队列单元放入所述对应的网卡队列D。14. The network card 600 determines the network card queue D corresponding to the corresponding queue expansion device queue C according to the second mapping relationship, and puts a total of 7 queue units of the first data to be sent and the second data to be sent into the corresponding network card Queue D.
15、网卡600刷新对应的网卡队列D的第四头指针的值为D7。15. The network card 600 refreshes the value of the fourth head pointer of the corresponding network card queue D to D7.
16、网卡600根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第二网卡DMA写描述符,获取存储于所述网卡中的,与所述第二网卡DMA写描述符对应的第二分片数据,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据。16. The network card 600 obtains, according to the first network card DMA write descriptor, the first fragmented data stored in the network card and corresponds to the first network card DMA write descriptor, and writes according to the second network card DMA write descriptor. Descriptor, acquiring the second fragmented data stored in the network card and corresponding to the DMA write descriptor of the second network card, wherein the first data to be written includes n pieces of first fragmented data, so The second data to be written includes m pieces of second data.
17、网卡600根据所述第一网卡DMA写描述符以及所述第一分片数据生成第一DMA写命令,根据所述第二网卡DMA写描述符与所述第二分片数据生成第二DMA写命令。17. The network card 600 generates a first DMA write command according to the first network card DMA write descriptor and the first fragment data, and generates a second DMA write command according to the second network card DMA write descriptor and the second fragment data. DMA write command.
18、网卡600更新对应的队列扩展设备队列C的尾指针为C7,并向所述队列扩展设备发送所述第一DMA写命令以及所述第二DMA写命令,以及发送完成队列单元和中断,并将第三尾指针C7的值携带给队列扩展设备500,使得队列扩展设备500刷新所述第一门铃寄存器中第三尾指针的值。18. The network card 600 updates the tail pointer of the corresponding queue expansion device queue C to C7, and sends the first DMA write command and the second DMA write command to the queue expansion device, as well as the sending completion queue unit and interrupt, The value of the third tail pointer C7 is carried to the queue expansion device 500, so that the queue expansion device 500 refreshes the value of the third tail pointer in the first doorbell register.
19、队列扩展设备根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中,并刷新所述第一门铃寄存器中第三尾指针的值。19. The queue expansion device writes the first fragmented data and the second fragmented data into the memory of the queue expansion device according to the first DMA write command and the second DMA write command, and refreshes all Describe the value of the third tail pointer in the first doorbell register.
20、队列扩展设备500解析完成队列单元和中断,根据队列完成单元的地址信息,确定第一待写入数据以及第二待写入数据写入所述计算设备的写入地址,从而在第一分片数据的数量为n的情况下,根据上述写入地址和第一待写入数据生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,根据上述写入地址和第二待写入数据生成第四DMA写命令,刷新第一门铃寄存器中的第一主机队列的第一尾指针的值为A3,第二主机队列的第二尾指针 的值为B2,产生新的完成队列单元以及中断。20. The queue expansion device 500 parses the completion queue unit and the interrupt, and according to the address information of the queue completion unit, determines the write addresses of the first data to be written and the second data to be written to the computing device, so that the first When the number of fragmented data is n, a third DMA write command is generated according to the above write address and the first data to be written, and when the number of second fragmented data is m, according to the above write The address and the second data to be written generate the fourth DMA write command, the value of the first tail pointer of the first host queue in the first doorbell register is refreshed is A3, and the value of the second tail pointer of the second host queue is B2. Generate a new completion queue unit and interrupt.
21、在队列扩展设备500的存储器中,第一分片数据的数量为n的情况下,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备。21. In the memory of the queue expansion device 500, when the number of the first fragmented data is n, generate the third DMA write command, and when the number of the second fragmented data is m, generate the fourth DMA write command, wherein the third DMA write command is used for the computing device to execute and write the first data to be written into the computing device, and the fourth DMA write command is used for the computing device The computing device executes and writes the first data to be written into the computing device.
22、所述队列扩展设备向所述计算设备发送所述第三DMA写命令、第四DMA写命令、新的完成队列单元和中断,使得计算设备可以刷新自己维护的第一主机队列尾指针以及第二主机队列尾指针,完成本次第一待读取数据和第二待读取数据的发送。22. The queue expansion device sends the third DMA write command, the fourth DMA write command, the new completion queue unit and the interrupt to the computing device, so that the computing device can refresh the tail pointer of the first host queue maintained by itself and The second host queue tail pointer completes the sending of the first data to be read and the second data to be read this time.
23、所述计算设备根据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。完成本次队列通信的过程。23. The computing device writes the first data to be written and the second data to be written into the computing device according to the third DMA write command and the fourth DMA write command. Complete the process of this queue communication.
可以理解的,使用本申请提供的队列通信方法,队列扩展设备在获取网卡中的网卡队列个数后,通过向计算设备发送扩展后网卡队列数量的方式,使得将网卡硬件的使用性能得到充分挖掘,虚拟机的线程报文转发率不再成为网卡处理报文转发的瓶颈,进一步避免了资源浪费。It is understandable that using the queue communication method provided in this application, after obtaining the number of network card queues in the network card, the queue expansion device sends the expanded network card queue number to the computing device, so that the performance of the network card hardware can be fully exploited , The thread message forwarding rate of the virtual machine no longer becomes the bottleneck of the network card processing message forwarding, further avoiding the waste of resources.
结合上文图1-图9所示的相关实施例,下面阐述本申请实施例涉及的相关装置。请参见图10,图10是本申请提供的一种转发设备的结构示意图。所述转发设备300与计算设备连接,所述转发设备包括至少一个转发队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,其中,所述转发设备包括接收单元310、获取单元320、存储单元330、响应单元340以及刷新单元350。With reference to the related embodiments shown in FIGS. 1 to 9 above, the related devices involved in the embodiments of the present application are described below. Please refer to FIG. 10, which is a schematic structural diagram of a forwarding device provided by the present application. The forwarding device 300 is connected to a computing device, the forwarding device includes at least one forwarding queue, the computing device includes a plurality of host queues, and a plurality of data to be sent are stored in the plurality of host queues, wherein the forwarding device The device includes a receiving unit 310, an acquiring unit 320, a storage unit 330, a response unit 340, and a refresh unit 350.
所述接收单元310用于接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;The receiving unit 310 is configured to receive a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue And the second host queue both belong to the multiple host queues;
所述获取单元320用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;The acquiring unit 320 is configured to acquire the information of the first host queue and the information of the second host queue from the first doorbell message, acquire the first to-be-sent data from the first host queue, and from Acquiring second data to be sent from the second host queue;
所述存储单元330用于根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。The storage unit 330 is configured to store the first data to be sent and the second data to be sent into the first host queue respectively according to the queue correspondence between the forwarding queue and the host queue. A forwarding queue corresponding to the second host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
在一实施例中,所述转发设备还包括响应单元340,所述接收单元310还用于在所述接收单元接收来自所述计算设备的第一门铃消息之前,接收来自所述计算设备的设备查询消息;所述响应单元340用于响应于所述设备查询消息,将扩展后的转发队列个数上报至所述计算设备,其中,所述扩展后的转发队列个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立所述队列对应关系。In an embodiment, the forwarding device further includes a response unit 340, and the receiving unit 310 is further configured to receive the device from the computing device before the receiving unit receives the first doorbell message from the computing device Query message; the response unit 340 is configured to report the number of extended forwarding queues to the computing device in response to the device query message, wherein the number of extended forwarding queues is forwarded by the at least one The number of queues and the expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence.
在一实施例中,所述转发设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中,所述响应单元340用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。In an embodiment, the forwarding device includes an attribute register, the number of the expanded forwarding queues is stored in the attribute register, and the response unit 340 is configured to query the attribute register and obtain the information from the attribute register. The number of the extended forwarding queues is acquired, and the number of the extended forwarding queues is reported to the computing device.
在一实施例中,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待 发送数据,所述转发设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个队列中的一个队列的头指针和尾指针,所述转发设备中还存储有所述至少一个队列的至少一组头指针和至少一组尾指针;所述转发设备还包括刷新单元350,所述获取单元320用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述刷新单元350用于根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头指针;所述获取单元320用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述刷新单元350用于根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针;所述获取单元用320于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述刷新单元350用于将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应转发队列之后,刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;所述刷新单元350用于刷新所述对应的转发队列的头指针;所述刷新单元350用于将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。In an embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so The second head pointer indicates the second data to be sent, and multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to multiple queues of the computing device The forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one queue; the forwarding device further includes a refresh unit 350, and the acquiring The unit 320 is configured to obtain the first head pointer and the second head pointer from the first doorbell message; the refresh unit 350 is configured to refresh all the groups of head pointers according to the first head pointer. The head pointer corresponding to the first host queue; the obtaining unit 320 is configured to use the head pointer corresponding to the first host queue after refreshing and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers, Acquiring the first data to be sent in the first host queue; the refresh unit 350 is configured to refresh the head pointer corresponding to the second host queue in the plurality of sets of head pointers according to the second head pointer; The acquiring unit 320 is used to acquire all the data from the second host queue according to the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent; the refresh unit 350 is configured to store the first data to be sent and the second data to be sent into the forwarding queues corresponding to the first host queue and the second host queue respectively, and then refresh The tail pointer of the first host queue and the tail pointer of the second host queue; the refresh unit 350 is used to refresh the head pointer of the corresponding forwarding queue; the refresh unit 350 is used to refresh all the The tail pointer of the first host queue and the refreshed tail pointer of the second host queue are sent to the computing device.
需要说明的,图10仅仅是本申请实施例的一种实现方式,本申请实施例中提到的多个模块或单元,本领域技术人员应该知道上述多个模块或单元的功能可以拆分到更多的子模块或子单元中,也可以组合成更少的模块或单元中实现同样的技术效果,因此都应落入本申请实施例的保护范围It should be noted that FIG. 10 is only an implementation of the embodiment of the present application. For the multiple modules or units mentioned in the embodiment of the present application, those skilled in the art should know that the functions of the foregoing multiple modules or units can be split into More sub-modules or sub-units can also be combined into fewer modules or units to achieve the same technical effect, so they should all fall into the protection scope of the embodiments of this application
图11是本申请提供的一种队列扩展设备的结构示意图。所述队列扩展设备和计算设备连接,所述网卡和所述计算设备连接,所述队列扩展设备包括至少一个队列扩展设备队列,所述网卡包括至少一个网卡队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据。如图11所示,所述队列扩展设备500包括接收单元510、获取单元520、存储单元530、发送单元540、响应单元550、刷新单元560Fig. 11 is a schematic structural diagram of a queue expansion device provided by the present application. The queue expansion device is connected to a computing device, the network card is connected to the computing device, the queue expansion device includes at least one queue expansion device queue, the network card includes at least one network card queue, and the computing device includes multiple hosts A queue, a plurality of data to be sent are stored in the plurality of host queues. As shown in FIG. 11, the queue expansion device 500 includes a receiving unit 510, an acquiring unit 520, a storage unit 530, a sending unit 540, a response unit 550, and a refresh unit 560.
所述接收单元510用于接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;The receiving unit 510 is configured to receive a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue And the second host queue both belong to the multiple host queues;
所述获取单元520用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;The obtaining unit 520 is configured to obtain the information of the first host queue and the information of the second host queue from the first doorbell message, obtain the first to-be-sent data from the first host queue, and from Acquiring second data to be sent from the second host queue;
所述存储单元530用于根据所述队列扩展设备队列和所述主机队列之间的第一队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列;The storage unit 530 is configured to store the first data to be sent and the second data to be sent into the first queue respectively according to the first queue correspondence between the queue expansion device queue and the host queue. A host queue and a queue expansion device queue corresponding to the second host queue;
所述发送单元540用于向所述网卡发送第二门铃消息,所述第二门铃消息中携带有所述对应的队列扩展设备队列的信息,使得所述网卡根据所述第二门铃消息,从所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据,并根据所述网卡队列和所述队列扩展设备队列之间的第二队列对应关系,将所述第一待发送数据和所述第二待发送数据存入所述对应的队列扩展设备队列对应的网卡队列中,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列 扩展设备队列中的同一个队列扩展设备队列,所述对应的网卡队列属于所述网卡队列。The sending unit 540 is configured to send a second doorbell message to the network card, and the second doorbell message carries the information of the corresponding queue expansion device queue, so that the network card receives information from the network card according to the second doorbell message. The first data to be sent and the second data to be sent are acquired from the corresponding queue expansion device queue, and according to the second queue correspondence between the network card queue and the queue expansion device queue, the second queue A data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first The host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue, and the corresponding network card queue belongs to the network card queue.
在一实施例中,所述设备还包括响应单元550,所述接收单元510还用于在接收来自所述计算设备的第一门铃消息之前,接收来自所述计算设备的第一设备查询消息;所述发送单元540用于向所述网卡送第二设备查询消息;所述响应单元550用于接收所述网卡发送的网卡队列个数,其中,所述网卡队列个数用于建立所述第二队列对应关系;所述响应单元550用于响应于所述第一设备查询消息,将扩展后的队列扩展设备队列个数上报至所述计算设备,其中,所述扩展后的队列扩展设备队列个数由所述网卡队列个数和扩展系数确定,所述扩展后的队列扩展设备队列个数用于建立所述第一队列对应关系。In an embodiment, the device further includes a response unit 550, and the receiving unit 510 is further configured to receive a first device query message from the computing device before receiving the first doorbell message from the computing device; The sending unit 540 is configured to send a second device query message to the network card; the response unit 550 is configured to receive the number of network card queues sent by the network card, wherein the number of network card queues is used to establish the first Correspondence between two queues; the response unit 550 is configured to report the number of expanded queue expansion device queues to the computing device in response to the first device query message, wherein the expanded queue expansion device queue The number is determined by the number of network card queues and an expansion coefficient, and the expanded number of queue expansion device queues is used to establish the first queue correspondence relationship.
在一实施例中,所述设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;所述响应单元550还用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的队列扩展设备队列个数,将所述扩展后的队列扩展设备队列个数上报至所述计算设备。In an embodiment, the device includes an attribute register, and the number of the expanded forwarding queues is stored in the attribute register; the response unit 550 is further configured to query the attribute register, and obtain information from the attribute register. The number of queues of the expanded queue expansion device is acquired, and the number of queues of the expanded queue expansion device is reported to the computing device.
在一实施例中,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述队列扩展设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述多个主机队列中的一个主机队列的头指针和尾指针,所述队列扩展设备中还存储有至少一组队列扩展设备头指针和至少一组队列扩展设备尾指针,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应,所述队列扩展设备还包括刷新单元560,所述获取单元520用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;所述刷新单元560用于根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;所述获取单元520用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;所述刷新单元560用于根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;所述获取单元520用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;所述存储单元530用于根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;所述刷新单元560用于刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;所述发送单元540还用于向所述网卡发送所述第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针,使得所述网卡根据所述对应的队列扩展设备队列的头指针以及所述第二队列对应关系刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针,并刷新后所述对应的网卡头指针和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据,从而根据所述第二队列对应关系,将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列。In an embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first to-be-sent data, and the information about the second host queue includes a second head pointer, so The second head pointer indicates the second data to be sent, and the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, and each set of head pointers and each set of tail pointers respectively correspond to the multiple host queues The head pointer and the tail pointer of a host queue in, the queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device tail pointers, and at least one set of network cards is stored in the network card A head pointer and at least one set of network card tail pointers, the at least one set of queue extension device head pointers correspond to the at least one set of network card head pointers, and the at least one set of queue extension device tail pointers corresponds to the at least one set of network card head pointers. There is a one-to-one correspondence between the tail pointers of the network card, the queue expansion device further includes a refresh unit 560, and the acquisition unit 520 is configured to acquire the first head pointer and the second head pointer from the first doorbell message; The refreshing unit 560 is configured to refresh the head pointers corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer and the first queue correspondence; the acquiring unit 520 is configured to refresh according to After refreshing, the head pointer corresponding to the first host queue, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers, acquire the first data to be sent in the first host queue; The refresh unit 560 is configured to refresh the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue; the acquiring unit 520 is configured to refresh according to After refreshing, the head pointer corresponding to the second host queue, and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers, acquire the second data to be sent in the second host queue; The storage unit 530 is configured to store the first data to be sent and the second data to be sent in the queue expansion device queues corresponding to the first host queue and the second host queue according to the corresponding relationship of the first queue , Wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue; The refresh unit 560 is configured to refresh the head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail pointer of the second host queue; the sending unit 540 is also configured to send a message to the network card Sending the second doorbell message, wherein the second doorbell message carries the head pointer of the corresponding queue expansion device queue, so that the network card expands the head pointer of the device queue according to the corresponding queue and the first pointer Correspondence of the two queues: refresh the head pointer of the corresponding queue expansion device in the at least one set of network card head pointers, and refresh the corresponding network card head pointer and the at least one set of network card tail pointers The tail pointer corresponding to the corresponding queue expansion device queue described in , Acquiring the first data to be sent and the second data to be sent in the corresponding queue expansion device queue, so as to combine the first data to be sent and the second data to be sent according to the corresponding relationship of the second queue Stored in the network card queue corresponding to the corresponding queue expansion device queue.
在一实施例中,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,所述接收单元510还用于接收所述网卡发送的第一DMA读命令以及第二DMA读命令,其中,其中,所述第一DMA读命令是所述网卡根据所述第一DMA描述符生成的,所述第二DMA读命令是所述网卡根据所述第二DMA描述符生成的;所述获取单元520还用于根据第一DMA读命令从所述计算设备获取第一待读取数据,根据第二DMA读命令从所述计算设备获取第二待读取数据;所述发送单元540还用于将所述第一待读取数据和所述第二待读取数据转发至所述网卡。In an embodiment, the first data to be sent is a first direct memory access DMA read descriptor, the second data to be sent is a second DMA read descriptor, and the receiving unit 510 is further configured to receive The first DMA read command and the second DMA read command sent by the network card, wherein, the first DMA read command is generated by the network card according to the first DMA descriptor, and the second DMA read command is The network card is generated according to the second DMA descriptor; the obtaining unit 520 is further configured to obtain the first data to be read from the computing device according to the first DMA read command, and obtain the first data to be read from the computing device according to the second DMA read command. The computing device obtains the second data to be read; the sending unit 540 is further configured to forward the first data to be read and the second data to be read to the network card.
在一实施例中,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,所述设备还包括转换单元570,所述转换单元570用于将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;所述存储单元530用于将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;所述接收单元510用于接收第一DMA写命令以及所述第二DMA写命令,其中,所述第一DMA写命令是所述网卡根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第一网卡DMA写描述符以及所述第一分片数据生成的第一DMA写命令,所述第二DMA写命令是所述网卡根据所述第二网卡DMA写描述符,获取存储于所述网卡中的与所述第二网卡DMA写描述符对应的第二分片数据之后,根据所述第二网卡DMA写描述符以及所述第二分片数据生成的第二DMA写命令,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;所述存储单元530用于根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;所述转换单元570用于在所述队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;所述发送单元540用于向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令,使得所述计算设备根据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。In an embodiment, the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA write descriptor, wherein the first DMA write descriptor is used to transfer the first DMA write descriptor. A data to be written is written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device, and the device It also includes a conversion unit 570, which is configured to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor , Wherein the first DMA write descriptor is used to write the first data to be written from the network card to the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card to the queue expansion device. The network card is written into the queue expansion device; the storage unit 530 is configured to store the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion device queue; The receiving unit 510 is configured to receive a first DMA write command and the second DMA write command, where the first DMA write command is obtained by the network card according to the first network card DMA write descriptor and stored in the network card In the first segment data corresponding to the first network card DMA write descriptor, the first DMA write command generated according to the first network card DMA write descriptor and the first segment data, the first The second DMA write command is that after the network card obtains the second fragment data stored in the network card corresponding to the second network card DMA write descriptor according to the second network card DMA write descriptor, according to the first The second network card DMA write descriptor and the second DMA write command generated by the second fragmented data, wherein the first to-be-written data includes n pieces of first fragmented data, and the second to-be-written data includes m second fragmented data; the storage unit 530 is configured to write the first fragmented data and the second fragmented data into the first fragmented data according to the first DMA write command and the second DMA write command In the memory of the queue expansion device; the conversion unit 570 is configured to generate a third piece of data according to the first data to be written when the number of first fragmented data in the memory of the queue expansion device is n. DMA write command, when the number of the second fragmented data is m, a fourth DMA write command is generated according to the second data to be written, wherein the third DMA write command is used for The computing device executes and writes the first data to be written into the computing device, and the fourth DMA write command is used for the computing device to execute and write the first data to be written into the computing device. The computing device; the sending unit 540 is configured to send the third DMA write command and the fourth DMA write command to the computing device, so that the computing device according to the third DMA write command and the first Four DMA write commands to write the first data to be written and the second data to be written into the computing device.
在一实施例中,所述接收单元510还用于接收所述网卡发送的完成消息和中断,其中,其中,所述完成消息和中断是所述网卡在将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后生成的;所述发送单元540还用于向所述计算设备发送完成消息和中断,使得所述计算设备根据所述完成消息刷新第一主机队列以及第二主机队列的尾指针。In an embodiment, the receiving unit 510 is further configured to receive a completion message and an interrupt sent by the network card, where the completion message and the interrupt are when the network card is sending the first data to be sent and the first data to be sent. 2. The data to be sent is generated after being stored in the network card queue corresponding to the corresponding queue expansion device queue; the sending unit 540 is also configured to send a completion message and an interrupt to the computing device, so that the computing device according to the The completion message refreshes the tail pointers of the first host queue and the second host queue.
需要说明的,图11仅仅是本申请实施例的一种实现方式,本申请实施例中提到的多个模块或单元,本领域技术人员应该知道上述多个模块或单元的功能可以拆分到更多的子模块或子单元中,也可以组合成更少的模块或单元中实现同样的技术效果,因此都应落入本申请实施例的保护范围。It should be noted that FIG. 11 is only an implementation of the embodiment of the present application. For the multiple modules or units mentioned in the embodiment of the present application, those skilled in the art should know that the functions of the foregoing multiple modules or units can be split into More sub-modules or sub-units can also be combined into fewer modules or units to achieve the same technical effect, and therefore all should fall within the protection scope of the embodiments of the present application.
图12是本申请实施例提供的一种转发设备的结构示意图,如图12所示,其中,转发设备700包括一个或多个处理器701、通信接口702和存储器703。其中,处理器801、通信接口702和存储器703之间可以通过总线704连接。总线704可以是外设部件互连标准(Peripheral Component Interconnect,简称PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等。所述总线704可以分为地址总线、数据总线、控制总线等。为便于表示,图12中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。FIG. 12 is a schematic structural diagram of a forwarding device provided by an embodiment of the present application. As shown in FIG. 12, the forwarding device 700 includes one or more processors 701, a communication interface 702, and a memory 703. Wherein, the processor 801, the communication interface 702, and the memory 703 may be connected through a bus 704. The bus 704 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 704 can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 12 to represent it, but it does not mean that there is only one bus or one type of bus.
具体实现中,处理器701包括一个或者多个通用处理器,其中,通用处理器可以是能够处理电子指令的任何类型的设备,包括CPU、微处理器、微控制器、主处理器、控制器以及ASIC等等。处理器701执行各种类型的数字存储指令,例如存储在存储器703中的软件或者固件程序,它能使计算设备提供较宽的多种服务。本申请实施例中,处理器701执行存储器703中的程序指令以实现前述图4、图6中的方法。例如,所述处理器701可以包括队列扩展模块、映射模块以及队列转发模块等等,其中,队列扩展模块可以通过调用存储器703中的程序代码以实现处理功能,例如计算扩展后队列的个数;映射模块可以通过调用存储器304中的程序代码以实现处理功能,生成主机队列与转发队列之间的队列对应关系;队列转发模块可以通过调用存储器703中的程序代码以实现处理功能,实现与计算设备的队列通信。处理器701还可以包括其他模块,用于执行图4和图6实施例描述的其他步骤,这里不再进行赘述。In a specific implementation, the processor 701 includes one or more general-purpose processors, where the general-purpose processor may be any type of device capable of processing electronic instructions, including a CPU, a microprocessor, a microcontroller, a main processor, and a controller. And ASIC and so on. The processor 701 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 703, which enables the computing device to provide a wide variety of services. In the embodiment of the present application, the processor 701 executes the program instructions in the memory 703 to implement the aforementioned methods in FIG. 4 and FIG. 6. For example, the processor 701 may include a queue expansion module, a mapping module, a queue forwarding module, etc., where the queue expansion module may implement processing functions by calling program codes in the memory 703, such as calculating the number of expanded queues; The mapping module can realize the processing function by calling the program code in the memory 304, and generate the queue correspondence between the host queue and the forwarding queue; the queue forwarding module can realize the processing function by calling the program code in the memory 703, and realize the connection with the computing device. Queue communication. The processor 701 may also include other modules for executing other steps described in the embodiment of FIG. 4 and FIG. 6, which will not be repeated here.
通信接口702可以为有线接口(例如以太网接口),用于与与其他设备或模块进行通信。The communication interface 702 may be a wired interface (for example, an Ethernet interface) for communicating with other devices or modules.
存储器703可以包括易失性存储器(Volatile Memory),例如随机存取存储器(Random Access Memory,RAM);存储器也可以包括非易失性存储器(Non-Volatile Memory),例如只读存储器(Read-Only Memory,ROM)、快闪存储器(Flash Memory)、硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD)存储器还可以包括上述种类的存储器的组合。存储器703可以包括门铃寄存器、属性寄存器以及转发队列,其中,门铃寄存器用于存储至少一组队列的头尾指针,属性寄存器用于存储扩展后队列的个数,转发队列用于存储由计算设备400发送的待发送数据。应理解,上述举例仅用于说明,存储器703还可以包括映射关系表,所述映射关系表用于存储队列对应关系,还可以用于存储其他程序代码或者程序数据,以供处理器实现图4和图6-图9实施例描述的其他步骤,这里不再进行赘述。The memory 703 may include a volatile memory (Volatile Memory), such as a random access memory (Random Access Memory, RAM); the memory may also include a non-volatile memory (Non-Volatile Memory), such as a read-only memory (Read-Only Memory). Memory, ROM, Flash Memory, Hard Disk Drive (HDD), or Solid-State Drive (SSD) memory may also include a combination of the foregoing types of memories. The memory 703 may include a doorbell register, an attribute register, and a forwarding queue. The doorbell register is used to store the head and tail pointers of at least one set of queues, the attribute register is used to store the number of expanded queues, and the forwarding queue is used to store 400 The data to be sent sent. It should be understood that the above examples are only for illustration, and the memory 703 may also include a mapping relationship table, which is used to store queue correspondences, and may also be used to store other program codes or program data for the processor to implement FIG. 4 And the other steps described in the embodiment of FIG. 6 to FIG. 9, which will not be repeated here.
图13是本申请提供的一种队列扩展设备800的结构示意图。如图13所示,队列扩展设备800包括处理器802、存储器504、端点端口501和根端口503。其中,端口端点501、根端口505以及存储器504均通过总线505与处理器502相连。FIG. 13 is a schematic structural diagram of a queue expansion device 800 provided by the present application. As shown in FIG. 13, the queue expansion device 800 includes a processor 802, a memory 504, an endpoint port 501, and a root port 503. Among them, the port endpoint 501, the root port 505, and the memory 504 are all connected to the processor 502 through a bus 505.
其中,队列扩展设备800包括一个或多个处理器801、通信接口802和存储器803。其中,处理器801、通信接口802和存储器803之间可以通过总线804连接。总线804可以是PCI总线或EISA总线等。所述总线704可以分为地址总线、数据总线、控制总线等。为便于表示,图13中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The queue expansion device 800 includes one or more processors 801, a communication interface 802, and a memory 803. Wherein, the processor 801, the communication interface 802, and the memory 803 may be connected through a bus 804. The bus 804 may be a PCI bus, an EISA bus, or the like. The bus 704 can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 13, but it does not mean that there is only one bus or one type of bus.
具体实现中,处理器802包括一个或者多个通用处理器,其中,通用处理器可以是能够处理电子指令的任何类型的设备,包括CPU、微处理器、微控制器、主处理器、控制器以及ASIC等等。处理器802执行各种类型的数字存储指令,例如存储在存储器804中的软件或者 固件程序,它能使计算设备提供较宽的多种服务。本申请实施例中,处理器801执行存储器803中的程序指令以实现前述图7、图8和图9中的方法。例如,所述处理器802可以包括队列扩展模块、映射模块以及队列转发模块等等,其中,队列扩展模块可以通过调用存储器804中的程序代码以实现处理功能,例如计算扩展后队列的个数;映射模块可以通过调用存储器804中的程序代码以实现处理功能,生成主机队列与队列扩展队列之间的第一队列对应关系,或者生成队列扩展队列与网卡队列之间的第二队列对应关系等等;队列转发模块可以通过调用存储器804中的程序代码以实现处理功能,对接收到的来自计算设备的待发送数据,完成在扩展队列设备到网卡之间的转发。处理器还可以包括其他模块,用于执行图5-图9实施例描述的其他步骤,这里不再进行赘述。In a specific implementation, the processor 802 includes one or more general-purpose processors, where the general-purpose processor may be any type of device capable of processing electronic instructions, including a CPU, a microprocessor, a microcontroller, a main processor, and a controller. And ASIC and so on. The processor 802 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 804, which enables the computing device to provide a wide variety of services. In the embodiment of the present application, the processor 801 executes the program instructions in the memory 803 to implement the aforementioned methods in FIG. 7, FIG. 8, and FIG. 9. For example, the processor 802 may include a queue expansion module, a mapping module, a queue forwarding module, etc., where the queue expansion module may implement processing functions by calling program codes in the memory 804, such as calculating the number of expanded queues; The mapping module can realize the processing function by calling the program code in the memory 804, generate the first queue correspondence between the host queue and the queue expansion queue, or generate the second queue correspondence between the queue expansion queue and the network card queue, etc. The queue forwarding module can realize the processing function by calling the program code in the memory 804, and complete the forwarding between the extended queue device and the network card for the received data to be sent from the computing device. The processor may also include other modules for executing other steps described in the embodiments in FIG. 5 to FIG. 9, and details are not described herein again.
通信接口802可以为有线接口(例如以太网接口),用于与与其他设备或模块进行通信。The communication interface 802 may be a wired interface (for example, an Ethernet interface) for communicating with other devices or modules.
存储器804可以包括易失性存储器,例如RAM;存储器也可以包括非易失性存储器,例如ROM、快闪存储器、HDD或SSD。存储器还可以包括上述种类的存储器的组合。存储器804可以包括第一门铃寄存器、属性寄存器以及队列扩展设备队列,其中,第一门铃寄存器用于存储至少一组队列的头尾指针,属性寄存器用于存储扩展后队列的个数,队列扩展设备队列用于存储由计算设备发送的待发送数据,应理解,上述举例仅用于说明,存储器804还可以包括映射关系表,所述映射关系表用于存储第一队列对应关系以及第二队列对应关系,所述存储器804还可以用于存储第一分片数据以及第二分片数据等,还可以用于存储其他程序代码或者程序数据,以供处理器实现图7-图9实施例描述的其他步骤,这里不再进行赘述。The memory 804 may include volatile memory, such as RAM; the memory may also include non-volatile memory, such as ROM, flash memory, HDD, or SSD. The memory may also include a combination of the above-mentioned types of memories. The memory 804 may include a first doorbell register, an attribute register, and a queue expansion device queue. The first doorbell register is used to store the head and tail pointers of at least one set of queues, and the attribute register is used to store the number of expanded queues. The device queue is used to store the to-be-sent data sent by the computing device. It should be understood that the above example is only for illustration, and the memory 804 may also include a mapping relationship table for storing the correspondence between the first queue and the second queue. Corresponding relationship, the memory 804 can also be used to store the first segment data and the second segment data, etc., and can also be used to store other program codes or program data for the processor to implement the description of the embodiments in FIGS. 7-9 The other steps are not repeated here.
需要说明的,图12、图13仅仅是本申请实施例的一种可能的实现方式,实际应用中,转发设备700以及队列扩展设备800还可以包括更多或更少的部件,这里不作限制。关于本申请实施例中未示出或未描述的内容,可参见前述图1-图9所述实施例中的相关阐述,这里不再赘述。It should be noted that FIG. 12 and FIG. 13 are only a possible implementation manner of the embodiment of the present application. In actual applications, the forwarding device 700 and the queue expansion device 800 may also include more or fewer components, which are not limited here. Regarding the content that is not shown or described in the embodiments of the present application, please refer to the relevant descriptions in the embodiments described in FIG. 1 to FIG. 9, which will not be repeated here.
如图11中所示的队列扩展设备500可以通过逻辑电路实现,具体的,可以通过专用集成电路(Application-Specific Integrated Circuit,ASIC)实现,或可编程逻辑器件(Programmable Logic Device,PLD)实现,上述PLD可以是复杂程序逻辑器件(Complex Programmable Logical Device,CPLD),现场可编程门阵列(Field-Programmable Gate Array,FPGA),通用阵列逻辑(Generic Array Logic,GAL)或其任意组合,本申请不作具体限定。The queue expansion device 500 shown in FIG. 11 can be implemented by a logic circuit, specifically, it can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (Programmable Logic Device, PLD). The above-mentioned PLD can be a Complex Programmable Logical Device (CPLD), a Field-Programmable Gate Array (FPGA), a Generic Array Logic (GAL), or any combination thereof. This application does not Specific restrictions.
本发明实施例还提供一种计算机非瞬态存储介质,所述计算机非瞬态存储介质中存储有指令,当其在处理器上运行时,图4、图6-图9中所描述的任一方法流程得以实现。The embodiment of the present invention also provides a computer non-transitory storage medium, the computer non-transitory storage medium stores instructions, when it runs on the processor, any of the descriptions in FIGS. 4, 6 and 9 A method flow is realized.
本发明实施例还提供一种计算机程序产品,当所述计算机程序产品在处理器上运行时,图4、图6-图9中所描述的任一方法流程得以实现。The embodiment of the present invention also provides a computer program product. When the computer program product runs on a processor, the process of any method described in FIGS. 4 and 6 to 9 can be realized.
结合本发明实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM、闪存、ROM、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另 外,该ASIC可以位于计算设备中。当然,处理器和存储介质也可以作为分立组件存在于计算设备中。The steps of the method or algorithm described in combination with the disclosure of the embodiment of the present invention may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, which can be stored in RAM, flash memory, ROM, erasable programmable read-only memory (Erasable Programmable ROM, EPROM), and electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), registers, hard disk, mobile hard disk, CD-ROM or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in the ASIC. In addition, the ASIC may be located in the computing device. Of course, the processor and the storage medium may also exist as discrete components in the computing device.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The program can be stored in a computer readable storage medium, and the program can be stored in a computer readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments. The aforementioned storage media include: ROM, RAM, magnetic disks or optical disks and other media that can store program codes.

Claims (31)

  1. 一种队列通信的方法,其特征在于,所述方法应用于转发设备,所述转发设备与计算设备连接,所述转发设备包括至少一个转发队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,所述方法包括:A method for queue communication, wherein the method is applied to a forwarding device, the forwarding device is connected to a computing device, the forwarding device includes at least one forwarding queue, the computing device includes multiple host queues, and the A plurality of data to be sent is stored in a plurality of host queues, and the method includes:
    所述转发设备接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;The forwarding device receives a first doorbell message from the computing device, where the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue and the The second host queues all belong to the multiple host queues;
    所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;The forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, obtains the first data to be sent from the first host queue, and obtains the first data to be sent from the first host queue. 2. Obtain the second data to be sent from the host queue;
    所述转发设备根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。The forwarding device stores the first to-be-sent data and the second to-be-sent data into the first host queue and the second host respectively according to the queue correspondence between the forwarding queue and the host queue A forwarding queue corresponding to the queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  2. 根据权利要求1所述的方法,其特征在于,所述转发设备接收来自所述计算设备的第一门铃消息之前,所述方法还包括:The method according to claim 1, wherein before the forwarding device receives the first doorbell message from the computing device, the method further comprises:
    所述转发设备接收来自所述计算设备的设备查询消息;The forwarding device receives a device query message from the computing device;
    响应于所述设备查询消息,所述转发设备将扩展后的转发队列个数上报至所述计算设备,其中,所述扩展后的转发队列个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立所述队列对应关系。In response to the device query message, the forwarding device reports the expanded number of forwarding queues to the computing device, where the expanded number of forwarding queues is determined by the number of the at least one forwarding queue and the expansion The coefficient is determined, and the expanded number of forwarding queues is used to establish the queue correspondence.
  3. 根据权利要求2所述的方法,其特征在于,所述转发设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;The method according to claim 2, wherein the forwarding device comprises an attribute register, and the number of the extended forwarding queues is stored in the attribute register;
    所述转发设备将扩展后的转发队列个数上报至所述计算设备包括:The reporting by the forwarding device of the expanded number of forwarding queues to the computing device includes:
    所述转发设备查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。The forwarding device queries the attribute register, obtains the expanded number of forwarding queues from the attribute register, and reports the expanded number of forwarding queues to the computing device.
  4. 根据权利要求1-3任一权利要求所述的方法,其特征在于,The method according to any one of claims 1-3, characterized in that,
    所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述转发设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个主机队列中的一个主机队列的头指针和尾指针,所述转发设备中还存储有所述至少一个转发队列的至少一组头指针和至少一组尾指针;The information of the first host queue includes a first head pointer, the first head pointer indicates the first data to be sent, and the information of the second host queue includes a second head pointer, the second head pointer indicates For the second data to be sent, multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to one of the multiple host queues of the computing device At least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue are also stored in the forwarding device;
    所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,包括:The acquiring, by the forwarding device, the information of the first host queue and the information of the second host queue from the first doorbell message includes:
    所述转发设备从所述第一门铃消息中获取所述第一头指针和所述第二头指针;Acquiring, by the forwarding device, the first head pointer and the second head pointer from the first doorbell message;
    所述转发队列从所述第一主机队列中获取第一待发送数据,包括:The forwarding queue acquiring the first to-be-sent data from the first host queue includes:
    所述转发设备根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头 指针;Refreshing, by the forwarding device, the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer;
    所述转发设备根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;The forwarding device obtains the first host queue from the first host queue according to the head pointer corresponding to the first host queue after the refresh and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. Data to be sent;
    所述转发队列从所述第二主机队列中获取第二待发送数据,包括:The acquiring, by the forwarding queue, of the second to-be-sent data from the second host queue, includes:
    所述转发设备根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针;Refreshing, by the forwarding device, the head pointer corresponding to the second host queue in the plurality of sets of head pointers according to the second head pointer;
    所述转发设备根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;The forwarding device obtains the second host queue from the second host queue according to the head pointer corresponding to the second host queue after the refresh and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. Data to be sent;
    所述转发设备将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应转发队列之后,所述方法还包括:After the forwarding device stores the first data to be sent and the second data to be sent into the corresponding forwarding queues of the first host queue and the second host queue, respectively, the method further includes:
    刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;Refreshing the tail pointer of the first host queue and the tail pointer of the second host queue;
    刷新所述对应的转发队列的头指针;Refreshing the head pointer of the corresponding forwarding queue;
    将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。Send the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing device.
  5. 根据权利要求1-4任一权利要求所述的方法,其特征在于,所述转发设备包括队列扩展设备和网卡,所述至少一个转发队列包括至少一个队列扩展设备队列和至少一个网卡队列,所述至少一个队列扩展设备队列位于所述队列扩展设备,所述至少一个网卡队列位于所述网卡,所述至少一组头指针和所述至少一组尾指针存储于所述队列扩展设备,所述队列对应关系包括第一队列对应关系和第二队列对应关系,所述第一队列对应关系为所述多个主机队列与所述至少一个队列扩展设备队列的对应关系,所述第二队列对应关系为所述至少一个网卡队列与所述至少一个队列扩展设备队列的对应关系,所述至少一个网卡队列与所述至少一个队列扩展设备队列一一对应,所述队列扩展设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述多个主机队列中的一个主机队列的头指针和尾指针,所述队列扩展设备中还存储有至少一组队列扩展设备头指针和至少一组队列扩展设备尾指针,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应;The method according to any one of claims 1 to 4, wherein the forwarding device includes a queue expansion device and a network card, and the at least one forwarding queue includes at least one queue expansion device queue and at least one network card queue, so The at least one queue expansion device queue is located in the queue expansion device, the at least one network card queue is located in the network card, the at least one set of head pointers and the at least one set of tail pointers are stored in the queue expansion device, and the The queue correspondence relationship includes a first queue correspondence relationship and a second queue correspondence relationship. The first queue correspondence relationship is the correspondence relationship between the plurality of host queues and the at least one queue expansion device queue, and the second queue correspondence relationship Is the correspondence between the at least one network card queue and the at least one queue expansion device queue, the at least one network card queue corresponds to the at least one queue expansion device queue one-to-one, and the queue expansion device stores multiple groups of headers Pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers respectively correspond to the head pointer and the tail pointer of a host queue in the plurality of host queues, and at least one set of queues is also stored in the queue expansion device Extension device head pointer and at least one set of queue extension device tail pointers, said network card stores at least one set of network card head pointers and at least one set of network card tail pointers, said at least one set of queue extension device head pointers and said at least One set of network card head pointers corresponds to one to one, and the at least one set of queue expansion device tail pointers corresponds to the at least one set of network card tail pointers;
    所述转发设备从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,包括:The acquiring, by the forwarding device, the information of the first host queue and the information of the second host queue from the first doorbell message includes:
    所述转发设备中的队列扩展设备从所述第一门铃消息中获取所述第一头指针和所述第二头指针;Acquiring, by the queue expansion device in the forwarding device, the first head pointer and the second head pointer from the first doorbell message;
    所述转发设备从所述第一主机队列中获取第一待发送数据,包括:The obtaining, by the forwarding device, the first to-be-sent data from the first host queue includes:
    所述转发设备中的队列扩展设备根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;The queue expansion device in the forwarding device refreshes the head pointer corresponding to the first host queue among the sets of head pointers according to the first head pointer and the corresponding relationship between the first queue;
    所述转发设备中的队列扩展设备根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;According to the queue expansion device in the forwarding device, the head pointer corresponding to the first host queue after being refreshed, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers, in the first host queue Acquiring the first to-be-sent data;
    所述转发设备从所述第二主机队列中获取第二待发送数据,包括:The obtaining, by the forwarding device, the second to-be-sent data from the second host queue includes:
    所述转发设备中的队列扩展设备根据所述第二头指针,以及所述第一队列对应关系,刷 新所述多组头指针中所述第二主机队列对应的头指针;The queue expansion device in the forwarding device refreshes the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue;
    所述转发设备中的队列扩展设备根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;According to the head pointer corresponding to the second host queue after being refreshed, the queue expansion device in the forwarding device and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers are in the second host queue. Acquiring the second to-be-sent data;
    所述转发设备将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列包括:The storing, by the forwarding device, the first data to be sent and the second data to be sent into the first host queue and the forwarding queue corresponding to the second host queue respectively includes:
    所述转发设备中的队列扩展设备根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;The queue expansion device in the forwarding device stores the first data to be sent and the second data to be sent in the queues corresponding to the first host queue and the second host queue according to the corresponding relationship of the first queue An expansion device queue, wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the same queue expansion in the at least one queue expansion device queue Equipment queue
    所述转发设备中的队列扩展设备刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;Refreshing, by the queue expansion device in the forwarding device, the head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail pointer of the second host queue;
    所述转发设备中的网卡接收来自所述队列扩展设备的第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针;The network card in the forwarding device receives the second doorbell message from the queue expansion device, where the second doorbell message carries the queue head pointer of the corresponding queue expansion device;
    所述转发设备中的网卡从所述第二门铃消息中获取所述对应的队列扩展设备队列的头指针;Acquiring, by the network card in the forwarding device, the head pointer of the corresponding queue expansion device queue from the second doorbell message;
    所述转发设备中的网卡根据所述对应的队列扩展设备队列的头指针,以及所述第二队列对应关系,刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针;The network card in the forwarding device refreshes the head pointer of the corresponding queue expansion device queue in the at least one set of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the second queue correspondence relationship Corresponding network card head pointer;
    所述转发设备中的网卡根据刷新后所述对应的网卡头指针,和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据;The network card in the forwarding device expands the device queue in the corresponding queue according to the corresponding head pointer of the network card after refreshing, and the tail pointer corresponding to the corresponding queue expansion device queue in the at least one set of network card tail pointers Acquiring the first data to be sent and the second data to be sent in;
    所述转发设备中的网卡根据所述第二队列对应关系,将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列。The network card in the forwarding device stores the first to-be-sent data and the second to-be-sent data in a network card queue corresponding to the corresponding queue expansion device queue according to the second queue correspondence.
  6. 根据权利要求5所述的方法,其特征在于,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:The method according to claim 5, wherein the first data to be sent is a first direct memory access DMA read descriptor, the second data to be sent is a second DMA read descriptor, and the After the first data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes:
    所述转发设备中的网卡根据所述第一DMA读描述符以及所述第二DMA读描述符,生成第一DMA读命令以及第二DMA读命令;The network card in the forwarding device generates a first DMA read command and a second DMA read command according to the first DMA read descriptor and the second DMA read descriptor;
    所述转发设备中的网卡向所述转发设备中的队列扩展设备发送所述第一DMA读命令以及第二DMA读命令;Sending, by the network card in the forwarding device, the first DMA read command and the second DMA read command to the queue expansion device in the forwarding device;
    所述转发设备中的队列扩展设备根据所述第一DMA读命令从所述计算设备获取第一待读取数据,根据所述第二DMA读命令从所述计算设备获取第二待读取数据;The queue expansion device in the forwarding device obtains first data to be read from the computing device according to the first DMA read command, and obtains second data to be read from the computing device according to the second DMA read command ;
    所述转发设备中的队列扩展设备将所述第一待读取数据和所述第二待读取数据转发至所述转发设备中的网卡。The queue expansion device in the forwarding device forwards the first data to be read and the second data to be read to the network card in the forwarding device.
  7. 根据权利要求5所述的方法,其特征在于,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待 写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,所述将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列包括:The method according to claim 5, wherein the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA write descriptor, wherein the first DMA The write descriptor is used to write the first data to be written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device. In the computing device, storing the first data to be sent and the second data to be sent in the first host queue and the queue expansion device queue corresponding to the second host queue includes:
    所述转发设备中的队列扩展设备将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;The queue expansion device in the forwarding device converts the first DMA write descriptor to a first network card DMA write descriptor, and converts the second DMA write descriptor to a second network card DMA write descriptor, where all The first DMA write descriptor is used to write the first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card into the queue expansion device. The queue expansion device;
    所述队列扩展设备将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;Storing, by the queue expansion device, the first network card DMA write descriptor and the second network card DMA write descriptor in the corresponding queue expansion device queue;
    所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:After storing the first data to be sent and the second data to be sent in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes:
    所述转发设备中的网卡根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第二网卡DMA写描述符,获取存储于所述网卡中的,与所述第二网卡DMA写描述符对应的第二分片数据,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;According to the first network card DMA write descriptor, the network card in the forwarding device obtains the first fragment data stored in the network card and corresponds to the first network card DMA write descriptor, and according to the second The network card DMA write descriptor is used to obtain the second segment data stored in the network card and corresponding to the second network card DMA write descriptor, wherein the first data to be written includes n first segments Data, the second to-be-written data includes m second fragmented data;
    所述转发设备中的网卡根据所述第一网卡DMA写描述符以及所述第一分片数据生成第一DMA写命令,根据所述第二网卡DMA写描述符以及所述第二分片数据生成第二DMA写命令;The network card in the forwarding device generates a first DMA write command according to the first network card DMA write descriptor and the first fragmented data, and generates a first DMA write command according to the second network card DMA write descriptor and the second fragmented data Generate the second DMA write command;
    所述转发设备中的网卡向所述队列扩展设备发送所述第一DMA写命令以及所述第二DMA写命令;Sending, by the network card in the forwarding device, the first DMA write command and the second DMA write command to the queue expansion device;
    所述转发设备中的队列扩展设备根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;The queue expansion device in the forwarding device writes the first fragmented data and the second fragmented data into the memory of the queue expansion device according to the first DMA write command and the second DMA write command ;
    在所述转发设备中的队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下,所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;In the memory of the queue expansion device in the forwarding device, when the number of first fragmented data is n, a third DMA write command is generated according to the first data to be written, and the third DMA write command is generated in the second fragment. When the number of pieces of data is m, a fourth DMA write command is generated according to the second data to be written, where the third DMA write command is used for the computing device to execute and the first DMA write command Write data to be written into the computing device, and the fourth DMA write command is used for the computing device to execute and write the first data to be written into the computing device;
    所述转发设备中的所述队列扩展设备向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令,使得所述计算设备根据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。The queue expansion device in the forwarding device sends the third DMA write command and the fourth DMA write command to the computing device, so that the computing device is based on the third DMA write command and the first DMA write command. Four DMA write commands to write the first data to be written and the second data to be written into the computing device.
  8. 根据权利要求5-7任一权利要求所述的方法,其特征在于,所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,所述方法还包括:The method according to any one of claims 5-7, wherein the storing the first data to be sent and the second data to be sent in a network card queue corresponding to the corresponding queue expansion device queue After that, the method further includes:
    所述转发设备中网卡向所述队列扩展设备发送完成消息和中断消息;The network card in the forwarding device sends a completion message and an interrupt message to the queue expansion device;
    所述转发设备中队列扩展设备向所述计算设备发送所述完成消息和中断,使得所述计算设备根据所述完成消息,刷新第一主机队列以及第二主机队列的尾指针。The queue expansion device in the forwarding device sends the completion message and interrupt to the computing device, so that the computing device refreshes the tail pointers of the first host queue and the second host queue according to the completion message.
  9. 一种队列通信系统,其特征在于,所述系统包括转发设备和计算设备,所述转发设备与计算设备连接,所述转发设备包括至少一个转发队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,其中,A queue communication system, characterized in that the system includes a forwarding device and a computing device, the forwarding device is connected to the computing device, the forwarding device includes at least one forwarding queue, the computing device includes multiple host queues, and the There are multiple data to be sent stored in the multiple host queues, among which,
    所述计算设备用于向所述转发设备发送第一命令消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;The computing device is configured to send a first command message to the forwarding device, where the first doorbell message carries information about the first host queue and the second host queue, and the first host queue and the all The second host queues all belong to the multiple host queues;
    所述转发设备用于接收来自所述计算设备的第一门铃消息;The forwarding device is used to receive the first doorbell message from the computing device;
    所述转发设备用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;The forwarding device is configured to obtain the information of the first host queue and the information of the second host queue from the first doorbell message, obtain the first data to be sent from the first host queue, and obtain the first data to be sent from the first host queue. Acquiring the second to-be-sent data from the second host queue;
    所述转发设备用于根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。The forwarding device is configured to store the first data to be sent and the second data to be sent into the first host queue and the first host queue according to the queue correspondence between the forwarding queue and the host queue. Two forwarding queues corresponding to the host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  10. 根据权利要求9所述的系统,其特征在于,所述计算设备用于在向所述转发设备发送第一门铃消息之前,向所述转发设备发送设备查询消息;The system according to claim 9, wherein the computing device is configured to send a device query message to the forwarding device before sending the first doorbell message to the forwarding device;
    所述转发设备用于接收来自所述计算设备的设备查询消息;The forwarding device is used to receive a device query message from the computing device;
    所述转发设备用于响应于所述设备查询消息,将扩展后的转发队列个数上报至所述计算设备,其中,所述扩展后的转发队列个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立所述队列对应关系。The forwarding device is configured to report the number of extended forwarding queues to the computing device in response to the device query message, wherein the number of the extended forwarding queues is determined by the number of the at least one forwarding queue And the expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence.
  11. 根据权利要求9所述的系统,其特征在于,所述转发设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;The system according to claim 9, wherein the forwarding device comprises an attribute register, and the number of the extended forwarding queues is stored in the attribute register;
    所述转发设备用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。The forwarding device is configured to query the attribute register, obtain the number of the extended forwarding queues from the attribute register, and report the number of the extended forwarding queues to the computing device.
  12. 根据权利要求9-11任一权利要求所述的系统,其特征在于,The system according to any one of claims 9-11, wherein:
    所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述转发设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个主机队列中的一个主机队列的头指针和尾指针,所述转发设备中还存储有所述至少一个转发队列的至少一组头指针和至少一组尾指针;The information of the first host queue includes a first head pointer, the first head pointer indicates the first data to be sent, and the information of the second host queue includes a second head pointer, the second head pointer indicates For the second data to be sent, multiple sets of head pointers and multiple sets of tail pointers are stored in the forwarding device, and each set of head pointers and each set of tail pointers respectively correspond to one of the multiple host queues of the computing device At least one set of head pointers and at least one set of tail pointers of the at least one forwarding queue are also stored in the forwarding device;
    所述转发设备用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;The forwarding device is configured to obtain the first head pointer and the second head pointer from the first doorbell message;
    所述转发设备用于根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头指针;The forwarding device is configured to refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer;
    所述转发设备用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;The forwarding device is configured to obtain the first host queue from the first host queue according to the head pointer corresponding to the first host queue after being refreshed, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent;
    所述转发设备用于根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针;The forwarding device is configured to refresh the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer;
    所述转发设备用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;The forwarding device is configured to obtain the second host queue according to the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent;
    所述转发设备用于在将所述第一待发送数据和所述第二待发送数据分别存入所述第一 主机队列以及第二主机队列对应转发队列之后,刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;The forwarding device is configured to refresh the first host queue after storing the first to-be-sent data and the second to-be-sent data in the first host queue and the corresponding forwarding queue of the second host queue, respectively A tail pointer and the tail pointer of the second host queue;
    所述转发设备用于刷新所述对应的转发队列的头指针;The forwarding device is used to refresh the head pointer of the corresponding forwarding queue;
    所述转发设备用于将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。The forwarding device is configured to send the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing device.
  13. 根据权利要求9-12任一权利要求所述的系统,其特征在于,所述转发设备包括队列扩展设备和网卡,所述至少一个转发队列包括至少一个队列扩展设备队列和至少一个网卡队列,所述至少一个队列扩展设备队列位于所述队列扩展设备,所述至少一个网卡队列位于所述网卡,所述至少一组头指针和所述至少一组尾指针存储于所述队列扩展设备,所述队列对应关系包括第一队列对应关系和第二队列对应关系,所述第一队列对应关系为所述多个主机队列与所述至少一个队列扩展设备队列的对应关系,所述第二队列对应关系为所述至少一个网卡队列与所述至少一个队列扩展设备队列的对应关系,所述至少一个网卡队列与所述至少一个队列扩展设备队列一一对应,所述队列扩展设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述多个主机队列中的一个主机队列的头指针和尾指针,所述队列扩展设备中还存储有至少一组队列扩展设备头指针和至少一组队列扩展设备尾指针,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应;The system according to any one of claims 9-12, wherein the forwarding device includes a queue expansion device and a network card, and the at least one forwarding queue includes at least one queue expansion device queue and at least one network card queue, so The at least one queue expansion device queue is located in the queue expansion device, the at least one network card queue is located in the network card, the at least one set of head pointers and the at least one set of tail pointers are stored in the queue expansion device, and the The queue correspondence relationship includes a first queue correspondence relationship and a second queue correspondence relationship. The first queue correspondence relationship is the correspondence relationship between the plurality of host queues and the at least one queue expansion device queue, and the second queue correspondence relationship Is the correspondence between the at least one network card queue and the at least one queue expansion device queue, the at least one network card queue corresponds to the at least one queue expansion device queue one-to-one, and the queue expansion device stores multiple groups of headers Pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers respectively correspond to the head pointer and the tail pointer of a host queue in the plurality of host queues, and at least one set of queues is also stored in the queue expansion device Extension device head pointer and at least one set of queue extension device tail pointers, said network card stores at least one set of network card head pointers and at least one set of network card tail pointers, said at least one set of queue extension device head pointers and said at least One set of network card head pointers corresponds one to one, and the at least one set of queue expansion device tail pointers corresponds to the at least one set of network card tail pointers;
    所述队列扩展设备用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;The queue expansion device is configured to obtain the first head pointer and the second head pointer from the first doorbell message;
    所述队列扩展设备用于根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;The queue expansion device is configured to refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer and the corresponding relationship of the first queue;
    所述队列扩展设备用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;The queue expansion device is configured to obtain all data from the first host queue according to the head pointer corresponding to the first host queue after being refreshed, and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent;
    所述队列扩展设备用于根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;The queue expansion device is configured to refresh the head pointer corresponding to the second host queue in the multiple sets of head pointers according to the second head pointer and the corresponding relationship of the first queue;
    所述队列扩展设备用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;The queue expansion device is configured to obtain all data from the second host queue according to the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent;
    所述队列扩展设备用于根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;The queue expansion device is configured to store the first data to be sent and the second data to be sent in the queue expansion device corresponding to the first host queue and the second host queue according to the corresponding relationship of the first queue Queue, wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue ;
    所述队列扩展设备用于刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;The queue expansion device is used to refresh the head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail pointer of the second host queue;
    所述网卡用于接收来自所述队列扩展设备的第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针;The network card is configured to receive a second doorbell message from the queue expansion device, where the second doorbell message carries the queue head pointer of the corresponding queue expansion device;
    所述网卡用于从所述第二门铃消息中获取所述对应的队列扩展设备队列的头指针;The network card is configured to obtain the head pointer of the corresponding queue expansion device queue from the second doorbell message;
    所述转发设备中的网卡根据所述对应的队列扩展设备队列的头指针,以及所述第二队列对应关系,刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针;The network card in the forwarding device refreshes the head pointer of the corresponding queue expansion device queue in the at least one set of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the second queue correspondence relationship Corresponding network card head pointer;
    所述网卡用于根据刷新后所述对应的网卡头指针,和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据;The network card is configured to obtain from the corresponding queue expansion device queue according to the corresponding head pointer of the network card after refreshing and the tail pointer corresponding to the corresponding queue expansion device queue in the at least one set of network card tail pointers The first data to be sent and the second data to be sent;
    所述网卡用于根据所述第二队列对应关系,将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列。The network card is configured to store the first data to be sent and the second data to be sent in a network card queue corresponding to the corresponding queue expansion device queue according to the corresponding relationship of the second queue.
  14. 根据权利要求13所述的系统,其特征在于,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,所述网卡还用于在所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,根据所述第一DMA读描述符以及所述第二DMA读描述符,生成第一DMA读命令以及第二DMA读命令;The system according to claim 13, wherein the first data to be sent is a first direct memory access DMA read descriptor, the second data to be sent is a second DMA read descriptor, and the network card It is also used for storing the first data to be sent and the second data to be sent in the network card queue corresponding to the corresponding queue expansion device queue, according to the first DMA read descriptor and the first Two DMA read descriptors, generating the first DMA read command and the second DMA read command;
    所述网卡用于向所述转发设备中的队列扩展设备发送所述第一DMA读命令以及第二DMA读命令;The network card is configured to send the first DMA read command and the second DMA read command to a queue expansion device in the forwarding device;
    所述队列扩展设备用于根据所述第一DMA读命令从所述计算设备获取第一待读取数据,根据所述第二DMA读命令从所述计算设备获取第二待读取数据;The queue expansion device is configured to obtain first data to be read from the computing device according to the first DMA read command, and obtain second data to be read from the computing device according to the second DMA read command;
    所述队列扩展设备用于将所述第一待读取数据和所述第二待读取数据转发至所述转发设备中的网卡。The queue expansion device is used to forward the first data to be read and the second data to be read to the network card in the forwarding device.
  15. 根据权利要求13所述的系统,其特征在于,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,The system according to claim 13, wherein the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA write descriptor, wherein the first DMA The write descriptor is used to write the first data to be written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device. Said computing equipment,
    所述队列扩展设备用于将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;The queue expansion device is used to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor, wherein the first DMA write descriptor is A DMA write descriptor is used to write the first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card into the queue expansion device. Queue expansion device;
    所述队列扩展设备用于将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;The queue expansion device is configured to store the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion device queue;
    所述网卡还用于在所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第二网卡DMA写描述符,获取存储于所述网卡中的,与所述第二网卡DMA写描述符对应的第二分片数据,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;The network card is further configured to write the descriptor according to the first network card DMA after storing the first data to be sent and the second data to be sent in the network card queue corresponding to the corresponding queue expansion device queue , Obtain the first fragmented data stored in the network card and corresponding to the DMA write descriptor of the first network card, and obtain the data stored in the network card and the data stored in the network card according to the DMA write descriptor of the second network card. The second fragmented data corresponding to the DMA write descriptor of the second network card, wherein the first data to be written includes n first fragments of data, and the second data to be written includes m second fragments data;
    所述网卡用于根据所述第一网卡DMA写描述符以及所述第一分片数据生成第一DMA写命令,根据所述第二网卡DMA写描述符以及所述第二分片数据生成第二DMA写命令;The network card is configured to generate a first DMA write command according to the first network card DMA write descriptor and the first fragment data, and generate a first DMA write command according to the second network card DMA write descriptor and the second fragment data. Two DMA write commands;
    所述网卡用于向所述队列扩展设备发送所述第一DMA写命令以及所述第二DMA写命令;The network card is configured to send the first DMA write command and the second DMA write command to the queue expansion device;
    所述队列扩展设备用于根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;The queue expansion device is configured to write the first fragmented data and the second fragmented data into the memory of the queue expansion device according to the first DMA write command and the second DMA write command;
    所述队列扩展设备用于在所述转发设备中的队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据 的数量为m的情况下,所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;The queue expansion device is configured to generate a third DMA write command according to the first data to be written in the case that the number of first fragmented data is n in the memory of the queue expansion device in the forwarding device , In the case that the number of the second fragmented data is m, a fourth DMA write command is generated according to the second data to be written, wherein the third DMA write command is used for the calculation The device executes and writes the first data to be written into the computing device, and the fourth DMA write command is used for execution by the computing device and writes the first data to be written into the computing device ;
    所述队列扩展设备用于向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令;The queue expansion device is configured to send the third DMA write command and the fourth DMA write command to the computing device;
    所述计算设备用于据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。The computing device is configured to write the first data to be written and the second data to be written into the computing device according to the third DMA write command and the fourth DMA write command.
  16. 根据权利要求13-15任一权利要求所述的系统,其特征在于,所述网卡还用于在所述将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后,向所述队列扩展设备发送完成消息和中断消息;The system according to any one of claims 13-15, wherein the network card is further used for storing the first data to be sent and the second data to be sent in the corresponding queue After expanding the network card queue corresponding to the device queue, sending a completion message and an interrupt message to the queue expansion device;
    所述队列扩展设备还用于向所述计算设备发送所述完成消息和中断,使得所述计算设备根据所述完成消息,刷新第一主机队列以及第二主机队列的尾指针。The queue expansion device is further configured to send the completion message and interrupt to the computing device, so that the computing device refreshes the tail pointers of the first host queue and the second host queue according to the completion message.
  17. 一种转发设备,其特征在于,所述转发设备与计算设备连接,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,其中,所述转发设备包括接收单元、获取单元和存储单元,所述存储单元包括至少一个转发队列:A forwarding device, characterized in that the forwarding device is connected to a computing device, the computing device includes a plurality of host queues, and a plurality of data to be sent are stored in the plurality of host queues, wherein the forwarding device includes A receiving unit, an acquiring unit, and a storage unit, the storage unit includes at least one forwarding queue:
    所述接收单元,用于接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;The receiving unit is configured to receive a first doorbell message from the computing device, wherein the first doorbell message carries information about a first host queue and information about a second host queue, and the first host queue And the second host queue both belong to the multiple host queues;
    所述获取单元,用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;The acquiring unit is configured to acquire the information of the first host queue and the information of the second host queue from the first doorbell message, acquire the first to-be-sent data from the first host queue, and Acquiring second data to be sent from the second host queue;
    所述存储单元,用于根据所述转发队列和所述主机队列之间的队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的转发队列,所述第一主机队列和所述第二主机队列对应所述至少一个转发队列中的同一个转发队列。The storage unit is configured to store the first data to be sent and the second data to be sent into the first host queue respectively according to the queue correspondence between the forwarding queue and the host queue, and A forwarding queue corresponding to the second host queue, and the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
  18. 根据权利要求16所述的设备,其特征在于,所述转发设备还包括响应单元,The device according to claim 16, wherein the forwarding device further comprises a response unit,
    所述接收单元还用于在所述接收单元接收来自所述计算设备的第一门铃消息之前,接收来自所述计算设备的设备查询消息;The receiving unit is further configured to receive a device query message from the computing device before the receiving unit receives the first doorbell message from the computing device;
    所述响应单元用于响应于所述设备查询消息,所述转发设备将扩展后的转发队列个数上报至所述计算设备,其中,所述扩展后的转发队列个数由所述至少一个转发队列的个数和扩展系数确定,所述扩展后的转发队列个数用于建立所述队列对应关系。The response unit is configured to respond to the device query message, and the forwarding device reports the number of extended forwarding queues to the computing device, wherein the number of extended forwarding queues is forwarded by the at least one The number of queues and the expansion coefficient are determined, and the expanded number of forwarding queues is used to establish the queue correspondence.
  19. 根据权利要求17所述的设备,其特征在于,所述响应单元包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中,The device according to claim 17, wherein the response unit comprises an attribute register, and the number of the expanded forwarding queues is stored in the attribute register,
    所述响应单元用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的转发队列个数,将所述扩展后的转发队列个数上报至所述计算设备。The response unit is used to query the attribute register, obtain the expanded number of forwarding queues from the attribute register, and report the expanded number of forwarding queues to the computing device.
  20. 根据权利要求16-19任一权利要求所述的设备,其特征在于,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述转发设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述计算设备的多个队列中的一个队列的头指针和尾指针,所述转发设备中还存储有所述至少一个队列的至少一组头指针和至少一组尾指针;所述转发设备还包括刷新单元,The device according to any one of claims 16-19, wherein the information of the first host queue includes a first head pointer, the first head pointer indicates the first data to be sent, and the The information of the second host queue includes a second head pointer, the second head pointer indicates the second data to be sent, the forwarding device stores multiple sets of head pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers The group tail pointers respectively correspond to the head pointer and the tail pointer of one of the multiple queues of the computing device, and the forwarding device also stores at least one set of head pointers and at least one set of tail pointers of the at least one queue; The forwarding device further includes a refresh unit,
    所述获取单元用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;The acquiring unit is configured to acquire the first head pointer and the second head pointer from the first doorbell message;
    所述刷新单元用于根据所述第一头指针刷新所述多组头指针中所述第一主机队列对应的头指针;The refresh unit is configured to refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer;
    所述获取单元用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;The acquiring unit is configured to acquire the first host queue from the first host queue according to the head pointer corresponding to the first host queue after the refresh and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent;
    所述刷新单元用于根据所述第二头指针刷新所述多组头指针中所述第二主机队列对应的头指针;The refresh unit is configured to refresh the head pointer corresponding to the second host queue in the plurality of groups of head pointers according to the second head pointer;
    所述获取单元用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;The acquiring unit is configured to acquire the second host queue from the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent;
    所述刷新单元用于将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应转发队列之后,刷新所述第一主机队列的尾指针和所述第二主机队列的尾指针;The refresh unit is configured to refresh the tail of the first host queue after storing the first data to be sent and the second data to be sent into the forwarding queues corresponding to the first host queue and the second host queue, respectively Pointer and the tail pointer of the second host queue;
    所述刷新单元用于刷新所述对应的转发队列的头指针;The refresh unit is used to refresh the head pointer of the corresponding forwarding queue;
    所述刷新单元用于将刷新后的所述第一主机队列的尾指针和刷新后的所述第二主机队列的尾指针发送至所述计算设备。The refresh unit is configured to send the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing device.
  21. 一种队列扩展设备,其特征在于,所述队列扩展设备队列与计算设备和网卡连接,所述队列扩展设备包括至少一个队列扩展设备队列,所述网卡包括至少一个网卡队列,所述计算设备包括多个主机队列,所述多个主机队列中存储有多个待发送数据,所述队列扩展设备包括:A queue expansion device, wherein the queue expansion device queue is connected to a computing device and a network card, the queue expansion device includes at least one queue expansion device queue, the network card includes at least one network card queue, and the computing device includes A plurality of host queues, a plurality of data to be sent are stored in the plurality of host queues, and the queue expansion device includes:
    接收单元,所述接收单元用于接收来自所述计算设备的第一门铃消息,其中,所述第一门铃消息中携带有第一主机队列的信息和第二主机队列的信息,所述第一主机队列和所述第二主机队列均属于所述多个主机队列;A receiving unit, the receiving unit is configured to receive a first doorbell message from the computing device, wherein the first doorbell message carries information about a first host queue and a second host queue, and the first Both the host queue and the second host queue belong to the multiple host queues;
    获取单元,所述获取单元用于从所述第一门铃消息中获取所述第一主机队列的信息和所述第二主机队列的信息,从所述第一主机队列中获取第一待发送数据,从所述第二主机队列中获取第二待发送数据;An acquiring unit configured to acquire information about the first host queue and information about the second host queue from the first doorbell message, and acquire first data to be sent from the first host queue , Acquiring second data to be sent from the second host queue;
    存储单元,所述存储单元用于根据所述队列扩展设备队列和所述主机队列之间的第一队列对应关系,将所述第一待发送数据和所述第二待发送数据分别存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列;A storage unit, which is configured to store the first data to be sent and the second data to be sent in the storage unit according to the first queue correspondence between the queue expansion device queue and the host queue. The first host queue and the queue expansion device queue corresponding to the second host queue;
    发送单元,所述发送单元用于向所述网卡发送第二门铃消息,所述第二门铃消息中携带有所述对应的队列扩展设备队列的信息,使得所述网卡根据所述第二门铃消息,从所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据,并根据所述网卡队列和所述队列扩展设备队列之间的第二队列对应关系,将所述第一待发送数据和所述第二待发送数据存入所述对应的队列扩展设备队列对应的网卡队列中,其中,所述对应的队列扩展设 备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列,所述对应的网卡队列属于所述网卡队列。A sending unit, the sending unit is configured to send a second doorbell message to the network card, the second doorbell message carrying the corresponding queue expansion device queue information, so that the network card according to the second doorbell message , Acquiring the first data to be sent and the second data to be sent from the corresponding queue expansion device queue, and according to the second queue correspondence between the network card queue and the queue expansion device queue, The first data to be sent and the second data to be sent are stored in the network card queue corresponding to the corresponding queue expansion device queue, where the corresponding queue expansion device queue belongs to the queue expansion device queue, and the The first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue, and the corresponding network card queue belongs to the network card queue.
  22. 根据权利要求21所述的设备,其特征在于,所述设备还包括响应单元,The device according to claim 21, wherein the device further comprises a response unit,
    所述接收单元还用于在接收来自所述计算设备的第一门铃消息之前,接收来自所述计算设备的第一设备查询消息;The receiving unit is further configured to receive a first device query message from the computing device before receiving the first doorbell message from the computing device;
    所述发送单元用于向所述网卡送第二设备查询消息;The sending unit is configured to send a second device query message to the network card;
    所述响应单元用于接收所述网卡发送的网卡队列个数,其中,所述网卡队列个数用于建立所述第二队列对应关系;The response unit is configured to receive the number of network card queues sent by the network card, wherein the number of network card queues is used to establish the second queue correspondence;
    所述响应单元用于响应于所述第一设备查询消息,将扩展后的队列扩展设备队列个数上报至所述计算设备,其中,所述扩展后的队列扩展设备队列个数由所述网卡队列个数和扩展系数确定,所述扩展后的队列扩展设备队列个数用于建立所述第一队列对应关系。The response unit is configured to report the number of expanded queue expansion device queues to the computing device in response to the first device query message, where the number of expanded queue expansion device queues is determined by the network card The number of queues and the expansion coefficient are determined, and the expanded number of queue expansion device queues is used to establish the first queue correspondence.
  23. 根据权利要求22所述的设备,其特征在于,所述设备包括属性寄存器,所述扩展后的转发队列个数存储在所述属性寄存器中;The device according to claim 22, wherein the device comprises an attribute register, and the number of the extended forwarding queues is stored in the attribute register;
    所述响应单元还用于查询所述属性寄存器,从所述属性寄存器中获取所述扩展后的队列扩展设备队列个数,将所述扩展后的队列扩展设备队列个数上报至所述计算设备。The response unit is also used to query the attribute register, obtain the number of the expanded queue expansion device queues from the attribute register, and report the number of the expanded queue expansion device queues to the computing device .
  24. 根据权利要求21-23任一权利要求所述的设备,其特征在于,所述第一主机队列的信息包括第一头指针,所述第一头指针指示所述第一待发送数据,所述第二主机队列的信息包括第二头指针,所述第二头指针指示所述第二待发送数据,所述队列扩展设备中存储有多组头指针和多组尾指针,每组头指针和每组尾指针分别对应所述多个主机队列中的一个主机队列的头指针和尾指针,所述队列扩展设备中还存储有至少一组队列扩展设备头指针和至少一组队列扩展设备尾指针,所述网卡中存储有至少一组网卡头指针和至少一组网卡尾指针,所述至少一组队列扩展设备头指针与所述至少一组网卡头指针一一对应,所述至少一组队列扩展设备尾指针与所述至少一组网卡尾指针一一对应,所述队列扩展设备还包括刷新单元,The device according to any one of claims 21-23, wherein the information of the first host queue includes a first head pointer, the first head pointer indicating the first data to be sent, and the The information of the second host queue includes a second head pointer, the second head pointer indicates the second to-be-sent data, the queue expansion device stores multiple sets of head pointers and multiple sets of tail pointers, and each set of head pointers and Each set of tail pointers respectively corresponds to the head pointer and the tail pointer of a host queue in the plurality of host queues, and the queue expansion device also stores at least one set of queue expansion device head pointers and at least one set of queue expansion device Tail pointer, the network card stores at least one set of network card head pointers and at least one set of network card tail pointers, the at least one set of queue expansion device head pointers corresponds to the at least one set of network card head pointers, and the at least The tail pointers of a group of queue expansion devices correspond one-to-one with the tail pointers of the at least one group of network cards, and the queue expansion device further includes a refresh unit,
    所述获取单元用于从所述第一门铃消息中获取所述第一头指针和所述第二头指针;The acquiring unit is configured to acquire the first head pointer and the second head pointer from the first doorbell message;
    所述刷新单元用于根据所述第一头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第一主机队列对应的头指针;The refresh unit is configured to refresh the head pointer corresponding to the first host queue in the multiple sets of head pointers according to the first head pointer and the corresponding relationship between the first queue;
    所述获取单元用于根据刷新后所述第一主机队列对应的头指针,和所述多组尾指针中所述第一主机队列对应的尾指针,在所述第一主机队列中获取所述第一待发送数据;The acquiring unit is configured to acquire the first host queue from the first host queue according to the head pointer corresponding to the first host queue after the refresh and the tail pointer corresponding to the first host queue in the multiple sets of tail pointers. The first data to be sent;
    所述刷新单元用于根据所述第二头指针,以及所述第一队列对应关系,刷新所述多组头指针中所述第二主机队列对应的头指针;The refreshing unit is configured to refresh the head pointer corresponding to the second host queue in the plurality of sets of head pointers according to the second head pointer and the corresponding relationship of the first queue;
    所述获取单元用于根据刷新后所述第二主机队列对应的头指针,和所述多组尾指针中所述第二主机队列对应的尾指针,在所述第二主机队列中获取所述第二待发送数据;The acquiring unit is configured to acquire the second host queue from the head pointer corresponding to the second host queue after refreshing and the tail pointer corresponding to the second host queue in the multiple sets of tail pointers. The second data to be sent;
    所述存储单元用于根据所述第一队列对应关系,将所述第一待发送数据以及所述第二待发送数据存入所述第一主机队列以及第二主机队列对应的队列扩展设备队列,其中,所述对应的队列扩展设备队列属于所述队列扩展设备队列,所述第一主机队列和所述第二主机队列对应所述至少一个队列扩展设备队列中的同一个队列扩展设备队列;The storage unit is configured to store the first data to be sent and the second data to be sent in the queue expansion device queues corresponding to the first host queue and the second host queue according to the corresponding relationship of the first queue , Wherein the corresponding queue expansion device queue belongs to the queue expansion device queue, and the first host queue and the second host queue correspond to the same queue expansion device queue in the at least one queue expansion device queue;
    所述刷新单元用于刷新所述对应的队列扩展设备队列的头指针、所述第一主机队列的尾指针以及第二主机队列的尾指针;The refresh unit is configured to refresh the head pointer of the corresponding queue expansion device queue, the tail pointer of the first host queue, and the tail pointer of the second host queue;
    所述发送单元还用于向所述网卡发送所述第二门铃消息,其中,所述第二门铃消息中携带所述对应的队列扩展设备队列的头指针,使得所述网卡根据所述对应的队列扩展设备队列的头指针以及所述第二队列对应关系刷新所述至少一组网卡头指针中所述对应的队列扩展设备队列的头指针对应的网卡头指针,并刷新后所述对应的网卡头指针和所述至少一组网卡尾指针中所述对应的队列扩展设备队列对应的尾指针,在所述对应的队列扩展设备队列中获取所述第一待发送数据以及第二待发送数据,从而根据所述第二队列对应关系,将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列。The sending unit is further configured to send the second doorbell message to the network card, wherein the second doorbell message carries the head pointer of the corresponding queue expansion device queue, so that the network card is configured according to the corresponding The head pointer of the queue expansion device queue and the corresponding relationship between the second queue and the corresponding network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one set of network card head pointers are refreshed, and the corresponding network card is refreshed A head pointer and a tail pointer corresponding to the corresponding queue expansion device queue in the at least one set of network card tail pointers, acquiring the first data to be sent and the second data to be sent in the corresponding queue expansion device queue, Therefore, according to the second queue correspondence, the first to-be-sent data and the second to-be-sent data are stored in the network card queue corresponding to the corresponding queue expansion device queue.
  25. 根据权利要求24所述的设备,其特征在于,所述第一待发送数据是第一直接内存存取DMA读描述符,所述第二待发送数据是第二DMA读描述符,The device according to claim 24, wherein the first data to be sent is a first direct memory access DMA read descriptor, and the second data to be sent is a second DMA read descriptor,
    所述接收单元还用于接收所述网卡发送的第一DMA读命令以及第二DMA读命令,其中,其中,所述第一DMA读命令是所述网卡根据所述第一DMA描述符生成的,所述第二DMA读命令是所述网卡根据所述第二DMA描述符生成的;The receiving unit is further configured to receive a first DMA read command and a second DMA read command sent by the network card, where the first DMA read command is generated by the network card according to the first DMA descriptor , The second DMA read command is generated by the network card according to the second DMA descriptor;
    所述获取单元还用于根据第一DMA读命令从所述计算设备获取第一待读取数据,根据第二DMA读命令从所述计算设备获取第二待读取数据;The acquiring unit is further configured to acquire first data to be read from the computing device according to a first DMA read command, and acquire second data to be read from the computing device according to a second DMA read command;
    所述发送单元还用于将所述第一待读取数据和所述第二待读取数据转发至所述网卡。The sending unit is further configured to forward the first data to be read and the second data to be read to the network card.
  26. 根据权利要求24所述的设备,其特征在于,所述第一待发送数据是第一DMA写描述符,所述第二待发送数据是第二DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述队列扩展设备写入所述计算设备,所述第二DMA描述符用于将第二待写入数据从所述队列扩展设备写入所述计算设备,所述设备还包括转换单元,The device according to claim 24, wherein the first data to be sent is a first DMA write descriptor, and the second data to be sent is a second DMA write descriptor, wherein the first DMA The write descriptor is used to write the first data to be written from the queue expansion device to the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device to the computing device. The computing device, the device further includes a conversion unit,
    所述转换单元用于将所述第一DMA写描述符转换为第一网卡DMA写描述符,将所述第二DMA写描述符转换为第二网卡DMA写描述符,其中,所述第一DMA写描述符用于将第一待写入数据从所述网卡写入所述队列扩展设备,所述第二DMA描述符用于将第二待写入数据从所述网卡写入所述队列扩展设备;The conversion unit is configured to convert the first DMA write descriptor to a first network card DMA write descriptor, and convert the second DMA write descriptor to a second network card DMA write descriptor, wherein the first The DMA write descriptor is used to write the first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used to write the second data to be written from the network card into the queue Expansion equipment;
    所述存储单元用于将所述第一网卡DMA写描述符以及所述第二网卡DMA写描述符存入所述对应的队列扩展设备队列;The storage unit is configured to store the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion device queue;
    所述接收单元用于接收第一DMA写命令以及所述第二DMA写命令,其中,所述第一DMA写命令是所述网卡根据所述第一网卡DMA写描述符,获取存储于所述网卡中的,与所述第一网卡DMA写描述符对应的第一分片数据,根据所述第一网卡DMA写描述符以及所述第一分片数据生成的第一DMA写命令,所述第二DMA写命令是所述网卡根据所述第二网卡DMA写描述符,获取存储于所述网卡中的与所述第二网卡DMA写描述符对应的第二分片数据之后,根据所述第二网卡DMA写描述符以及所述第二分片数据生成的第二DMA写命令,其中,所述第一待写入数据包括n个第一分片数据,所述第二待写入数据包括m个第二分片数据;The receiving unit is configured to receive a first DMA write command and the second DMA write command, wherein the first DMA write command is obtained by the network card according to the first network card DMA write descriptor and stored in the In the network card, the first fragment data corresponding to the first network card DMA write descriptor is generated according to the first network card DMA write descriptor and the first DMA write command generated by the first fragment data, the The second DMA write command is after the network card obtains the second fragment data stored in the network card corresponding to the second network card DMA write descriptor according to the second network card DMA write descriptor, and then according to the The second network card DMA write descriptor and the second DMA write command generated by the second fragmented data, wherein the first to-be-written data includes n pieces of first fragmented data, and the second to-be-written data Including m second fragment data;
    所述存储单元用于根据所述第一DMA写命令以及所述第二DMA写命令,将所述第一分片数据以及第二分片数据写入所述队列扩展设备的存储器中;The storage unit is configured to write the first fragmented data and the second fragmented data into the memory of the queue expansion device according to the first DMA write command and the second DMA write command;
    所述转换单元用于在所述队列扩展设备的存储器中,第一分片数据的数量为n的情况下,根据所述第一待写入数据,生成第三DMA写命令,在所述第二分片数据的数量为m的情况下, 所根据所述第二待写入数据,生成第四DMA写命令,其中,所述第三DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备,所述第四DMA写命令用于供所述计算设备执行并将所述第一待写入数据写入所述计算设备;The conversion unit is configured to generate a third DMA write command according to the first data to be written in the case where the number of first fragmented data in the memory of the queue expansion device is n. When the number of two-slice data is m, a fourth DMA write command is generated according to the second data to be written, where the third DMA write command is used for the computing device to execute and The first data to be written is written into the computing device, and the fourth DMA write command is used for the computing device to execute and write the first data to be written into the computing device;
    所述发送单元用于向所述计算设备发送所述第三DMA写命令以及所述第四DMA写命令,使得所述计算设备根据所述第三DMA写命令以及所述第四DMA写命令,将所述第一待写入数据以及所述第二待写入数据写入所述计算设备中。The sending unit is configured to send the third DMA write command and the fourth DMA write command to the computing device, so that the computing device according to the third DMA write command and the fourth DMA write command, The first data to be written and the second data to be written are written into the computing device.
  27. 根据权利要求24-26任一权利要求所述的设备,其特征在于,The device according to any one of claims 24-26, wherein:
    所述接收单元还用于接收所述网卡发送的完成消息和中断,其中,其中,所述完成消息和中断是所述网卡在将所述第一待发送数据以及第二待发送数据存入与所述对应的队列扩展设备队列对应的网卡队列之后生成的;The receiving unit is further configured to receive a completion message and an interrupt sent by the network card, wherein, the completion message and the interrupt are when the network card is storing the first data to be sent and the second data to be sent in and Generated after the corresponding network card queue corresponding to the corresponding queue expansion device queue;
    所述发送单元还用于向所述计算设备发送完成消息和中断,使得所述计算设备根据所述完成消息刷新第一主机队列以及第二主机队列的尾指针。The sending unit is further configured to send a completion message and an interrupt to the computing device, so that the computing device refreshes the tail pointers of the first host queue and the second host queue according to the completion message.
  28. 一种转发设备,所述设备包括处理器和存储器,包括处理器和存储器,所述处理器执行所述存储器中的代码实现如权利要求1至8任一权利要求所述的方法。A forwarding device, the device includes a processor and a memory, including a processor and a memory, and the processor executes the code in the memory to implement the method according to any one of claims 1 to 8.
  29. 一种计算机程序产品,其特征在于,当所述计算机程序产品被计算设备读取并执行时,如权利要求1至8任一权利要求所述的方法将被实现。A computer program product, characterized in that, when the computer program product is read and executed by a computing device, the method according to any one of claims 1 to 8 will be implemented.
  30. 一种计算机非瞬态存储介质,其特征在于,包括指令,当所述指令在计算设备上运行时,使得所述计算设备实现如权利要求1至8任一权利要求所述的方法。A computer non-transitory storage medium, characterized by comprising instructions, when the instructions are run on a computing device, the computing device is made to implement the method according to any one of claims 1 to 8.
  31. 一种转发设备,所述设备包括逻辑电路,所述转发设备通过所述逻辑电路执行如权利要求1至8任一权利要求所述的方法。A forwarding device, the device comprising a logic circuit, and the forwarding device executes the method according to any one of claims 1 to 8 through the logic circuit.
PCT/CN2020/113497 2019-09-30 2020-09-04 Queue communication method and system, and related devices WO2021063154A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910944642.X 2019-09-30
CN201910944642.XA CN110750367B (en) 2019-09-30 2019-09-30 Method, system and related equipment for queue communication

Publications (1)

Publication Number Publication Date
WO2021063154A1 true WO2021063154A1 (en) 2021-04-08

Family

ID=69277683

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/113497 WO2021063154A1 (en) 2019-09-30 2020-09-04 Queue communication method and system, and related devices

Country Status (2)

Country Link
CN (1) CN110750367B (en)
WO (1) WO2021063154A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750367B (en) * 2019-09-30 2023-03-17 超聚变数字技术有限公司 Method, system and related equipment for queue communication
CN112162875A (en) * 2020-10-12 2021-01-01 上交所技术有限责任公司 High-reliability message transmission method in transaction system
CN114785714B (en) * 2022-03-01 2023-08-22 阿里巴巴(中国)有限公司 Message transmission delay detection method, storage medium and equipment
CN116795605B (en) * 2023-08-23 2023-12-12 珠海星云智联科技有限公司 Automatic recovery system and method for abnormality of peripheral device interconnection extension equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968186A (en) * 2006-06-19 2007-05-23 华为技术有限公司 Message sending scheduling apparatus and method
CN106789152A (en) * 2016-11-17 2017-05-31 东软集团股份有限公司 Processor extended method and device based on many queue network interface cards
CN107005495A (en) * 2017-01-20 2017-08-01 华为技术有限公司 Method, network interface card, host device and computer system for forwarding packet
US20190065206A1 (en) * 2017-08-22 2019-02-28 Bank Of America Corporation Predictive Queue Control and Allocation
CN109729024A (en) * 2018-12-29 2019-05-07 中盈优创资讯科技有限公司 Data packet handling system and method
CN110750367A (en) * 2019-09-30 2020-02-04 华为技术有限公司 Method, system and related equipment for queue communication

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5843397B2 (en) * 2012-07-20 2016-01-13 富士通テレコムネットワークス株式会社 Communication device
CN106713185B (en) * 2016-12-06 2019-09-13 瑞斯康达科技发展股份有限公司 A kind of load-balancing method and device of multi-core CPU
KR101716715B1 (en) * 2016-12-27 2017-03-15 주식회사 티맥스클라우드 Method and apparatus for handling network I/O apparatus virtualization
CN109218226A (en) * 2017-07-03 2019-01-15 迈普通信技术股份有限公司 Message processing method and the network equipment
CN109962859A (en) * 2017-12-26 2019-07-02 北京华为数字技术有限公司 A kind of method for dispatching message and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968186A (en) * 2006-06-19 2007-05-23 华为技术有限公司 Message sending scheduling apparatus and method
CN106789152A (en) * 2016-11-17 2017-05-31 东软集团股份有限公司 Processor extended method and device based on many queue network interface cards
CN107005495A (en) * 2017-01-20 2017-08-01 华为技术有限公司 Method, network interface card, host device and computer system for forwarding packet
US20190065206A1 (en) * 2017-08-22 2019-02-28 Bank Of America Corporation Predictive Queue Control and Allocation
CN109729024A (en) * 2018-12-29 2019-05-07 中盈优创资讯科技有限公司 Data packet handling system and method
CN110750367A (en) * 2019-09-30 2020-02-04 华为技术有限公司 Method, system and related equipment for queue communication

Also Published As

Publication number Publication date
CN110750367B (en) 2023-03-17
CN110750367A (en) 2020-02-04

Similar Documents

Publication Publication Date Title
WO2021063154A1 (en) Queue communication method and system, and related devices
US20220100696A1 (en) Techniques for command validation for access to a storage device by a remote client
US10810135B2 (en) Data transmission method, apparatus, device, and system
CN107992436B (en) NVMe data read-write method and NVMe equipment
EP3033681B1 (en) Method and apparatus for delivering msi-x interrupts through non-transparent bridges to computing resources in pci-express clusters
US6631430B1 (en) Optimizations to receive packet status from fifo bus
WO2023185035A1 (en) Direct memory access architecture, system and method, and electronic device and medium
US20200201578A1 (en) Method and Apparatus for Transmitting Data Processing Request
CN114265800B (en) Interrupt message processing method and device, electronic equipment and readable storage medium
US11397697B2 (en) Core-to-core communication
US6684281B1 (en) Fast delivery of interrupt message over network
US20210075745A1 (en) Methods and apparatus for improved polling efficiency in network interface fabrics
US11741039B2 (en) Peripheral component interconnect express device and method of operating the same
AU2015402888B2 (en) Computer device and method for reading/writing data by computer device
WO2017101080A1 (en) Write request processing method, processor and computer
US11966585B2 (en) Storage device and storage system
US20160241666A1 (en) Network interface
CN109857553B (en) Memory management method and device
US10817446B1 (en) Optimized multiport NVMe controller for multipath input/output applications
WO2005036313A2 (en) Queue register configuration structure
US9288163B2 (en) Low-latency packet receive method for networking devices
US10628342B1 (en) System and method for accelerating performance of non-volatile memory RAID stacks
US8041902B2 (en) Direct memory move of multiple buffers between logical partitions
EP4254207A1 (en) Data processing apparatus and method, and related device
WO2020252763A1 (en) Adaptive pipeline selection for accelerating memory copy operations

Legal Events

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

Ref document number: 20872992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20872992

Country of ref document: EP

Kind code of ref document: A1