Packet sending method and system of network equipment, storage medium and computer program product

By using the ring cache area to synchronize the packet transmission situation in network devices, the problem of insufficient memory resources of the network card is solved, and the packetization efficiency and throughput rate are improved.

CN119561922APending Publication Date: 2025-03-04WU QI TECH INC +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411750446.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In high-throughput scenarios, a large amount of memory space is needed on the network card to store messages to be sent, resulting in reduced packet transmission efficiency and reduced throughput.

Method used

By using a ring cache area between the master control device and the network card, the number of packets is recorded, the number of packets is released, and the number of sent packets has been synchronized. The network card does not need to construct messages indicating that the packet has been sent to avoid consuming memory resources.

Benefits of technology

Ensure that memory resources can be fully utilized when issuing network cards, improve packetization efficiency, and effectively improve the efficiency of memory resource recycling on the main control device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561922A_ABST
    Figure CN119561922A_ABST
Patent Text Reader

Abstract

The invention provides a packet sending method and system of network equipment, a storage medium and a computer program product, and the method comprises the steps that main control equipment transmits address information of a target data packet to a network card, writes the address information into a local annular cache region, and updates the packet writing number of the annular cache region; the network card allocates a serial number for the target data packet indicated by the address information, and writes the serial number into a data structure body corresponding to the target data packet in the annular cache region; the network card detects whether the serial number of the target data packet is continuous with the serial number of the sent data packet after sending the target data packet obtained by the address information; if yes, the network card updates the sent packet serial number of the annular cache region according to the serial number of the target data packet; and when the main control equipment polls the annular cache region, judging whether the sent packet serial number is equal to the packet release number, if not, releasing the corresponding number of data packets in the memory, and updating the packet release number until the packet release number is equal to the packet write-in number. According to the scheme, the packet sending efficiency is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer processing technology, and in particular to a method and system for sending packets for a network device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Network devices such as computers and servers send and receive data packets through network cards. The network card is a peripheral device of the network device, which is connected to the main control device of the network device through the PCIe (peripheral component interconnect express, a high-speed serial computer expansion bus standard) interface. The main control device sends the data packet to the network card and records the data packet in the local memory. After the network card sends the data packet, it can notify the main control device of the sent data packet by interrupting and adding a notification message. After receiving the message, the main control device can determine that the data packet indicated by the message has been sent, and then release the data packet in the memory. Under this mechanism, memory space is required on the network card to store the messages to be sent. In the high-throughput scenario, a large amount of memory space is required on the network card to store the messages to be sent. Since the memory resources of the network card are limited, this will lead to a reduction in the memory resources that can be used for sending packets on the network card, thereby reducing the packet sending efficiency of the network card and reducing the throughput. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a packet sending method and system for a network device, a computer-readable storage medium, and a computer program product, which are used to ensure that memory resources can be fully utilized when a network card sends packets, thereby ensuring packet sending efficiency.

[0004] On the one hand, the present application provides a packet sending method of a network device, which is applied to a network device, wherein the network device includes a network card and a main control device, and the network card and the main control device are connected via a PCIe interface, including:

[0005] The master control device delivers the address information of the target data packet to the network card, writes the address information into the local circular buffer area, and updates the packet write quantity of the circular buffer area;

[0006] The network card assigns a sequence number to the target data packet indicated by the address information, and writes the sequence number into a data structure corresponding to the target data packet in the ring buffer area;

[0007] After sending the target data packet obtained by using the address information, the network card detects whether the sequence number of the target data packet is continuous with the sequence number of the sent data packet;

[0008] If it is continuous, the network card updates the sent packet sequence number of the ring buffer with the sequence number of the target data packet;

[0009] When the master control device polls the circular buffer area, it determines whether the sent packet sequence number is equal to the packet release quantity. If not, it releases the corresponding number of data packets in the memory and updates the packet release quantity until the packet release quantity is equal to the packet write quantity.

[0010] In one embodiment, before the main control device delivers the address information of the target data packet to the network card, the method further includes:

[0011] When the network card loads the firmware, the main control device delivers the size information of the circular buffer area to the network card; the size information is used to limit the maximum value of the sequence number that can be allocated by the network card.

[0012] In one embodiment, when the master device polls the ring buffer, before determining whether the sent packet sequence number is equal to the packet release quantity, the method further includes:

[0013] The main control device periodically starts polling the ring buffer area through a preset timer.

[0014] In one embodiment, when the master device polls the ring buffer, before determining whether the sent packet sequence number is equal to the packet release quantity, the method further includes:

[0015] After updating the sequence number of the sent packet, the network card notifies the main control device to start polling the ring buffer area.

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

