CN110750367A - Method, system and related equipment for queue communication - Google Patents

Method, system and related equipment for queue communication Download PDF

Info

Publication number
CN110750367A
CN110750367A CN201910944642.XA CN201910944642A CN110750367A CN 110750367 A CN110750367 A CN 110750367A CN 201910944642 A CN201910944642 A CN 201910944642A CN 110750367 A CN110750367 A CN 110750367A
Authority
CN
China
Prior art keywords
queue
data
host
network card
forwarding
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910944642.XA
Other languages
Chinese (zh)
Other versions
CN110750367B (en
Inventor
李涛
江锦毅
李生
周宇
杨荣玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910944642.XA priority Critical patent/CN110750367B/en
Publication of CN110750367A publication Critical patent/CN110750367A/en
Priority to PCT/CN2020/113497 priority patent/WO2021063154A1/en
Application granted granted Critical
Publication of CN110750367B publication Critical patent/CN110750367B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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 application provides a queue communication method. The method comprises the following steps: the forwarding device receiving a first doorbell message from the computing device; the forwarding device acquires information of a first host queue and information of a second host queue from the first doorbell message, acquires first data to be transmitted from the first host queue, and acquires second data to be transmitted from the second host queue; and the forwarding equipment stores the first data to be transmitted and the second data to be transmitted into forwarding queues corresponding to the first host queue and the second host queue respectively according to the queue corresponding relationship between the forwarding queues and the host queues, wherein the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.

Description

Method, system and related equipment for queue communication
Technical Field
The present application relates to the field of computers, and in particular, to a method, a system, and a related device for queue communication.
Background
The emergence of technologies such as multi-core processors, virtualization technology, distributed storage and the like prompts the generation of a novel computing mode, namely cloud computing. Cloud computing provides convenient, on-demand access to services for users based on a pool of configurable shared computing resources. Generally, a cloud computing service provider provides various specifications of virtual machines, and flexibly issues virtual machines with different specifications according to user requirements. For example, when the user has a large demand for the network, the user may be divided into a large-format Virtual machine having a Virtual Central Processing Unit (vCPU) with 64 bits and a storage space of 128 GB.
The virtual machine runs on the computing device, and configuring the virtual machine further includes assigning a plurality of host queues on the computing device to the virtual machine. When the virtual machine communicates with other devices except the computing device, the virtual machine needs to send data to the network card. For a virtual machine configured with a network card queue, when data needs to be sent to the network card, the data to be sent can be directly sent to a host queue allocated to the virtual machine, and then the host queue allocated to the virtual machine and the network card queue on the network card copy the data to be sent in the host queue allocated to the virtual machine to a network card queue of the network card through a queue communication mechanism, so that data communication between the virtual machine and the network card can be completed once.
In a queue communication mechanism of the related art, a host queue on a computing device and a network card queue of a network card are mapped one by one, and in other words, data to be sent stored in one host queue of the computing device from a virtual machine can only be sent to one network card queue on the network card. Typically, the performance of queued communications is limited by the forwarding capabilities of host queues on the computing device and the forwarding capabilities of network card queues. When the virtual machine sends data to the network card, the forwarding capability of the queue allocated to the virtual machine on the host is generally weaker than that of the queue on the network card due to the forwarding capability of the vCPU of the virtual machine, so that the forwarding performance of the queue on the network card cannot be fully exerted, and the communication efficiency is influenced.
Disclosure of Invention
The application provides a queue communication method, a queue communication system and related equipment, which are used for solving the problem that the communication efficiency is influenced because the queue forwarding performance on a network card cannot be fully exerted.
In a first aspect, a method for queue communication is provided, where 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 multiple data to be sent are stored in the multiple host queues, and the method includes:
the forwarding device receives a first doorbell message from the computing device, wherein the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues;
the forwarding device acquires the information of the first host queue and the information of the second host queue from the first doorbell message, acquires first data to be transmitted from the first host queue, and acquires second data to be transmitted from the second host queue;
and the forwarding equipment stores the first data to be sent and the second data to be sent into forwarding queues corresponding to the first host queue and the second host queue respectively according to the queue corresponding relation between the forwarding queues and the host queues, wherein the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
By implementing the method described in the first aspect, the queue corresponding relationship is generated between the multiple host queues and the same forwarding queue, so that the multiple host queues with low forwarding performance can share one forwarding queue with high forwarding capability for queue communication, thereby solving the problem that the forwarding performance of the queue on the network card cannot be fully exerted due to the fact that the forwarding performance of the host queue is lower than that of the network card queue, and further improving the communication efficiency.
In an embodiment, 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; and responding to the equipment query message, and reporting the number of the expanded forwarding queues to the computing equipment by the forwarding equipment, wherein the number of the expanded forwarding queues is determined by the number of the at least one forwarding queue and an expansion coefficient, and the number of the expanded forwarding queues is used for establishing the queue corresponding relation.
In one embodiment, the forwarding device includes an attribute register, and the number of the extended forwarding queues is stored in the attribute register; the reporting, by the forwarding device, the expanded number of forwarding queues to the computing device includes: and the forwarding equipment inquires the attribute register, acquires the number of the extended forwarding queues from the attribute register and reports the number of the extended forwarding queues to the computing equipment.
In the above embodiment, the forwarding device sends the number of the expanded forwarding queues to the computing device, so that the computing device can allocate a queue correspondence between a plurality of host queues and one forwarding queue, and the problem that the forwarding performance of the queue on the network card cannot be fully exerted due to the fact that the forwarding performance of the host queue is lower than that of the queue on the network card is solved without any upgrade to the computing device, thereby improving the communication efficiency.
In an embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first data to be sent, the information of the second host queue includes a second head pointer, the second head pointer indicates the second data to be sent, multiple groups of head pointers and multiple groups of tail pointers are stored in the forwarding device, each group of head pointers and each group of tail pointers respectively correspond to a head pointer and a tail pointer of one host queue of multiple host queues of the computing device, and at least one group of head pointers and at least one group of tail pointers of the at least one forwarding queue are also stored in the forwarding device; the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, and the method includes: the forwarding device acquires the first head pointer and the second head pointer from the first doorbell message; the method for acquiring the first data to be sent from the first host queue by the forwarding queue includes: the forwarding equipment refreshes the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer; the forwarding device obtains the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers; the forwarding queue obtains second data to be sent from the second host queue, including: the forwarding equipment refreshes the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers; the forwarding device obtains the second data to be sent in the second host queue 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 groups of tail pointers; after the forwarding device stores the first data to be sent and the second data to be sent in the first host queue and the forwarding queue corresponding to the second host queue, respectively, the method further includes: refreshing a tail pointer of the first host queue and a tail pointer of the second host queue; refreshing the head pointer of the corresponding forwarding queue; and sending the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing device.
In one 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, 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 group of head pointers and the at least one group of tail pointers are stored in the queue expansion device, the queue correspondence includes a first queue correspondence and a second queue correspondence, the first queue correspondence is a correspondence between the plurality of host queues and the at least one queue expansion device queue, the second queue correspondence is a correspondence 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 one to one, a plurality of groups of head pointers and tail pointers are stored in the queue expansion device, each group of head pointers and each group of tail pointers respectively correspond to a head pointer and a tail pointer of one host queue in the plurality of host queues, at least one group of queue expansion device head pointers and at least one group of queue expansion device tail pointers are also stored in the queue expansion device, at least one group of network card head pointers and at least one group of network card tail pointers are stored in the network card, the at least one group of queue expansion device head pointers correspond to the at least one group of network card head pointers one to one, and the at least one group of queue expansion device tail pointers correspond to the at least one group of network card tail pointers one to one; the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, and the method includes: the queue expansion equipment in the forwarding equipment acquires the first head pointer and the second head pointer from the first doorbell message; the method for acquiring the first data to be sent from the first host queue by the forwarding device includes: the queue expansion equipment in the forwarding equipment refreshes the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer and the corresponding relation of the first queue; the queue expansion equipment in the forwarding equipment acquires the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers; the forwarding device obtains second data to be sent from the second host queue, including: refreshing, by a queue expansion device in the forwarding device, head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers and the first queue correspondence; the queue expansion device in the forwarding device acquires the second data to be sent in the second host queue 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 groups of tail pointers; the step of the forwarding device storing the first data to be transmitted and the second data to be transmitted into the forwarding queues corresponding to the first host queue and the second host queue respectively includes: the queue expansion device in the forwarding device stores the first data to be transmitted and the second data to be transmitted into queue expansion device queues corresponding to the first host queue and the second host queue according to the first queue corresponding relationship, wherein the corresponding queue expansion device queues belong to the queue expansion device queues, 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 equipment in the forwarding equipment refreshes a head pointer of the corresponding queue expansion equipment queue, a tail pointer of the first host queue and a tail pointer of the second host queue; a network card in the forwarding device receives a second doorbell message from the queue expansion device, wherein the second doorbell message carries a head pointer of the corresponding queue expansion device queue; the network card in the forwarding equipment acquires the head pointer of the corresponding queue expansion equipment queue from the second doorbell message; the network card in the forwarding device refreshes the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one group of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue; the network card in the forwarding device acquires the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion device queue according to the refreshed corresponding network card head pointer and the tail pointer corresponding to the corresponding queue expansion device queue in the at least one group of network card tail pointers; and the network card in the forwarding equipment stores the first data to be transmitted and the second data to be transmitted into a network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relationship of the second queue, wherein the corresponding network card queue belongs to the network card queue.
In the above embodiment, a plurality of host queues in the computing device and one queue expansion device queue in the queue expansion device generate a first queue corresponding relationship, and one queue expansion device queue in the queue expansion device and a network card queue in one network card generate a second queue corresponding relationship, so that under the condition that neither the computing device nor the network card needs to be upgraded, the first data to be transmitted and the second data to be transmitted sent from the computing device are forwarded to the network card through the queue expansion device, the problem that the forwarding performance of the host queue on the network card cannot be fully exerted due to the fact that the forwarding performance of the host queue is lower than that of the network card queue can be solved, and the communication efficiency is improved.
In an embodiment, the first data to be transmitted is a first direct memory access DMA read descriptor, the second data to be transmitted is a second DMA read descriptor, and after the first data to be transmitted and the second data to be transmitted are stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: a network card in the forwarding equipment 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; a network card in the forwarding equipment sends the first DMA read command and a second DMA read command to queue expansion equipment in the forwarding equipment; the queue expansion equipment in the forwarding equipment acquires first data to be read from the computing equipment according to the first DMA read command, and acquires second data to be read from the computing equipment according to the second DMA read command; and the queue expansion equipment in the forwarding equipment forwards the first data to be read and the second data to be read to a network card in the forwarding equipment.
In an embodiment, the first data to be transmitted is a first DMA write descriptor, and the second data to be transmitted is a second DMA write descriptor, where the first DMA write descriptor is used to write the first 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, and the storing the first data to be transmitted and the second data to be transmitted in the queue expansion device queues corresponding to the first host queue and the second host queue includes: a queue expansion device in the forwarding device 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, wherein the first DMA write descriptor is used for writing first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used for writing second data to be written from the network card into the queue expansion device; the queue expansion equipment in the forwarding equipment stores the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion equipment queue; after the first data to be transmitted and the second data to be transmitted are stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: a network card in the forwarding device acquires first fragmentation data which is stored in the network card and corresponds to a first network card DMA write descriptor according to the first network card DMA write descriptor, and acquires second fragmentation data which is stored in the network card and corresponds to a second network card DMA write descriptor according to the second network card DMA write descriptor, wherein the first data to be written comprises n first fragmentation data, and the second data to be written comprises m second fragmentation data; a network card in the forwarding equipment 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; a 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 equipment in the forwarding equipment writes the first fragment data and the second fragment data into a memory of the queue expansion equipment according to the first DMA write command and the second DMA write command; in a memory of a queue expansion device in the forwarding device, generating a third DMA write command according to the first data to be written when the number of first fragmented data is n, and generating a fourth DMA write command according to the second data to be written when the number of second fragmented data is m, 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 the computing device to execute and write the first data to be written into the computing device; and the queue expansion equipment in the forwarding equipment sends the third DMA write command and the fourth DMA write command to the computing equipment, so that the computing equipment writes the first data to be written and the second data to be written into the computing equipment according to the third DMA write command and the fourth DMA write command.
In the above embodiment, the queue expansion device stores the first fragmented data sent by the network card in the memory, and after all n fragmented data of the first data to be written are collected, the first data to be written is sent to the computing device, because the data received by the network card is generally fragmented data, the problem that the processing pressure of the computing device is large when the computing device receives the disordered first fragmented data is avoided, and the efficiency of queue communication is improved.
In an embodiment, after the first data to be transmitted and the second data to be transmitted are stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: the network card in the forwarding equipment sends a completion message and an interruption message to the queue expansion equipment; and the queue expansion equipment in the forwarding equipment sends the completion message and the interrupt to the computing equipment, so that the computing equipment refreshes tail pointers of the first host queue and the second host queue according to the completion message.
In a second aspect, a queue communication system is provided, the system comprising a forwarding device and a computing device, the forwarding device being connected to the computing device, the forwarding device comprising at least one forwarding queue, the computing device comprising a plurality of host queues, a plurality of data to be sent being stored in the plurality of host queues, wherein,
the computing device is configured to send a first command message to the forwarding device, where the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues;
the forwarding device is to receive a first doorbell message from the computing device;
the forwarding device is configured to obtain information of the first host queue and information of the second host queue from the first doorbell message, obtain first data to be sent from the first host queue, and obtain second data to be sent 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 in forwarding queues corresponding to the first host queue and the second host queue, respectively, according to a queue correspondence between the forwarding queues and the host queues, where the first host queue and the second host queue correspond to a same forwarding queue of the at least one forwarding queue.
In one embodiment, the computing device is to send a device query message to the forwarding device prior to sending the first doorbell message to the forwarding device; the forwarding device is configured to receive a device query message from the computing device; the forwarding device is configured to report the number of expanded forwarding queues to the computing device in response to the device query message, where the number of expanded forwarding queues is determined by the number of the at least one forwarding queue and an expansion coefficient, and the number of expanded forwarding queues is used to establish the queue correspondence.
In one 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 is configured to query the attribute register, obtain the number of the expanded forwarding queues from the attribute register, and report the number of the expanded forwarding queues 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 data to be sent, the information of the second host queue includes a second head pointer, the second head pointer indicates the second data to be sent, multiple groups of head pointers and multiple groups of tail pointers are stored in the forwarding device, each group of head pointers and each group of tail pointers respectively correspond to a head pointer and a tail pointer of one host queue of multiple host queues of the computing device, and at least one group of head pointers and at least one group of tail pointers of the at least one forwarding queue are also stored in the forwarding device; the forwarding device is used for acquiring the first head pointer and the second head pointer from the first doorbell message; the forwarding device is used for refreshing the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer; the forwarding device is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers; the forwarding device is configured to refresh, according to the second head pointer, a head pointer corresponding to the second host queue in the multiple groups of head pointers; the forwarding device is configured to obtain the second to-be-sent data in the second host queue 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 groups of tail pointers; the forwarding device is configured to refresh a tail pointer of the first host queue and a tail pointer of the second host queue after the first data to be sent and the second data to be sent are stored in the first host queue and the forwarding queue corresponding to the second host queue, respectively; the forwarding device is used for refreshing 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.
In one 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, 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 group of head pointers and the at least one group of tail pointers are stored in the queue expansion device, the queue correspondence includes a first queue correspondence and a second queue correspondence, the first queue correspondence is a correspondence between the plurality of host queues and the at least one queue expansion device queue, the second queue correspondence is a correspondence 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 one to one, a plurality of groups of head pointers and tail pointers are stored in the queue expansion device, each group of head pointers and each group of tail pointers respectively correspond to a head pointer and a tail pointer of one host queue in the plurality of host queues, at least one group of queue expansion device head pointers and at least one group of queue expansion device tail pointers are also stored in the queue expansion device, at least one group of network card head pointers and at least one group of network card tail pointers are stored in the network card, the at least one group of queue expansion device head pointers correspond to the at least one group of network card head pointers one to one, and the at least one group of queue expansion device tail pointers correspond to the at least one group of network card tail pointers one to one; the queue expansion equipment is used for acquiring the first head pointer and the second head pointer from the first doorbell message; the queue expansion equipment is used for refreshing the head pointer corresponding to the first host queue in the plurality of groups of head pointers according to the first head pointer and the corresponding relation of the first queue; the queue expansion device is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers; the queue expansion equipment is used for refreshing the head pointer corresponding to the second host queue in the multiple groups of head pointers according to the second head pointer and the corresponding relation of the first queue; the queue expansion device is configured to obtain the second data to be sent in the second host queue 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 groups of tail pointers; the queue expansion device is configured to store the first data to be transmitted and the second data to be transmitted into a queue expansion device queue corresponding to the first host queue and the second host queue according to the first queue correspondence relationship, where 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 a same queue expansion device queue in the at least one queue expansion device queue; the queue expansion device is used for refreshing a head pointer of the corresponding queue expansion device queue, a tail pointer of the first host queue and a tail pointer of the second host queue; the network card is used for receiving a second doorbell message from the queue expansion equipment, wherein the second doorbell message carries a head pointer of the corresponding queue expansion equipment queue; the network card is used for acquiring the head pointer of the corresponding queue expansion equipment queue from the second doorbell message; the network card in the forwarding device refreshes the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one group of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue; the network card is used for acquiring the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion equipment queue according to the corresponding network card head pointer after being refreshed and the tail pointer corresponding to the corresponding queue expansion equipment queue in the at least one group of network card tail pointers; and the network card is used for storing the first data to be transmitted and the second data to be transmitted into the network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relationship of the second queue.
In an embodiment, the first to-be-transmitted data is a first direct memory access DMA read descriptor, the second to-be-transmitted data is a second DMA read descriptor, and the network card is further configured to generate a first DMA read command and a second DMA read command according to the first DMA read descriptor and the second DMA read descriptor after the first to-be-transmitted data and the second to-be-transmitted data are stored in the network card queue corresponding to the corresponding queue expansion device queue; the network card is used for sending the first DMA read command and the second DMA read command to a queue expansion device in the forwarding device; the queue expansion equipment is used for acquiring first data to be read from the computing equipment according to the first DMA read command and acquiring second data to be read from the computing equipment according to the second DMA read command; the queue expansion device is used for forwarding the first data to be read and the second data to be read to a network card in the forwarding device.
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, where the first DMA write descriptor is used to write the first 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 queue expansion device is used to convert the first DMA write descriptor into a first network card DMA write descriptor, and convert the second DMA write descriptor into a second network card DMA write descriptor, where 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 queue expansion equipment is used for storing the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion equipment queue; the network card is further configured 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, obtain, according to the first network card DMA write descriptor, first sliced data stored in the network card and corresponding to the first network card DMA write descriptor, and obtain, according to the second network card DMA write descriptor, second sliced data stored in the network card and corresponding to the second network card DMA write descriptor, where the first data to be written includes n pieces of first sliced data, and the second data to be written includes m pieces of second sliced data; the network card is used for generating a first DMA write command according to the first network card DMA write descriptor and the first fragment data, and generating a second DMA write command according to the second network card DMA write descriptor and the second fragment data; the network card is used for sending the first DMA write command and the second DMA write command to the queue expansion equipment; the queue expansion device is used for writing the first fragment data and the second fragment data into a memory of the queue expansion device according to the first DMA write command and the second DMA write command; the queue expansion device is configured to generate a third DMA write command according to the first to-be-written data when the number of first fragmented data is n in a memory of the queue expansion device in the forwarding device, and generate a fourth DMA write command according to the second to-be-written data when the number of second fragmented data is m, where the third DMA write command is used for being executed by the computing device and writing the first to-be-written data into the computing device, and the fourth DMA write command is used for being executed by the computing device and writing the first to-be-written data into the computing device; the queue expansion device is used for sending the third DMA write command and the fourth DMA write command to the computing device; 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.
In an embodiment, the network card is further configured to send a completion message and an interrupt message to the queue expansion device 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; and the queue expansion equipment is also used for sending the completion message and the interrupt to the computing equipment, so that the computing equipment refreshes tail pointers of the first host queue and the second host queue according to the completion message.
In a third aspect, a forwarding device is provided, where the forwarding device 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, where the forwarding device includes:
a receiving unit, configured to receive a first doorbell message from the computing device, where the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the multiple host queues;
an obtaining unit, configured to obtain information of the first host queue and information of the second host queue from the first doorbell message, obtain first data to be sent from the first host queue, and obtain second data to be sent from the second host queue;
and the storage unit is used for respectively storing the first data to be transmitted and the second data to be transmitted into the forwarding queues corresponding to the first host queue and the second host queue according to the queue corresponding relationship between the forwarding queues and the host queues, 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 comprises 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 configured to respond to the device query message, and the forwarding device reports the number of the expanded forwarding queues to the computing device, where the number of the expanded forwarding queues is determined by the number of the at least one forwarding queue and an expansion coefficient, and the number of the expanded forwarding queues is used to establish the queue correspondence.
In an embodiment, the forwarding device includes an attribute register, the extended number of forwarding queues is stored in the attribute register, and the response unit is configured to query the attribute register, obtain the extended number of forwarding queues from the attribute register, and report the extended number of forwarding queues 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 data to be sent, the information of the second host queue includes a second head pointer, 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, each set of head pointer and each set of tail pointer respectively corresponds to a head pointer and a tail pointer of one queue of multiple queues of the computing device, and at least one set of head pointers and at least one set of tail pointers of the at least one queue are also stored in the forwarding device; the forwarding device further comprises a refreshing unit, and the obtaining unit is used for obtaining the first head pointer and the second head pointer from the first doorbell message; the refreshing unit is used for refreshing the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer; the obtaining unit is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers; the refreshing unit is used for refreshing the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers; the obtaining unit is configured to obtain the second data to be sent in the second host queue 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 groups of tail pointers; the refreshing unit is configured to refresh a tail pointer of the first host queue and a tail pointer of the second host queue after the first data to be sent and the second data to be sent are respectively stored in the first host queue and a forwarding queue corresponding to the second host queue; the refreshing unit is used for refreshing the head pointer of the corresponding forwarding queue; the refreshing unit is used for sending the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing equipment.
In a fourth aspect, a queue expansion device is provided, where a queue expansion device queue is connected to a computing device and a network card, the queue expansion device is connected to the 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, 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, where the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the multiple host queues;
an obtaining unit, configured to obtain information of the first host queue and information of the second host queue from the first doorbell message, obtain first data to be sent from the first host queue, and obtain second data to be sent from the second host queue;
the storage unit is used for respectively storing the first data to be transmitted and the second data to be transmitted into the queue expansion equipment queues corresponding to the first host queue and the second host queue according to the first queue corresponding relation between the queue expansion equipment queue and the host queue;
a sending unit, configured to send a second doorbell message to the network card, where the second doorbell message carries information of the corresponding queue expansion device queue, so that the network card obtains the first data to be sent and the second data to be sent from the corresponding queue expansion device queue according to the second doorbell message, and stores 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 a second queue correspondence between the network card queue and the queue expansion device queue, where 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 a 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 comprises a response unit, the receiving unit further configured to receive a first device query message from the computing device before receiving a first doorbell message from the computing device; the sending unit is used for sending a second equipment query message to the network card; the response unit is used for receiving the number of network card queues sent by the network card, wherein the number of the network card queues is used for establishing the corresponding relation of the second queues; the response unit is configured to report the number of the expanded queue expansion device queues to the computing device in response to the first device query message, where the number of the expanded queue expansion device queues is determined by the number of the network card queues and an expansion coefficient, and the number of the expanded queue expansion device queues is used to establish the first queue correspondence.
In one embodiment, the device includes an attribute register, and the number of the extended forwarding queues is stored in the attribute register; the response unit is further configured to query the attribute register, obtain the number of the queue expansion device queues after the expansion from the attribute register, and report the number of the queue expansion device queues after the expansion to the computing device.
In one embodiment, the information of the first host queue includes a first head pointer, the first head pointer indicates the first data to be transmitted, the information of the second host queue includes a second head pointer, the second head pointer indicates the second data to be transmitted, a plurality of groups of head pointers and a plurality of groups of tail pointers are stored in the queue expansion device, each group of head pointers and each group of tail pointers respectively correspond to the head pointer and the tail pointer of one host queue of the plurality of host queues, at least one group of queue expansion device head pointers and at least one group of queue expansion device tail pointers are stored in the queue expansion device, at least one group of network card head pointers and at least one group of network card tail pointers are stored in the network card, the at least one group of queue expansion device head pointers correspond to the at least one networking chuck pointer one by one, and the at least one group of queue expansion device tail pointers correspond to the at least one group of network card tail pointers one by one, the queue expansion equipment further comprises a refreshing unit, and the acquiring unit is used for acquiring the first head pointer and the second head pointer from the first doorbell message; the refreshing unit is used for refreshing the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer and the first queue corresponding relation; the obtaining unit is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers; the refreshing unit is used for refreshing the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers and the corresponding relation of the first queue; the obtaining unit is configured to obtain the second data to be sent in the second host queue 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 groups of tail pointers; the storage unit is configured to store the first data to be transmitted and the second data to be transmitted into queue expansion device queues corresponding to the first host queue and the second host queue according to the first queue correspondence relationship, where the corresponding queue expansion device queues belong to the queue expansion device queues, and the first host queue and the second host queue correspond to a same queue expansion device queue in the at least one queue expansion device queue; the refreshing unit is used for refreshing a head pointer of the corresponding queue expansion equipment queue, a tail pointer of the first host queue and a tail pointer of the second host queue; the sending unit is further configured to send the second doorbell message to the network card, where the second doorbell message carries a head pointer of the corresponding queue expansion device queue, the network card refreshes the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one group of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue, and the corresponding network card head pointer and the tail pointer corresponding to the queue expansion device queue in the at least one group of network card tail pointers after being refreshed, acquiring the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion device queue, and storing the first data to be transmitted and the second data to be transmitted into the network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relation of the second queue.
In an embodiment, the first data to be transmitted is a first direct memory access DMA read descriptor, the second data to be transmitted is a second DMA read descriptor, and the receiving unit is further configured to receive a first DMA read command and a second DMA read command transmitted by the network card, where the first DMA read command is generated by the network card according to the first DMA descriptor, and the second DMA read command is generated by the network card according to the second DMA descriptor; the acquisition unit is further used for acquiring first data to be read from the computing equipment according to the first DMA read command and acquiring second data to be read from the computing equipment according to the 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.
In one embodiment, the first data to be transmitted is a first DMA write descriptor, the second data to be transmitted is a second DMA write descriptor, wherein the first DMA write descriptor is to write a first data to be written from the queue expansion device to the computing device, the second DMA descriptor is for writing second data to be written from the queue expansion device to the computing device, the device further comprises a translation unit for translating the first DMA write descriptor into a first network card DMA write descriptor, translating the second DMA write descriptor into a second network card DMA write descriptor, wherein the first DMA write descriptor is used for writing first data to be written from the network card into the queue expansion device, the second DMA descriptor is used for writing second data to be written into the queue expansion equipment from the network card; the storage unit is used for storing the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion equipment queue; the receiving unit is to receive a first DMA write command and the second DMA write command, wherein the first DMA write command is that the network card acquires first fragmented data which is stored in the network card and corresponds to the first network card DMA write descriptor according to the first network card DMA write descriptor, a first DMA write command generated according to the first network card DMA write descriptor and the first fragment data, the second DMA write command is that after the network card acquires second fragmentation data which is stored in the network card and corresponds to the second network card DMA write descriptor according to the second network card DMA write descriptor, a second DMA write command generated according to the second network card DMA write descriptor and the second slice data, the first data to be written comprises n first fragmented data, and the second data to be written comprises m second fragmented data; the storage unit is used for writing the first fragment data and the second fragment data into a memory of the queue expansion device according to the first DMA write command and the second DMA write command; the conversion unit is configured to generate a third DMA write command according to the first to-be-written data when the number of first fragmented data is n in a memory of the queue expansion device, and generate a fourth DMA write command according to the second to-be-written data when the number of second fragmented data is m, where the third DMA write command is used for being executed by the computing device and writing the first to-be-written data into the computing device, and the fourth DMA write command is used for being executed by the computing device and writing the first to-be-written data 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 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.
In an embodiment, the receiving unit is further configured to receive a completion message and an interrupt sent by the network card, where the completion message and the interrupt are generated by the network card after the first data to be sent and the second data to be sent are stored in a 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.
In a fifth aspect, there is provided a forwarding device comprising a processor and a memory, wherein the processor executes code in the memory to implement the method described in the first aspect.
A sixth aspect provides a computer program product which, when read and executed by a computing device, implements the method described in the first aspect.
In a seventh aspect, there is provided a computer non-transitory storage medium comprising instructions that, when executed 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, where the forwarding 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 comprising a processor and a memory, the processor executing 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 when read and executed by a computing device implements the queue expansion device described in the fourth aspect.
In an eleventh aspect, there is provided a computer non-transitory storage medium characterized by instructions that, when executed on a computing device, cause the computing device to implement the queue expansion device described in the fourth aspect.
In a twelfth aspect, a queue expansion device is provided, where the device includes a logic circuit, and the forwarding device implements the queue expansion device described in the fourth aspect through the logic circuit.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a schematic diagram of a logical structure of a network system to which the solution provided in the present application is applicable;
fig. 2 is a schematic diagram of a logical structure of a forwarding device for queue communication in a network system according to the present application;
fig. 3 is a schematic diagram of a logical structure of a queue expansion device for queue communication in a network system according to the present application;
FIG. 4 is a flow chart illustrating the steps of a queue communication method provided herein;
FIGS. 5A-5C are schematic diagrams of a queue structure;
FIG. 6 is a flow chart of steps of another queue communication method provided herein;
fig. 7 is a flowchart illustrating steps of obtaining first data to be transmitted and second data to be transmitted according to a doorbell message in a queue communication method provided in the present application;
FIG. 8 is a flowchart of the steps of a queue communication method provided in the present application in an application scenario;
FIG. 9 is a flowchart illustrating steps of a queue communication method according to an embodiment of the present disclosure in another application scenario;
fig. 10 is a schematic structural diagram of a forwarding device provided in the present application;
FIG. 11 is a schematic diagram of a queue expansion apparatus provided in the present application;
fig. 12 is a schematic hardware structure diagram of a forwarding device provided in the present application;
fig. 13 is a schematic hardware structure diagram of a queue expansion apparatus provided in the present application.
Detailed Description
The terminology used in the description of the embodiments section of the present application is for the purpose of describing particular embodiments of the present application only and is not intended to be limiting of the present application.
The scheme provided by the application is suitable for a network system, and the network system can realize data communication between the computing devices. As shown in fig. 1, fig. 1 is a schematic diagram of a logical structure of a network system to which the present application is applied, where the network system includes: computing device 110 and computing device 120, forwarding device 210 and forwarding device 220, and network 300, where computing device 110 and forwarding device 210 are connected and communicate, forwarding device 210 is connected and communicates with network 300, computing device 120 is connected and communicates with forwarding device 220, and forwarding device 220 is connected and communicates with network 300. It should be noted that fig. 1 only depicts two computing devices and two forwarding devices for facilitating understanding, and each computing device is only connected with one forwarding device, in a practical situation, the network system may include one or more computing devices and one or more forwarding devices, the number of the computing devices and the number of the forwarding devices are not limited to the embodiments of the present application, each computing device may also be connected with a plurality of forwarding devices, the system may be adjusted according to user requirements, and the present application does not specifically limit this. Moreover, fig. 1 is only for convenience of description, and only shows a part of resources, and in a specific implementation, the computing device shown in fig. 1 may further include hardware resources such as a memory and a hard disk, and software resources such as an operating system and an application program that need to be run, which are not described again.
When data to be sent needs to be transmitted to the computing device 120 in the computing device 110, the data to be sent on the side of the computing device 110 may be transmitted to the forwarding device 210, the network card 210 transmits the data to be sent to the network card 220 through the network 300 connected to the network card 210, and the forwarding device 220 may receive the data to be sent through the network 300 and transmit the data to be sent to the computing device 120, so that the purpose of transmitting the data to be sent to the computing device 120 by the computing device 110 is achieved. The present application is mainly directed to a communication process between a computing device and a forwarding device, and therefore, a process of data transmission by the forwarding device through a network is not described again. The following explains in detail how the present application implements communication between a computing device and a forwarding device.
In this embodiment of the application, the forwarding device may be a network card, and 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 (4 host queues Q00-Q03 are drawn in the drawing), the forwarding device 210 includes at least one forwarding queue 211 (only 2 forwarding queues Q10 and Q11 are drawn in the drawing), and a queue correspondence exists between the at least one forwarding queue 211 and the plurality of host queues 111, where a queue correspondence may exist between 1 forwarding queue 211 and the plurality of host queues 211, for example, a queue correspondence exists between the host queues Q00-Q01 and the forwarding queue Q10 shown in fig. 2, and a queue correspondence exists 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, only the computing device 110 and the forwarding device 210 are drawn in fig. 1 for ease of understanding, and are not described again.
Then, when the computing device 110 needs to transmit data to be transmitted to the forwarding device 210, the data to be transmitted may be first placed in a host queue, for example, the host queues Q00 and Q01 in fig. 2, and then the forwarding queue Q10 corresponding to the host queues Q00 and Q01 is determined according to the queue correspondence, so that the data to be transmitted is transferred from the host queues Q00 and Q01 to the forwarding queue Q10, so that the data to be transmitted can be transmitted from the computing device 110 to the forwarding device 210. It can be understood that, in the forwarding queues in the forwarding device provided by the present application, each forwarding queue may generate a queue corresponding relationship with a plurality of host queues, thereby avoiding low communication efficiency caused by the forwarding capability of the host queues being weaker than that of the network card queues, and enabling the forwarding performance of the network card queues to be fully exerted.
In this embodiment of the present application, the forwarding device may further include a queue expansion device and a network card, and in a specific implementation, the communication system shown in fig. 1 may be as shown in fig. 3, wherein the computing device 110 comprises a plurality of host queues 111 (4 host queues Q00-Q03 are depicted in the figure), the forwarding device 210 comprises a queue expansion device 2101 and a network card 2102, wherein queue expansion device 2010 includes at least one queue expansion device queue 2111 (only 2 queue expansion device queues Q10 and Q11 are drawn in the figure), network card 2102 includes at least one network card queue 2112 (only 2 network card queues Q20 and Q21 are drawn in the figure), and, a first queue correspondence exists between the at least one queue expansion device queue 2111 and the plurality of host queues 111, a second queue corresponding relationship exists between the at least one network card queue 2112 and the at least one queue expansion device queue 2111. Wherein, there may be a first queue correspondence between 1 queue expansion device queue 2111 and multiple host queues 211, for example, there may be a queue correspondence between host queues Q00-Q01 and queue expansion device queue Q10 shown in fig. 3; a second queue correspondence may exist between 1 queue expansion device queue 2111 and 1 network card queue 2112, for example, a queue correspondence exists between a queue expansion device queue Q10 and a network card queue Q20 shown in fig. 3.
Then, when the computing device 110 needs to transmit data to be transmitted to the network card 2112, the data to be transmitted may be first placed in a host queue, for example, in the host queues Q00 and Q01 in fig. 3, and then according to the first queue correspondence, the queue expansion device queue Q10 corresponding to the host queue Q00 and Q01 is determined, so that the data to be transmitted is transferred from the host queues Q00 and Q01 to the queue expansion device queue Q00; and determining a network card queue Q20 corresponding to the queue expansion device queue Q10 according to the second queue correspondence, so that the data to be sent is transferred from the queue expansion device queue Q10 to the network card queue Q20, and the data to be sent is transmitted from the computing device 110 to the network card 2112. It can be understood that, in the queue expansion device provided by the present application, each queue expansion device queue may generate a queue corresponding relationship with a plurality of host queues, and the expansion device queues and the network card queues are in a one-to-one corresponding relationship, so that under the condition that the network card and the computing device do not need to be upgraded at all, the low communication efficiency caused by the forwarding capability of the host queue being weaker than that of the network card queue is avoided, and the forwarding performance of the network card queue is fully exerted.
In this embodiment of the 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, may also be two virtual machines located in the same physical machine, and may also be two virtual machines located in different physical machines, which is not limited in this application.
The method for queue communication based on forwarding devices provided by the present application is described below based on the network architectures shown in fig. 1-2.
As shown in fig. 4, the present application provides a method of 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 a plurality of host queues, a plurality of data to be sent are stored in the plurality of host queues of the computing device, and in brief, the data to be sent in the plurality of host queues of the computing device is to be sent to the at least one forwarding queue of the forwarding device. Computing device 400 in fig. 4 may be computing device 110 and computing device 120 in fig. 1-2, the method of queue communication comprising the steps of:
s101: the forwarding device receives a device query message from the computing device.
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 the forwarding device through PCIe device enumeration, and then can communicate with the forwarding device.
S102: and responding to the equipment query message, and reporting the number of the expanded forwarding queues to the computing equipment by the forwarding equipment, so as to establish a queue corresponding relation between the forwarding queues and the host queue. The number of the extended forwarding queues is determined by the number of the at least one forwarding queue and an extension coefficient, and the number of the extended forwarding queues is used for establishing a queue corresponding relation.
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 the expanded forwarding queues to the computing device includes: and the forwarding equipment inquires the attribute register, acquires the number of the expanded forwarding queues from the attribute register and reports the number of the expanded forwarding queues to the computing equipment. Wherein the expansion coefficient n can be determined according to the queue processing capacity of the forwarding device and the single thread processing capacity of the processor of the computing device.
S103: the forwarding device receives a first doorbell message from the computing device, wherein the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the queues.
S104: and the forwarding equipment acquires the information of the first host queue and the information of the second host queue from the first doorbell message, acquires first data to be transmitted from the first host queue and acquires second data to be transmitted from the second host queue.
S105: and the forwarding equipment stores the first data to be transmitted and the second data to be transmitted into forwarding queues corresponding to the first host queue and the second host queue respectively according to the queue corresponding relationship between the forwarding queues and the host queues, wherein the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
In a specific implementation, the host queue and the forwarding queue may be understood as a segment of memory, where the segment of memory is divided into a plurality of memory blocks with equal length, and corresponds to a work unit, and each work unit is used to store a message with a fixed length, such as a data request (a read request or a write request) initiated by a computing device to a forwarding device. Therefore, similar to other storage mechanisms, each queue maintained by the computing device and the forwarding device further includes a Head pointer (Head) and a Tail pointer (Tail), and the storage condition of the queue can be obtained by comparing the positions of the two pointers. Specifically, the refresh rule of the head pointer is: pointing to the next empty position in the queue, and the refreshing rule of the tail pointer is as follows: pointing to the location of the next command to be executed. The tail pointer moves continuously as new commands are added to the queue and the head pointer moves continuously as commands are fetched for consumption, so the queue can be logically understood as a circular queue as shown in fig. 5A. However, it should be understood that the actual state of the memory in the queue is a long stripe, as shown in fig. 5B, when the head and Tail pointers point to the same position, it means that the queue is currently an empty queue, as shown in fig. 5C, and when the next pointer of the Tail pointer is the head pointer, i.e., head ═ Tail +1, the queue is a full queue, and no new message can be received. It should be understood that the above examples are illustrative only and are not to be construed as being particularly limiting. It will be appreciated that each host queue in computing device 400 includes head and tail pointers, and thus, the information for the first host queue includes a first head pointer and the information for the second host queue includes a second head pointer. The first head pointer indicates the first data to be transmitted, and the second head pointer indicates the second data to be transmitted. For example, as shown in fig. 6, the first data to be sent is located in 4 units a0-A3 in the first host queue, then the first head pointer may point to A3, the second data to be sent is located in 3 units B0-B2 in the second host queue, then the second head pointer may point to B2, and therefore, the first doorbell message sent by the computing device 400 to the forwarding device 300 at step S103 will contain the first head pointer A3 and the second head pointer B2.
Correspondingly, the forwarding device 300 also stores multiple sets of head 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 one of the multiple host 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 forwarding queue. In a specific implementation, as shown in fig. 6, the forwarding device 300 further includes a doorbell register for storing the values of the head and tail pointers of the first host queue and the second host queue in the computing device 400, and the values of the head pointer and the tail pointer of the forwarding queue in the forwarding device.
Therefore, the specific steps of step S104 may be as follows:
s1041: and the forwarding equipment acquires the first head pointer and the second head pointer from the first doorbell message.
S1042: and the forwarding equipment refreshes the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer.
S1043: and the forwarding equipment refreshes the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers.
S1044: and the forwarding equipment acquires the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers.
S1045: and the forwarding equipment acquires the second data to be sent in the second host queue 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 groups of tail pointers.
For example, as shown in fig. 6, when the forwarding device 300 receives the first doorbell message sent by the computing device 400, first, in step S1041, the first head pointer A3 and the second head pointer B2 may be obtained from the first doorbell message, and in step S1042, the value of the first head pointer stored in the doorbell register may be refreshed to A3 according to the first head pointer A3 obtained in the first doorbell message, and similarly, in step S1043, the value of the second head pointer stored in the memory in the doorbell register may be refreshed to B2 according to the second head pointer B2 obtained in the first doorbell message. Finally, the forwarding device obtains the first data to be sent A0-A3 from the first host queue by comparing the values of the first head pointer A3 and the first tail pointer A0 which are refreshed in the doorbell register, and obtains the second data to be sent B0-B2 from the second host queue according to the values of the second head pointer B2 and the second tail pointer B0.
It can be understood that, after acquiring the first data to be transmitted and the second data to be transmitted, in step S105, the forwarding device may first acquire the forwarding queues corresponding to the first host queue and the second host queue according to the queue corresponding relationship established in step S102. And then storing the first data to be transmitted and the second data to be transmitted into the forwarding queue to finish one-time data communication.
In an embodiment, after the forwarding device stores the first data to be transmitted and the second data to be transmitted in the forwarding queues corresponding to the first host queue and the second host queue, respectively, the method further includes: refreshing a tail pointer of the first host queue and a tail pointer of the second host queue; refreshing the head pointer of the corresponding forwarding queue; and sending the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing device. For example, as shown in fig. 6, after the forwarding device stores the first data to be transmitted and the second data to be transmitted in the forwarding queue C corresponding to the first host queue and the second host queue, the forwarding device may flush the tail pointer of the forwarding queue C in the doorbell register to C7, flush the first tail pointer of the first host queue to A3 and the second tail pointer of the second host queue to B3 because the data in the first host queue and the second host queue have moved into the forwarding queue C, and transmit the values of the first tail pointer and the second tail pointer to the computing device, thereby achieving the purpose of notifying the computing device that the first data to be transmitted and the second data to be transmitted have been removed by the forwarding device.
In summary, by using the queue communication method provided by the present application, the forwarding device sends the number of the expanded network card queues to the computing device, so that the use performance of the network card hardware is fully exploited, the thread message forwarding rate of the computing device no longer becomes the bottleneck of network card processing message forwarding, and further resource waste is avoided.
Next, based on the system architecture shown in fig. 3, a queue communication method of the queue expansion device provided in the present application is described, and it can be understood that the forwarding device 300 includes a queue expansion device 500 and a network card 600, at least one forwarding queue of the forwarding device 300 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 corresponding relationship comprises a first queue corresponding relationship and a second queue corresponding relationship, the first queue corresponding relationship is the corresponding relationship between the host queues and the at least one queue expansion equipment queue, the second queue corresponding relationship is the corresponding relationship between the at least one network card queue and the at least one queue expansion equipment queue, and the at least one network card queue corresponds to the at least one queue expansion equipment queue one to one. As shown in fig. 7, the method of queue communication includes the following steps:
s201: the computing device 400 sends a device query message to the queue expansion device 500.
S202: the queue expansion device 500 sends a device query message to the network card 600.
S203: the network card 600 reports the number of the network card queues to the queue expansion device 500, so as to establish a second queue corresponding relationship between the queue expansion device and the network card queues. The network card queue and the queue expansion equipment queue are in one-to-one correspondence. In a specific implementation, the queue expansion device 500 includes an attribute register, and after receiving the number of the network card queues of the network card 600, the queue expansion device 500 stores the number of the network card queues in the attribute register.
S204: the queue expansion device 500 reports the number of the expanded queues to the computing device 400, so as to establish a first queue corresponding relationship between the queue expansion device queue and the host queue. And the number of the expanded queues is determined by the number of the network card queues and the expansion coefficient.
In a specific implementation, the number of the extended queues is stored in the attribute register. The queue expansion device 500 may obtain the number of network card queues from the attribute register by querying the attribute register, calculate the number of expanded queues according to the expansion coefficient k, and report the number of expanded queues to the computing device. The expansion coefficient k may be determined according to a message forwarding rate a of the network card and a message forwarding rate b of a single thread of a processor of the computing device. In particular, the amount of the solvent to be used,
Figure BDA0002223809830000161
for example, if the message forwarding rate of the network card is 2 mbps, and the message forwarding rate of a single thread of the processor of the computing device is 0.5 mbps, the expansion ratio k at this time is less than or equal to 4.
S205: the queue extension device 500 receives a first doorbell message from the computing device 400, where the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues.
S206: the queue extension device 500 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 transmitted from the first host queue, and obtains the second data to be transmitted from the second host queue.
S207: the queue expansion device 500 stores the first data to be sent and the second data to be sent into a queue expansion device queue corresponding to the first host queue and the second host queue in the queue expansion device queue respectively according to the first queue corresponding relationship, so that the data to be sent in the first host queue and the second host queue in the computing device are stored into the queue expansion device queue in the queue expansion device 500.
S208: the network card 600 receives a second doorbell message from the queue expansion device 500, where the second doorbell message carries information of a corresponding queue expansion device queue, and the corresponding queue expansion device queue belongs to the queue expansion device queue.
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 transmitted and the second data to be transmitted from the corresponding queue expansion device queue.
S210: the network card 600 stores the first data to be transmitted and the second data to be transmitted into the network card queue corresponding to the queue expansion device queue in the network card queue according to the second queue corresponding relationship, so that the data to be transmitted in the host queue in the computing device is stored into the network card queue in the network card 600.
Referring to the foregoing descriptions of fig. 5A to 5C, each host queue in the computing device 400 includes a head-to-tail pointer, and each network card queue in the network card 600 includes a head-to-tail pointer, so that, correspondingly, the at least one group of head pointers and the at least one group of tail pointers are stored in the queue expansion device 500, the at least one group of network card head pointers and the at least one group of network card tail pointers are stored in the network card, the at least one group of queue expansion device head pointers 500 correspond to the at least one group of network card head pointers one to one, and the at least one group of queue expansion device tail pointers correspond to the at least one group of network card tail pointers one to one. In a specific implementation, as shown in fig. 8, the queue expansion device 500 includes a first doorbell register for storing values of head and tail pointers of the first host queue and the second host queue in the computing device 400, and values of a head pointer and a tail pointer of a forwarding queue in the queue expansion device 500. The network card 600 includes a second doorbell register for storing values of the head and tail pointers of the corresponding queue expansion device queue in the queue expansion device 500, and values of the head and tail pointers of the network card queue in the network card 600.
Therefore, referring to the specific flow of acquiring the first to-be-transmitted data and the second to-be-transmitted data from the first doorbell information in the embodiment in fig. 4, in step S206, the specific steps of the queue extension device acquiring the first to-be-transmitted data and the second to-be-transmitted data from the first doorbell information may be:
s2061: the queue expansion equipment acquires the first head pointer and the second head pointer from the first doorbell message;
s2062: the queue expansion equipment refreshes the head pointers of the queue expansion queues corresponding to the first host queue in the multiple groups of head pointers according to the first head pointers and the corresponding relation of the first queues;
s2063: the queue expansion equipment acquires the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers;
s2064: the queue expansion equipment refreshes the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers and the corresponding relation of the first queue;
s2065: and the queue expansion equipment acquires the second data to be sent in the second host queue 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 groups of tail pointers.
For details in the above steps S2061 to S2065, in the embodiment of fig. 6, the process of the forwarding device obtaining the first data to be transmitted and the second data to be transmitted from the first doorbell information may be referred to, and details are not described here.
It can be understood that, after the queue expansion device obtains the first data to be transmitted and the second data to be transmitted in step S206, the queue expansion device queues corresponding to the first host queue and the second host queue, that is, the corresponding queue expansion device queues, are determined according to the first queue corresponding relationship, then the first data to be transmitted and the second data to be transmitted are stored in the corresponding queue expansion device queues, the head pointers of the corresponding queue expansion device queues are refreshed, the second doorbell information including the third head pointer is sent to the network card 600, so that the network card repeats the above steps, obtains the first data to be transmitted and the second data to be transmitted from the corresponding queue expansion device queues according to the third head pointers in the second doorbell information, and determines the network card queue corresponding to the corresponding queue expansion device queue according to the second queue corresponding relationship, the first data to be transmitted and the second data to be transmitted are stored in the corresponding network card queue. That is, 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 equipment in the forwarding equipment acquires the first head pointer and the second head pointer from the first doorbell message; the method for acquiring the first data to be sent from the first host queue by the forwarding device includes: the queue expansion equipment in the forwarding equipment refreshes the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer and the corresponding relation of the first queue; the queue expansion device in the forwarding device acquires the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers; the forwarding device obtains second data to be sent from the second host queue, including: refreshing, by a queue expansion device in the forwarding device, a head pointer corresponding to the second host queue in the multiple groups of head pointers according to the second head pointer and the first queue corresponding relationship; the queue expansion device in the forwarding device obtains the second data to be sent in the second host queue 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 groups of tail pointers; the step of storing, by the forwarding device, the first data to be transmitted and the second data to be transmitted in the forwarding queues corresponding to the first host queue and the second host queue respectively includes: the queue expansion device in the forwarding device stores the first data to be transmitted and the second data to be transmitted into queue expansion device queues corresponding to the first host queue and the second host queue according to the first queue corresponding relationship, wherein the corresponding queue expansion device queues belong to the queue expansion device queues, 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 in the forwarding device refreshes a head pointer of the corresponding queue expansion device queue, a tail pointer of the first host queue and a tail pointer of the second host queue; a network card in the forwarding device receives a second doorbell message from the queue expansion device, wherein the second doorbell message carries a head pointer of the corresponding queue expansion device queue; the network card in the forwarding equipment acquires the head pointer of the corresponding queue expansion equipment queue from the second doorbell message; the network card in the forwarding device refreshes a network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one networking chuck pointer according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue; the network card in the forwarding device acquires the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion device queue according to the refreshed corresponding network card head pointer and the tail pointer corresponding to the corresponding queue expansion device queue in the at least one group of network card tail pointers; and the network card in the forwarding equipment stores the first data to be transmitted and the second data to be transmitted into a network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relationship of the second queue, wherein the corresponding network card queue belongs to the network card queue. It should be understood that specific details of the above process can refer to the foregoing embodiments of fig. 4 and 6, and are not described herein again.
In an embodiment, the first data to be transmitted may be a first Direct Memory Access (DMA) read descriptor, which is used to transmit the first data to be read at the computing device to the network card, and the second data to be transmitted may be a second DMA read descriptor, which is used to transmit the second data to be read at the computing device to the network card. As can be seen from the foregoing, an actual form of a queue is actually a segment of memory blocks divided into a plurality of memory blocks with equal length, and each work unit is used to store a message with a fixed length, that is, the storage capacity of each work unit is very small, if the computing device needs to send the first data to be read to the network card at present, the DMA read descriptor of the first data to be read can be taken as the data to be sent and placed in the host queue. The DMA read descriptor may include a read address, a packet length, description information, and the like of the first data to be read, and through steps S201 to S210, the network card may generate a DMA read command for directly reading the first data to be read from the computing device after receiving the DMA descriptor sent by the computing device.
In a specific implementation, the first data to be transmitted is a first direct memory access DMA read descriptor, the second data to be transmitted is a second DMA read descriptor, and after the first data to be transmitted and the second data to be transmitted are stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: a 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; a network card in the forwarding equipment sends the first DMA read command and a second DMA read command to queue expansion equipment in the forwarding equipment; the queue expansion equipment in the forwarding equipment acquires first data to be read from the computing equipment according to the first DMA read command, and acquires second data to be read from the computing equipment according to the second DMA read command; and the queue expansion equipment in the forwarding equipment forwards the first data to be read and the second data to be read to a network card in the forwarding equipment.
Second data to be read 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, where the first DMA write descriptor is used to write the first data to be written from the queue expansion device into the computing device, and the second DMA descriptor is used to write the second data to be written from the queue expansion device into the computing device. The difference between the second data to be written and the DMA read descriptor is that the data received by the network card is generally fragmented data, for example, the first data to be written may be transmitted to the network card in the form of n first fragmented data, and if the network card receives one first fragmented data every time, the network card sends the first fragmented data to the computing device, and the computing device receives a plurality of disordered first fragmented data, thereby increasing the processing pressure of the computing device. Therefore, the queue expansion device further includes a Memory, such as a double data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM). In a specific implementation, the queue expansion device may store the first fragmented data received from the network card in the DDR, and send the first data to be written to the computing device after all n fragmented data of the first data to be written are collected. Thus, at step S207, the queue expansion device needs to convert the received DMA write descriptor for writing to the computing device into a network card DMA write descriptor for writing to the queue expansion device.
In a specific implementation, 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, where the first DMA write descriptor is used to write the first data to be written from the queue expansion device into the computing device, the second DMA descriptor is used to write the second data to be written from the queue expansion device into the computing device, and the storing the first data to be sent and the second data to be sent into the first host queue and the queue expansion device queue corresponding to the second host queue includes: a queue expansion device in the forwarding device 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, wherein the first DMA write descriptor is used for writing first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used for writing second data to be written from the network card into the queue expansion device; the queue expansion equipment in the forwarding equipment stores the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion equipment queue; after the first data to be transmitted and the second data to be transmitted are 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 acquires first fragmentation data which is stored in the network card and corresponds to the first network card DMA write descriptor according to the first network card DMA write descriptor, and acquires second fragmentation data which is stored in the network card and corresponds to the second network card DMA write descriptor according to the second network card DMA write descriptor, wherein the first data to be written comprises n first fragmentation data, and the second data to be written comprises m second fragmentation data; a network card in the forwarding equipment 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; a 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 equipment in the forwarding equipment writes the first fragment data and the second fragment data into a memory of the queue expansion equipment according to the first DMA write command and the second DMA write command; in a memory of a queue expansion device in the forwarding device, generating a third DMA write command according to the first data to be written when the number of first fragmented data is n, and generating a fourth DMA write command according to the second data to be written when the number of second fragmented data is m, where the third DMA write command is used for being executed by the computing device and writing the first data to be written into the computing device, and the fourth DMA write command is used for being executed by the computing device and writing the first data to be written into the computing device; and the queue expansion equipment in the forwarding equipment sends the third DMA write command and the fourth DMA write command to the computing equipment, so that the computing equipment writes the first data to be written and the second data to be written into the computing equipment according to the third DMA write command and the fourth DMA write command. Second data to be written, and second data to be written in an embodiment, after the first data to be transmitted and the second data to be transmitted are stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further includes: a network card in the forwarding equipment sends a completion message and an interruption message to the queue expansion equipment; and the queue expansion equipment in the forwarding equipment sends the completion message and the interrupt to the computing equipment, so that the computing equipment refreshes tail pointers of the first host queue and the second host queue according to the completion message. In the specific implementation, after the forwarding device or the network card processes the read command or the write command, command completion information is written into the network card queue and is sent to the queue expansion device together with the interrupt message, and the queue expansion device sends the interrupt message and the command completion information to the computing device, so that a data communication process is completely completed.
In summary, by using the queue communication method provided by the present application, after the queue expansion device obtains the number of the network card queues in the network card, the usage performance of the network card hardware is fully exploited by sending the number of the expanded network card queues to the computing device, the thread message forwarding rate of the virtual machine no longer becomes the bottleneck of network card processing message forwarding, and further resource waste is avoided.
As shown in fig. 8, the queue communication method described in fig. 7 is exemplified below by taking an application scenario in which the first data to be transmitted and the second data to be transmitted are DMA read descriptors (the computing device transmits the first data to be read and the second read data to the network card).
As shown in fig. 8, assuming that the queue expansion coefficient n is 2, the queue expansion device has generated a second queue correspondence with the network card, generated a first queue correspondence with the computing device, and stored the two queue correspondences in the queue mapping table. A first queue corresponding relationship exists between the first host queue a and the second host queue B and the corresponding queue expansion device queue C, and a second queue corresponding relationship exists between the corresponding queue expansion device queue C and the corresponding network card queue D. 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, and then the specific communication flow may be as follows:
1. the computing device 400 places the DMA read descriptor of the first data to be read, i.e., the first data to be sent, into 4 queue elements of the first host queue a, and places the DMA read descriptor of the second data to be read, i.e., the second data to be sent, into 3 queue elements of the second host queue B.
2. The computing device 400 flushes the first host queue with a first head pointer value of A3 and the second host queue with a second head pointer value of B3.
3. Computing device 400 sends a first doorbell message to queue expansion device 500.
4. The queue extension apparatus 500 obtains the first head pointer a3 and the second head pointer B3 from the first doorbell message.
5. The queue extension device 500 flushes the first head pointer to A3 and the second head pointer to B2 in the first doorbell register.
6. According to the refreshed first doorbell register and the head-to-tail pointers of the first host queue being A3 and a0, the queue extension device 500 obtains the data of the 4 queue units a0-A3, that is, the first data to be sent, and similarly obtains the second data to be sent from the computing device.
7. The queue expansion device 500 determines a 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 puts the first data to be transmitted (4 queue units) and the second data to be transmitted (3 queue units) into the corresponding queue expansion device queue C.
8. The value of the third head pointer of the queue expansion device 500 refreshing the corresponding queue expansion device queue C is C7.
9. The queue expansion device 500 sends a second doorbell message to the network card 600.
10. The network card 600 obtains the value C7 of the third head pointer from the second doorbell message.
11. Network card 600 refreshes the value C7 of the third head pointer in the second doorbell register.
12. According to the refreshed second doorbell registers, the head and tail pointers of the corresponding queue expansion device queues are C7 and C0, and the network card 600 acquires the data of the 7 queue units C0-C7, that is, the first data to be transmitted and the second data to be transmitted, from the queue expansion device 500.
13. The network card 600 determines, according to the second mapping relationship, a network card queue D corresponding to the queue expansion device queue C, and puts 7 queue units of the first data to be transmitted and the second data to be transmitted into the corresponding network card queue D.
14. The fourth pointer of the network card 600 refreshing the corresponding network card queue D has a value D7.
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 the first DMA read command and the second DMA read command to the queue expansion device 500.
16. Queue expansion device 500 passes through the first DMA read command and the second DMA read command to the computing device.
17. The computing device 400 obtains the first data to be read and the second data to be read, which are stored in the computing device 400 and correspond 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.
18. The computing apparatus 400 sends the first data to be read and the second data to be read to the queue expansion apparatus 500.
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. The network card 600 updates the tail pointer of the corresponding queue expansion device queue C to C7.
21. The network card 600 sends a completion queue unit and an 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. The queue expansion device 500 analyzes the completion queue unit and the interrupt, refreshes a first tail pointer of the first host queue in the first doorbell register to be a3, refreshes a second tail pointer of the second host queue to be B2, generates a new completion queue unit and an interrupt, and sends the new completion queue unit and the interrupt to the computing device, so that the computing device can refresh the first host queue tail pointer and the second host queue tail pointer maintained by itself, and complete the sending of the current first data to be read and the current second data to be read.
By using the queue communication method provided by the application, after the queue expansion device obtains the number of the network card queues in the network card, the use performance of the network card hardware is fully mined by sending the number of the expanded network card queues to the computing device, the thread message forwarding rate of the virtual machine does not become the bottleneck of the network card in processing message forwarding, and the resource waste is further avoided.
As shown in fig. 9, the queue communication method described in fig. 7 is exemplified below by taking an application scenario in which the first data to be transmitted and the second data to be transmitted are DMA write descriptors (the network card transmits the first data to be written and the second data to be written to the computing device).
As shown in fig. 9, assuming that the queue expansion coefficient n is 2, the queue expansion device has generated a second queue correspondence with the network card, generated a first queue correspondence with the computing device, and stored the two queue correspondences in the queue mapping table. A first queue corresponding relationship exists between the first host queue a and the second host queue B and the corresponding queue expansion device queue C, and a second queue corresponding relationship exists between the corresponding queue expansion device queue C and the corresponding network card queue D. 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, and then the specific communication flow may be as follows:
1. computing device 400 places a first DMA write descriptor for a first data to be written, i.e., a first data to be sent, into 4 queue elements of first host queue a, and places a second DMA write descriptor for a second data to be written, i.e., a second data to be sent, into 3 queue elements of second host queue B. Wherein the first DMA write descriptor is used to write first data to be written to the computing device and the second DMA descriptor is used to write second data to be written to the computing device.
2. The computing device 400 flushes the first host queue with a first head pointer value of A3 and the second host queue with a second head pointer value of B2.
3. Computing device 400 sends a first doorbell message to queue expansion device 500.
4. The queue extension apparatus 500 obtains the first head pointer a3 and the second head pointer B2 from the first doorbell message.
5. The queue extension device 500 flushes the first head pointer to A3 and the second head pointer to B2 in the first doorbell register.
6. The queue extension device 500 obtains the data of the 4 queue elements A0-A3, namely the first DMA write descriptor, from the computing device according to the flushed head and tail pointers of the first host queue in the first doorbell register, namely A3 and A0, and similarly obtains the second DMA write descriptor from the computing device.
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 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. The queue expansion device 500 determines a 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 puts the converted first DMA write descriptor (4 queue elements) and the converted second DMA write descriptor (3 queue elements) into the corresponding queue expansion device queue C.
9. The value of the third head pointer of the queue expansion device 500 refreshing the corresponding queue expansion device queue C is C7.
10. The queue expansion device 500 sends a second doorbell message to the network card 600.
11. The network card 600 obtains the value C7 of the third head pointer from the second doorbell message.
12. Network card 600 refreshes the value C7 of the third head pointer in the second doorbell register.
13. According to the refreshed second doorbell registers, the head and tail pointers of the corresponding queue expansion device queues are C7 and C0, and the network card 600 acquires the data of the 7 queue units C0-C7, that is, the converted first DMA write descriptor and the converted second DMA write descriptor, from the queue expansion device 500.
14. The network card 600 determines, according to the second mapping relationship, a network card queue D corresponding to the queue expansion device queue C, and puts 7 queue units of the first data to be transmitted and the second data to be transmitted into the corresponding network card queue D.
15. The fourth pointer of the network card 600 refreshing the corresponding network card queue D has a value D7.
16. The network card 600 acquires first fragmentation data stored in the network card and corresponding to the first network card DMA write descriptor according to the first network card DMA write descriptor, and acquires second fragmentation data stored in the network card and corresponding to the second network card DMA write descriptor according to the second network card DMA write descriptor, wherein the first data to be written includes n first fragmentation data, and the second data to be written includes m second fragmentation data.
17. The network card 600 generates a first DMA write command according to the first network card DMA write descriptor and the first tile data, and generates a second DMA write command according to the second network card DMA write descriptor and the second tile data.
18. The network card 600 updates the tail pointer of the queue C of the corresponding queue expansion device to be C7, sends the first DMA write command and the second DMA write command to the queue expansion device, sends a completion queue unit and an interrupt, 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.
19. And the queue expansion equipment writes the first fragment data and the second fragment data into a memory of the queue expansion equipment according to the first DMA write command and the second DMA write command, and refreshes the value of a third tail pointer in the first doorbell register.
20. The queue extension device 500 parses the completion queue unit and the interrupt, determines a write address at which the first data to be written and the second data to be written are written into the computing device according to the address information of the queue completion unit, so that a third DMA write command is generated according to the write address and the first data to be written when the number of the first fragmented data is n, a fourth DMA write command is generated according to the write address and the second data to be written when the number of the second fragmented data is m, a value of a first tail pointer of a first host queue in a first doorbell register is refreshed is a3, a value of a second tail pointer of a second host queue is B2, and a new completion queue unit and an interrupt are generated.
21. In the memory of the queue expansion device 500, when the number of the first fragmented data is n, a third DMA write command is generated, and when the number of the second fragmented data is m, a fourth DMA write command is generated, 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 the computing device to execute and write the first data to be written into the computing device.
22. And 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 self-maintained first host queue tail pointer and the second host queue tail pointer to complete the sending of the first data to be read and the second data to be read.
23. And the computing equipment writes the first data to be written and the second data to be written into the computing equipment according to the third DMA write command and the fourth DMA write command. And finishing the process of the queue communication.
By using the queue communication method provided by the application, after the queue expansion device obtains the number of the network card queues in the network card, the use performance of the network card hardware is fully mined by sending the number of the expanded network card queues to the computing device, the thread message forwarding rate of the virtual machine does not become the bottleneck of the network card in processing message forwarding, and the resource waste is further avoided.
In connection with the related embodiments shown in fig. 1-9 above, the related devices related to the embodiments of the present application are explained below. Referring to fig. 10, fig. 10 is a schematic structural diagram of a forwarding device provided in 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, where the forwarding device includes a receiving unit 310, an obtaining unit 320, a storing unit 330, a responding unit 340, and a refreshing 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 of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues;
the obtaining unit 320 is configured to obtain information of the first host queue and information of the second host queue from the first doorbell message, obtain first data to be sent from the first host queue, and obtain second data to be sent from the second host queue;
the storage unit 330 is configured to store the first data to be transmitted and the second data to be transmitted in forwarding queues corresponding to the first host queue and the second host queue, respectively, according to a queue correspondence relationship between the forwarding queues and the host queues, where the first host queue and the second host queue correspond to a same forwarding queue of the at least one forwarding queue.
In an embodiment, the forwarding device further comprises a response unit 340, and the receiving unit 310 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 340 is configured to respond to the device query message, and report the number of the expanded forwarding queues to the computing device, where the number of the expanded forwarding queues is determined by the number of the at least one forwarding queue and an expansion coefficient, and the number of the expanded forwarding queues is used to establish the queue correspondence relationship.
In an embodiment, the forwarding device includes an attribute register, the extended number of forwarding queues is stored in the attribute register, and the response unit 340 is configured to query the attribute register, obtain the extended number of forwarding queues from the attribute register, and report the extended number of forwarding queues 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 data to be sent, the information of the second host queue includes a second head pointer, 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, each set of head pointers and each set of tail pointers respectively correspond to a head pointer and a tail pointer of one queue of multiple queues of the computing device, and at least one set of head pointers and at least one set of tail pointers of the at least one queue are also stored in the forwarding device; the forwarding device further comprises a refreshing unit 350, and the obtaining unit 320 is configured to obtain the first head pointer and the second head pointer from the first doorbell message; the refreshing unit 350 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 obtaining unit 320 is configured to obtain the first data to be sent in the first host queue according to the refreshed 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; the refreshing unit 350 is configured to refresh the head pointer corresponding to the second host queue in the multiple groups of head pointers according to the second head pointer; the obtaining unit 320 is configured to obtain the second data to be sent in the second host queue 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; the refreshing unit 350 is configured to refresh a tail pointer of the first host queue and a tail pointer of the second host queue after the first data to be sent and the second data to be sent are respectively stored in the first host queue and a forwarding queue corresponding to the second host queue; the refreshing unit 350 is configured to refresh the head pointer of the corresponding forwarding queue; the refreshing unit 350 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.
It should be noted that fig. 10 is only one implementation manner of the embodiment of the present application, and a plurality of modules or units mentioned in the embodiment of the present application, and those skilled in the art should understand that the functions of the plurality of modules or units can be split into more sub-modules or sub-units, or combined into fewer modules or units to achieve the same technical effect, and therefore all of the modules or units should fall within the scope of the embodiment of the present application
Fig. 11 is a schematic structural diagram of a queue expansion device provided in the present application. The queue expansion device is connected with the computing device, the network card is connected with the computing device, the queue expansion device comprises at least one queue expansion device queue, the network card comprises at least one network card queue, the computing device comprises a plurality of host queues, and a plurality of data to be sent are stored in the host queues. As shown in fig. 11, the queue extension apparatus 500 includes a receiving unit 510, a retrieving unit 520, a storing unit 530, a sending unit 540, a responding unit 550, and a refreshing 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 of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues;
the obtaining unit 520 is configured to obtain information of the first host queue and information of the second host queue from the first doorbell message, obtain first data to be sent from the first host queue, and obtain second data to be sent from the second host queue;
the storage unit 530 is configured to store the first data to be transmitted and the second data to be transmitted in the queue expansion device queues corresponding to the first host queue and the second host queue respectively according to a first queue corresponding relationship 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, where the second doorbell message carries information of the corresponding queue expansion device queue, so that the network card obtains the first data to be sent and the second data to be sent from the corresponding queue expansion device queue according to the second doorbell message, and stores 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 a second queue correspondence between the network card queue and the queue expansion device queue, where 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 a 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 comprises a response unit 550, the receiving unit 510 is further configured to receive a first device query message from the computing device before receiving a 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, where the number of network card queues is used to establish the second queue corresponding relationship; the response unit 550 is configured to report, in response to the first device query message, the number of expanded queue expansion device queues to the computing device, where the number of expanded queue expansion device queues is determined by the number of network card queues and an expansion coefficient, and the number of expanded 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 extended forwarding queues is stored in the attribute register; the response unit 550 is further configured to query the attribute register, obtain the number of queue expansion devices after expansion from the attribute register, and report the number of queue expansion devices after expansion 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 data to be transmitted, the information of the second host queue includes a second head pointer, the second head pointer indicates the second data to be transmitted, a plurality of groups of head pointers and a plurality of groups of tail pointers are stored in the queue expansion device, each group of head pointers and each group of tail pointers respectively correspond to a head pointer and a tail pointer of one host queue of the plurality of host queues, at least one group of queue expansion device head pointers and at least one group of queue expansion device tail pointers are stored in the queue expansion device, at least one group of network card head pointers and at least one group of network card tail pointers are stored in the network card, the at least one group of queue expansion device head pointers correspond to the at least one group of network card head pointers one to one, and the at least one group of queue expansion device tail pointers correspond to the at least one group of network card tail pointers one to one, the queue expansion device further comprises a refresh unit 560, and the obtaining unit 520 is configured to obtain the first head pointer and the second head pointer from the first doorbell message; the refreshing unit 560 is configured to refresh the head pointer corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer and the first queue corresponding relationship; the obtaining unit 520 is configured to obtain the first data to be sent in the first host queue according to the refreshed 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; the refreshing unit 560 is configured to refresh the head pointer corresponding to the second host queue in the multiple groups of head pointers according to the second head pointer and the first queue corresponding relationship; the obtaining unit 520 is configured to obtain the second data to be sent in the second host queue 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; the storage unit 530 is configured to store the first data to be transmitted and the second data to be transmitted into queue expansion device queues corresponding to the first host queue and the second host queue according to the first queue correspondence relationship, where the corresponding queue expansion device queues belong to the queue expansion device queues, and the first host queue and the second host queue correspond to a same queue expansion device queue in the at least one queue expansion device queue; the refreshing unit 560 is configured to refresh a head pointer of the corresponding queue expansion device queue, a tail pointer of the first host queue, and a tail pointer of the second host queue; the sending unit 540 is further configured to send the second doorbell message to the network card, where the second doorbell message carries a head pointer of the corresponding queue expansion device queue, the network card refreshes the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one group of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue, and the corresponding network card head pointer and the tail pointer corresponding to the queue expansion device queue in the at least one group of network card tail pointers after being refreshed, acquiring the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion device queue, and storing the first data to be transmitted and the second data to be transmitted into the network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relation of the second queue.
In an embodiment, the first data to be transmitted is a first direct memory access DMA read descriptor, the second data to be transmitted is a second DMA read descriptor, and the receiving unit 510 is further configured to receive a first DMA read command and a second DMA read command transmitted by the network card, where the first DMA read command is generated by the network card according to the first DMA descriptor, and the second DMA read command is generated by the network card according to the second DMA descriptor; the obtaining unit 520 is further 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 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.
In one embodiment, the first data to be transmitted is a first DMA write descriptor, the second data to be transmitted is a second DMA write descriptor, wherein the first DMA write descriptor is to write a first data to be written from the queue expansion device to the computing device, the second DMA descriptor is for writing second data to be written from the queue expansion device to the computing device, the device further comprises a translation unit 570, the translation unit 570 configured to translate the first DMA write descriptor into a first network card DMA write descriptor, translate the second DMA write descriptor into a second network card DMA write descriptor, wherein the first DMA write descriptor is used for writing first data to be written from the network card into the queue expansion device, the second DMA descriptor is used for writing second data to be written into the queue expansion equipment from the network card; 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, wherein the first DMA write command is that the network card acquires first fragmented data which is stored in the network card and corresponds to the first network card DMA write descriptor according to the first network card DMA write descriptor, a first DMA write command generated according to the first network card DMA write descriptor and the first fragmentation data, the second DMA write command is that after the network card acquires second fragmentation data which is stored in the network card and corresponds to the second network card DMA write descriptor according to the second network card DMA write descriptor, a second DMA write command generated according to the second network card DMA write descriptor and the second slice data, the first data to be written comprises n first fragmented data, and the second data to be written comprises m second fragmented data; the storage unit 530 is configured to write the first slice data and the second slice data into a memory of the queue expansion device according to the first DMA write command and the second DMA write command; the conversion unit 570 is configured to generate a third DMA write command according to the first to-be-written data when the number of first fragmented data is n in the memory of the queue expansion device, and generate a fourth DMA write command according to the second to-be-written data when the number of second fragmented data is m, where the third DMA write command is used for being executed by the computing device and writing the first to-be-written data into the computing device, and the fourth DMA write command is used for being executed by the computing device and writing the first to-be-written data into 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 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.
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 generated after the network card stores 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; the sending unit 540 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.
It should be noted that fig. 11 is only one implementation manner of the embodiment of the present application, and a plurality of modules or units mentioned in the embodiment of the present application, and those skilled in the art should understand that the functions of the plurality of modules or units may be split into more sub-modules or sub-units, or combined into fewer modules or units to achieve the same technical effect, and therefore, all of the modules or units should fall within the scope of the embodiment of the present application.
Fig. 12 is a schematic structural diagram of a forwarding device according to an embodiment of the present application, as shown in fig. 12, where 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 by a bus 704. The bus 704 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 704 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 12, but this is not intended to represent only one bus or type of bus.
In particular implementations, processor 701 includes one or more general-purpose processors, where a general-purpose processor may be any type of device capable of processing electronic instructions, including a CPU, microprocessor, microcontroller, host processor, controller, ASIC, and the like. The processor 701 executes various types of digitally stored instructions, such as software or firmware programs stored in the memory 703, which enable 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 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, and the like, where the queue expansion module may implement a processing function by calling a program code in the memory 703, for example, calculating the number of queues after expansion; the mapping module may invoke the program code in the memory 304 to implement the processing function, generating a queue correspondence between the host queue and the forwarding queue; the queue forwarding module may enable queue communication with the computing device by calling program code in memory 703 to implement processing functions. The processor 701 may further include other modules, which are configured to perform other steps described in the embodiments of fig. 4 and fig. 6, and are not described herein again.
The communication interface 702 may be a wired interface (e.g., an ethernet interface) for communicating with other devices or modules.
The Memory 703 may include Volatile Memory (Volatile Memory), such as Random Access Memory (RAM); the Memory may also include a Non-volatile Memory (Non-volatile Memory), such as a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk Drive (HDD), or a Solid-State Drive (SSD) Memory, which may also include a combination of the above types of memories. The memory 703 may include a doorbell register for storing head and tail pointers of at least one set of queues, an attribute register for storing the number of extended queues, and a forwarding queue for storing data to be sent by the computing device 400. It should be understood that the above example is only used for illustration, and the memory 703 may further include a mapping relationship table, where the mapping relationship table is used to store the queue corresponding relationship, and may also be used to store other program codes or program data, so that the processor can implement other steps described in the embodiments of fig. 4 and fig. 6 to fig. 9, and details are not described here again.
Fig. 13 is a schematic structural diagram of a queue expansion device 800 according to the present application. As shown in fig. 13, queue expansion device 800 includes a processor 802, a memory 504, an endpoint port 501, and a root port 503. The port endpoint 501, the root port 505, and the memory 504 are all connected to the processor 502 via the bus 505.
Queue expansion device 800 includes, among other things, one or more processors 801, a communication interface 802, and memory 803. The processor 801, the communication interface 802, and the memory 803 may be connected by a bus 804. The bus 804 may be a PCI bus or an EISA bus, etc. The bus 704 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 13, but this is not intended to represent only one bus or type of bus.
In particular implementations, processor 802 includes one or more general-purpose processors, which may be any type of device capable of processing electronic instructions, including a CPU, microprocessor, microcontroller, host processor, controller, ASIC, and the like. The processor 802 executes various types of digitally stored instructions, such as software or firmware programs stored in the memory 804, which enable 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 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, and the like, wherein the queue expansion module may implement a processing function by calling program codes in the memory 804, such as calculating the number of queues after expansion; the mapping module may call a program code in the memory 804 to implement a processing function, generate a first queue correspondence between the host queue and the queue expansion queue, or generate a second queue correspondence between the queue expansion queue and the network card queue, and the like; the queue forwarding module may implement a processing function by calling program codes in the memory 804, and complete forwarding between the extended queue device and the network card for data to be sent received from the computing device. The processor may further include other modules, which are not described herein again, and are configured to perform other steps described in the embodiments of fig. 5A to 9.
The communication interface 802 may be a wired interface (e.g., 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 a non-volatile memory, such as a ROM, a flash memory, a HDD, or an SSD. The memory may also comprise a combination of memories of the kind described above. The memory 804 may include a first doorbell register, an attribute register, and a queue expansion device queue, where the first doorbell register is configured to store head and tail pointers of at least one group of queues, the attribute register is configured to store the number of the expanded queues, and the queue expansion device queue is configured to store data to be sent by the computing device, it should be understood that the above example is only used for illustration, the memory 804 may further include a mapping relationship table, the mapping relationship table is configured to store a first queue corresponding relationship and a second queue corresponding relationship, the memory 804 may also be configured to store first fragment data, second fragment data, and the like, and may also be configured to store other program codes or program data, so as to enable the processor to implement other steps described in the embodiments of fig. 7 to 9, and details are not repeated here.
It should be noted that fig. 12 and fig. 13 are only one possible implementation manner of the embodiment of the present application, and in practical applications, the forwarding device 700 and the queue expansion device 800 may further include more or less components, which is not limited herein. For the content that is not shown or described in the embodiment of the present application, reference may be made to the related explanation in the embodiment described in fig. 1 to fig. 9, which is not described herein again.
The queue expansion Device 500 shown in fig. 11 may be implemented by a Logic Circuit, and particularly, may be implemented by an Application-Specific Integrated Circuit (ASIC), or a Programmable Logic Device (PLD), which may be a Complex Programmable Logic Device (CPLD), a Field Programmable Gate Array (FPGA), a General Array Logic (GAL), or any combination thereof, and the present Application is not particularly limited.
Embodiments of the present invention also provide a computer non-transitory storage medium having instructions stored therein, where when the computer non-transitory storage medium runs on a processor, any one of the method flows described in fig. 4, 6 to 9 is implemented.
Embodiments of the present invention also provide a computer program product, where when the computer program product runs on a processor, any one of the method flows described in fig. 4, 6-9 is implemented.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware or in software executed by a processor. The software instructions may consist of corresponding software modules that may be stored in RAM, flash memory, ROM, erasable programmable read-only memory (EPROM), Electrically erasable programmable read-only memory (EEPROM), registers, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC. Additionally, the ASIC may reside in a computing device. Of course, the processor and the storage medium may reside as discrete components in a computing device.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. And the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.

Claims (31)

1. A method for queue communication, the method being applied to a forwarding device, the forwarding device being connected to a computing device, the forwarding device including at least one forwarding queue, the computing device including a plurality of host queues, a plurality of data to be sent being stored in the plurality of host queues, the method comprising:
the forwarding device receives a first doorbell message from the computing device, wherein the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues;
the forwarding device acquires the information of the first host queue and the information of the second host queue from the first doorbell message, acquires first data to be transmitted from the first host queue, and acquires second data to be transmitted from the second host queue;
and the forwarding equipment stores the first data to be transmitted and the second data to be transmitted into forwarding queues corresponding to the first host queue and the second host queue respectively according to the queue corresponding relationship between the forwarding queues and the host queues, wherein the first host queue and the second host queue correspond to the same forwarding queue in the at least one forwarding queue.
2. The method of claim 1, wherein prior to the forwarding device receiving the first doorbell message from the computing device, the method further comprises:
the forwarding device receives a device query message from the computing device;
and responding to the equipment query message, and reporting the number of the expanded forwarding queues to the computing equipment by the forwarding equipment, wherein the number of the expanded forwarding queues is determined by the number of the at least one forwarding queue and an expansion coefficient, and the number of the expanded forwarding queues is used for establishing the queue corresponding relation.
3. The method of claim 2, wherein the forwarding device includes an attribute register, and wherein the extended number of forwarding queues is stored in the attribute register;
the reporting, by the forwarding device, the expanded number of forwarding queues to the computing device includes:
and the forwarding equipment inquires the attribute register, acquires the number of the extended forwarding queues from the attribute register and reports the number of the extended forwarding queues to the computing equipment.
4. The method according to any one of claims 1 to 3,
the information of the first host queue comprises a first head pointer, the first head pointer indicates the first data to be sent, the information of the second host queue comprises a second head pointer, the second head pointer indicates the second data to be sent, multiple groups of head pointers and multiple groups of tail pointers are stored in the forwarding device, each group of head pointers and each group of tail pointers respectively correspond to the head pointer and the tail pointer of one host queue in multiple host queues of the computing device, and at least one group of head pointers and at least one group of tail pointers of the at least one forwarding queue are also stored in the forwarding device;
the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, and the method includes:
the forwarding device acquires the first head pointer and the second head pointer from the first doorbell message;
the method for acquiring the first data to be sent from the first host queue by the forwarding queue includes:
the forwarding equipment refreshes the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer;
the forwarding device obtains the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers;
the forwarding queue obtains second data to be sent from the second host queue, including:
the forwarding equipment refreshes the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers;
the forwarding device obtains the second data to be sent in the second host queue 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 groups of tail pointers;
after the forwarding device stores the first data to be sent and the second data to be sent in the first host queue and the forwarding queue corresponding to the second host queue, respectively, the method further includes:
refreshing a tail pointer of the first host queue and a tail pointer of the second host queue;
refreshing the head pointer of the corresponding forwarding queue;
and sending the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing device.
5. The method according to any one of claims 1 to 4, wherein 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 group of head pointers and the at least one group of tail pointers are stored in the queue expansion device, 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 expansion device queue, the second queue correspondence relationship is a correspondence relationship 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 by one, a plurality of groups of head pointers and a plurality of groups of tail pointers are stored in the queue expansion device, each group of head pointers and each group of tail pointers respectively correspond to the head pointer and the tail pointer of one host queue in the plurality of host queues, at least one group of queue expansion device head pointers and at least one group of queue expansion device tail pointers are also stored in the queue expansion device, at least one group of network card head pointers and at least one group of network card tail pointers are stored in the network card, the at least one group of queue expansion device head pointers correspond to the at least one group of network card head pointers one by one, and the at least one group of queue expansion device tail pointers correspond to the at least one group of network card tail pointers;
the forwarding device obtains the information of the first host queue and the information of the second host queue from the first doorbell message, and the method includes:
the queue expansion equipment in the forwarding equipment acquires the first head pointer and the second head pointer from the first doorbell message;
the method for acquiring, by the forwarding device, the first data to be transmitted from the first host queue includes:
the queue expansion equipment in the forwarding equipment refreshes the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer and the corresponding relation of the first queue;
the queue expansion equipment in the forwarding equipment acquires the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers;
the forwarding device obtains second data to be sent from the second host queue, including:
refreshing, by the queue expansion device in the forwarding device, the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointer and the first queue corresponding relationship;
the queue expansion device in the forwarding device acquires the second data to be sent in the second host queue 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 groups of tail pointers;
the step of the forwarding device storing the first data to be transmitted and the second data to be transmitted into the forwarding queues corresponding to the first host queue and the second host queue respectively includes:
the queue expansion device in the forwarding device stores the first data to be transmitted and the second data to be transmitted into queue expansion device queues corresponding to the first host queue and the second host queue according to the first queue corresponding relationship, wherein the corresponding queue expansion device queues belong to the queue expansion device queues, 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 equipment in the forwarding equipment refreshes a head pointer of the corresponding queue expansion equipment queue, a tail pointer of the first host queue and a tail pointer of the second host queue;
a network card in the forwarding device receives a second doorbell message from the queue expansion device, wherein the second doorbell message carries a head pointer of the corresponding queue expansion device queue;
the network card in the forwarding equipment acquires the head pointer of the corresponding queue expansion equipment queue from the second doorbell message;
the network card in the forwarding device refreshes the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one group of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue;
the network card in the forwarding device acquires the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion device queue according to the corresponding network card head pointer after being refreshed and the tail pointer corresponding to the corresponding queue expansion device queue in the at least one group of network card tail pointers;
and the network card in the forwarding equipment stores the first data to be transmitted and the second data to be transmitted into the network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relationship of the second queue.
6. The method of claim 5, wherein the first data to be transmitted is a first Direct Memory Access (DMA) read descriptor, the second data to be transmitted is a second DMA read descriptor, and after the first data to be transmitted and the second data to be transmitted are stored in the network card queue corresponding to the corresponding queue expansion device queue, the method further comprises:
a 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;
a network card in the forwarding equipment sends the first DMA read command and a second DMA read command to queue expansion equipment in the forwarding equipment;
the queue expansion equipment in the forwarding equipment acquires first data to be read from the computing equipment according to the first DMA read command, and acquires second data to be read from the computing equipment according to the second DMA read command;
and the queue expansion equipment in the forwarding equipment forwards the first data to be read and the second data to be read to a network card in the forwarding equipment.
7. The method of 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 write descriptor is used for writing the first data to be written from the queue expansion device to the computing device, the second DMA descriptor is used for writing the second data to be written from the queue expansion device to the computing device, and the storing the first data to be sent and the second data to be sent in queue expansion device queues corresponding to the first host queue and the second host queue comprises:
a queue expansion device in the forwarding device 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, wherein the first DMA write descriptor is used for writing first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used for writing second data to be written from the network card into the queue expansion device;
the queue expansion equipment stores the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion equipment queue;
after the first data to be transmitted and the second data to be transmitted are 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 acquires first fragmentation data which is stored in the network card and corresponds to the first network card DMA write descriptor according to the first network card DMA write descriptor, and acquires second fragmentation data which is stored in the network card and corresponds to the second network card DMA write descriptor according to the second network card DMA write descriptor, wherein the first data to be written comprises n first fragmentation data, and the second data to be written comprises m second fragmentation data;
a network card in the forwarding equipment 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;
a 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 equipment in the forwarding equipment writes the first fragment data and the second fragment data into a memory of the queue expansion equipment according to the first DMA write command and the second DMA write command;
in a memory of a queue expansion device in the forwarding device, generating a third DMA write command according to the first data to be written when the number of first fragmented data is n, and generating a fourth DMA write command according to the second data to be written when the number of second fragmented data is m, 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 the computing device to execute and write the first data to be written into the computing device;
and the queue expansion equipment in the forwarding equipment sends the third DMA write command and the fourth DMA write command to the computing equipment, so that the computing equipment writes the first data to be written and the second data to be written into the computing equipment according to the third DMA write command and the fourth DMA write command.
8. The method according to any one of claims 5 to 7, wherein after storing the first data to be transmitted and the second data to be transmitted in the network card queue corresponding to the corresponding queue expansion device queue, the method further comprises:
a network card in the forwarding equipment sends a completion message and an interruption message to the queue expansion equipment;
and the queue expansion equipment in the forwarding equipment sends the completion message and the interrupt to the computing equipment, so that the computing equipment refreshes tail pointers of the first host queue and the second host queue according to the completion message.
9. A queue communication system, comprising a forwarding device and a computing device, the forwarding device being connected to the computing device, the forwarding device comprising at least one forwarding queue, the computing device comprising a plurality of host queues having a plurality of data to be sent stored therein, wherein,
the computing device is configured to send a first command message to the forwarding device, where the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues;
the forwarding device is to receive a first doorbell message from the computing device;
the forwarding device is configured to obtain information of the first host queue and information of the second host queue from the first doorbell message, obtain first data to be sent from the first host queue, and obtain second data to be sent from the second host queue;
the forwarding device is configured to store the first data to be transmitted and the second data to be transmitted in forwarding queues corresponding to the first host queue and the second host queue, respectively, according to a queue correspondence between the forwarding queues and the host queues, where the first host queue and the second host queue correspond to a same forwarding queue of the at least one forwarding queue.
10. The system of claim 9, wherein the computing device is configured to send a device query message to the forwarding device prior to sending the first doorbell message to the forwarding device;
the forwarding device is configured to receive a device query message from the computing device;
the forwarding device is configured to report the number of expanded forwarding queues to the computing device in response to the device query message, where the number of expanded forwarding queues is determined by the number of the at least one forwarding queue and an expansion coefficient, and the number of expanded forwarding queues is used to establish the queue correspondence.
11. The system of claim 9, wherein the forwarding device includes an attribute register, and wherein the extended number of 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. The system according to any one of claims 9-11,
the information of the first host queue comprises a first head pointer, the first head pointer indicates the first data to be sent, the information of the second host queue comprises a second head pointer, the second head pointer indicates the second data to be sent, multiple groups of head pointers and multiple groups of tail pointers are stored in the forwarding device, each group of head pointers and each group of tail pointers respectively correspond to the head pointer and the tail pointer of one host queue in multiple host queues of the computing device, and at least one group of head pointers and at least one group of tail pointers of the at least one forwarding queue are also stored in the forwarding device;
the forwarding device is used for acquiring the first head pointer and the second head pointer from the first doorbell message;
the forwarding device is used for refreshing the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer;
the forwarding device is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers;
the forwarding device is used for refreshing the head pointers corresponding to the second host queues in the multiple groups of head pointers according to the second head pointers;
the forwarding device is configured to obtain the second data to be sent in the second host queue 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 groups of tail pointers;
the forwarding device is configured to refresh a tail pointer of the first host queue and a tail pointer of the second host queue after the first data to be sent and the second data to be sent are stored in the first host queue and the forwarding queue corresponding to the second host queue, respectively;
the forwarding device is used for refreshing 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. The system according to any one of claims 9 to 12, wherein 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 group of head pointers and the at least one group of tail pointers are stored in the queue expansion device, the queue correspondence includes a first queue correspondence and a second queue correspondence, the first queue correspondence is a correspondence between the plurality of host queues and the at least one queue expansion device queue, the second queue correspondence is a 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 by one, a plurality of groups of head pointers and a plurality of groups of tail pointers are stored in the queue expansion device, each group of head pointers and each group of tail pointers respectively correspond to the head pointer and the tail pointer of one host queue in the plurality of host queues, at least one group of queue expansion device head pointers and at least one group of queue expansion device tail pointers are also stored in the queue expansion device, at least one group of network card head pointers and at least one group of network card tail pointers are stored in the network card, the at least one group of queue expansion device head pointers correspond to the at least one group of network card head pointers one by one, and the at least one group of queue expansion device tail pointers correspond to the at least one group of network card tail pointers;
the queue expansion equipment is used for acquiring the first head pointer and the second head pointer from the first doorbell message;
the queue expansion equipment is used for refreshing the head pointer corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer and the corresponding relation of the first queue;
the queue expansion device is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers;
the queue expansion equipment is used for refreshing the head pointer corresponding to the second host queue in the multiple groups of head pointers according to the second head pointer and the corresponding relation of the first queue;
the queue expansion device is configured to obtain the second data to be sent in the second host queue 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 groups of tail pointers;
the queue expansion device is configured to store the first data to be transmitted and the second data to be transmitted into a queue expansion device queue corresponding to the first host queue and the second host queue according to the first queue corresponding relationship, where 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 a same queue expansion device queue in the at least one queue expansion device queue;
the queue expansion device is used for refreshing a head pointer of the corresponding queue expansion device queue, a tail pointer of the first host queue and a tail pointer of the second host queue;
the network card is used for receiving a second doorbell message from the queue expansion equipment, wherein the second doorbell message carries a head pointer of the corresponding queue expansion equipment queue;
the network card is used for acquiring the head pointer of the corresponding queue expansion equipment queue from the second doorbell message;
the network card in the forwarding device refreshes the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one group of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue;
the network card is used for acquiring the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion equipment queue according to the corresponding network card head pointer after being refreshed and the tail pointer corresponding to the corresponding queue expansion equipment queue in the at least one group of network card tail pointers;
and the network card is used for storing the first data to be transmitted and the second data to be transmitted into the network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relation of the second queue.
14. The system according to claim 13, wherein the first data to be transmitted is a first direct memory access DMA read descriptor, the second data to be transmitted is a second DMA read descriptor, and the network card is further configured to generate a first DMA read command and a second DMA read command according to the first DMA read descriptor and the second DMA read descriptor after the first data to be transmitted and the second data to be transmitted are stored in the network card queue corresponding to the corresponding queue expansion device queue;
the network card is used for sending the first DMA read command and the second DMA read command to a queue expansion device in the forwarding device;
the queue expansion equipment is used for acquiring first data to be read from the computing equipment according to the first DMA read command and acquiring second data to be read from the computing equipment according to the second DMA read command;
the queue expansion device is used for forwarding the first data to be read and the second data to be read to a network card in the forwarding device.
15. The system of claim 13, wherein the first data to be sent is a first DMA write descriptor for writing first data to be written to the computing device from the queue expansion device and the second data to be sent is a second DMA write descriptor for writing second data to be written to the computing device from the queue expansion device,
the queue expansion equipment is used for converting the first DMA write descriptor into a first network card DMA write descriptor and converting the second DMA write descriptor into a second network card DMA write descriptor, wherein the first DMA write descriptor is used for writing first data to be written into the queue expansion equipment from the network card, and the second DMA descriptor is used for writing second data to be written into the queue expansion equipment from the network card;
the queue expansion equipment is used for storing the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion equipment queue;
the network card is further configured 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, obtain, according to the first network card DMA write descriptor, first sliced data stored in the network card and corresponding to the first network card DMA write descriptor, and obtain, according to the second network card DMA write descriptor, second sliced data stored in the network card and corresponding to the second network card DMA write descriptor, where the first data to be written includes n pieces of first sliced data, and the second data to be written includes m pieces of second sliced data;
the network card is used for generating a first DMA write command according to the first network card DMA write descriptor and the first fragment data, and generating a second DMA write command according to the second network card DMA write descriptor and the second fragment data;
the network card is used for sending the first DMA write command and the second DMA write command to the queue expansion equipment;
the queue expansion device is used for writing the first fragment data and the second fragment data into a memory of the queue expansion device according to the first DMA write command and the second DMA write command;
the queue expansion device is configured to generate a third DMA write command according to the first data to be written when the number of first fragmented data is n in a memory of the queue expansion device in the forwarding device, and generate a fourth DMA write command according to the second data to be written when the number of second fragmented data is m, where the third DMA write command is used for being executed by the computing device and writing the first data to be written into the computing device, and the fourth DMA write command is used for being executed by the computing device and writing the first data to be written into the computing device;
the queue expansion device is configured to send the third DMA write command and the fourth DMA write command to the computing device;
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. The system according to any one of claims 13 to 15, wherein the network card is further configured to send a completion message and an interrupt message to the queue expansion device 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;
and the queue expansion equipment is also used for sending the completion message and the interrupt to the computing equipment, so that the computing equipment refreshes tail pointers of the first host queue and the second host queue according to the completion message.
17. A forwarding device, wherein 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 obtaining unit, and a storage unit, and the storage unit includes at least one forwarding queue:
the receiving unit is configured to receive a first doorbell message from the computing device, where the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the plurality of host queues;
the acquiring unit is configured to acquire information of the first host queue and information of the second host queue from the first doorbell message, acquire first data to be transmitted from the first host queue, and acquire second data to be transmitted from the second host queue;
the storage unit is configured to store the first data to be transmitted and the second data to be transmitted in forwarding queues corresponding to the first host queue and the second host queue, respectively, according to a queue correspondence relationship between the forwarding queues and the host queues, where the first host queue and the second host queue correspond to a same forwarding queue of the at least one forwarding queue.
18. The apparatus of 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 the expanded forwarding queues to the computing device, where the number of the expanded forwarding queues is determined by the number of the at least one forwarding queue and an expansion coefficient, and the number of the expanded forwarding queues is used to establish the queue correspondence relationship.
19. The apparatus of claim 17, wherein the response unit includes an attribute register, wherein the extended number of forwarding queues is stored in the attribute register,
the response unit is used for inquiring the attribute register, acquiring the number of the expanded forwarding queues from the attribute register, and reporting the number of the expanded forwarding queues to the computing equipment.
20. The apparatus according to any of claims 16-19, wherein the information of the first host queue comprises a first head pointer indicating the first data to be transmitted, the information of the second host queue comprises a second head pointer indicating the second data to be transmitted, the forwarding apparatus stores multiple sets of head pointers and multiple sets of tail pointers, each set of head pointers and each set of tail pointers respectively correspond to a head pointer and a tail pointer of one of the queues of the computing apparatus, and the forwarding apparatus further 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 comprises a refresh unit,
the acquiring unit is used for acquiring the first head pointer and the second head pointer from the first doorbell message;
the refreshing unit is used for refreshing the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer;
the obtaining unit is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers;
the refreshing unit is used for refreshing the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers;
the obtaining unit is configured to obtain the second data to be sent in the second host queue 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 groups of tail pointers;
the refreshing unit is used for refreshing a tail pointer of the first host queue and a tail pointer of the second host queue after the first data to be sent and the second data to be sent are respectively stored in the first host queue and the forwarding queue corresponding to the second host queue;
the refreshing unit is used for refreshing the head pointer of the corresponding forwarding queue;
the refreshing unit is used for sending the refreshed tail pointer of the first host queue and the refreshed tail pointer of the second host queue to the computing equipment.
21. A queue expansion device, wherein a 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, 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, where the first doorbell message carries information of a first host queue and information of a second host queue, and the first host queue and the second host queue both belong to the multiple host queues;
an obtaining unit, configured to obtain information of the first host queue and information of the second host queue from the first doorbell message, obtain first data to be sent from the first host queue, and obtain second data to be sent from the second host queue;
the storage unit is used for respectively storing the first data to be transmitted and the second data to be transmitted into the queue expansion equipment queues corresponding to the first host queue and the second host queue according to the first queue corresponding relation between the queue expansion equipment queue and the host queue;
a sending unit, configured to send a second doorbell message to the network card, where the second doorbell message carries information of the corresponding queue expansion device queue, so that the network card obtains the first data to be sent and the second data to be sent from the corresponding queue expansion device queue according to the second doorbell message, and stores 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 a second queue correspondence between the network card queue and the queue expansion device queue, where 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 a 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. The apparatus of claim 21, further comprising a response unit,
the receiving unit is further configured to receive a first device query message from the computing device prior to receiving a first doorbell message from the computing device;
the sending unit is used for sending a second equipment query message to the network card;
the response unit is used for receiving the number of network card queues sent by the network card, wherein the number of the network card queues is used for establishing the corresponding relation of the second queues;
the response unit is configured to report the number of the expanded queue expansion device queues to the computing device in response to the first device query message, where the number of the expanded queue expansion device queues is determined by the number of the network card queues and an expansion coefficient, and the number of the expanded queue expansion device queues is used to establish the first queue correspondence.
23. The apparatus of claim 22, wherein the apparatus comprises an attribute register, and wherein the extended number of forwarding queues is stored in the attribute register;
the response unit is further configured to query the attribute register, obtain the number of the queue expansion device queues after the expansion from the attribute register, and report the number of the queue expansion device queues after the expansion to the computing device.
24. The apparatus according to any of claims 21-23, wherein the information of the first host queue comprises a first head pointer indicating the first data to be transmitted, the information of the second host queue comprises a second head pointer indicating the second data to be transmitted, the queue expansion apparatus stores multiple sets of head 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 one host queue of the multiple host queues, the queue expansion apparatus further stores at least one set of queue expansion apparatus head pointers and at least one set of queue expansion apparatus tail pointers, 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 apparatus head pointers and the at least one set of network card head pointers are in one-to-one correspondence, the queue expansion device comprises at least one group of network card tail pointers, at least one group of queue expansion device tail pointers and at least one group of network card tail pointers, wherein the queue expansion device tail pointers correspond to the network card tail pointers one to one,
the acquiring unit is used for acquiring the first head pointer and the second head pointer from the first doorbell message;
the refreshing unit is used for refreshing the head pointers corresponding to the first host queue in the multiple groups of head pointers according to the first head pointer and the first queue corresponding relation;
the obtaining unit is configured to obtain the first data to be sent in the first host queue according to the refreshed head pointer corresponding to the first host queue and the tail pointer corresponding to the first host queue in the multiple groups of tail pointers;
the refreshing unit is used for refreshing the head pointers corresponding to the second host queue in the multiple groups of head pointers according to the second head pointers and the corresponding relation of the first queue;
the obtaining unit is configured to obtain the second data to be sent in the second host queue 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 groups of tail pointers;
the storage unit is configured to store the first data to be transmitted and the second data to be transmitted into queue expansion device queues corresponding to the first host queue and the second host queue according to the first queue correspondence relationship, where the corresponding queue expansion device queues belong to the queue expansion device queues, and the first host queue and the second host queue correspond to a same queue expansion device queue in the at least one queue expansion device queue;
the refreshing unit is used for refreshing a head pointer of the corresponding queue expansion equipment queue, a tail pointer of the first host queue and a tail pointer of the second host queue;
the sending unit is further configured to send the second doorbell message to the network card, where the second doorbell message carries a head pointer of the corresponding queue expansion device queue, the network card refreshes the network card head pointer corresponding to the head pointer of the corresponding queue expansion device queue in the at least one group of network card head pointers according to the head pointer of the corresponding queue expansion device queue and the corresponding relation of the second queue, and the corresponding network card head pointer and the tail pointer corresponding to the queue expansion device queue in the at least one group of network card tail pointers after being refreshed, acquiring the first data to be transmitted and the second data to be transmitted in the corresponding queue expansion device queue, and storing the first data to be transmitted and the second data to be transmitted into the network card queue corresponding to the corresponding queue expansion equipment queue according to the corresponding relation of the second queue.
25. The apparatus of claim 24, wherein the first data to be sent is a first Direct Memory Access (DMA) read descriptor, wherein the second data to be sent is a second DMA read descriptor,
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, and the second DMA read command is generated by the network card according to the second DMA descriptor;
the acquisition unit is further used for acquiring first data to be read from the computing equipment according to the first DMA read command and acquiring second data to be read from the computing equipment according to the 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. The device of claim 24, wherein the first data to be sent is a first DMA write descriptor for writing first data to be written from the queue expansion device to the computing device and the second data to be sent is a second DMA write descriptor for writing second data to be written from the queue expansion device to the computing device, the device further comprising a translation unit,
the conversion unit is configured to convert the first DMA write descriptor into a first network card DMA write descriptor, and convert the second DMA write descriptor into a second network card DMA write descriptor, where the first DMA write descriptor is used to write first data to be written from the network card into the queue expansion device, and the second DMA descriptor is used to write second data to be written from the network card into the queue expansion device;
the storage unit is used for storing the first network card DMA write descriptor and the second network card DMA write descriptor into the corresponding queue expansion equipment queue;
the receiving unit is to receive a first DMA write command and the second DMA write command, wherein the first DMA write command is that the network card acquires first fragmented data which is stored in the network card and corresponds to the first network card DMA write descriptor according to the first network card DMA write descriptor, a first DMA write command generated according to the first network card DMA write descriptor and the first fragmentation data, the second DMA write command is that after the network card acquires second fragmentation data which is stored in the network card and corresponds to the second network card DMA write descriptor according to the second network card DMA write descriptor, a second DMA write command generated according to the second network card DMA write descriptor and the second slice data, the first data to be written comprises n first fragmented data, and the second data to be written comprises m second fragmented data;
the storage unit is used for writing the first fragment data and the second fragment data into a memory of the queue expansion device according to the first DMA write command and the second DMA write command;
the conversion unit is configured to generate a third DMA write command according to the first to-be-written data when the number of first fragmented data is n in a memory of the queue expansion device, and generate a fourth DMA write command according to the second to-be-written data when the number of second fragmented data is m, where the third DMA write command is used for being executed by the computing device and writing the first to-be-written data into the computing device, and the fourth DMA write command is used for being executed by the computing device and writing the first to-be-written data 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 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.
27. The apparatus according to any one of claims 24 to 26,
the receiving unit is further configured to receive a completion message and an interrupt sent by the network card, where the completion message and the interrupt are generated by the network card after the first data to be sent and the second data to be sent are stored in a 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 tail pointers of the first host queue and the second host queue according to the completion message.
28. A forwarding device comprising a processor and a memory, including a processor and a memory, the processor executing code in the memory to implement the method of any of claims 1 to 8.
29. A computer program product, characterized in that the method according to any of claims 1 to 8 is to be implemented when the computer program product is read and executed by a computing device.
30. A computer non-transitory storage medium comprising instructions that, when executed on a computing device, cause the computing device to implement the method of any of claims 1 to 8.
31. A forwarding device comprising logic circuitry by which the forwarding device performs the method of any of claims 1 to 8.
CN201910944642.XA 2019-09-30 2019-09-30 Method, system and related equipment for queue communication Active CN110750367B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910944642.XA CN110750367B (en) 2019-09-30 2019-09-30 Method, system and related equipment for queue communication
PCT/CN2020/113497 WO2021063154A1 (en) 2019-09-30 2020-09-04 Queue communication method and system, and related devices

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN110750367A true CN110750367A (en) 2020-02-04
CN110750367B CN110750367B (en) 2023-03-17

Family

ID=69277683

Family Applications (1)

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

Country Status (2)

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

Cited By (4)

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

Citations (7)

* 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
US20140022922A1 (en) * 2012-07-20 2014-01-23 Fujitsu Telecom Networks Limited Communication device
CN106713185A (en) * 2016-12-06 2017-05-24 瑞斯康达科技发展股份有限公司 Load balancing method and apparatus of multi-core CPU
CN107005495A (en) * 2017-01-20 2017-08-01 华为技术有限公司 Method, network interface card, host device and computer system for forwarding packet
US20180181425A1 (en) * 2016-12-27 2018-06-28 Tmax Cloud Co., Ltd. Method and apparatus for handling network i/o device 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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789152A (en) * 2016-11-17 2017-05-31 东软集团股份有限公司 Processor extended method and device based on many queue network interface cards
US10606604B2 (en) * 2017-08-22 2020-03-31 Bank Of America Corporation Predictive queue control and allocation
CN109729024B (en) * 2018-12-29 2023-05-12 中盈优创资讯科技有限公司 Data packet processing system and method
CN110750367B (en) * 2019-09-30 2023-03-17 超聚变数字技术有限公司 Method, system and related equipment for queue communication

Patent Citations (7)

* 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
US20140022922A1 (en) * 2012-07-20 2014-01-23 Fujitsu Telecom Networks Limited Communication device
CN106713185A (en) * 2016-12-06 2017-05-24 瑞斯康达科技发展股份有限公司 Load balancing method and apparatus of multi-core CPU
US20180181425A1 (en) * 2016-12-27 2018-06-28 Tmax Cloud Co., Ltd. Method and apparatus for handling network i/o device virtualization
CN107005495A (en) * 2017-01-20 2017-08-01 华为技术有限公司 Method, network interface card, host device and computer system for forwarding packet
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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张荣华等: "基于链表的动态存储器管理设计与实现", 《计算机技术与发展》 *

Cited By (6)

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

Also Published As

Publication number Publication date
CN110750367B (en) 2023-03-17
WO2021063154A1 (en) 2021-04-08

Similar Documents

Publication Publication Date Title
CN110750367B (en) Method, system and related equipment for queue communication
CN108984465B (en) Message transmission method and device
US9785356B2 (en) NVM express controller for remote access of memory and I/O over ethernet-type networks
US20200201578A1 (en) Method and Apparatus for Transmitting Data Processing Request
CN108959127B (en) Address translation method, device and system
EP4428684A1 (en) Data access method and computing device
CA2987807C (en) Computer device and method for reading/writing data by computer device
US11010056B2 (en) Data operating method, device, and system
WO2023165518A1 (en) Interrupt message processing method and apparatus, electronic device, and readable storage medium
CN110837488B (en) Message transmission method and device
US11741039B2 (en) Peripheral component interconnect express device and method of operating the same
KR102681251B1 (en) Processing of input/output storage commands
CN113468090B (en) PCIe communication method and device, electronic equipment and readable storage medium
CN114556881B (en) Address translation method and device
CN112799840B (en) Method, apparatus, device and storage medium for transmitting data
US20220300442A1 (en) Peripheral component interconnect express device and method of operating the same
CN104765701A (en) Data access method and device
US20230137668A1 (en) storage device and storage system
US10394733B2 (en) Data transfer using a descriptor
US11048555B2 (en) Method, apparatus, and computer program product for optimizing execution of commands in a distributed system
CN109857553B (en) Memory management method and device
CN111158905A (en) Method and device for adjusting resources
CN114144768A (en) Adaptive pipeline selection for accelerating memory copy operations
EP4440080A1 (en) Network node configuration and access request processing method and apparatus
US8041902B2 (en) Direct memory move of multiple buffers between logical partitions

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20211222

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Applicant after: xFusion Digital Technologies Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant