Data flow processing method and device of intelligent network card

The method of segmenting the linked list into the cache area solves the problems of low port utilization efficiency and high risk of congestion in the existing network card message caching solution, achieves efficient data traffic processing, and makes full use of FPGA on-chip storage resources.

CN115914130BActive Publication Date: 2024-10-22CHINA TELECOM CLOUD TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211421221.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2024-10-22
Estimated Expiration
2042-11-14

AI Technical Summary

Technical Problem

The message caching solution of the existing network card causes the entire packet to be occupied by the input port, resulting in low utilization efficiency of different ports and a high risk of output port congestion, which wastes FPGA on-chip storage RAM resources.

Method used

By segmenting the linked list into the cache area, flexible dynamic memory management is achieved. It is judged based on whether the message fragments are completely written and whether the cache port has enough space to avoid output port congestion and improve the message scheduling efficiency of each port.

Benefits of technology

It effectively improves port utilization efficiency, reduces the risk of output port congestion, makes full use of FPGA on-chip storage resources, and improves the efficiency of data traffic processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914130B_ABST
    Figure CN115914130B_ABST
Patent Text Reader

Abstract

This application relates to a data traffic processing method and apparatus for a smart network interface card (NIC). The method includes: acquiring and parsing an original packet and a key to obtain a lookup result and a packet fragment. The parsed original packet and key are respectively matched with a first control parameter and a second control parameter. The packet fragment is segmented and written into a first buffer using a linked list. The first buffer receives descriptor requests from a second buffer and sends back descriptor dequeue requests. The descriptor contains the length of the packet fragment and its starting address pointer information. It is determined whether the packet fragment has been completely written into the first buffer and whether the buffer port has sufficient space to store the packet fragment. If the packet fragment has been completely written into the first buffer and the buffer port has sufficient space, the lookup result is written into the second buffer. The second control parameter is sent to a third buffer. The third buffer receives the second control parameter and sends a lookup result dequeue request to the second buffer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communication technology, and in particular to a method and device for processing data traffic of a smart network card. Background Art

[0002] With the rise of cloud services, unprecedented demands have been placed on network and storage services, especially in terms of performance and uptime. These have put tremendous pressure on the CPUs of server infrastructure computing nodes. Smart NICs can transfer packet processing workloads from the CPU to FPGA-based (Field Programmable Gate Array, hardware reconfigurable architecture, Chinese name is field programmable gate array) smart NICs. By offloading network processing workloads and tasks from the server CPU, Smart NICs improve server performance in cloud and private data centers.

[0003] At present, the mainstream approach is to offload the network forwarding function and some storage functions to the accelerator card. FPGA (field programmable gate array) mainly implements message parsing, extracts tuple information, forms key (key code) for flow table matching, obtains action (a request or call) according to off-chip or on-chip table items, and edits the message according to action (request or call) and then outputs it. In the entire process of extracting message tuple information and flow table matching, the original message needs to be stored in the PM (memory) cache. The existing network card message cache solution processes data traffic as a whole packet. Only after the message cache of the current input port is completed can the message of other ports be processed. In addition, placing network traffic and storage traffic in different cache areas wastes precious FPGA (field programmable gate array) on-chip storage RAM resources in different scenarios. If a simple deep fifo (cache) is used to implement caching, when there are multiple output ports, a port is blocked due to an abnormality, which will cause the message to be unable to be output to other ports.

[0004] Therefore, the whole packet occupation of the input port in the existing message buffering scheme of the network card leads to low utilization efficiency of different ports and a high risk of blocking the output port. Summary of the invention

[0005] Based on this, it is necessary to provide a data flow processing method and device for a smart network card with high port utilization efficiency and low risk of output port blocking in order to solve the above technical problems.

[0006] In a first aspect, the present application provides a method for processing data traffic of a smart network card, the method comprising:

[0007] Obtaining an original message and a key code and parsing them, wherein the key code is used for table lookup and obtaining a table lookup result, and obtaining a message fragment after parsing the original message, and the parsed original message and the key code are matched with corresponding control parameters and are respectively a first control parameter and a second control parameter;

[0008] Writing the message fragments into the first buffer area in segments through a linked list, the first buffer area being used to receive a descriptor request from the second buffer area and feeding back a descriptor receiving message dequeue request, wherein the descriptor includes the length of the message fragment and the starting address pointer information;

