CN112910802B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN112910802B
CN112910802B CN202110044594.6A CN202110044594A CN112910802B CN 112910802 B CN112910802 B CN 112910802B CN 202110044594 A CN202110044594 A CN 202110044594A CN 112910802 B CN112910802 B CN 112910802B
Authority
CN
China
Prior art keywords
port
network card
message
sending
intelligent network
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.)
Active
Application number
CN202110044594.6A
Other languages
Chinese (zh)
Other versions
CN112910802A (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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202110044594.6A priority Critical patent/CN112910802B/en
Publication of CN112910802A publication Critical patent/CN112910802A/en
Application granted granted Critical
Publication of CN112910802B publication Critical patent/CN112910802B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3027Output queuing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for processing a packet. The method is applied to an intelligent network card, the network equipment with the intelligent network card is also provided with a common network card, the intelligent network card is connected with a virtual machine established on the network equipment, the intelligent network card and the common network card are connected with external equipment, and a sending buffer area of the common network card is configured in a memory of the network equipment, and the method comprises the following steps: obtaining the memory address information of the sending buffer area; establishing a first logic port, establishing a connection relation between the first logic port and the sending buffer area based on the memory address information of the sending buffer area, and forming an aggregation port by the first logic port and a local physical port; when a first message sent by a virtual machine is received, a target port for sending the first message is determined from the aggregation port based on the communication address information of the first message, and the first message is sent to an external device through the target port.

Description

Message processing method and device
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for processing a packet.
Background
The Smart NIC, i.e., the Smart network card, completely transfers the virtual switch function from the server CPU to the network card, freeing up the expensive computing power of the server CPU to return to the application, thereby better extending the network card functionality and providing higher performance.
Because the forwarding mechanisms of the intelligent network card and the common network card are different, the intelligent network card is bypass kernel, the memory of the virtual machine and the memory of the intelligent network card are directly mapped, and the common network card is written to the memory mapped by the network card through the kernel, so that the intelligent network card and the common network card cannot be aggregated at present.
At present, in order to reduce the cost, the port rate of some models of the smart cards is lower than the chip forwarding rate, for example, the port is 2 × 25G — 50G, and the chip forwarding rate is 100G, so that the smart card has a bandwidth of 50G to be idle. And if the intelligent network card port is damaged, the port of other network cards can not be used for backup.
Disclosure of Invention
The application provides a message processing method and device, which are used for solving the problem that an intelligent network card and a common network card cannot be used in a polymerization manner in the prior art.
In a first aspect, the present application provides a message processing method, which is applied to an intelligent network card, where a network device in which the intelligent network card is deployed is also deployed with a common network card, the intelligent network card is connected to a virtual machine created on the network device, the intelligent network card and the common network card are connected to an external device, and a transmission buffer area of the common network card is configured in a memory of the network device, and the method includes:
the intelligent network card acquires the memory address information of the sending buffer area;
the intelligent network card establishes a first logic port, establishes a connection relation between the first logic port and the sending buffer area based on the memory address information of the sending buffer area, and forms the first logic port and a local physical port into an aggregation port;
and when receiving a first message sent by a virtual machine, the intelligent network card determines a target port for sending the first message from the aggregation port based on the communication address information of the first message, and sends the first message to external equipment through the target port.
Optionally, the step of determining, based on the communication address information of the first packet, a destination port from the aggregation port to send the first packet, and sending the first packet to an external device through the destination port includes:
the intelligent network card performs hash calculation according to the MAC and/or IP address information of the first message, and determines a target port for sending the first message from the first logic port and the local physical port according to a hash result;
if the intelligent network card determines that the target port is the local physical port, the first message is sent to external equipment through the physical port;
if the intelligent network card determines that the target port is the first logical port, the first message is sent to the sending cache area through the first logical port, so that the common network card sends the first message to an external device from a local physical port of the common network card.
Optionally, a receiving buffer of the common network card is further configured in the memory of the network device; the method further comprises the following steps:
the intelligent network card acquires the memory address information of the receiving buffer area;
the intelligent network card creates a second logic port, and establishes a connection relation between the first logic port and the receiving buffer area based on the memory address information of the receiving buffer area;
and when receiving an interrupt request sent by the common network card, the intelligent network card acquires a second message from the receiving buffer area through the second logic port and sends the second message to the corresponding virtual machine, wherein the common network card sends the interrupt request to the intelligent network card when receiving the second message sent by the external equipment and caching the second message to the receiving buffer area.
Optionally, the method further comprises:
and when determining that the utilization rate of the sending buffer area is greater than a first set threshold value, the intelligent network card takes the local physical port in the aggregation port as a target port and sends the received first message sent by the virtual machine to external equipment through the local physical port.
Optionally, the method further comprises:
and when determining that the utilization rate of the sending buffer area is smaller than a second set threshold value, the intelligent network card executes the steps of determining a target port for sending the first message from the aggregation port based on the communication address information of the first message, and sending the first message to external equipment through the target port, wherein the second set threshold value is smaller than the first set threshold value.
In a second aspect, the present application provides a packet processing apparatus, which is applied to an intelligent network card, wherein a network device in which the intelligent network card is deployed is also deployed with a common network card, the intelligent network card is connected to a virtual machine created on the network device, the intelligent network card is connected to an external device, and a transmission buffer of the common network card is configured in a memory of the network device, and the apparatus includes:
an obtaining unit, configured to obtain memory address information of the sending buffer;
a creating unit, configured to create a first logical port, establish a connection relationship between the first logical port and the sending buffer based on the memory address information of the sending buffer, and form an aggregation port by the first logical port and a local physical port;
the receiving unit is used for determining a target port for sending a first message from the aggregation port based on communication address information of the first message when the first message sent by the virtual machine is received, and sending the first message to external equipment through the target port.
Optionally, when determining, based on the communication address information of the first packet, a destination port for sending the first packet from the aggregation port, and sending the first packet to an external device through the destination port, the receiving unit is specifically configured to:
performing hash calculation according to the MAC and/or IP address information of the first message, and determining a target port for sending the first message from the first logic port and the local physical port according to a hash result;
if the target port is determined to be the local physical port, sending the first message to external equipment through the physical port;
if the target port is determined to be the first logical port, the first message is sent to the sending cache area through the first logical port, so that the common network card sends the first message to an external device from a local physical port of the common network card.
Optionally, a receiving buffer of the common network card is further configured in the memory of the network device;
the obtaining unit is further configured to obtain memory address information of the receive buffer;
the creating unit is further configured to create a second logical port, and establish a connection relationship between the first logical port and the receive buffer area based on the memory address information of the receive buffer area;
the receiving unit is further configured to, when receiving an interrupt request sent by the common network card, obtain a second message from the receiving buffer through the second logic port, and send the second message to the corresponding virtual machine, where the common network card sends the interrupt request to the intelligent network card when receiving the second message sent by the external device and caching the second message to the receiving buffer.
Optionally, the apparatus further comprises:
and the determining unit is used for taking the local physical port in the aggregation port as a target port and sending the received first message sent by the virtual machine to external equipment through the local physical port when the utilization rate of the sending buffer is determined to be greater than a first set threshold value.
Alternatively,
the determining unit is further configured to, when it is determined that the usage rate of the sending buffer is smaller than a second set threshold, perform a step of determining, based on the communication address information of the first packet, a target port from the aggregation port to send the first packet, and sending the first packet to an external device through the target port, where the second set threshold is smaller than the first set threshold.
In a third aspect, an embodiment of the present application provides a packet processing apparatus, where the apparatus includes:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the steps of the method according to any one of the above first aspects in accordance with the obtained program instructions.
In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium storing computer-executable instructions for causing the computer to perform the steps of the method according to any one of the above first aspects.
To sum up, the message processing method provided in the embodiment of the present application is applied to an intelligent network card, a network device in which the intelligent network card is deployed is also deployed with a common network card, the intelligent network card is connected to a virtual machine created on the network device, the intelligent network card and the common network card are connected to an external device, and a sending buffer of the common network card is configured in a memory of the network device, and the method includes: the intelligent network card acquires the memory address information of the sending buffer area; the intelligent network card establishes a first logic port, establishes a connection relation between the first logic port and the sending buffer area based on the memory address information of the sending buffer area, and forms the first logic port and a local physical port into an aggregation port; and when receiving a first message sent by a virtual machine, the intelligent network card determines a target port for sending the first message from the aggregation port based on the communication address information of the first message, and sends the first message to external equipment through the target port.
By adopting the message processing method provided by the embodiment of the application, the intelligent network card of the network equipment and the sending cache area of the common network card establish a connection relation and form the aggregation port of the local physical port of the intelligent network card and the logic port connected with the sending cache area, so that the aggregation function of the intelligent network card and the common network card is realized, the intelligent network card can share the message processing function of the common network card, the problem of waste of the bandwidth of the chip of the intelligent network card caused by low performance of the physical port of the intelligent network card is solved, and when the local physical port connected with the external equipment of the intelligent network card breaks down, the common network card can still be used for message processing.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present application.
Fig. 1 is a detailed flowchart of a message processing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a networking connection provided in an embodiment of the present application;
fig. 3 is a schematic diagram of another networking connection provided in the embodiment of the present application;
fig. 4 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another message processing apparatus according to an embodiment of the present application.
Detailed Description
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
Exemplarily, referring to fig. 1, a detailed flowchart of a message processing method provided in an embodiment of the present application is shown, where the method is applied to an intelligent network card, a network device configured with the intelligent network card is also configured with a common network card, the intelligent network card is connected to a virtual machine created on the network device, the intelligent network card and the common network card are connected to an external device, and a transmission buffer of the common network card is configured in a memory of the network device, and the method includes the following steps:
step 100: the intelligent network card acquires the memory address information of the sending buffer area.
In the embodiment of the application, when the network device is initialized, the network card driver acquires the memory address information of the transmission BUFFER (e.g., TX BUFFER RING) of the common network card, and notifies the acquired memory address information of the transmission BUFFER to the intelligent network card.
It should be noted that the network card driver is a network card driver that can drive an intelligent network card deployed on a network device and, at the same time, can drive a common network card deployed on the network device. The TX BUFFER RING is essentially a RING consisting of a series of small blocks of memory, and each message may occupy several small blocks of memory because the address of the TX BUFFER RING written in the smart card is the starting address of the currently idle memory block. After the intelligent network card sends a message to the TX BUFFER RING, the starting address needs to be modified and shifted to the starting address of the new idle memory block, so that the message which is sent just before is prevented from being covered by other messages before being sent by the common network card.
In practical application, after sensing that the transmission buffer changes (i.e. after buffering the message to be transmitted), the DMA sends the message buffered by the transmission buffer out from the physical port of the common network card.
Step 110: the intelligent network card establishes a first logic port, establishes a connection relation between the first logic port and the sending buffer area based on the memory address information of the sending buffer area, and forms an aggregation port by the first logic port and a local physical port.
In this embodiment, after obtaining the sending buffer area of the normal network card, the intelligent network card locally creates a first logical port, where the first logical port is used to point to a memory address of the sending buffer area of the normal network card, that is, the first logical port and the sending buffer area of the normal network card establish a connection relationship, the first logical port can send a message to the sending buffer area of the normal network card, and further, the intelligent network card forms an aggregation port by using the first logical port and a physical port locally used for sending the message, and both the aggregation port and the physical port are used for message sending processing.
Step 120: and when receiving a first message sent by the virtual machine, the intelligent network card determines a target port for sending the first message from the aggregation port based on the communication address information of the first message, and sends the first message to an external device through the target port.
In this embodiment of the present application, when determining, based on the communication address information of the first packet, a destination port for sending the first packet from the aggregation port, and sending the first packet to an external device through the destination port, a preferable implementation manner is:
and the intelligent network card performs hash calculation according to the MAC and/or IP address information of the first message, and determines a target port for sending the first message from the first logic port and the local physical port according to a hash result.
As can be seen from the above, the aggregation port includes a local physical port on the smart network card and the first logical port, and then the determined target port may be the local physical port, or the determined target port may be the first logical interface.
And if the intelligent network card determines that the target port is the local physical port, the first message is sent to external equipment through the physical port.
If the intelligent network card determines that the target port is the first logical port, the first message is sent to the sending cache area through the first logical port, so that the common network card sends the first message to an external device from a local physical port of the common network card.
Exemplarily, referring to fig. 2, a networking connection diagram provided for the embodiment of the present application is shown, where an intelligent network card, a common network card, a virtual machine, a sending buffer of the common network card and a network card driver are deployed on a network device, a first logical interface of the intelligent network card is connected to the sending buffer of the common network card, the intelligent network card is connected to the virtual machine, the intelligent network card is connected to the common network card and an external switch, and the first logical interface of the intelligent network card and a local physical port for sending a message form an aggregation port.
Then, when the virtual machine sends a message, the message sending process of the network device is as follows: when a virtual machine deployed in network equipment sends a message, according to the processing logic of the intelligent network card, the message bypasses (bypass) an inner core to reach the intelligent network card, a flow table on the intelligent network card is inquired, an output port of the flow table is a polymerization port, the intelligent network card performs hash processing according to information such as MAC (media access control), IP (Internet protocol) and the like of the message, the message hashed to a local physical port is directly sent out from a physical port of the intelligent network card, the message hashed to the logical port is sent to a sending buffer zone through the logical port, then the message is sensed by a DMA (direct memory access) of a common network card, and the message is sent out from a physical port of the common physical network card.
Further, in this embodiment, a receiving buffer of the common network card is further configured in the memory of the network device; the above method further comprises the steps of:
the method comprises the following steps: and the intelligent network card acquires the memory address information of the receiving buffer area.
Specifically, the network card driver may still be configured to acquire the memory address information of the receiving BUFFER (e.g., RX BUFFER RING) of the common network card, and notify the intelligent network card of the memory address information of the receiving BUFFER, so that the intelligent network card acquires the memory address information of the receiving BUFFER.
Step two: and the intelligent network card establishes a second logic port and establishes a connection relation between the first logic port and the receiving buffer area based on the memory address information of the receiving buffer area.
Further, the intelligent network card creates a new second logical port, or the second logical port may also be the first logical port, that is, in this embodiment of the application, the second logical port and the first logical port are the same logical port, and a connection relationship between the second logical port and the receiving buffer of the ordinary network card is established, that is, the intelligent network card may obtain the cached message from the receiving buffer of the ordinary network card through the second logical port.
Step three: and when receiving an interrupt request sent by the common network card, the intelligent network card acquires a second message from the receiving buffer area through the second logic port and sends the second message to the corresponding virtual machine, wherein when receiving the second message sent by the external equipment and caching the second message to the receiving buffer area, the common network card sends the interrupt request to the intelligent network card.
For example, referring to fig. 3, another schematic diagram of networking connection provided for the embodiment of the present application is shown, where an intelligent network card, a normal network card, a virtual machine, a sending buffer area of the normal network card, and a network card driver are deployed on a network device, a second logic interface of the intelligent network card is connected to a receiving buffer area of the normal network card, the intelligent network card is connected to the virtual machine, and the intelligent network card, the normal network card, and an external switch are connected.
Then, when the local physical port on the intelligent network card receives the message sent by the switch, the message is directly forwarded to the corresponding virtual machine, and when the common network card receives the message sent by the switch, the message processing process is as follows:
specifically, the intelligent network card suspends packet receiving interruption of the ordinary network card to the CPU of the intelligent network card, so that when the ordinary network card receives a message and caches the message in the receiving BUFFER, the intelligent network card receives an interruption request, further reads the message from the RX BUFFER RING, and forwards the message to the corresponding virtual machine by looking up the flow table.
Further, in this embodiment of the present application, the message processing method may further include the following steps: and when determining that the utilization rate of the sending buffer area is greater than a first set threshold value, the intelligent network card takes the local physical port in the aggregation port as a target port and sends the received first message sent by the virtual machine to external equipment through the local physical port.
And when determining that the usage rate of the transmission buffer is smaller than a second set threshold, the intelligent network card performs a step of determining a destination port for transmitting the first message from the aggregation port based on the communication address information of the first message, and transmitting the first message to an external device through the destination port, wherein the second set threshold is smaller than the first set threshold.
That is, when the usage rate of the sending BUFFER is greater than the first set threshold, for example, the sending BUFFER is full and no more usable BUFFER is available, at this time, the virtual port corresponding to the common network card may be set to not participate in the hash, so that the subsequent message is not sent to the common network card. And setting the logic port corresponding to the common network card as the joining hash again until the common network card sends the current message of the sending BUFFER zone completely, and setting the logic port corresponding to the common network card as the joining hash again, so that the message sent by the subsequent virtual machine can still be hashed to the common network card.
Exemplarily, referring to fig. 4, a schematic structural diagram of a message processing apparatus provided in an embodiment of the present application is shown, where the apparatus is applied to an intelligent network card, a network device configured with the intelligent network card is also configured with a normal network card, the intelligent network card is connected to a virtual machine created on the network device, the intelligent network card and the normal network card are connected to an external device, and a sending buffer of the normal network card is configured in a memory of the network device, and the apparatus includes:
an obtaining unit 40, configured to obtain memory address information of the sending buffer;
a creating unit 41, configured to create a first logical port, establish a connection relationship between the first logical port and the sending buffer based on the memory address information of the sending buffer, and form an aggregation port by the first logical port and a local physical port;
a receiving unit 42, configured to, when receiving a first packet sent by a virtual machine, determine, based on communication address information of the first packet, a target port for sending the first packet from the aggregation port, and send the first packet to an external device through the target port.
Optionally, when determining, based on the communication address information of the first packet, a destination port for sending the first packet from the aggregation port, and sending the first packet to an external device through the destination port, the receiving unit 42 is specifically configured to:
performing hash calculation according to the MAC and/or IP address information of the first message, and determining a target port for sending the first message from the first logic port and the local physical port according to a hash result;
if the target port is determined to be the local physical port, sending the first message to external equipment through the physical port;
if the target port is determined to be the first logical port, the first message is sent to the sending cache area through the first logical port, so that the common network card sends the first message to an external device from a local physical port of the common network card.
Optionally, a receiving buffer of the common network card is further configured in the memory of the network device;
the obtaining unit 40 is further configured to obtain memory address information of the receiving buffer;
the creating unit 41 is further configured to create a second logical port, and establish a connection relationship between the first logical port and the receiving buffer area based on the memory address information of the receiving buffer area;
the receiving unit 42 is further configured to, when receiving an interrupt request sent by the common network card, obtain a second message from the receiving buffer through the second logic port, and send the second message to the corresponding virtual machine, where the common network card sends the interrupt request to the intelligent network card when receiving the second message sent by the external device and caching the second message to the receiving buffer.
Optionally, the apparatus further comprises:
and the determining unit is used for taking the local physical port in the aggregation port as a target port and sending the received first message sent by the virtual machine to external equipment through the local physical port when the utilization rate of the sending buffer is determined to be greater than a first set threshold value.
Alternatively,
the determining unit is further configured to, when it is determined that the usage rate of the sending buffer is smaller than a second set threshold, perform a step of determining, based on the communication address information of the first packet, a target port from the aggregation port to send the first packet, and sending the first packet to an external device through the target port, where the second set threshold is smaller than the first set threshold.
The above units may be one or more integrated circuits configured to implement the above methods, for example: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above units is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Further, in the packet processing device provided in the embodiment of the present application, from a hardware level, a schematic diagram of a hardware architecture of the packet processing device may be shown in fig. 5, where the packet processing device may include: a memory 50 and a processor 51 for storing data,
the memory 50 is used for storing program instructions; the processor 51 calls the program instructions stored in the memory 50 and executes the above-described method embodiments according to the obtained program instructions. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application also provides a network device, comprising at least one processing element (or chip) for performing the above method embodiments.
Optionally, the present application also provides a program product, such as a computer-readable storage medium, having stored thereon computer-executable instructions for causing the computer to perform the above-described method embodiments.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A message processing method is characterized in that the method is applied to an intelligent network card, a network device with the intelligent network card is also provided with a common network card, the intelligent network card is connected with a virtual machine established on the network device, the intelligent network card and the common network card are connected with an external device, and a sending buffer area of the common network card is configured in a memory of the network device, and the method comprises the following steps:
the intelligent network card acquires the memory address information of the sending buffer area;
the intelligent network card establishes a first logic port, establishes a connection relation between the first logic port and the sending buffer area based on the memory address information of the sending buffer area, and forms the first logic port and a local physical port into an aggregation port;
and when receiving a first message sent by a virtual machine, the intelligent network card determines a target port for sending the first message from the aggregation port based on the communication address information of the first message, and sends the first message to external equipment through the target port.
2. The method of claim 1, wherein determining a destination port from the aggregation port to send the first packet based on the communication address information of the first packet, and sending the first packet to an external device through the destination port comprises:
the intelligent network card performs hash calculation according to the MAC and/or IP address information of the first message, and determines a target port for sending the first message from the first logic port and the local physical port according to a hash result;
if the intelligent network card determines that the target port is the local physical port, the first message is sent to external equipment through the physical port;
if the intelligent network card determines that the target port is the first logical port, the first message is sent to the sending buffer area through the first logical port, so that the common network card sends the first message to an external device from a local physical port of the common network card.
3. The method according to claim 1 or 2, wherein a receiving buffer of the generic network card is further configured in the memory of the network device; the method further comprises the following steps:
the intelligent network card acquires the memory address information of the receiving buffer area;
the intelligent network card creates a second logic port, and establishes a connection relation between the first logic port and the receiving buffer area based on the memory address information of the receiving buffer area;
and when receiving an interrupt request sent by the common network card, the intelligent network card acquires a second message from the receiving buffer area through the second logic port and sends the second message to the corresponding virtual machine, wherein when receiving the second message sent by the external equipment and caching the second message to the receiving buffer area, the common network card sends the interrupt request to the intelligent network card.
4. The method of claim 1 or 2, wherein the method further comprises:
and when determining that the utilization rate of the sending buffer area is greater than a first set threshold value, the intelligent network card takes the local physical port in the aggregation port as a target port and sends the received first message sent by the virtual machine to external equipment through the local physical port.
5. The method of claim 4, wherein the method further comprises:
and when determining that the utilization rate of the sending buffer area is smaller than a second set threshold value, the intelligent network card executes the steps of determining a target port for sending the first message from the aggregation port based on the communication address information of the first message, and sending the first message to external equipment through the target port, wherein the second set threshold value is smaller than the first set threshold value.
6. A message processing device is characterized in that the device is applied to an intelligent network card, a network device with the intelligent network card is also provided with a common network card, the intelligent network card is connected with a virtual machine established on the network device, the intelligent network card and the common network card are connected with an external device, a sending buffer area of the common network card is configured in a memory of the network device, and the device comprises:
an obtaining unit, configured to obtain memory address information of the sending buffer;
a creating unit, configured to create a first logical port, establish a connection relationship between the first logical port and the sending buffer based on the memory address information of the sending buffer, and form an aggregation port by the first logical port and a local physical port;
the receiving unit is used for determining a target port for sending the first message from the aggregation port based on the communication address information of the first message when the first message sent by the virtual machine is received, and sending the first message to an external device through the target port.
7. The apparatus according to claim 6, wherein when determining, based on the communication address information of the first packet, a destination port from the aggregation port to send the first packet, and sending the first packet to an external device through the destination port, the receiving unit is specifically configured to:
performing hash calculation according to the MAC and/or IP address information of the first message, and determining a target port for sending the first message from the first logic port and the local physical port according to a hash result;
if the target port is determined to be the local physical port, sending the first message to external equipment through the physical port;
if the target port is determined to be the first logical port, the first message is sent to the sending buffer area through the first logical port, so that the common network card sends the first message to an external device from a local physical port of the common network card.
8. The apparatus according to claim 6 or 7, wherein a receive buffer of the generic network card is further configured in the memory of the network device;
the obtaining unit is further configured to obtain memory address information of the receive buffer;
the creating unit is further configured to create a second logical port, and establish a connection relationship between the first logical port and the receive buffer area based on the memory address information of the receive buffer area;
the receiving unit is further configured to, when receiving an interrupt request sent by the common network card, obtain a second message from the receiving buffer through the second logic port, and send the second message to the corresponding virtual machine, where the common network card sends the interrupt request to the intelligent network card when receiving the second message sent by the external device and caching the second message to the receiving buffer.
9. The apparatus of claim 6 or 7, wherein the apparatus further comprises:
and the determining unit is used for taking the local physical port in the aggregation port as a target port and sending the received first message sent by the virtual machine to external equipment through the local physical port when the utilization rate of the sending buffer is determined to be greater than a first set threshold value.
10. The apparatus of claim 9,
the determining unit is further configured to, when it is determined that the usage rate of the sending buffer is smaller than a second set threshold, perform a step of determining, based on the communication address information of the first packet, a target port from the aggregation port to send the first packet, and sending the first packet to an external device through the target port, where the second set threshold is smaller than the first set threshold.
CN202110044594.6A 2021-01-13 2021-01-13 Message processing method and device Active CN112910802B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110044594.6A CN112910802B (en) 2021-01-13 2021-01-13 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110044594.6A CN112910802B (en) 2021-01-13 2021-01-13 Message processing method and device

Publications (2)

Publication Number Publication Date
CN112910802A CN112910802A (en) 2021-06-04
CN112910802B true CN112910802B (en) 2022-05-24

Family

ID=76112935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110044594.6A Active CN112910802B (en) 2021-01-13 2021-01-13 Message processing method and device

Country Status (1)

Country Link
CN (1) CN112910802B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113630265B (en) * 2021-06-30 2023-04-07 济南浪潮数据技术有限公司 Virtual network redundancy backup method and device based on intelligent network card
CN114401218B (en) * 2021-12-28 2023-07-21 绿盟科技集团股份有限公司 Bypass forwarding method and device for data message
CN115277879B (en) * 2022-06-13 2023-05-30 新华三技术有限公司 Message forwarding method and device, intelligent network card and storage medium
CN115277640B (en) * 2022-07-29 2023-11-24 迈普通信技术股份有限公司 Data processing method, device, intelligent network card and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244579A (en) * 2010-05-12 2011-11-16 北京研华兴业电子科技有限公司 Network interface card and method for receiving network data
US9628374B1 (en) * 2016-01-19 2017-04-18 International Business Machines Corporation Ethernet link aggregation with shared physical ports
WO2017152633A1 (en) * 2016-03-09 2017-09-14 中兴通讯股份有限公司 Port binding implementation method and device
CN110851371A (en) * 2018-08-20 2020-02-28 华为技术有限公司 Message processing method and related equipment
CN110912836A (en) * 2019-11-14 2020-03-24 优刻得科技股份有限公司 Method, control device, storage medium, and system for forwarding data by forwarding device
CN111327523A (en) * 2020-02-28 2020-06-23 深信服科技股份有限公司 Network protection method and device based on aggregation port, network equipment and storage medium
CN111698167A (en) * 2020-04-01 2020-09-22 新华三大数据技术有限公司 Message processing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9178839B2 (en) * 2008-07-24 2015-11-03 International Business Machines Corporation Sharing buffer space in link aggregation configurations

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244579A (en) * 2010-05-12 2011-11-16 北京研华兴业电子科技有限公司 Network interface card and method for receiving network data
US9628374B1 (en) * 2016-01-19 2017-04-18 International Business Machines Corporation Ethernet link aggregation with shared physical ports
WO2017152633A1 (en) * 2016-03-09 2017-09-14 中兴通讯股份有限公司 Port binding implementation method and device
CN110851371A (en) * 2018-08-20 2020-02-28 华为技术有限公司 Message processing method and related equipment
CN110912836A (en) * 2019-11-14 2020-03-24 优刻得科技股份有限公司 Method, control device, storage medium, and system for forwarding data by forwarding device
CN111327523A (en) * 2020-02-28 2020-06-23 深信服科技股份有限公司 Network protection method and device based on aggregation port, network equipment and storage medium
CN111698167A (en) * 2020-04-01 2020-09-22 新华三大数据技术有限公司 Message processing method and device

Also Published As

Publication number Publication date
CN112910802A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
CN112910802B (en) Message processing method and device
US9300578B2 (en) Large receive offload functionality for a system on chip
CN109347757B (en) Message congestion control method, system, device and storage medium
CN112596960B (en) Distributed storage service switching method and device
CN108632165B (en) Message processing method, device and equipment
US20220201103A1 (en) Metadata compaction in packet coalescing
CN106331065A (en) Proxy application for host system with service container and system
CN114189477B (en) Message congestion control method and device
WO2018000195A1 (en) Packet transmission method, virtual switch, and server
CN110519388B (en) Processing method and device for block chain request, electronic equipment and readable storage medium
JP2020521388A (en) Packet transmission method and apparatus
CN114697387B (en) Data packet transmission method, device and storage medium
CN112887210B (en) Flow table management method and device
CN116501657B (en) Processing method, equipment and system for cache data
CN110650546B (en) File transmission method, device, storage medium and terminal
CN112596669A (en) Data processing method and device based on distributed storage
CN109361749B (en) Message processing method, related equipment and computer storage medium
CN111431921A (en) Configuration synchronization method
CN111865716A (en) Port congestion detection method, device, equipment and machine-readable storage medium
CN111314432B (en) Message processing method and device
CN112367267B (en) Virtual machine management method and device
US10250515B2 (en) Method and device for forwarding data messages
CN112769716B (en) Data forwarding method and device of virtual switch based on hybrid virtual network bridge
CN113572695B (en) Link aggregation method, device, computing equipment and computer storage medium
US20140301199A1 (en) Methods, systems, and computer program products for processing a packet

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
GR01 Patent grant
GR01 Patent grant