[0017] If it is not continuous, the network card records the sending status of the target data packet on a preset bitmap in the annular buffer area; wherein each pixel in the bitmap corresponds to a serial number, and the pixel value of the pixel represents the sending status of the data packet indicated by the serial number.

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

[0019] If the sent packet sequence number is equal to the packet release quantity, checking whether the successfully sent data packet recorded in the bitmap is released;

[0020] If any successfully sent data packet has not been released, release the data packet from the memory.

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

[0022] After the network card updates the bitmap and determines that the sequence number of the target data packet is continuous with the sequence number of the sent data packet, the sequence number of the sent packet in the ring buffer is updated based on the sequence number of the target data packet and the bitmap.

[0023] On the other hand, the present application provides a packet sending system for a network device, the system comprising a network card and a main control device, the network card and the main control device are connected via a PCIe interface, and the system implements the packet sending method of the above-mentioned network device when executed.

[0024] Furthermore, the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to complete the packet sending method of the above-mentioned network device.

[0025] In addition, the present application provides a computer program product, including a computer program / instruction, which implements the packet sending method of the above-mentioned network device when executed by a processor.

[0026] The present application solution records the number of packet writes, the number of packet releases, and the sequence number of sent packets in the circular buffer area, so that the network card and the main control device can synchronize the sending of data packets through the circular buffer area. After the network card sends the data packet, the main control device can effectively release the sent data packet from the memory. This process can be synchronized by the network card accessing the circular buffer area through the PCIe interface to synchronize the sending of data packets. There is no need to construct a message on the network card indicating that the data packet has been sent, which avoids the occupation of the network card's memory resources by such messages, so that the network card can fully utilize the memory resources when sending packets, ensuring the efficiency of packet sending, and effectively improving the efficiency of memory resource recovery on the main control device. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.

[0028] Figure 1 A schematic diagram of the architecture of a packet sending system for a network device provided in one embodiment of the present application;

[0029] Figure 2 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0030] Figure 3 A schematic diagram of a flow chart of a packet sending method of a network device provided in an embodiment of the present application;

[0031] Figure 4 A schematic diagram of the interaction of a packet sending system of a network device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0033] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0034] Figure 1 This is a schematic diagram of the architecture of the packet sending system of the network device provided in the embodiment of the present application. Figure 1 As shown, the system may include a network card 20 and a host device (Host) 30, and the system may be equipped with multiple network cards 20. The network card 20 and the host device 30 are connected via a PCIe interface. The system may be a network device such as a computer or a server that has a data packet receiving and sending function. When sending packets, the system implements the packet sending method of the network device described below to achieve a higher packet sending efficiency and avoid the problem of insufficient memory resources of the network card during the packet sending process.

[0035] like Figure 2 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 2 A processor 11 is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment. In one embodiment, the electronic device 1 can be a network device such as a computer or a server with a data packet sending and receiving function, which is used to execute the packet sending method of the network device.

[0036] The memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0037] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 11 to complete the packet sending method of the network device provided in the present application.

[0038] The present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the packet sending method of the network device provided in the present application.

[0039] See also Figure 3 , is a flow chart of a packet sending method of a network device provided in an embodiment of the present application, such as Figure 3 As shown, the method may include the following steps 310 - 350 .

[0040] Step 310: The master control device passes the address information of the target data packet to the network card, writes the address information into the local circular buffer area, and updates the packet write quantity of the circular buffer area.

[0041] This solution is applied to network equipment, which includes a network card and a main control device, and the network card and the main control device are connected through a PCIe interface.

[0042] The target data packet is the data packet that the network device needs to send.

[0043] A data ring is set in the main control device, which can record the data structure corresponding to each target data packet (the data structure can be an skb structure), and the address information of the target data packet can be written into the data structure, and the address information indicates the location of the target data packet in the memory of the network device.

[0044] In addition, the ring buffer area may include a packet write quantity field (host_write_idx), a packet release quantity field (host_free_idx), and a sent packet sequence number field (fw_done_idx). Here, the packet write quantity field is used to store the packet write quantity, which indicates the number of data packets that the network device has sent to the network card when sending data packets. The packet release quantity field is used to store the packet release quantity, which indicates the number of data packets released from the memory of the network device after the data packet is sent. The sent packet sequence number field is used to store the sent packet sequence number, which indicates the sequence number of the data packet that the network card has sent.

[0045] When the master device sends a target data packet at the MAC (Media Access Control Layer) layer, it can hand over the address information of the target data packet to the network card through the PCIe interface, build a corresponding data structure for the address information, and write it to the circular buffer area, thereby updating the packet write quantity (that is, increasing the packet write quantity by one).