[0009] Determine whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment, if the message fragment is completely written into the first buffer area and the buffer port has enough space to cache the message fragment, write the table lookup result into the second buffer area;

[0010] The second control parameter is sent to a third buffer area, and the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0011] In one embodiment, writing the message fragments into the first buffer area in segments through a linked list includes:

[0012] Detect whether the message segment is abnormal, and mark the abnormal message.

[0013] In one embodiment, the determining whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment includes:

[0014] If the message segment is abnormal or the cache port does not have enough space to store the message segment, the message segment is discarded and the message is marked as discarded.

[0015] In one embodiment, the determining whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment includes:

[0016] Obtain message enqueue information, if the message fragment has been completely written into the first buffer area, and the buffer port has enough space to cache the message fragment, obtain message information corresponding to the control parameter, and write the enqueue message information into the first buffer area.

[0017] In one embodiment, writing the message fragments into the first buffer area in segments through a linked list includes:

[0018] The message dequeue request is sent through the DWRR scheduling mode according to the number of queued messages and the number of tokens of the cache port, where the number of tokens is the number of identities of the queued messages.

[0019] In one embodiment, the method further comprises:

[0020] The original message is read and the dequeued message information is parsed, and the dequeued message is message edited by a corresponding processing unit.

[0021] In a second aspect, the present application provides a data flow processing device for a smart network card, the device comprising:

[0022] A first acquisition module is used to acquire an original message and a key code and parse them, wherein the key code is used to look up a table and obtain a table lookup result, and the original message is parsed to obtain a message fragment, and the parsed original message and the key code are matched with corresponding control parameters and are respectively a first control parameter and a second control parameter;

[0023] A first cache module, used for writing the message fragment into a first cache area by segmentation through a linked list, the first cache area is used for receiving a descriptor request of a second cache area and feeding back a descriptor receiving message dequeue request, the descriptor including the length of the message fragment and the starting address pointer information;

[0024] a first judging module, configured to judge whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment, and if the message fragment is completely written into the first buffer area and the buffer port has enough space to cache the message fragment, then writing the table lookup result into the second buffer area;

[0025] The first sending module is used to send the second control parameter to a third buffer area, and the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0026] In one embodiment, the device further comprises:

[0027] A second cache module, used for obtaining message enqueue information, and if the message fragment has been completely written into the first cache area and the cache port has enough space to cache the message fragment, obtaining message information corresponding to the control parameter, and writing the enqueue message information into the first cache area;

[0028] A first detection module, used to detect whether the message segment is abnormal and mark the abnormal message;

[0029] The first editing module is used to read the original message and parse the dequeued message information, and perform message editing on the dequeued message through a corresponding processing unit.

[0030] In a third aspect, the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0031] Obtaining an original message and a key code and parsing them, wherein the key code is used for table lookup and obtaining a table lookup result, and obtaining a message fragment after parsing the original message, and the parsed original message and the key code are matched with corresponding control parameters and are respectively a first control parameter and a second control parameter;

[0032] Writing the message fragments into the first buffer area in segments through a linked list, the first buffer area being used to receive a descriptor request from the second buffer area and feeding back a descriptor receiving message dequeue request, wherein the descriptor includes the length of the message fragment and the starting address pointer information;

[0033] Determine whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment, if the message fragment is completely written into the first buffer area and the buffer port has enough space to cache the message fragment, write the table lookup result into the second buffer area;

[0034] The second control parameter is sent to a third buffer area, and the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0035] In a fourth aspect, the present application provides a computer storage medium storing a computer program, wherein when the computer program is executed by a processor, the following steps are implemented:

[0036] Obtaining an original message and a key code and parsing them, wherein the key code is used for table lookup and obtaining a table lookup result, and obtaining a message fragment after parsing the original message, and the parsed original message and the key code are matched with corresponding control parameters and are respectively a first control parameter and a second control parameter;

[0037] Writing the message fragments into the first buffer area in segments through a linked list, the first buffer area being used to receive a descriptor request from the second buffer area and feeding back a descriptor receiving message dequeue request, wherein the descriptor includes the length of the message fragment and the starting address pointer information;

[0038] Determine whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment, if the message fragment is completely written into the first buffer area and the buffer port has enough space to cache the message fragment, write the table lookup result into the second buffer area;

