Network interface card (NIC) testing methods, apparatus, equipment and storage media
By obtaining the target network card's connection method and utilizing the test results from different stress testing tools, combined with core binding, interrupt binding, and interrupt binding core binding tests, the problem of time-consuming and labor-intensive parameter adjustment in network card performance testing was solved, achieving efficient network card performance optimization.
Patent Information
- Application Number
- CN202211384290.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-11-07
AI Technical Summary
Existing network card performance testing requires testers to constantly adjust parameters within the operating system to meet standards, leading to increased time and manpower costs.
By obtaining the target network card connection method, different stress testing tools are used to obtain the test results with the highest bandwidth performance. When the bandwidth does not meet the standard, core binding, interrupt binding, and interrupt binding core binding tests are performed to obtain the optimal test results and send them to the display screen.
It enables the rapid determination of the optimal network card connection method and configuration parameters, saving time and manpower costs.
Smart Images

Figure CN115622916B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a network card testing method, apparatus, device, and storage medium. Background Technology
[0002] Servers are equipped with network interface cards (NICs) to enable communication and information exchange. Based on server design requirements, NIC performance testing is necessary; only NICs that meet the test requirements can be added to the server's configuration list. NIC performance testing mainly includes latency testing and bandwidth testing. Bandwidth testing plays a primary role in NIC evaluation, making it a very time-consuming task to quickly achieve the required bandwidth performance.
[0003] Existing bandwidth testing methods include: in a computer network system, connecting the network card of the machine under test to the network card of the auxiliary test machine, and using netperf (performance testing tool), iperf (stress testing tool), and iperf3 (stress testing tool) to run on two servers, testing the bandwidth performance of the network card based on its basic configuration. When the network card under test maintains a speed of more than 90% of the bandwidth limit during the specified test time and there are no network card-related errors, the network card is deemed to have passed the test.
[0004] However, due to different network card connection methods, not all network cards can meet the standard. Therefore, testers still need to continuously adjust the parameters under the operating system to meet the standard, which greatly increases the time and manpower costs. Summary of the Invention
[0005] The purpose of this invention is to provide a network interface card (NIC) testing method, apparatus, device, and storage medium, solving the problem that existing NIC performance testing requires testers to continuously adjust parameters under the operating system to achieve the standard, which greatly increases time and labor costs. The specific technical solution is as follows:
[0006] In a first aspect of the present invention, a network interface card (NIC) testing method is provided, characterized in that the method includes:
[0007] Obtain the target network card's target connection method based on the first command;
[0008] For the target connection method, obtain the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth.
[0009] If the first bandwidth of the target network card is detected to be less than the target threshold, the target stress test tool will perform core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the number of target threads, the target connection method, and the second bandwidth.
[0010] The second test result is sent to the display screen.
[0011] Optionally, obtaining the target network interface card's target connection method according to the first command includes:
[0012] According to the first command, obtain the numa node of the target end network card and the auxiliary end network card;
[0013] If the numa node is found to be consistent, the target network card and the auxiliary network card are determined to be the first connection method;
[0014] If the inconsistency of the numa node is detected, the target network card and the auxiliary network card are determined to be connected in the second way;
[0015] The target connection method of the target network card is obtained according to the first connection method or the second connection method.
[0016] Optionally, the stress testing tools include: iperf, iperf3, and netperf. The step of obtaining the first test result with the highest bandwidth performance among the test results of different stress testing tools for the target connection method includes:
[0017] For the target connection method, a third test result is generated based on iperf, a fourth test result is generated based on iperf3, and a fifth test result is generated based on netperf.
[0018] Based on the third test result, the fourth test result, and the fifth test result, the first test result with the highest bandwidth performance is obtained.
[0019] Optionally, before obtaining the second test result with the highest bandwidth performance among the test results, the method further includes:
[0020] Get all numa nodes;
[0021] According to the second command, the target network card and the auxiliary network card are respectively bound to the full number of numa nodes to generate a full core binding method;
[0022] The full core binding test results are generated based on the target stress testing tool and the full core binding method.
[0023] Optionally, before obtaining the second test result with the highest bandwidth performance from the test results, the method further includes:
[0024] Get the number of cores based on the third command;
[0025] Generate the target number of network ports based on the number of cores;
[0026] According to the fourth command, the target network card and the auxiliary network card are respectively bound to the target number of network ports to generate a target binding interrupt mode;
[0027] The target stress test tool and the target interruption method are used to generate target interruption test results.
[0028] Optionally, after generating the target binding interrupt mode by binding the target network interface card and the auxiliary network interface card to the target number of network ports according to the fourth command, the method further includes:
[0029] Get all numa nodes;
[0030] According to the second command, the target network card and the auxiliary network card are respectively bound to the full number of numa nodes to generate a full core binding method;
[0031] The full core binding and interruption binding test results are generated based on the target stress testing tool, the full core binding method, and the target interruption binding method.
[0032] Optionally, before performing core binding, interrupt binding, and interrupt binding core binding tests on the target stress testing tool when the first bandwidth of the target network card is detected to be less than the target threshold, the method further includes:
[0033] If the first bandwidth of the target network card is detected to be not less than the target threshold, the first test result is sent to the display screen.
[0034] In a second aspect of the present invention, a network interface card (NIC) testing device is also provided, characterized in that it comprises:
[0035] The first acquisition module is used to acquire the target connection method of the target network card according to the first command.
[0036] The second acquisition module is used to acquire, for the target connection method, the first test result with the highest bandwidth performance among the test results of different stress testing tools, wherein the first test result is obtained based on the target stress testing tool and the first bandwidth.
[0037] The third acquisition module is used to perform core binding, interrupt binding, and interrupt binding core binding tests on the target stress test tool when the first bandwidth of the target network card is detected to be less than the target threshold, and to obtain the second test result with the highest bandwidth performance among the test results. The second test result is obtained based on the target binding method, the number of target threads, the target connection method, and the second bandwidth.
[0038] The first sending module is used to send the second test result to the display screen.
[0039] In a third aspect of the present invention, a communication device is also provided, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;
[0040] The processor is used to read the program in the memory to execute any of the network card testing methods described above.
[0041] In a fourth aspect of the present invention, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the network card testing methods described above.
[0042] The network card testing method provided in this invention obtains the target connection method of the target network card according to a first command. For the target connection method, it obtains the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. When the first bandwidth of the target network card is detected to be less than the target threshold, the target stress testing tool is subjected to core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the target number of threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen, thereby realizing the network card test information of the network card connection method, the target number of threads, and the target binding method that can achieve the best bandwidth performance, which is sent to the display screen for reference by the staff, greatly saving time and manpower costs. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0044] Figure 1 The step flow of the network card testing method provided in the embodiments of the present invention Figure 1 ;
[0045] Figure 2 This is the step flow of the network card testing method provided in the embodiments of the present invention. Figure 2 ;
[0046] Figure 3 This is the step flow of the network card testing method provided in the embodiments of the present invention. Figure 3 ;
[0047] Figure 4 This is the step flow of the network card testing method provided in the embodiments of the present invention. Figure 4 ;
[0048] Figure 5 This is the step flow of the network card testing method provided in the embodiments of the present invention. Figure 5 ;
[0049] Figure 6 This is a schematic diagram of the structure of a network card testing device provided in an embodiment of the present invention;
[0050] Figure 7 This is a schematic diagram of the structure of a communication device provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details are presented in the various embodiments of the present invention to facilitate a better understanding of this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.
[0052] Reference Figure 1 The flowchart of the network card testing method provided in the embodiment of the present invention is shown. Figure 1 The method may include:
[0053] Step 101: Obtain the target connection method of the target network card according to the first command.
[0054] This invention tests the bandwidth performance of the target network card (NIC) by connecting it to the auxiliary NIC within the system. However, since there are multiple connection methods between the two NICs, and the bandwidth performance varies depending on the connection method, to obtain the bandwidth performance of the target NIC, the two NICs are first installed on two servers. Then, a first command is used to obtain the connection method of the target NIC. For example, the NIC connection method can be confirmed by checking the numa_node corresponding to the logical port of the NIC. That is, the numa_node corresponding to the logical port of the target NIC and the auxiliary NIC is obtained. When the numa_nodes of the two NICs are the same, it is determined that the two NICs are not connected across DIEs. When the numa_nodes of the two NICs are different, it is determined that the two NICs are connected across DIEs. Of course, other commands can also be used to obtain other parameter information of the NICs to determine the connection method. This invention does not specifically limit this.
[0055] It should be noted that the connection method is determined by checking the numanodes corresponding to the logical ports of the target network card and the auxiliary network card using the first command. The specific steps include:
[0056] Obtain the numa node of the target network card and the auxiliary network card according to the first command;
[0057] If the numa node is found to be consistent, the target network card and the auxiliary network card are determined to be the first connection method;
[0058] If an inconsistency in the numa node is detected, the target network card and the auxiliary network card are determined to be the second connection method;
[0059] Obtain the target connection method of the target network card based on the first or second connection method.
[0060] The first connection method mentioned above is the connection method that does not cross the DIE, while the second connection method is the connection method that crosses the DIE.
[0061] Therefore, in this embodiment of the invention, after configuring the target network card and the auxiliary network card to two servers respectively, the target connection method of the target network card is obtained according to the first command, so as to obtain the bandwidth performance of the network card under the target connection method and perform optimized configuration.
[0062] Step 102: For the target connection method, obtain the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth.
[0063] In this embodiment of the invention, after determining the target network card connection method, the bandwidth performance of the network card is tested. At this point, a stress testing tool is needed to obtain the test results. Since different stress testing tools will produce different network card bandwidth performance readings, several different stress testing tools are needed to obtain the best bandwidth performance of the network card at this time. For example, common stress testing tools include iperf, iperf3, and netperf. These tools are used on two servers respectively, and the test results are compared to obtain the first test result with the highest bandwidth performance. The first test result includes: the target stress testing tool from which the result was obtained, and the measured network card bandwidth at this time.
[0064] Step 103: If the first bandwidth of the target network card is less than the target threshold, the target stress test tool is used to perform core binding, interrupt binding, and interrupt binding core binding tests. The second test result with the highest bandwidth performance is obtained from the test results. The second test result is obtained based on the target binding method, the number of target threads, the target connection method, and the second bandwidth.
[0065] In this embodiment of the invention, after obtaining the first test result with the highest bandwidth performance through different stress testing tools, if the first bandwidth of the target network card is detected to be less than the target threshold, the network card needs to be configured. Here, the target threshold is the threshold for determining whether the bandwidth of the network card meets the standard. When it is less than this threshold, the bandwidth of the network card does not meet the configuration requirements of the server. At this time, the target stress testing tool with the best network card stress test performance is used to perform core binding test, interrupt binding test, and interrupt binding core test, and the obtained test results are compared to obtain the second test result with the highest bandwidth performance. The second test result obtained at this time includes: the target connection method of the target network card, the target stress testing tool that obtained the result, the target number of threads required to obtain the bandwidth performance, the target binding method at this time, and the second bandwidth.
[0066] It should be noted that when the first test result shows that the first bandwidth is greater than or equal to the target threshold, it means that the network card's bandwidth performance already meets the standard, and no further adjustments are needed. At this point, the first test result can be directly sent to the display screen for staff reference to configure the network card. Specifically, the implementation steps include:
[0067] If the first bandwidth of the target network card is detected to be not less than the target threshold, the first test result will be sent to the display screen.
[0068] Therefore, in this embodiment of the invention, after obtaining the best network card stress test performance tool and the first bandwidth at this time through the stress test tool, the first bandwidth is compared with the target threshold representing the bandwidth qualification standard, and the corresponding operation of directly sending the result to the display screen or further configuring the network card is performed according to the different results obtained.
[0069] Step 104: Send the second test result to the display screen.
[0070] In this embodiment of the invention, the second test result is printed on the display screen for testers to refer to, and the testers can configure the network card accordingly based on the target binding method, target number of threads, target connection method and second bandwidth in the second test result, so that the final bandwidth of the network card can reach the second bandwidth and meet the optimization configuration of the network card.
[0071] The network card testing method provided in this invention obtains the target connection method of the target network card according to a first command. For the target connection method, it obtains the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. When the first bandwidth of the target network card is detected to be less than the target threshold, the target stress testing tool is subjected to core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the target number of threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen, thereby realizing the network card test information of the network card connection method, the target number of threads, and the target binding method that can achieve the best bandwidth performance, which is sent to the display screen for reference by the staff, greatly saving time and manpower costs.
[0072] Reference Figure 2 The flowchart of the network card testing method provided in the embodiment of the present invention is shown. Figure 2 The method may include:
[0073] Step 201: For the target connection method, generate the third test result based on iperf, the fourth test result based on iperf3, and the fifth test result based on netperf.
[0074] In this embodiment of the invention, the stress testing tools include iperf, iperf3, and netperf. Therefore, a third test result is generated based on iperf, a fourth test result is generated based on iperf3, and a fifth test result is generated based on netperf. Specifically, the test command used to generate the third test result based on iperf is `nohup iperf -c network_interface_IP -i 1 -t 150 -P 11 >>3005.log&`. It should be noted that the parameters in this command mean: `nohup` refers to running in the background, `c` specifies the host IP, `i` refers to the interval between reports in seconds, `t` refers to the test duration, `P` refers to the number of concurrent packet sending threads, and `>>3005.log&` sends the test results to the corresponding file. Therefore, the above command means that the stress testing tool iperf runs in the background on the specified host IP with 11 concurrent packet sending threads for 150 seconds, reporting the obtained results every second, and sending all the reported results to the `3005.log&` file.
[0075] The fourth test result based on iperf3 is generated using the command `nohup iperf3 -c network_port_IP -t150 -i1 -p 5201 --forceflush 5 -P 11|tee -a 5201.log&`. The fifth test result based on netperf is generated using the command `nohup netperf -H network_port_IP -l 150 >>log&`. This invention can also use other stress testing tools to test the network card; however, this invention does not specifically limit the scope of the test results.
[0076] Step 202: Based on the third, fourth, and fifth test results, obtain the first test result with the highest bandwidth performance.
[0077] In this embodiment of the invention, the network card is tested using iperf, iperf3, and netperf, respectively, to obtain third, fourth, and fifth test results. The bandwidth performance parameters in these test results are compared, and the test result with the highest bandwidth performance is selected as the first test result. This includes the target stress testing tool and the first bandwidth. For example, if the bandwidth in the third test result generated by iperf is 8Mbps, the bandwidth in the fourth test result generated by iperf3 is 9Mbps, and the bandwidth in the fifth test result generated by netperf is 10Mbps, since 10Mbps > 9Mbps > 8Mbps, the fifth test result with a bandwidth of 10Mbps is selected as the first test result.
[0078] The network card testing method provided in this invention obtains the target connection method of the target network card according to a first command. For the target connection method, it obtains the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. When the first bandwidth of the target network card is detected to be less than the target threshold, the target stress testing tool is subjected to core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the target number of threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen, thereby realizing the network card test information of the network card connection method, the target number of threads, and the target binding method that can achieve the best bandwidth performance, which is sent to the display screen for reference by the staff, greatly saving time and manpower costs.
[0079] Reference Figure 3 The flowchart of the network card testing method provided in the embodiment of the present invention is shown. Figure 3 The method may include:
[0080] Step 301: Obtain all numa nodes.
[0081] In this embodiment of the invention, the selected target stress testing tool is subjected to core binding testing. First, the status of the CPU numa node is obtained. For example, the obtained full numa nodes are 1 and 0.
[0082] Step 302: According to the second command, bind the target network card and the auxiliary network card to the full number of numa nodes respectively to generate the full number of core binding methods.
[0083] In this embodiment of the invention, the target network card and the auxiliary network card are bound to all numa nodes according to the second command to generate a full binding method. For example, if the obtained full numa nodes are 1 and 0, then the full binding method includes: binding both the target network card and the auxiliary network card to 0, binding both the target network card and the auxiliary network card to 1, and binding the target network card and the auxiliary network card to 0 and 1 respectively.
[0084] Step 303: Generate full core binding test results based on the target stress testing tool and the full core binding method.
[0085] In this embodiment of the invention, after selecting the corresponding core binding method for both the target network card and the auxiliary network card, the test is performed using the selected target stress test tool to obtain the full core binding test results.
[0086] For example, if the target stress testing tool is selected as iperf, the test command can be used: `numactl --cpunodebind=0 --membind=0 iperf -c network_port_IP -i 1 -t 150 -P`
[0087] The command 11>>3005.log& is used to achieve this. Here, numactl--cpunodebind=0--membind=0 means binding the network card to numa node 0. The following commands have the same meaning as the iperf test commands mentioned above, and will not be elaborated on here.
[0088] The network card testing method provided in this invention obtains the target connection method of the target network card according to a first command. For the target connection method, it obtains the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. When the first bandwidth of the target network card is detected to be less than the target threshold, the target stress testing tool is subjected to core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the target number of threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen, thereby realizing the network card test information of the network card connection method, the target number of threads, and the target binding method that can achieve the best bandwidth performance, which is sent to the display screen for reference by the staff, greatly saving time and manpower costs.
[0089] Reference Figure 4 The flowchart of the network card testing method provided in the embodiment of the present invention is shown. Figure 4 The method may include:
[0090] Step 401: Obtain the number of cores according to the third command.
[0091] In this embodiment of the invention, the selected target stress testing tool is subjected to interrupt binding test. First, the number of cores is obtained according to the third command, where the third command refers to lscpu.
[0092] It should be noted that lscpu collects CPU architecture information from sysfs and / proc / cpuinfo. The command output includes information such as the number of CPUs, threads, cores, sockets and Nom-Uniform Memory Access (NUMA), cache, etc.
[0093] Step 402: Generate the target number of network ports based on the number of cores.
[0094] In this embodiment of the invention, a target number of network ports are generated based on the number of cores. The number of network ports generated for access is less than the number of cores. For example, if the number of cores is 48, the target number of network ports generated is 16, numbered 0-15.
[0095] Step 403: According to the fourth command, bind the target network card and the auxiliary network card to the target number of network ports respectively to generate the target binding interrupt mode.
[0096] In this embodiment of the invention, the target network card and the auxiliary network card are bound to the target number of network ports according to the fourth command to generate the target interrupt binding method. For example, the network port names corresponding to the generated network ports are 0-15. Then the interrupt binding method is to bind both the target network card and the auxiliary network card to the corresponding network ports.
[0097] Step 404: Generate target-bound interruption test results based on the target stress testing tool and the target-bound interruption method.
[0098] In this embodiment of the invention, after selecting the corresponding interrupt binding method for both the target network card and the auxiliary network card, the test is performed using the selected target stress test tool to obtain the target interrupt binding test results.
[0099] For example, if the target stress testing tool is selected as iperf, it can be achieved using the test command `taskset -c 0-15 iperf -c network_port IP -i 1 -t 150 -P 11 >> 3005.log &`. Here, `taskset -c 0-15` means binding the network card to the network port 0-15. The following commands have the same meaning as the iperf test commands mentioned above, and will not be elaborated on here. The network card testing method provided in this invention obtains the target connection method of the target network card according to a first command. For the target connection method, it obtains the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. When the first bandwidth of the target network card is detected to be less than the target threshold, the target stress testing tool is subjected to core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the target number of threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen, thereby realizing the network card test information of the network card connection method, the target number of threads, and the target binding method that can achieve the best bandwidth performance, which is sent to the display screen for reference by the staff, greatly saving time and manpower costs.
[0100] Reference Figure 5 The flowchart of the network card testing method provided in the embodiment of the present invention is shown. Figure 5The method may include:
[0101] Step 501: Obtain all numa nodes.
[0102] The method for obtaining the full set of numa nodes in this embodiment of the invention is the same as step 301 above, and will not be described in detail here.
[0103] Step 502: According to the second command, bind the target network card and the auxiliary network card to the full number of numa nodes respectively to generate the full number of core binding methods.
[0104] In this embodiment of the invention, the method of binding the target network card and the auxiliary network card to the full number of numa nodes according to the second command to generate a full number of bound cores is the same as step 302 above, and will not be described in detail here.
[0105] Step 503: Generate full core binding and interruption binding test results based on the target stress testing tool, full core binding method, and target interruption binding method.
[0106] In this embodiment of the invention, core binding and interrupt binding means that the interrupt must be on the corresponding numa node. Therefore, based on the target stress testing tool, the full core binding method, and the target interrupt binding method, the full core binding and interrupt binding test results are generated. For example, this can be achieved by numactl --cpunodebind=0 --membind=0 taskset -c 0-15iperf -c network port IP -i 1 -t 150 -P 11>>3005.log&.
[0107] The network card testing method provided in this invention obtains the target connection method of the target network card according to a first command. For the target connection method, it obtains the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. When the first bandwidth of the target network card is detected to be less than the target threshold, the target stress testing tool is subjected to core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the target number of threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen, thereby realizing the network card test information of the network card connection method, the target number of threads, and the target binding method that can achieve the best bandwidth performance, which is sent to the display screen for reference by the staff, greatly saving time and manpower costs.
[0108] Reference Figure 6 The diagram shows a schematic of the structure of a network card testing device provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the device may include:
[0109] The first acquisition module 601 is used to acquire the target connection method of the target network card according to the first command.
[0110] The second acquisition module 602 is used to acquire the first test result with the highest bandwidth performance among the test results of different stress testing tools for the target connection method. The first test result is obtained based on the target stress testing tool and the first bandwidth.
[0111] The third acquisition module 603 is used to perform core binding, interrupt binding, and interrupt binding core binding tests on the target stress test tool when the first bandwidth of the target network card is detected to be less than the target threshold, and to obtain the second test result with the highest bandwidth performance in the test results. The second test result is obtained based on the target binding method, the number of target threads, the target connection method, and the second bandwidth.
[0112] The first sending module 604 is used to send the second test result to the display screen.
[0113] Optionally, the first acquisition module further includes:
[0114] The first acquisition submodule is used to acquire the numa node of the target network card and the auxiliary network card according to the first command.
[0115] The first determination submodule is used to determine the target network card and the auxiliary network card as the first connection method when the numa node is detected to be consistent.
[0116] The second determination submodule is used to determine the target network card and the auxiliary network card as the second connection method when the numa node inconsistency is detected.
[0117] The second acquisition submodule is used to acquire the target connection method of the target network card according to the first connection method or the second connection method.
[0118] Optionally, the stress testing tools include: iperf, iperf3, netperf, and the second acquisition module further includes:
[0119] The first generation submodule is used to generate a third test result based on iperf, a fourth test result based on iperf3, and a fifth test result based on netperf for the target connection method.
[0120] The third acquisition submodule is used to obtain the first test result with the highest bandwidth performance based on the third, fourth, and fifth test results.
[0121] Optionally, the network card testing device further includes:
[0122] The fourth module is used to obtain the full set of numa nodes.
[0123] The first generation module is used to generate a full-core binding method by binding the target network card and the auxiliary network card to the full number of numanodes respectively according to the second command.
[0124] The second generation module is used to generate full core-binding test results based on the target stress testing tool and the full core-binding method.
[0125] Optionally, the network interface card (NIC) testing device further includes:
[0126] The fifth module is used to obtain the number of cores based on the third command.
[0127] The third generation module is used to generate the target number of network ports based on the number of cores.
[0128] The fourth generation module is used to bind the target network card and the auxiliary network card to the target number of network ports respectively according to the fourth command to generate the target binding interrupt mode.
[0129] The fifth generation module is used to generate target-bound interruption test results based on the target stress testing tool and the target-bound interruption method.
[0130] Optionally, the network interface card (NIC) testing device further includes:
[0131] The sixth module is used to obtain the full set of numa nodes.
[0132] The sixth generation module is used to generate a full-core binding method by binding the target network card and the auxiliary network card to the full number of numanodes respectively according to the second command.
[0133] The seventh generation module is used to generate full core binding and interruption binding test results based on the target stress testing tool, the full core binding method, and the target interruption binding method.
[0134] The second sending module is used to send the first test result to the display screen when the first bandwidth of the target network card is detected to be not less than the target threshold.
[0135] The network card testing method provided in this invention obtains the target connection method of the target network card according to a first command. For the target connection method, it obtains the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. When the first bandwidth of the target network card is detected to be less than the target threshold, the target stress testing tool is subjected to core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the target number of threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen, thereby realizing the sending of network card test information with the network card connection method, target number of threads, and target binding method that can achieve the best bandwidth performance to the display screen for staff reference, which greatly saves time and manpower costs.
[0136] This invention also provides a communication device, such as... Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0137] Memory 703 is used to store computer programs;
[0138] When processor 701 executes a program stored in memory 703, it performs the following steps:
[0139] Obtain the target network card's target connection method based on the first command;
[0140] For the target connection method, obtain the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth.
[0141] If the first bandwidth of the target network card is less than the target threshold, the target stress test tool will perform core binding, interrupt binding, and interrupt binding core binding tests. The second test result with the highest bandwidth performance will be obtained. The second test result is obtained based on the target binding method, the number of target threads, the target connection method, and the second bandwidth.
[0142] The second test result is sent to the display screen.
[0143] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0144] The communication interface is used for communication between the aforementioned terminal and other devices.
[0145] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0146] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0147] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the network card testing methods described in the above embodiments.
[0148] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the network card testing methods described in the above embodiments.
[0149] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0150] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0151] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0152] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A network card testing method, characterized in that, The method includes: Obtain the target network card's target connection method based on the first command; For the target connection method, obtain the first test result with the highest bandwidth performance among the test results of different stress testing tools. The first test result is obtained based on the target stress testing tool and the first bandwidth. If the first bandwidth of the target network card is detected to be less than the target threshold, the target stress test tool will perform core binding, interrupt binding, and interrupt binding core binding tests to obtain the second test result with the highest bandwidth performance. The second test result is obtained based on the target binding method, the number of target threads, the target connection method, and the second bandwidth. The second test result is sent to the display screen.
2. The method according to claim 1, characterized in that, The step of obtaining the target network card's target connection method according to the first command includes: The model nodes (numa nodes) of the target network card and the auxiliary network card are obtained according to the first command; If the numa node is found to be consistent, the target network card and the auxiliary network card are determined to be the first connection method; If the inconsistency of the numa node is detected, the target network card and the auxiliary network card are determined to be connected in the second way; The target connection method of the target network card is obtained according to the first connection method or the second connection method.
3. The method according to claim 1, characterized in that, The stress testing tools include iperf, iperf3, and netperf. For the target connection method, obtaining the first test result with the highest bandwidth performance among the test results of different stress testing tools includes: For the target connection method, a third test result is generated based on iperf, a fourth test result is generated based on iperf3, and a fifth test result is generated based on netperf. Based on the third test result, the fourth test result, and the fifth test result, the first test result with the highest bandwidth performance is obtained.
4. The method according to claim 1, characterized in that, Before obtaining the second test result with the highest bandwidth performance in the test results, the method further includes: Get all numa nodes; According to the second command, the target network card and the auxiliary network card are respectively bound to the full number of numa nodes to generate a full core binding method; The full core binding test results are generated based on the target stress testing tool and the full core binding method.
5. The method according to claim 1, characterized in that, Before obtaining the second test result with the highest bandwidth performance in the test results, the method further includes: Get the number of cores based on the third command; Generate the target number of network ports based on the number of cores; According to the fourth command, the target network card and the auxiliary network card are respectively bound to the target number of network ports to generate the target binding interrupt mode; The target stress test tool and the target interruption method are used to generate target interruption test results.
6. The method according to claim 5, characterized in that, After generating the target binding interrupt mode by binding the target network interface card and the auxiliary network interface card to the target number of network ports according to the fourth command, the method further includes: Get all numa nodes; According to the second command, the target network card and the auxiliary network card are respectively bound to the full number of numa nodes to generate a full core binding method; The full core binding and interruption binding test results are generated based on the target stress testing tool, the full core binding method, and the target interruption binding method.
7. The method according to claim 1, characterized in that, Before performing core binding, interrupt binding, and interrupt binding core binding tests on the target stress testing tool when the first bandwidth of the target network card is detected to be less than the target threshold, the method further includes: If the first bandwidth of the target network card is detected to be not less than the target threshold, the first test result is sent to the display screen.
8. A network card testing device, characterized in that, include: The first acquisition module is used to acquire the target connection method of the target network card according to the first command. The second acquisition module is used to acquire, for the target connection method, the first test result with the highest bandwidth performance among the test results of different stress testing tools, wherein the first test result is obtained based on the target stress testing tool and the first bandwidth. The third acquisition module is used to perform core binding, interrupt binding, and interrupt binding core binding tests on the target stress test tool when the first bandwidth of the target network card is detected to be less than the target threshold, and to obtain the second test result with the highest bandwidth performance among the test results. The second test result is obtained based on the target binding method, the number of target threads, the target connection method, and the second bandwidth. The first sending module is used to send the second test result to the display screen.
9. A communication device, characterized in that, include: A transceiver, a memory, a processor, and a program stored in the memory and executable on the processor; The processor is used to read the program in the memory to implement the steps in the network card testing method as described in any one of claims 1-7.
10. A readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps in the network card testing method as described in any one of claims 1-7.
Citation Information
Patent Citations
Data migration method and apparatus for virtual machine, and electronic device and storage medium
WO2024021490A1