[0046] Step 320: The network card assigns a sequence number to the target data packet indicated by the address information, and writes the sequence number into a data structure corresponding to the target data packet in the ring buffer.

[0047] After the network card obtains the address information sent by the master device, it can assign a sequence number to the target data packet corresponding to the address information. Here, the sequence number values ​​assigned by the network card are continuous and integer. The network card can access the circular buffer area through the PCIe interface, search the data structure corresponding to the address information in the circular buffer area, and write the sequence number into the found data structure.

[0048] Step 330: After sending the target data packet obtained by using the address information, the network card detects whether the sequence number of the target data packet is continuous with the sequence number of the sent data packet.

[0049] The network card can access the location of the address information through the PCIe interface, obtain the target data packet, and then send the target data packet. After sending the target data packet, the network card can detect whether the sequence number of the target data packet is continuous with the sequence number of the sent data packet, that is, whether the sequence number of the target data packet is the value of the sent packet sequence number plus one in the current sent packet sequence number field.

[0050] On the one hand, if it is not continuous, it is necessary to use the preset bitmap to complete the subsequent process, as described below. On the other hand, if it is continuous, step 340 can be continued.

[0051] Step 340: If it is continuous, the network card updates the sent packet sequence number of the ring buffer with the sequence number of the target data packet.

[0052] When the sequence number of the target data packet is continuous with the sequence number of the sent data packet, the network card can update the sent packet sequence number field of the ring buffer through the PCIe interface, that is, write the sequence number of the target data packet into the sent packet sequence number field.

[0053] Step 350: When the master device polls the circular buffer area, it determines whether the sent packet sequence number is equal to the packet release quantity. If not, it releases the corresponding number of data packets in the memory and updates the packet release quantity until the packet release quantity is equal to the packet write quantity.

[0054] When polling the circular buffer, the master control device can read the sent packet sequence number of the sent packet sequence number field and the packet release quantity of the packet release quantity field in the circular buffer, and then determine whether the sent packet sequence number is equal to the packet release quantity.

[0055] If the two are not equal, it means that some data packets have not been released from the memory after being sent by the network card. In this case, the master device can calculate the difference between the sent packet sequence number and the packet release number, which indicates the number of data packets that can be released. The master device can release the corresponding number of data packets in the memory, thereby updating the packet release number.

[0056] Exemplarily, the sent packet sequence number is 150 and the number of released packets is 145, which means that the data packets with sequence numbers 146 to 150 can be released from the memory. Therefore, the master control device can release the data packets one by one starting from sequence number 146.

[0057] Each time a data packet is released, the number of packets released can be updated and compared with the number of packets written. If the two are inconsistent, it means that there are still data packets to be released and the data packets can continue to be released. If the two are consistent, it means that the sent data packets have been released.

[0058] Through the above measures, the number of packet writes, the number of packet releases and the sequence number of sent packets are recorded in the circular buffer area, so that the network card and the main control device can synchronize the sending of data packets through the circular buffer area. After the network card sends the data packet, the main control device can effectively release the sent data packet from the memory. This process can be synchronized by the network card accessing the circular buffer area through the PCIe interface to synchronize the sending of data packets. There is no need to construct a message on the network card indicating that the data packet has been sent, which avoids the occupation of the network card memory resources by such messages, so that the network card can fully utilize the memory resources when sending packets, ensuring the efficiency of packet sending, and effectively improving the efficiency of memory resource recovery on the main control device.

[0059] In one embodiment, before executing step 310, when the network device is started, the network card needs to load firmware, which is a Wi-Fi driver. At this time, the main control device can pass the size information of the ring buffer (recorded as buf size) to the network card. The size information is used to limit the maximum value of the sequence number that can be allocated by the network card.

[0060] After the network card obtains the size information, it can determine the maximum value of the sequence number subsequently allocated to the target data packet. In the process of allocating sequence numbers to each data packet, when the sequence number reaches the maximum value, the sequence number can be rolled back, that is, the first sequence number can be allocated to the next data packet. For example, the maximum sequence number is 1000. After the sequence number 1000 is allocated to the 1000th data packet, the sequence number 1 can be allocated to the 1001st data packet.

[0061] In this case, the sent packet sequence number will roll back after reaching the maximum value. To adapt to this mechanism, the master device also needs to roll back when updating the number of packet writes. For example, if the maximum sequence number is 1000, the maximum number of packet writes is also 1000. After the number of packet writes reaches 1000, if data packets continue to be sent, the number of packet writes will be updated to 1.