[0039] The second control parameter is sent to a third buffer area, and the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0040] The data flow processing method and device of the above-mentioned intelligent network card obtains the original message and key code and parses them to obtain the table lookup result and the message fragment. The parsed original message and key code match the first control parameter and the second control parameter. The message fragment is written into the first cache area in segments through a linked list. The linked list structure can make full use of the cache space, and the message is polled and scheduled according to fixed bytes to achieve flexible memory dynamic management, so that the message scheduling of each port is more efficient. The first cache area can receive the descriptor request of the second cache area and feedback the descriptor to receive the message dequeue request sent by the second cache area, and the descriptor contains the length of the message segment and its starting address pointer information, and judges whether the message segment is completely written into the first cache area and whether the cache port has enough space to store the message segment. If the message segment has been completely written into the first cache area and the cache port has enough space to cache the message segment, the table lookup result is written into the second cache area, and finally the second control parameter is sent to the third cache area. The third cache area can receive the second control parameter and send the table lookup result dequeue request to the second cache area, which effectively avoids the blockage of a certain output port, resulting in the inability to output subsequent messages, greatly reducing the risk of output port blockage. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flow chart of a method for processing data traffic of a smart network card in one embodiment of the present application;

[0042] Figure 2 A roadmap of a method for processing data traffic of a smart network card in one embodiment of the present application;

[0043] Figure 3 A schematic diagram of the relationship between scheduling submodules of a data traffic processing solution for a smart network card in an embodiment of the present application;

[0044] Figure 4 is a processing flow chart of the data traffic processing solution of the smart network card of this embodiment;

[0045] Figure 5 A schematic diagram of the PTD linked list structure of the data traffic processing solution of the smart network card of this embodiment;

[0046] Figure 6 A schematic diagram of DPU OVS (Smart NIC Virtual Switch) unloading of the data traffic processing solution of the Smart NIC of this embodiment;

[0047] Figure 7 This is a schematic diagram of the structure of a data flow processing device of a smart network card in one embodiment of the present application;

[0048] Figure 8 This is a schematic diagram of the structure of a data flow processing device of a smart network card in one embodiment of the present application;

[0049] Fig. 9 This is a diagram of the internal structure of a computer device according to one embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] like Figure 1 As shown, in one embodiment, a method for processing data traffic of a smart network card includes the following steps:

[0052] Step S110, obtain the original message and key code and parse them. The key code is used to look up a table and obtain the table lookup result. After the original message is parsed, a message fragment is obtained. The parsed original message and key code are matched with corresponding control parameters and are respectively the first control parameter and the second control parameter.

[0053] Specifically, the shared scheduling unit in the server obtains the original message and the key code and parses them. After the original message is parsed, a message fragment is obtained. The key code is used to look up a table and obtain the table lookup result. The parsed original message and key code respectively match the corresponding first control parameter and second control parameter.

[0054] Step S120, write the message fragments into the first buffer area in segments through the linked list, the first buffer area is used to receive the descriptor request of the second buffer area and feedback the descriptor receiving message dequeue request, the descriptor contains the length of the message fragment and the starting address pointer information.

[0055] Specifically, the shared scheduling unit writes the message fragment obtained in step S110 into the first cache area. The first cache area can receive the descriptor request of the second cache area and feedback the descriptor to the second cache area, and receive the message dequeue request sent by the second cache area, the length of the descriptor message fragment and its starting address pointer information.

[0056] Step S130, determining whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment; if the message fragment is completely written into the first buffer area and the buffer port has enough space to cache the message fragment, writing the table lookup result into the second buffer area.

[0057] Specifically, the shared scheduling unit determines whether the message segment is completely written into the first cache area and whether the cache port has enough space to store the message segment. If the message segment is completely written into the first cache area and the cache port has enough space to cache the message segment, the table lookup result is written into the second cache area.

[0058] Step S140: Send the second control parameter to the third buffer area, the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0059] Specifically, the shared scheduling unit sends the second control parameter to the third buffer area, and the third buffer area can receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0060] In the data flow processing method of the above-mentioned smart network card, the shared scheduling unit of the server obtains the original message and the key code and parses them to obtain the table lookup result and the message fragment, and the parsed original message and the key code match the first control parameter and the second control parameter. The message fragment is written into the first cache area in segments through a linked list. The linked list structure can make full use of the cache space, and the message is polled and scheduled according to fixed bytes to achieve flexible memory dynamic management, so that the message scheduling of each port is more efficient. The first cache area can receive the descriptor request of the second cache area and feedback the descriptor to receive the message dequeue request sent by the second cache area, and the descriptor contains the length of the message segment and its starting address pointer information, and judges whether the message segment is completely written into the first cache area and whether the cache port has enough space to store the message segment. If the message segment has been completely written into the first cache area and the cache port has enough space to cache the message segment, the table lookup result is written into the second cache area, and finally the second control parameter is sent to the third cache area. The third cache area can receive the second control parameter and send the table lookup result dequeue request to the second cache area, which effectively avoids the blockage of a certain output port, resulting in the inability to output subsequent messages, greatly reducing the risk of output port blockage.

[0061] like Figure 2As shown, in one embodiment, a method for processing data traffic of a smart network card includes the following steps:

[0062] Step S210, obtain the original message and key code and parse them. The key code is used to look up a table and obtain the table lookup result. After the original message is parsed, a message fragment is obtained. The parsed original message and key code are matched with corresponding control parameters and are respectively the first control parameter and the second control parameter.

[0063] Specifically, the shared scheduling unit in the server obtains the original message and the key code and parses them. After the original message is parsed, a message fragment is obtained. The key code is used to look up a table and obtain the table lookup result. The parsed original message and key code respectively match the corresponding first control parameter and second control parameter.

[0064] Step S220, write the message fragments into the first buffer area through the linked list segmentation, the first buffer area is used to receive the descriptor request of the second buffer area and feedback the descriptor receiving message dequeue request, the descriptor contains the length of the message fragment and the starting address pointer information.

[0065] Specifically, the shared scheduling unit writes the message fragment obtained in step S210 into the first cache area. The first cache area can receive the descriptor request of the second cache area and feedback the descriptor to the second cache area, and receive the message dequeue request sent by the second cache area. The second cache area sends the message dequeue request through DWRR (DeficitWeighted Round Robin) scheduling according to the number of queued messages and the number of tokens of the cache port. The number of tokens is the number of identities to be kept warm, the length of the descriptor message fragment and its starting address pointer information.

[0066] Step S230, detecting whether the message segment is abnormal, and marking the abnormal message.

[0067] Specifically, the shared scheduling unit detects the message fragments while writing the message fragments into the first buffer area, and marks abnormal messages according to the detection result.

[0068] Step S240, determining whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment; if the message fragment is completely written into the first buffer area and the buffer port has enough space to buffer the message fragment, writing the table lookup result into the second buffer area.

[0069] Specifically, the shared scheduling unit determines whether the message fragment is completely written into the first cache area and whether the cache port has sufficient space to store the message fragment. If the message fragment is completely written into the first cache area and the cache port has sufficient space to cache the message fragment, the table lookup result is written into the second cache area. If the message fragment is marked as abnormal or the cache port does not have sufficient space to store the message fragment, the message fragment is discarded and the message is marked as discarded.

[0070] Step S250, obtaining message enqueuing information, if the message fragments have been completely written into the first buffer area, and the buffer port has enough space to cache the message fragments, obtaining message information corresponding to the control parameters, and writing the enqueuing message information into the first buffer area.

[0071] Specifically, the shared scheduling unit obtains message enqueue information, and when the message fragment has been completely written into the first buffer area and the buffer short has enough space to cache the message fragment, obtains message information corresponding to the control parameter, and writes the enqueue message information into the first buffer area.

[0072] Step S260: Send the second control parameter to the third buffer area, the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0073] Specifically, the shared scheduling unit sends the second control parameter to the third buffer area, and the third buffer area can receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0074] Step S270, reading the original message and parsing the dequeued message information, and performing message editing on the dequeued message through the corresponding processing unit.

[0075] Specifically, the shared scheduling unit reads the original message and parses the dequeued message information, and then edits the dequeued message through the corresponding processing unit.