[0062] To adapt to this mechanism, the number of package releases also needs to be rolled back when updating. After the sent package sequence number is rolled back, due to the lag in the number of package releases, it needs to be increased to the maximum value before rolling back. For example, the sent package sequence number is rolled back from the maximum value of 1000 and updated from 1 to 5. At this time, the number of package releases may still be 998. The number of package releases needs to be increased one by one to 1000 before rolling back to 1.

[0063] This measure can ensure that the network card can reasonably assign sequence numbers to data packets in the ring buffer area.

[0064] In one embodiment, before executing step 350, the master control device may periodically start polling the ring buffer area through a preset timer. Here, the period length set by the timer can be configured as needed.

[0065] In one embodiment, before executing step 350, the network card may notify the main control device to start polling the ring buffer after updating the sent packet sequence number. The network card may notify the main control device to start polling after updating the sent sequence number through a soft interrupt.

[0066] In one embodiment, when the sequence number of the target data packet is not continuous with the sequence number of the sent data packet, the network card can record the sending status of the target data packet on a bitmap in the ring buffer. Each pixel in the bitmap corresponds to a sequence number, and the pixel value of the pixel represents the sending status of the data packet indicated by the sequence number. Exemplarily, the pixel value can be 1 or 0. If any data packet is sent successfully, the pixel value corresponding to the sequence number of the data packet is 1; if any data packet fails to be sent, the pixel value corresponding to the sequence number of the data packet is 0.

[0067] The ring buffer can be set with multiple bitmaps so that the number of pixels in the bitmap can match the maximum sequence number assigned by the network card. After sending the target data packet, the network card can access the ring buffer through the PCIe interface according to the sending status and set the corresponding pixel value on the pixel corresponding to the sequence number of the target data packet.

[0068] Through the above measures, the sending status of each data packet can be accurately recorded by the bitmap in the ring buffer area.

[0069] In one embodiment, when executing step 350, the master device polls the circular buffer to determine that the sequence number of the sent packet is equal to the number of packets released. In this case, the sent data packets may have been released from the memory, or the sequence numbers of the sent data packets may be discontinuous, resulting in some of the sent data packets not being released. To further determine that all the sent data packets are released, the master device can check the bitmap record of the successfully sent data packets to be released.

[0070] Exemplarily, if the pixel value of any pixel in the bitmap is 1, it means that the data packet indicated by the sequence number corresponding to the pixel is sent successfully; if the pixel value of any pixel is 0, it means that the data packet indicated by the sequence number corresponding to the pixel fails to be sent. The master control device can check whether the pixel value of the pixel corresponding to the sequence number of the data packet that has been handed over to the network card to send is 1, and release the data packet corresponding to the pixel value 1 from the memory. Exemplarily, the sequence number of the sent packet is 2000, and the number of packets released is 2000. However, the pixel values ​​of the pixels corresponding to sequence numbers 2001 to 2005 in the bitmap are 0, and the pixel values ​​of the pixels corresponding to sequence numbers 2006 to 2096 are 1. At this time, the master control device can release the data packets with sequence numbers 2006 to 2096 from the memory, and retain the data packets with sequence numbers 2001 to 2005 that have not been sent successfully in the memory.

[0071] Through the above measures, the sending of data packets can be more accurately synchronized between the network card and the main control device with the help of the bitmap, so that when the sequence numbers of the successfully sent data packets are not continuous, the main control device can release the sent data packets.

[0072] In one embodiment, after the network card updates the bitmap, and determines that the sequence number of the target data packet is continuous with the sequence number of the sent data packet, the sent sequence number of the circular buffer area can be updated. Since the bitmap has been updated before, the sequence number of the current target data packet may not be the maximum sequence number of the sent data packet. The network card can access the circular buffer area through the PCIe interface and update the sent packet sequence number of the circular buffer area based on the sequence number of the target data packet and the bitmap. The network card can determine whether the sequence number of the target data packet is the maximum sequence number of multiple continuous sent data packets based on the bitmap and the sequence number of the target data packet. In addition, in the case of sequence number rollback, it is necessary to determine whether the sequence number of the target data packet is the maximum sequence number of multiple continuous sent data packets after the rollback.

[0073] On the one hand, if the sequence number of the target data packet is the maximum sequence number of multiple consecutive sent data packets (or, if the sequence number of the target data packet is the maximum sequence number of multiple consecutive sent data packets after rollback), the sent packet sequence number of the circular buffer area can be updated to the sequence number of the target data packet.