[0076] In the data flow processing method of the above-mentioned smart network card, the shared scheduling unit of the server obtains the original message and key code and parses them to obtain the table lookup result and the message fragment, and the parsed original message and key code match the first control parameter and the second control parameter. The message fragment is written into the first cache area in segments through a linked list, and while writing, it is detected whether the message fragment is abnormal and the abnormal message is marked. The linked list structure can make full use of the cache space, and the message is polled and scheduled according to fixed bytes, so as to realize flexible memory dynamic management, making the message scheduling of each port more efficient. The first buffer area can receive the descriptor request of the second buffer area and feedback the descriptor to receive the message dequeue request sent by the second buffer area according to the number of queued messages and the number of tokens of the cache port through the DWRR (differential weighted round-robin) scheduling method, and the descriptor contains the length of the message fragment and its starting address pointer information, and judges whether the message fragment is completely written into the first buffer area and whether the cache port has enough space to store the message fragment. If the message fragment has been completely written into the first buffer area, and the cache port has enough space to cache the message fragment, the table lookup result is written into the second buffer area. If the message fragment is abnormal or the cache port does not have enough space to store the message fragment, the message fragment is discarded and the message is marked as discarded. Finally, the second control parameter is sent to the third buffer area, and the third buffer area can receive the second control parameter and send the table lookup result dequeue request to the second buffer area, and read the original message and parse the dequeue information, and edit the dequeue message through the corresponding processing unit. This method effectively avoids the blockage of a certain output port, resulting in the inability to output subsequent messages, greatly reducing the risk of output port blockage.

[0077] like Figure 3 As shown, in one embodiment, a data traffic processing solution for a smart network card, in which shared cache scheduling can be divided into three modules, namely, an NBQ module, a TXQ module and a TXSCH module, wherein the NBQ module is used to complete message enqueue and dequeue operations and message cache sharing management and related control of its linked list, the TXQ module is used to complete PTD cache and address linked list management, and the TXSCH module is used to implement egress traffic scheduling.

[0078] After the table lookup result is returned, the control parameter Pid can be used to associate the table lookup result with the original message information, where tcam_luk_resp_txq is the TCAM (memory) storage message table lookup result, Lkup_i is the TCAM (memory) network message table lookup result, Ptdwr is the EMC (electromagnetic compatibility) network message table lookup result, Dq_pdesc_req is the message descriptor request from the TXQ module, Dq_pdesc_resp is the message descriptor returned by the NBQ module, the descriptor includes the message length and its starting address pointer information, etc., Dq_packect_info is the relevant information sent by the TXQ module to the NBQ module for message dequeueing, PMRD data represents the message information read out by the PM memory, and Modify_cmd is the modification instruction sent by TXQ to NBQ.

[0079] like Figure 4 As shown, the message parsing module outputs the key code (key) and the original message, and assigns a control parameter (pid) to the parsed key code (key) and the original message, wherein the key code (key) is used for table lookup, specifically for finding the difference between the key code (key) of TCAM and the key code (key) of EMC. The original message segment output by the message parsing module is stored in the cache packet memory (packet memory), and the message segment is cached in a multi-port sharing manner. For long messages, the address of each segment needs to be maintained in the linked list RAM. Figure 5 As shown, the linked list structure can make full use of the cache space and realize flexible dynamic memory management.

[0080] When the message is written into the cache, it will check whether the message is abnormal, and make corresponding marks for abnormal messages. At the same time, it will maintain that each message is completely written into the cache. After the table lookup result is returned, it will determine whether the message corresponding to the control parameter (Pid) is completely written into the cache and whether the action output port (request or call output port) cache has enough space to store the message. If the message has been completely written into the cache, and the cache of the output port has enough space to store the message, the table lookup result (Ptd) will be stored in the cache. When the table lookup result (Ptd) is stored, it will be cached according to the port number in the action (request or call) and a shared cache method will be used to improve the utilization of the cache space and save resources in the FPGA (field programmable gate array) chip. If the message is abnormal or the output port cache is insufficient, the message will be discarded and the message discard mark will be set.

[0081] When the table lookup result (Ptd) is written into the cache or discarded, a message queue information eq_ctrl_info is obtained. When the judgment result is that the message has been completely written into the cache, the sop_seg_id, eop_seg_id and message length of the corresponding Pid (control parameter) message are obtained, and the queue message information is cached in pdes_info, and the number of queue messages corresponding to the output port is increased by 1. If the drop mark in eq_ctrl_info is valid, the seg_id of the message needs to be recycled.

[0082] It should be noted that the Qos traffic control module determines the number of queued messages and tokens of each port in real time, and uses DWRR (differential weighted round-robin) scheduling to send message dequeue requests. In addition, the shared cache uses a port-differentiated address list management, and each node stores the pointer field of the next node address.

[0083] After receiving the message dequeue request, obtain the table lookup action (request or call) of the corresponding output port from PTD_RAM, and obtain the dequeued message information from pdes_info, such as sop_seg_id, eop_seg_id and message length. Parse the message information to be dequeued, read the original message from the packet memory, and send the original message and action (request or call) to the corresponding message editing module for message editing according to the port number in the action (request or call).

[0084] like Figure 6 As shown in the figure, the main implementation scenario of this solution is in the cloud service system, where the OVS (Open vSwitch, virtual switch) part is unloaded to the smart network card, and the scheduler module is a shared cache scheduling module, which is used to cache the original message and perform QoS (Quality of Service) speed limit on the output port.

[0085] It should be noted that MAC and PCIE are both interfaces, Parser means parser, TCAM means memory, EMC means electromagnetic compatibility, modify means modification module, and DDR means dynamic random access memory.

[0086] The data traffic processing scheme of the above-mentioned smart network card is based on the efficient shared cache of the network and storage traffic of the smart network card, which greatly improves the utilization rate of cache resources in the FPGA (field programmable gate array), the core device of the smart network card, and saves the on-chip resources of the FPGA (field programmable gate array). The shared cache is divided into three different back pressure waterlines. The more flexible back pressure waterline setting makes the entire shared cache design adapt to more complex traffic scenarios. It has global space, global storage space and two waterlines (total level waterlines). It will divide the space according to each virtual port into port lever level waterlines (with 10 vports), and each destination vid (VLAN ID) has a space division queue lever level waterline. It provides output port traffic shaping and performs QoS speed limit based on the output port. Even if there is a traffic peak, it has good processing capabilities, realizes nanosecond level update decision and token (processing authentication), and ensures uniform and smooth traffic. In addition, the shared cache scheduling module design has good independence. In the overall architecture, the shared cache scheduling module will not affect the normal operation of other modules. It has good independence and is easy to manage. This solution can adapt well to complex traffic scenarios. The main problem this design focuses on is the limited hardware cache resources, improving cache utilization, and supporting scenarios where network traffic and storage traffic are mixed.

[0087] like Figure 7 As shown, in one embodiment, a data traffic processing device of a smart network card includes a first acquisition module 710, a first cache module 720, a first judgment module 730 and a first sending module 740.

[0088] The first acquisition module 710 is used to acquire the original message and the key code and parse them. The key code is used to look up a table and obtain the table lookup result. The original message is parsed to obtain message fragments. The parsed original message and the key code are matched with corresponding control parameters and are respectively the first control parameter and the second control parameter.

[0089] The first cache module 720 is used to write the message fragment into the first cache area through a linked list segment. The first cache area is used to receive the descriptor request of the second cache area and feedback the descriptor receiving message dequeue request. The descriptor contains the length of the message fragment and the starting address pointer information.

[0090] The first judgment module 730 is used to judge whether the message fragment is completely written into the first cache area and whether the cache port has sufficient space to store the message fragment. If the message fragment has been completely written into the first cache area and the cache port has sufficient space to cache the message fragment, the table lookup result is written into the second cache area.

[0091] The first sending module 740 is used to send the second control parameter to the third buffer area, and the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0092] In the data flow processing device of the above-mentioned intelligent network card, the first acquisition module acquires the original message and the key code and parses them to obtain the table lookup result and the message fragment, and the parsed original message and the key code match the first control parameter and the second control parameter. The first cache module writes the message fragment into the first cache area in segments through a linked list. The linked list structure can make full use of the cache space, and the message is polled and scheduled according to fixed bytes to achieve flexible memory dynamic management, so that the message scheduling of each port is more efficient. The first cache area can receive the descriptor request of the second cache area and feedback the descriptor to receive the message dequeue request sent by the second cache area, and the descriptor contains the length of the message segment and its starting address pointer information, and judges whether the message segment is completely written into the first cache area and whether the cache port has enough space to store the message segment through the first judgment module. If the message segment has been completely written into the first cache area and the cache port has enough space to cache the message segment, the table lookup result is written into the second cache area, and finally the second control parameter is sent to the third cache area through the first sending module. The third cache area can receive the second control parameter and send the table lookup result dequeue request to the second cache area, which effectively avoids the blockage of a certain output port, resulting in the inability to output subsequent messages, greatly reducing the risk of output port blockage.