[0074] On the other hand, if the sequence number of the target data packet is not the maximum sequence number of multiple consecutive sent data packets, the maximum sequence number of multiple consecutive sent data packets can be determined from the bitmap, and the sent packet sequence number of the circular buffer area is updated to the maximum sequence number (or, if the sequence number of the data packet is not the maximum sequence number of multiple consecutive sent data packets after the rollback, the maximum sequence number of multiple consecutive sent data packets after the rollback can be determined from the bitmap, and the sent packet sequence number of the circular buffer area is updated to the maximum sequence number).

[0075] Through the above measures, the network card can accurately update the sequence number of the sent packets to ensure the correct execution of the process.

[0076] See also Figure 4 , is an interactive schematic diagram of a packet sending system of a network device provided in an embodiment of the present application, such as Figure 4 As shown, the host device (Host) is connected to the network card equipped with firmware (Fw) through a PCIe interface; the host device is provided with a circular buffer area ( Figure 4 The ring buffer area can store the data structure corresponding to the address information of the data packets sent by each master device to the network card, and the address information and the serial number assigned by the network card are written into the data structure. In addition, the ring buffer area sets the packet write quantity field (host_write_idx), the packet release quantity field (host_free_idx), the sent packet sequence number field (fw_done_idx) and the bitmap. After the master device sends the address information of the data packet to the network card, the packet write quantity field can be updated. After the network card successfully sends the data packet, the sent packet sequence number field can be updated. The master device can update the packet release quantity field after releasing the data packet in the memory. In addition, the bitmap is used to more accurately synchronize the sending of data packets between the master device and the network card.

[0077] This solution uses the unified encoding scheme of PCIe to manage control and data information in a unified manner. The network card can access and read and write data structures on the main control device through the PCIe interface. In addition, the network card no longer relies on local memory to build messages to notify the main control device to release data packets, which effectively improves the packet sending efficiency of the network card.

[0078] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0079] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0080] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

Claims

1. A packet sending method for a network device, applied to a network device, wherein the network device comprises a network card and a main control device, wherein the network card and the main control device are connected via a PCIe interface, and wherein: include: The master control device delivers the address information of the target data packet to the network card, writes the address information into the local circular buffer area, and updates the packet write quantity of the circular buffer area; The network card assigns a sequence number to the target data packet indicated by the address information, and writes the sequence number into a data structure corresponding to the target data packet in the ring buffer area; After sending the target data packet obtained by using the address information, the network card detects whether the sequence number of the target data packet is continuous with the sequence number of the sent data packet; If it is continuous, the network card updates the sent packet sequence number of the ring buffer with the sequence number of the target data packet; When the master control device polls the circular buffer area, it determines whether the sent packet sequence number is equal to the packet release quantity. If not, it releases the corresponding number of data packets in the memory and updates the packet release quantity until the packet release quantity is equal to the packet write quantity.

2. The method according to claim 1, characterized in that Before the main control device delivers the address information of the target data packet to the network card, the method further includes: When the network card loads the firmware, the main control device delivers the size information of the circular buffer area to the network card; the size information is used to limit the maximum value of the sequence number that can be allocated by the network card.

3. The method according to claim 1, characterized in that When the master control device polls the ring buffer area, before determining whether the sent packet sequence number is equal to the packet release quantity, the method further includes: The main control device periodically starts polling the ring buffer area through a preset timer.

4. The method according to claim 1, characterized in that: When the master control device polls the ring buffer area, before determining whether the sent packet sequence number is equal to the packet release quantity, the method further includes: After updating the sequence number of the sent packet, the network card notifies the main control device to start polling the ring buffer area.

5. The method according to claim 1, characterized in that The method further comprises: If it is not continuous, the network card records the sending status of the target data packet on a preset bitmap in the annular buffer area; wherein each pixel in the bitmap corresponds to a serial number, and the pixel value of the pixel represents the sending status of the data packet indicated by the serial number.

6. The method according to claim 5, characterized in that The method further comprises: If the sent packet sequence number is equal to the packet release quantity, checking whether the successfully sent data packet recorded in the bitmap is released; If any successfully sent data packet has not been released, release the data packet from the memory.

7. The method according to claim 5, characterized in that The method further comprises: After the network card updates the bitmap and determines that the sequence number of the target data packet is continuous with the sequence number of the sent data packet, the sequence number of the sent packet in the ring buffer is updated based on the sequence number of the target data packet and the bitmap.

8. A packet sending system for a network device, characterized in that: The system includes a network card and a main control device, the network card and the main control device are connected via a PCIe interface, and when the system is executed, the packet sending method of the network device according to any one of claims 1 to 7 is implemented.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to complete the packet sending method of the network device according to any one of claims 1 to 7.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the packet sending method of the network device described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Software upgrading method and device for LCD (Liquid Crystal Display) screen of box transformer measurement and control device

    CN120276758A