[0093] like Figure 8 As shown, in one embodiment, a data traffic processing device of a smart network card includes a first acquisition module 810, a first cache module 820, a first detection module 830, a first judgment module 840, a second cache module 850, a first sending module 860 and a first editing module 860.

[0094] The first acquisition module 810 is used to acquire the original message and the key code and parse them. The key code is used to look up a table and obtain the table lookup result. After the original message is parsed, message fragments are obtained. The parsed original message and the key code are matched with corresponding control parameters and are respectively the first control parameter and the second control parameter.

[0095] The first cache module 820 is used to write the message fragments into the first cache area through the linked list segmentation. The first cache area is used to receive the descriptor request of the second cache area and feedback the descriptor receiving message dequeue request. The descriptor contains the length of the message fragment and the starting address pointer information.

[0096] The first detection module 830 is used to detect whether the message segment is abnormal and mark the abnormal message.

[0097] The first judgment module 840 is used to judge whether the message segment is completely written into the first buffer area and whether the buffer port has enough space to store the message segment. If the message segment is completely written into the first buffer area and the buffer port has enough space to cache the message segment, the table lookup result is written into the second buffer area. If the message segment is marked as abnormal or the buffer port does not have enough space to store the message segment, the message segment is discarded and the message is marked as discarded.

[0098] The second cache module 850 is used to obtain message enqueue information. If the message fragments have been completely written into the first cache area and the cache port has enough space to cache the message fragments, it obtains the message information corresponding to the control parameters and writes the enqueue message information into the first cache area.

[0099] The first sending module 860 is used to send the second control parameter to the third buffer area, and the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

[0100] The first editing module 870 is used to read the original message and parse the dequeued message information, and perform message editing on the dequeued message through the corresponding processing unit.

[0101] The data flow processing device of the above-mentioned intelligent network card obtains the original message and key code through the first acquisition module and parses them to obtain the table lookup result and the message fragment. The parsed original message and key code match the first control parameter and the second control parameter. The message fragment is written into the first cache area through the linked list segment by the first cache module. While writing, the first detection module detects whether the message fragment is abnormal and marks the abnormal message. The linked list structure can make full use of the cache space, and the message is polled and scheduled according to the fixed byte, so as to realize flexible memory dynamic management, so that the message scheduling of each port is more efficient. The first buffer area can receive the descriptor request of the second buffer area and feedback the descriptor to receive the message dequeue request sent by the second buffer area according to the number of queued messages and the number of tokens of the cache port through the DWRR (differential weighted round-robin) scheduling method, and the descriptor contains the length of the message fragment and its starting address pointer information, and the first judgment module is used to judge whether the message fragment is completely written into the first buffer area and whether the cache port has enough space to store the message fragment. If the message fragment has been completely written into the first buffer area, and the cache port has enough space to cache the message fragment, the table lookup result is written into the second buffer area. If the message fragment is abnormal or the cache port does not have enough space to store the message fragment, the message fragment is discarded and the message is marked as discarded. Finally, the second control parameter is sent to the third buffer area through the first sending module, and the third buffer area can receive the second control parameter and send the table lookup result dequeue request to the second buffer area, and read the original message and parse the dequeue information through the first editing module, and edit the dequeue message through the corresponding processing unit. The device effectively avoids the blockage of a certain output port, resulting in the inability to output subsequent messages, greatly reducing the risk of output port blockage.

[0102] In one embodiment, a computer device is provided. The computer device may be a smart terminal, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data traffic processing method of an intelligent network card is implemented.

[0103] Those skilled in the art will understand that Fig. 9The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0104] In one embodiment, an electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0105] In one embodiment, a computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0106] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0107] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0108] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0109] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for processing data flow of an intelligent network card, characterized in that: The method comprises: The original message and key code are obtained and parsed. The key code is used to look up a table and obtain a table lookup result. The original message is parsed to obtain a message fragment. The control parameter corresponding to the parsed original message is the first control parameter. The key code matches the corresponding control parameter as the second control parameter. The second control parameter is the table lookup result action output by the key code table lookup. Action represents a request or call. The message fragments are segmented and written into the first buffer area through a linked list, and while writing, whether the message fragments are abnormal is detected and the abnormal messages are marked, and the messages are scheduled according to fixed byte polling; the first buffer area is used to receive the descriptor request of the second buffer area and feedback the descriptor to receive the message dequeue request sent by the second buffer area through the DWRR differential weighted round-robin scheduling method according to the number of queued messages and the number of tokens of the cache port, and the descriptor contains the length of the message fragment and the starting address pointer information; Determine whether the message segment is completely written into the first buffer area and whether the buffer port has enough space to store the message segment; if the message segment is completely written into the first buffer area and the buffer port has enough space to cache the message segment, write the table lookup result into the second buffer area for caching; if the message segment is abnormal or the buffer port does not have enough space to store the message segment, discard the message segment and mark the message as discarded; Sending the second control parameter to a third buffer area, the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area; and reading the original message and parsing the dequeue information, and editing the dequeue message through the corresponding processing unit; The table lookup result is written into the second buffer area for caching, and its functions include: judging the number of queued messages and tokens of each port in real time, and sending a message dequeue request by using the DWRR differential weighted round-robin scheduling method, obtaining the table lookup result action of the corresponding output port from the second buffer area PTD_RAM, and obtaining the dequeued message information from pdes_info at the same time, parsing the message information to be dequeued, reading the original message from the data packet memory, and sending the original message and the table lookup result action to the corresponding message editing module for message editing according to the port number in the table lookup result action.

2. The method for processing data traffic of a smart network card according to claim 1, characterized in that: The step of writing the message fragments into the first buffer area in segments through a linked list comprises: Detect whether the message segment is abnormal, and mark the abnormal message.

3. The method for processing data traffic of a smart network card according to claim 1, characterized in that: The determining whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment comprises: Obtain message enqueue information. If the message fragment has been completely written into the first cache area and the cache port has enough space to cache the message fragment, obtain message information of the corresponding first control parameter and write the enqueue message information into the first cache area.

4. The method for processing data traffic of a smart network card according to claim 1, characterized in that: Writing the message fragments into the first buffer area in segments through the linked list includes: The message dequeue request is sent through the DWRR scheduling mode according to the number of queued messages and the number of tokens of the cache port, where the number of tokens is the number of identities of the queued messages.

5. The method for processing data traffic of a smart network card according to claim 1, characterized in that: The method further comprises: The original message is read and the dequeued message information is parsed, and the dequeued message is message edited by a corresponding processing unit.

6. A data flow processing device for an intelligent network card, characterized in that: The device is used to implement the steps of the method according to any one of claims 1 to 5, and the device comprises: A first acquisition module is used to acquire an original message and a key code and parse them, wherein the key code is used to look up a table and obtain a table lookup result, and the original message is parsed to obtain a message fragment, and the parsed original message and the key code are matched with corresponding control parameters and are respectively a first control parameter and a second control parameter; A first cache module, used for writing the message fragment into a first cache area by segmentation through a linked list, the first cache area is used for receiving a descriptor request of a second cache area and feeding back a descriptor receiving message dequeue request, the descriptor including the length of the message fragment and the starting address pointer information; a first judging module, configured to judge whether the message fragment is completely written into the first buffer area and whether the buffer port has enough space to store the message fragment, and if the message fragment is completely written into the first buffer area and the buffer port has enough space to cache the message fragment, then writing the table lookup result into the second buffer area; The first sending module is used to send the second control parameter to a third buffer area, and the third buffer area is used to receive the second control parameter and send a table lookup result dequeue request to the second buffer area.

7. The data flow processing device according to claim 6, characterized in that: The device also includes: A second cache module, used for obtaining message enqueue information, and if the message fragment has been completely written into the first cache area and the cache port has enough space to cache the message fragment, obtaining message information corresponding to the control parameter, and writing the enqueue message information into the first cache area; A first detection module, used to detect whether the message segment is abnormal and mark the abnormal message; The first editing module is used to read the original message and parse the dequeued message information, and perform message editing on the dequeued message through a corresponding processing unit.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Message dispatching method and device thereof

    CN103647726A

  • TSN network port output scheduling device

    CN115086238A

  • Workload scheduler for memory allocation

    US20200192715A1